__REACT_DEVTOOLS_GLOBAL_HOOK__ = {
    isDisabled: true
};

(() => {
    var __webpack_modules__ = [ , module => {
        "use strict";
        module.exports = require("electron");
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        var __webpack_unused_export__;
        __webpack_unused_export__ = {
            value: true
        };
        __webpack_unused_export__ = __webpack_unused_export__ = __webpack_unused_export__ = exports.UI = exports.et = __webpack_unused_export__ = __webpack_unused_export__ = __webpack_unused_export__ = void 0;
        const constants = __webpack_require__(3);
        __webpack_unused_export__ = constants;
        const errors = __webpack_require__(4);
        __webpack_unused_export__ = errors;
        const multiWrite = __webpack_require__(13);
        __webpack_unused_export__ = multiWrite;
        const scanner = __webpack_require__(106);
        exports.et = scanner;
        const sourceDestination = __webpack_require__(143);
        exports.UI = sourceDestination;
        const sparseStream = __webpack_require__(283);
        __webpack_unused_export__ = sparseStream;
        const tmp = __webpack_require__(97);
        __webpack_unused_export__ = tmp;
        const utils = __webpack_require__(6);
        __webpack_unused_export__ = utils;
    }, (__unused_webpack_module, exports) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.DEFAULT_ALIGNMENT = exports.XXHASH_SEED = exports.NO_MATCHING_FILE_MSG = exports.CHUNK_SIZE = exports.RETRY_BASE_TIMEOUT = exports.SPEED_WINDOW = exports.PROGRESS_EMISSION_INTERVAL = void 0;
        exports.PROGRESS_EMISSION_INTERVAL = 1e3 / 4;
        exports.SPEED_WINDOW = 2;
        exports.RETRY_BASE_TIMEOUT = 100;
        exports.CHUNK_SIZE = 1024 ** 2;
        exports.NO_MATCHING_FILE_MSG = "Can't find a matching file in this zip archive";
        exports.XXHASH_SEED = 1163150152;
        exports.DEFAULT_ALIGNMENT = 512;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.retryOnTransientError = exports.BlocksVerificationError = exports.ChecksumVerificationError = exports.VerificationError = exports.NotCapable = void 0;
        const process_1 = __webpack_require__(5);
        const utils_1 = __webpack_require__(6);
        class NotCapable extends Error {}
        exports.NotCapable = NotCapable;
        class VerificationError extends Error {
            constructor() {
                super(...arguments);
                this.code = "EVALIDATION";
            }
        }
        exports.VerificationError = VerificationError;
        class ChecksumVerificationError extends VerificationError {
            constructor(message, checksum, expectedChecksum) {
                super(message);
                this.checksum = checksum;
                this.expectedChecksum = expectedChecksum;
            }
        }
        exports.ChecksumVerificationError = ChecksumVerificationError;
        function blocksVerificationErrorMessage(blocksWithChecksum, checksum) {
            const start = blocksWithChecksum.blocks[0].offset;
            const lastBlock = blocksWithChecksum.blocks[blocksWithChecksum.blocks.length - 1];
            const end = lastBlock.offset + lastBlock.length - 1;
            return `Checksum does not match for range [${start}, ${end}]: "${blocksWithChecksum.checksum}" != "${checksum}"`;
        }
        class BlocksVerificationError extends VerificationError {
            constructor(blocks, checksum) {
                super(blocksVerificationErrorMessage(blocks, checksum));
                this.blocks = blocks;
                this.checksum = checksum;
            }
        }
        exports.BlocksVerificationError = BlocksVerificationError;
        function isTransientError(error) {
            if (process_1.platform === "darwin") {
                return error.code === "ENXIO" || error.code === "EBUSY";
            } else if (process_1.platform === "linux") {
                return error.code === "EIO" || error.code === "EBUSY";
            } else if (process_1.platform === "win32") {
                return error.code === "ENOENT" || error.code === "UNKNOWN";
            }
            return false;
        }
        async function retryOnTransientError(fn, maxRetries, baseDelay) {
            let retries = 0;
            while (true) {
                try {
                    return await fn();
                } catch (error) {
                    if (isTransientError(error)) {
                        if (retries < maxRetries) {
                            retries += 1;
                            await (0, utils_1.delay)(baseDelay * retries);
                            continue;
                        }
                        error.code = "EUNPLUGGED";
                    }
                    throw error;
                }
            }
        }
        exports.retryOnTransientError = retryOnTransientError;
    }, module => {
        "use strict";
        module.exports = require("process");
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.once = exports.every = exports.sumBy = exports.maxBy = exports.minBy = exports.delay = exports.fromCallback = exports.asCallback = exports.difference = exports.sparseStreamToBuffer = exports.streamToBuffer = void 0;
        const aligned_lockable_buffer_1 = __webpack_require__(7);
        function streamToBuffer(stream) {
            return new Promise(((resolve, reject) => {
                const chunks = [];
                stream.on("error", reject);
                stream.on("data", (async chunk => {
                    let data;
                    if ((0, aligned_lockable_buffer_1.isAlignedLockableBuffer)(chunk)) {
                        const unlock = await chunk.rlock();
                        try {
                            data = Buffer.allocUnsafe(chunk.length);
                            chunk.copy(data);
                        } finally {
                            unlock();
                        }
                    } else {
                        data = chunk;
                    }
                    chunks.push(data);
                }));
                stream.on("end", (() => {
                    resolve(Buffer.concat(chunks));
                }));
                stream.resume();
            }));
        }
        exports.streamToBuffer = streamToBuffer;
        async function sparseStreamToBuffer(stream) {
            const chunks = [];
            await new Promise(((resolve, reject) => {
                stream.on("error", reject);
                stream.on("end", resolve);
                stream.on("data", (async chunk => {
                    if ((0, aligned_lockable_buffer_1.isAlignedLockableBuffer)(chunk.buffer)) {
                        let unlock;
                        try {
                            unlock = await chunk.buffer.rlock();
                        } catch (error) {
                            reject(error);
                            return;
                        }
                        let data;
                        try {
                            data = Buffer.allocUnsafe(chunk.buffer.length);
                            chunk.buffer.copy(data);
                        } finally {
                            unlock();
                        }
                        chunk.buffer = data;
                    }
                    chunks.push(chunk);
                }));
            }));
            if (chunks.length === 0) {
                return Buffer.alloc(0);
            }
            const lastChunk = chunks[chunks.length - 1];
            const result = Buffer.alloc(lastChunk.position + lastChunk.buffer.length);
            for (const chunk of chunks) {
                chunk.buffer.copy(result, chunk.position);
            }
            return result;
        }
        exports.sparseStreamToBuffer = sparseStreamToBuffer;
        function difference(setA, setB) {
            const _difference = new Set(setA);
            for (const elem of setB) {
                _difference.delete(elem);
            }
            return _difference;
        }
        exports.difference = difference;
        async function asCallback(promise, callback) {
            try {
                const value = await promise;
                callback(null, value);
            } catch (error) {
                callback(error);
            }
        }
        exports.asCallback = asCallback;
        async function fromCallback(fn) {
            return await new Promise(((resolve, reject) => {
                fn(((error, result) => {
                    if (error != null) {
                        reject(error);
                    } else {
                        resolve(result);
                    }
                }));
            }));
        }
        exports.fromCallback = fromCallback;
        async function delay(ms) {
            await new Promise((resolve => {
                setTimeout(resolve, ms);
            }));
        }
        exports.delay = delay;
        function minBy(things, iteratee) {
            let result;
            let minimum;
            for (const t of things) {
                const value = iteratee(t);
                if (minimum === undefined || value < minimum) {
                    minimum = value;
                    result = t;
                }
            }
            return result;
        }
        exports.minBy = minBy;
        function maxBy(things, iteratee) {
            return minBy(things, (t => -iteratee(t)));
        }
        exports.maxBy = maxBy;
        function sumBy(things, iteratee) {
            let result = 0;
            for (const t of things) {
                result += iteratee(t);
            }
            return result;
        }
        exports.sumBy = sumBy;
        function every(things) {
            for (const t of things) {
                if (!t) {
                    return false;
                }
            }
            return true;
        }
        exports.every = every;
        function once(fn) {
            let ran = false;
            let result;
            return () => {
                if (!ran) {
                    result = fn();
                    ran = true;
                }
                return result;
            };
        }
        exports.once = once;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.AlignedReadableState = exports.isAlignedLockableBuffer = exports.createBuffer = void 0;
        const direct_io_1 = __webpack_require__(8);
        const RWMutex = __webpack_require__(9);
        function alignedLockableBufferSlice(start, end) {
            const slice = Buffer.prototype.slice.call(this, start, end);
            return attachMutex(slice, this.alignment, this.lock, this.rlock);
        }
        function attachMutex(buf, alignment, lock, rlock) {
            const buffer = buf;
            buffer.alignment = alignment;
            buffer.lock = lock;
            buffer.rlock = rlock;
            buffer.slice = alignedLockableBufferSlice;
            return buffer;
        }
        function createBuffer(size, alignment) {
            const mutex = new RWMutex;
            return attachMutex((0, direct_io_1.getAlignedBuffer)(size, alignment), alignment, mutex.lock.bind(mutex), mutex.rlock.bind(mutex));
        }
        exports.createBuffer = createBuffer;
        function isAlignedLockableBuffer(buffer) {
            return "rlock" in buffer;
        }
        exports.isAlignedLockableBuffer = isAlignedLockableBuffer;
        class AlignedReadableState {
            constructor(bufferSize, alignment, numBuffers) {
                this.bufferSize = bufferSize;
                this.alignment = alignment;
                this.numBuffers = numBuffers;
                this.currentBufferIndex = 0;
                this.buffers = new Array(numBuffers);
            }
            getCurrentBuffer() {
                let buffer = this.buffers[this.currentBufferIndex];
                if (buffer === undefined) {
                    buffer = createBuffer(this.bufferSize, this.alignment);
                    this.buffers[this.currentBufferIndex] = buffer;
                }
                this.currentBufferIndex = (this.currentBufferIndex + 1) % this.numBuffers;
                return buffer;
            }
        }
        exports.AlignedReadableState = AlignedReadableState;
    }, module => {
        module.exports = require("./modules/@ronomon/direct-io/binding.node");
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        function _interopDefault(ex) {
            return ex && typeof ex === "object" && "default" in ex ? ex["default"] : ex;
        }
        var _debug = _interopDefault(__webpack_require__(10));
        const debug = _debug("rwmutex");
        class Mutex {
            constructor(label = "") {
                this.label = label;
                this._rlockId = 0;
                this._rlocks = [];
            }
            lock() {
                if (this._lock) {
                    return this._lock.then((() => this.lock()));
                }
                if (this._rlocks.length) {
                    return Promise.all(this._rlocks).then((() => this.lock()));
                }
                let resolve, unlocked = false;
                const promise = new Promise((r => resolve = r));
                const unlock = () => {
                    if (unlocked) return;
                    unlocked = true;
                    if (this._lock === promise) delete this._lock;
                    debug("unlock", this.label);
                    resolve();
                };
                debug("lock", this.label);
                this._lock = promise;
                return Promise.resolve(unlock);
            }
            rlock() {
                if (this._lock) {
                    return this._lock.then((() => this.rlock()));
                }
                let resolve, unlocked = false;
                const promise = new Promise((r => resolve = r));
                const unlock = () => {
                    if (unlocked) return;
                    unlocked = true;
                    const index = this._rlocks.indexOf(promise);
                    if (index > -1) this._rlocks.splice(index, 1);
                    debug("runlock", this.label, id);
                    resolve();
                };
                const id = this._rlockId++;
                debug("rlock", this.label, id);
                this._rlocks.push(promise);
                return Promise.resolve(unlock);
            }
        }
        module.exports = Mutex;
    }, (module, exports, __webpack_require__) => {
        "use strict";
        function _typeof(obj) {
            if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
                _typeof = function _typeof(obj) {
                    return typeof obj;
                };
            } else {
                _typeof = function _typeof(obj) {
                    return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
                };
            }
            return _typeof(obj);
        }
        exports.log = log;
        exports.formatArgs = formatArgs;
        exports.save = save;
        exports.load = load;
        exports.useColors = useColors;
        exports.storage = localstorage();
        exports.colors = [ "#0000CC", "#0000FF", "#0033CC", "#0033FF", "#0066CC", "#0066FF", "#0099CC", "#0099FF", "#00CC00", "#00CC33", "#00CC66", "#00CC99", "#00CCCC", "#00CCFF", "#3300CC", "#3300FF", "#3333CC", "#3333FF", "#3366CC", "#3366FF", "#3399CC", "#3399FF", "#33CC00", "#33CC33", "#33CC66", "#33CC99", "#33CCCC", "#33CCFF", "#6600CC", "#6600FF", "#6633CC", "#6633FF", "#66CC00", "#66CC33", "#9900CC", "#9900FF", "#9933CC", "#9933FF", "#99CC00", "#99CC33", "#CC0000", "#CC0033", "#CC0066", "#CC0099", "#CC00CC", "#CC00FF", "#CC3300", "#CC3333", "#CC3366", "#CC3399", "#CC33CC", "#CC33FF", "#CC6600", "#CC6633", "#CC9900", "#CC9933", "#CCCC00", "#CCCC33", "#FF0000", "#FF0033", "#FF0066", "#FF0099", "#FF00CC", "#FF00FF", "#FF3300", "#FF3333", "#FF3366", "#FF3399", "#FF33CC", "#FF33FF", "#FF6600", "#FF6633", "#FF9900", "#FF9933", "#FFCC00", "#FFCC33" ];
        function useColors() {
            if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
                return true;
            }
            if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
                return false;
            }
            return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
        }
        function formatArgs(args) {
            args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
            if (!this.useColors) {
                return;
            }
            var c = "color: " + this.color;
            args.splice(1, 0, c, "color: inherit");
            var index = 0;
            var lastC = 0;
            args[0].replace(/%[a-zA-Z%]/g, (function(match) {
                if (match === "%%") {
                    return;
                }
                index++;
                if (match === "%c") {
                    lastC = index;
                }
            }));
            args.splice(lastC, 0, c);
        }
        function log() {
            var _console;
            return (typeof console === "undefined" ? "undefined" : _typeof(console)) === "object" && console.log && (_console = console).log.apply(_console, arguments);
        }
        function save(namespaces) {
            try {
                if (namespaces) {
                    exports.storage.setItem("debug", namespaces);
                } else {
                    exports.storage.removeItem("debug");
                }
            } catch (error) {}
        }
        function load() {
            var r;
            try {
                r = exports.storage.getItem("debug");
            } catch (error) {}
            if (!r && typeof process !== "undefined" && "env" in process) {
                r = process.env.DEBUG;
            }
            return r;
        }
        function localstorage() {
            try {
                return localStorage;
            } catch (error) {}
        }
        module.exports = __webpack_require__(11)(exports);
        var formatters = module.exports.formatters;
        formatters.j = function(v) {
            try {
                return JSON.stringify(v);
            } catch (error) {
                return "[UnexpectedJSONParseError]: " + error.message;
            }
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        function setup(env) {
            createDebug.debug = createDebug;
            createDebug.default = createDebug;
            createDebug.coerce = coerce;
            createDebug.disable = disable;
            createDebug.enable = enable;
            createDebug.enabled = enabled;
            createDebug.humanize = __webpack_require__(12);
            Object.keys(env).forEach((function(key) {
                createDebug[key] = env[key];
            }));
            createDebug.instances = [];
            createDebug.names = [];
            createDebug.skips = [];
            createDebug.formatters = {};
            function selectColor(namespace) {
                var hash = 0;
                for (var i = 0; i < namespace.length; i++) {
                    hash = (hash << 5) - hash + namespace.charCodeAt(i);
                    hash |= 0;
                }
                return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
            }
            createDebug.selectColor = selectColor;
            function createDebug(namespace) {
                var prevTime;
                function debug() {
                    if (!debug.enabled) {
                        return;
                    }
                    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
                        args[_key] = arguments[_key];
                    }
                    var self = debug;
                    var curr = Number(new Date);
                    var ms = curr - (prevTime || curr);
                    self.diff = ms;
                    self.prev = prevTime;
                    self.curr = curr;
                    prevTime = curr;
                    args[0] = createDebug.coerce(args[0]);
                    if (typeof args[0] !== "string") {
                        args.unshift("%O");
                    }
                    var index = 0;
                    args[0] = args[0].replace(/%([a-zA-Z%])/g, (function(match, format) {
                        if (match === "%%") {
                            return match;
                        }
                        index++;
                        var formatter = createDebug.formatters[format];
                        if (typeof formatter === "function") {
                            var val = args[index];
                            match = formatter.call(self, val);
                            args.splice(index, 1);
                            index--;
                        }
                        return match;
                    }));
                    createDebug.formatArgs.call(self, args);
                    var logFn = self.log || createDebug.log;
                    logFn.apply(self, args);
                }
                debug.namespace = namespace;
                debug.enabled = createDebug.enabled(namespace);
                debug.useColors = createDebug.useColors();
                debug.color = selectColor(namespace);
                debug.destroy = destroy;
                debug.extend = extend;
                if (typeof createDebug.init === "function") {
                    createDebug.init(debug);
                }
                createDebug.instances.push(debug);
                return debug;
            }
            function destroy() {
                var index = createDebug.instances.indexOf(this);
                if (index !== -1) {
                    createDebug.instances.splice(index, 1);
                    return true;
                }
                return false;
            }
            function extend(namespace, delimiter) {
                return createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
            }
            function enable(namespaces) {
                createDebug.save(namespaces);
                createDebug.names = [];
                createDebug.skips = [];
                var i;
                var split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
                var len = split.length;
                for (i = 0; i < len; i++) {
                    if (!split[i]) {
                        continue;
                    }
                    namespaces = split[i].replace(/\*/g, ".*?");
                    if (namespaces[0] === "-") {
                        createDebug.skips.push(new RegExp("^" + namespaces.substr(1) + "$"));
                    } else {
                        createDebug.names.push(new RegExp("^" + namespaces + "$"));
                    }
                }
                for (i = 0; i < createDebug.instances.length; i++) {
                    var instance = createDebug.instances[i];
                    instance.enabled = createDebug.enabled(instance.namespace);
                }
            }
            function disable() {
                createDebug.enable("");
            }
            function enabled(name) {
                if (name[name.length - 1] === "*") {
                    return true;
                }
                var i;
                var len;
                for (i = 0, len = createDebug.skips.length; i < len; i++) {
                    if (createDebug.skips[i].test(name)) {
                        return false;
                    }
                }
                for (i = 0, len = createDebug.names.length; i < len; i++) {
                    if (createDebug.names[i].test(name)) {
                        return true;
                    }
                }
                return false;
            }
            function coerce(val) {
                if (val instanceof Error) {
                    return val.stack || val.message;
                }
                return val;
            }
            createDebug.enable(createDebug.load());
            return createDebug;
        }
        module.exports = setup;
    }, module => {
        var s = 1e3;
        var m = s * 60;
        var h = m * 60;
        var d = h * 24;
        var w = d * 7;
        var y = d * 365.25;
        module.exports = function(val, options) {
            options = options || {};
            var type = typeof val;
            if (type === "string" && val.length > 0) {
                return parse(val);
            } else if (type === "number" && isFinite(val)) {
                return options.long ? fmtLong(val) : fmtShort(val);
            }
            throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val));
        };
        function parse(str) {
            str = String(str);
            if (str.length > 100) {
                return;
            }
            var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);
            if (!match) {
                return;
            }
            var n = parseFloat(match[1]);
            var type = (match[2] || "ms").toLowerCase();
            switch (type) {
              case "years":
              case "year":
              case "yrs":
              case "yr":
              case "y":
                return n * y;

              case "weeks":
              case "week":
              case "w":
                return n * w;

              case "days":
              case "day":
              case "d":
                return n * d;

              case "hours":
              case "hour":
              case "hrs":
              case "hr":
              case "h":
                return n * h;

              case "minutes":
              case "minute":
              case "mins":
              case "min":
              case "m":
                return n * m;

              case "seconds":
              case "second":
              case "secs":
              case "sec":
              case "s":
                return n * s;

              case "milliseconds":
              case "millisecond":
              case "msecs":
              case "msec":
              case "ms":
                return n;

              default:
                return undefined;
            }
        }
        function fmtShort(ms) {
            var msAbs = Math.abs(ms);
            if (msAbs >= d) {
                return Math.round(ms / d) + "d";
            }
            if (msAbs >= h) {
                return Math.round(ms / h) + "h";
            }
            if (msAbs >= m) {
                return Math.round(ms / m) + "m";
            }
            if (msAbs >= s) {
                return Math.round(ms / s) + "s";
            }
            return ms + "ms";
        }
        function fmtLong(ms) {
            var msAbs = Math.abs(ms);
            if (msAbs >= d) {
                return plural(ms, msAbs, d, "day");
            }
            if (msAbs >= h) {
                return plural(ms, msAbs, h, "hour");
            }
            if (msAbs >= m) {
                return plural(ms, msAbs, m, "minute");
            }
            if (msAbs >= s) {
                return plural(ms, msAbs, s, "second");
            }
            return ms + " ms";
        }
        function plural(ms, msAbs, n, name) {
            var isPlural = msAbs >= n * 1.5;
            return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
        }
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.pipeSourceToDestinations = exports.decompressThenFlash = exports.DECOMPRESSED_IMAGE_PREFIX = void 0;
        const fs_1 = __webpack_require__(14);
        const path_1 = __webpack_require__(15);
        const block_read_stream_1 = __webpack_require__(16);
        const block_transform_stream_1 = __webpack_require__(20);
        const constants_1 = __webpack_require__(3);
        const compressed_source_1 = __webpack_require__(21);
        const configured_source_1 = __webpack_require__(68);
        const file_1 = __webpack_require__(100);
        const multi_destination_1 = __webpack_require__(105);
        const source_destination_1 = __webpack_require__(25);
        const tmp_1 = __webpack_require__(97);
        exports.DECOMPRESSED_IMAGE_PREFIX = "decompressed-image-";
        function getEta(current, total, speed) {
            return speed === 0 ? undefined : (total - current) / speed;
        }
        function isWorthDecompressing(filename = "") {
            return [ ".img", ".bin", ".hddimg", ".raw", ".sdcard", ".rpi-sdimg", ".wic" ].includes((0, 
            path_1.extname)(filename));
        }
        function defaultEnoughSpaceForDecompression(free, imageSize) {
            return imageSize === undefined ? false : imageSize < Math.min(free / 2, 5 * 1024 ** 3);
        }
        async function decompressThenFlash({source, destinations, onFail, onProgress, verify = false, numBuffers = 16, decompressFirst = false, trim = false, configure, enoughSpaceForDecompression = defaultEnoughSpaceForDecompression, asItIs = false}) {
            await source.open();
            if (!asItIs) {
                source = await source.getInnerSource();
            }
            const sourceMetadata = await source.getMetadata();
            const enoughDiskSpaceAvailable = enoughSpaceForDecompression(await (0, tmp_1.freeSpace)(), sourceMetadata.size);
            let decompressedFilePath;
            try {
                if (decompressFirst && sourceMetadata.isCompressed && isWorthDecompressing(sourceMetadata.name) && enoughDiskSpaceAvailable) {
                    ({path: decompressedFilePath} = await (0, tmp_1.tmpFile)({
                        keepOpen: false,
                        prefix: exports.DECOMPRESSED_IMAGE_PREFIX
                    }));
                    const decompressedSource = new file_1.File({
                        path: decompressedFilePath,
                        write: true
                    });
                    await decompressedSource.open();
                    const inputStream = await source.createReadStream();
                    const outputStream = await decompressedSource.createWriteStream();
                    await new Promise(((resolve, reject) => {
                        outputStream.on("done", resolve);
                        outputStream.on("error", reject);
                        inputStream.on("error", reject);
                        const state = {
                            active: 0,
                            failed: 0,
                            type: "decompressing"
                        };
                        const [$onProgress, onRootStreamProgress] = createCompleteOnProgress(onProgress, sourceMetadata, state, false);
                        (0, compressed_source_1.getRootStream)(inputStream).on("progress", onRootStreamProgress);
                        outputStream.on("progress", $onProgress);
                        inputStream.pipe(outputStream);
                    }));
                    source = decompressedSource;
                }
                if ((trim || configure !== undefined) && !(source instanceof configured_source_1.ConfiguredSource)) {
                    if (!await source.canRead()) {
                        console.warn("Can't configure or trim a source that is not randomly readable, skipping");
                    } else {
                        source = new configured_source_1.ConfiguredSource({
                            source,
                            shouldTrimPartitions: trim,
                            createStreamFromDisk: decompressFirst || !sourceMetadata.isCompressed,
                            configure
                        });
                        await source.open();
                    }
                }
                return await pipeSourceToDestinations({
                    source,
                    destinations,
                    onFail,
                    onProgress,
                    verify,
                    numBuffers
                });
            } finally {
                if (decompressedFilePath) {
                    await fs_1.promises.unlink(decompressedFilePath);
                }
            }
        }
        exports.decompressThenFlash = decompressThenFlash;
        function createCompleteOnProgress(onProgress, sourceMetadata, state, sparse) {
            function $onProgress(progress) {
                if (sourceMetadata.size !== undefined && state.size === undefined) {
                    state.size = sourceMetadata.size;
                }
                let size;
                let percentage;
                let eta;
                if (sparse) {
                    size = state.blockmappedSize;
                    state.bytesWritten = progress.bytes;
                } else {
                    size = state.size;
                    state.bytesWritten = progress.position;
                }
                if (size !== undefined && state.bytesWritten !== undefined && state.bytesWritten <= size) {
                    percentage = state.bytesWritten / size * 100;
                    eta = getEta(state.bytesWritten, size, progress.speed);
                } else if (state.rootStreamSpeed !== undefined && state.rootStreamPosition !== undefined && state.compressedSize !== undefined) {
                    percentage = state.rootStreamPosition / state.compressedSize * 100;
                    eta = getEta(state.rootStreamPosition, state.compressedSize, state.rootStreamSpeed);
                }
                const result = {
                    ...progress,
                    ...state,
                    percentage,
                    eta
                };
                onProgress(result);
            }
            function onRootStreamProgress(progress) {
                state.rootStreamPosition = progress.position;
                state.rootStreamSpeed = progress.speed;
                state.rootStreamAverageSpeed = progress.averageSpeed;
            }
            return [ $onProgress, onRootStreamProgress ];
        }
        async function pipeSourceToDestinations({source, destinations, onFail, onProgress, verify = false, numBuffers = 16}) {
            if (numBuffers < 2) {
                numBuffers = 2;
            }
            const destination = new multi_destination_1.MultiDestination(destinations);
            const failures = new Map;
            const state = {
                active: destination.destinations.size,
                failed: 0,
                type: "flashing"
            };
            destination.on("fail", _onFail);
            await Promise.all([ source.open(), destination.open() ]);
            const [sourceMetadata, sparseSource, sparseDestination] = await Promise.all([ source.getMetadata(), source.canCreateSparseReadStream(), destination.canCreateSparseWriteStream() ]);
            const sparse = sparseSource && sparseDestination;
            state.sparse = sparse;
            state.size = sourceMetadata.size;
            state.compressedSize = sourceMetadata.compressedSize;
            state.blockmappedSize = sourceMetadata.blockmappedSize;
            function updateState(step) {
                if (step !== undefined) {
                    state.type = step;
                }
                state.failed = failures.size;
                state.active = destination.destinations.size - state.failed;
            }
            function _onFail(error) {
                failures.set(error.destination, error.error);
                updateState();
                onFail(error.destination, error.error);
            }
            const [$onProgress, onRootStreamProgress] = createCompleteOnProgress(onProgress, sourceMetadata, state, sparse);
            if (sparse) {
                await pipeSparseSourceToDestination(source, destination, verify, numBuffers, updateState, _onFail, $onProgress, onRootStreamProgress);
            } else {
                await pipeRegularSourceToDestination(source, sourceMetadata, destination, verify, numBuffers, updateState, _onFail, $onProgress, onRootStreamProgress);
            }
            updateState("finished");
            await Promise.all([ source.close(), destination.close() ]);
            return {
                sourceMetadata,
                failures,
                bytesWritten: state.bytesWritten || 0
            };
        }
        exports.pipeSourceToDestinations = pipeSourceToDestinations;
        function notUndefined(x) {
            return x !== undefined;
        }
        function getAlignment(...devices) {
            const alignments = devices.map((d => d.getAlignment())).filter(notUndefined);
            if (alignments.length) {
                return Math.max(...alignments);
            }
        }
        async function pipeRegularSourceToDestination(source, sourceMetadata, destination, verify, numBuffers, updateState, onFail, onProgress, onRootStreamProgress) {
            let lastPosition = 0;
            const emitSourceProgress = sourceMetadata.size === undefined || sourceMetadata.isSizeEstimated;
            const alignment = getAlignment(source, destination);
            const highWaterMark = alignment === undefined ? undefined : numBuffers - 1;
            const [sourceStream, destinationStream] = await Promise.all([ source.createReadStream({
                emitProgress: emitSourceProgress,
                alignment,
                numBuffers
            }), destination.createWriteStream({
                highWaterMark
            }) ]);
            (0, compressed_source_1.getRootStream)(sourceStream).on("progress", (progress => {
                onRootStreamProgress(progress);
            }));
            const checksum = await new Promise(((resolve, reject) => {
                let result;
                let done = false;
                let hasher;
                function maybeDone(maybeChecksum) {
                    if (maybeChecksum !== undefined) {
                        result = maybeChecksum;
                    } else {
                        done = true;
                    }
                    if (done && (!verify || destination.activeDestinations.size === 0 || result !== undefined)) {
                        if (hasher !== undefined) {
                            sourceStream.unpipe(hasher);
                            hasher.end();
                        }
                        resolve(result);
                    }
                }
                sourceStream.once("error", reject);
                destinationStream.on("fail", onFail);
                destinationStream.once("error", reject);
                if (verify) {
                    hasher = (0, source_destination_1.createHasher)();
                    hasher.once("checksum", maybeDone);
                    sourceStream.pipe(hasher);
                }
                destinationStream.once("done", maybeDone);
                destinationStream.on("progress", (progress => {
                    lastPosition = progress.position;
                    onProgress(progress);
                }));
                if (alignment !== undefined && !(sourceStream instanceof block_read_stream_1.BlockReadStream || sourceStream instanceof block_transform_stream_1.BlockTransformStream)) {
                    sourceStream.pipe(new block_transform_stream_1.BlockTransformStream({
                        chunkSize: constants_1.CHUNK_SIZE,
                        alignment,
                        numBuffers
                    })).pipe(destinationStream);
                } else {
                    sourceStream.pipe(destinationStream);
                }
            }));
            if (sourceMetadata.size === undefined || sourceMetadata.isSizeEstimated === true) {
                sourceMetadata.size = lastPosition;
                sourceMetadata.isSizeEstimated = false;
            }
            if (verify && checksum) {
                updateState("verifying");
                const verifier = destination.createVerifier(checksum, lastPosition);
                await runVerifier(verifier, onFail, onProgress);
            }
        }
        async function pipeSparseSourceToDestination(source, destination, verify, numBuffers, updateState, onFail, onProgress, onRootStreamProgress) {
            const alignment = getAlignment(source, destination);
            const highWaterMark = alignment === undefined ? undefined : numBuffers - 1;
            const [sourceStream, destinationStream] = await Promise.all([ source.createSparseReadStream({
                generateChecksums: verify,
                alignment,
                numBuffers
            }), destination.createSparseWriteStream({
                highWaterMark
            }) ]);
            (0, compressed_source_1.getRootStream)(sourceStream).on("progress", (progress => {
                onRootStreamProgress(progress);
            }));
            await new Promise(((resolve, reject) => {
                sourceStream.once("error", reject);
                destinationStream.once("error", reject);
                destinationStream.once("done", resolve);
                destinationStream.on("fail", onFail);
                destinationStream.on("progress", onProgress);
                sourceStream.pipe(destinationStream);
            }));
            if (verify) {
                updateState("verifying");
                const verifier = destination.createVerifier(sourceStream.blocks);
                await runVerifier(verifier, onFail, onProgress);
            }
        }
        async function runVerifier(verifier, onFail, onProgress) {
            await new Promise(((resolve, reject) => {
                verifier.once("error", reject);
                verifier.once("finish", resolve);
                verifier.on("fail", onFail);
                verifier.on("progress", onProgress);
                verifier.run();
            }));
        }
    }, module => {
        "use strict";
        module.exports = require("fs");
    }, module => {
        "use strict";
        module.exports = require("path");
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.ProgressBlockReadStream = exports.BlockReadStream = void 0;
        const stream_1 = __webpack_require__(17);
        const aligned_lockable_buffer_1 = __webpack_require__(7);
        const constants_1 = __webpack_require__(3);
        const errors_1 = __webpack_require__(4);
        const progress_1 = __webpack_require__(18);
        class BlockReadStream extends stream_1.Readable {
            constructor({source, alignment, start = 0, end = Infinity, chunkSize = constants_1.CHUNK_SIZE, maxRetries = 5, numBuffers = 2}) {
                super({
                    objectMode: true,
                    highWaterMark: numBuffers - 1
                });
                this.bytesRead = 0;
                this.source = source;
                this.alignment = alignment;
                this.bytesRead = start;
                this.end = end;
                this.chunkSize = chunkSize;
                this.maxRetries = maxRetries;
                if (alignment !== undefined) {
                    this.chunkSize = Math.max(Math.floor(chunkSize / alignment) * alignment, alignment);
                    this.alignedReadableState = new aligned_lockable_buffer_1.AlignedReadableState(chunkSize, alignment, numBuffers);
                }
            }
            async tryRead(buffer) {
                return await (0, errors_1.retryOnTransientError)((async () => await this.source.read(buffer, 0, buffer.length, this.bytesRead)), this.maxRetries, constants_1.RETRY_BASE_TIMEOUT);
            }
            async _read() {
                if (this.bytesRead > this.end) {
                    this.push(null);
                    return;
                }
                let buffer = this.alignment !== undefined ? this.alignedReadableState.getCurrentBuffer() : Buffer.allocUnsafe(this.chunkSize);
                const toRead = this.end - this.bytesRead + 1;
                if (toRead < buffer.length) {
                    buffer = buffer.slice(0, toRead);
                }
                try {
                    let unlock;
                    if ((0, aligned_lockable_buffer_1.isAlignedLockableBuffer)(buffer)) {
                        unlock = await buffer.lock();
                    }
                    let bytesRead;
                    try {
                        ({bytesRead} = await this.tryRead(buffer));
                    } finally {
                        unlock === null || unlock === void 0 ? void 0 : unlock();
                    }
                    this.bytesRead += bytesRead;
                    if (bytesRead !== 0) {
                        this.push(buffer.slice(0, bytesRead));
                    } else {
                        this.push(null);
                    }
                } catch (error) {
                    this.emit("error", error);
                }
            }
        }
        exports.BlockReadStream = BlockReadStream;
        exports.ProgressBlockReadStream = (0, progress_1.makeClassEmitProgressEvents)(BlockReadStream, "bytesRead", "bytesRead");
    }, module => {
        "use strict";
        module.exports = require("stream");
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.ProgressWritable = exports.CountingWritable = exports.makeClassEmitProgressEvents = void 0;
        const stream_1 = __webpack_require__(17);
        const constants_1 = __webpack_require__(3);
        const speedometer_1 = __webpack_require__(19);
        function makeClassEmitProgressEvents(Cls, attribute, positionAttribute, interval = constants_1.PROGRESS_EMISSION_INTERVAL) {
            return class extends Cls {
                constructor(...args) {
                    super(...args);
                    const startTime = Date.now();
                    const meter = new speedometer_1.Speedometer(constants_1.SPEED_WINDOW);
                    const state = {
                        position: 0,
                        bytes: 0,
                        speed: 0,
                        averageSpeed: 0
                    };
                    let attributeValue = this[attribute];
                    const update = () => {
                        const newValue = this[attribute];
                        const attributeDelta = newValue - attributeValue;
                        if (attributeDelta === 0) {
                            return;
                        }
                        attributeValue = newValue;
                        state.bytes += attributeDelta;
                        const position = this[positionAttribute];
                        if (position !== undefined) {
                            state.position = position;
                        }
                        state.speed = meter.speed(attributeDelta);
                        state.averageSpeed = state.bytes / (Date.now() - startTime) * 1e3;
                        this.emit("progress", state);
                    };
                    const timer = setInterval(update, interval);
                    const clear = () => {
                        clearInterval(timer);
                    };
                    this.once("error", clear);
                    this.once("finish", clear);
                    this.once("finish", update);
                    this.once("end", clear);
                    this.once("end", update);
                }
            };
        }
        exports.makeClassEmitProgressEvents = makeClassEmitProgressEvents;
        class CountingWritable extends stream_1.Writable {
            constructor() {
                super(...arguments);
                this.bytesWritten = 0;
            }
            _write(chunk, _enc, callback) {
                if (Buffer.isBuffer(chunk)) {
                    this.bytesWritten = this.position = this.bytesWritten + chunk.length;
                } else {
                    this.bytesWritten += chunk.buffer.length;
                    this.position = chunk.position + chunk.buffer.length;
                }
                callback();
            }
        }
        exports.CountingWritable = CountingWritable;
        exports.ProgressWritable = makeClassEmitProgressEvents(CountingWritable, "bytesWritten", "position");
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.Speedometer = void 0;
        const utils_1 = __webpack_require__(6);
        class Speedometer {
            constructor(windowSize = 5) {
                this.windowSize = windowSize;
                this.values = [];
                this.values.push([ this.now(), 0 ]);
            }
            now() {
                return Date.now() / 1e3;
            }
            removeOldValues(start) {
                const index = this.values.findIndex((v => v[0] > start));
                const deleteUntil = index === -1 ? undefined : index - 1;
                this.values.splice(0, deleteUntil);
            }
            moment(index) {
                return this.values[index][0];
            }
            value(index) {
                return this.values[index][1];
            }
            speed(amount) {
                const now = this.now();
                this.values.push([ now, amount ]);
                const start = now - this.windowSize;
                this.removeOldValues(start);
                if (this.values.length < 2) {
                    return 0;
                }
                let ratio;
                let duration;
                if (start <= this.values[0][0]) {
                    ratio = (this.moment(1) - start) / (this.moment(1) - this.moment(0));
                    duration = this.windowSize;
                } else {
                    ratio = 1;
                    duration = now - this.moment(0);
                }
                const sum = ratio * this.value(1) + (0, utils_1.sumBy)(this.values.slice(2), (v => v[1]));
                return sum / duration;
            }
        }
        exports.Speedometer = Speedometer;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.BlockTransformStream = void 0;
        const stream_1 = __webpack_require__(17);
        const aligned_lockable_buffer_1 = __webpack_require__(7);
        const constants_1 = __webpack_require__(3);
        const utils_1 = __webpack_require__(6);
        class BlockTransformStream extends stream_1.Transform {
            constructor({chunkSize, alignment, numBuffers = 2}) {
                super({
                    objectMode: true,
                    highWaterMark: numBuffers - 1
                });
                this.bytesRead = 0;
                this.bytesWritten = 0;
                this.currentBufferPosition = 0;
                this.alignedReadableState = new aligned_lockable_buffer_1.AlignedReadableState(chunkSize, alignment, numBuffers);
            }
            __flush() {
                this.unlockCurrentBuffer();
                if (this.currentBufferPosition !== this.currentBuffer.length) {
                    this.push(this.currentBuffer.slice(0, this.currentBufferPosition));
                } else {
                    this.push(this.currentBuffer);
                }
                this.bytesWritten += this.currentBufferPosition;
                this.currentBufferPosition = 0;
            }
            async pushChunk(chunk) {
                if (chunk.length === 0) {
                    return;
                }
                if (this.currentBufferPosition === 0) {
                    this.currentBuffer = this.alignedReadableState.getCurrentBuffer();
                    this.unlockCurrentBuffer = await this.currentBuffer.lock();
                }
                const lengthToCopy = Math.min(chunk.length, this.currentBuffer.length - this.currentBufferPosition);
                chunk.copy(this.currentBuffer, this.currentBufferPosition, 0, lengthToCopy);
                this.currentBufferPosition += lengthToCopy;
                this.bytesRead += lengthToCopy;
                if (this.currentBufferPosition === this.currentBuffer.length) {
                    this.__flush();
                }
                if (lengthToCopy < chunk.length) {
                    await this.pushChunk(chunk.slice(lengthToCopy));
                }
            }
            _transform(chunk, _encoding, callback) {
                (0, utils_1.asCallback)(this.pushChunk(chunk), callback);
            }
            _flush(callback) {
                try {
                    this.__flush();
                    callback();
                } catch (error) {
                    callback(error);
                }
            }
            static alignIfNeeded(stream, alignment, numBuffers) {
                if (alignment === undefined) {
                    return stream;
                }
                const transform = new BlockTransformStream({
                    chunkSize: constants_1.CHUNK_SIZE,
                    alignment,
                    numBuffers
                });
                stream.on("error", transform.emit.bind(transform, "error"));
                stream.pipe(transform);
                return transform;
            }
        }
        exports.BlockTransformStream = BlockTransformStream;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.CompressedSource = exports.getRootStream = exports.isSourceTransform = void 0;
        const path_1 = __webpack_require__(15);
        const errors_1 = __webpack_require__(4);
        const stream_limiter_1 = __webpack_require__(22);
        const source_source_1 = __webpack_require__(24);
        function isSourceTransform(stream) {
            return stream.sourceStream !== undefined;
        }
        exports.isSourceTransform = isSourceTransform;
        function getRootStream(stream) {
            while (isSourceTransform(stream)) {
                stream = stream.sourceStream;
            }
            return stream;
        }
        exports.getRootStream = getRootStream;
        class CompressedSource extends source_source_1.SourceSource {
            async getSize() {
                return;
            }
            async canCreateReadStream() {
                return true;
            }
            async createReadStream({emitProgress = false, start = 0, end} = {}) {
                if (start !== 0) {
                    throw new errors_1.NotCapable;
                }
                const stream = await this.source.createReadStream({
                    emitProgress
                });
                const transform = this.createTransform();
                stream.pipe(transform);
                transform.sourceStream = stream;
                if (end !== undefined) {
                    const limiter = new stream_limiter_1.StreamLimiter(transform, end + 1);
                    limiter.sourceStream = transform;
                    limiter.on("finish", (() => {
                        stream.on("error", (err => {
                            if (err.code !== "EBADF") {
                                throw err;
                            }
                        }));
                    }));
                    return limiter;
                }
                return transform;
            }
            async getSizeFromPartitionTable() {
                try {
                    const partitions = await this.getPartitionTable();
                    if (partitions !== undefined) {
                        const lastByte = Math.max(...partitions.partitions.map((({offset, size}) => offset + size)));
                        if (lastByte !== -Infinity) {
                            return lastByte;
                        }
                    }
                } catch (error) {}
            }
            async _getMetadata() {
                const sourceMetadata = await this.source.getMetadata();
                const compressedSize = sourceMetadata.compressedSize || sourceMetadata.size;
                const size = await this.getSize();
                let name;
                if (sourceMetadata.name !== undefined) {
                    name = (0, path_1.basename)(sourceMetadata.name, (0, path_1.extname)(sourceMetadata.name));
                }
                return {
                    isCompressed: true,
                    name,
                    size: size === null || size === void 0 ? void 0 : size.size,
                    compressedSize,
                    isSizeEstimated: size === null || size === void 0 ? void 0 : size.isEstimated
                };
            }
        }
        exports.CompressedSource = CompressedSource;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.StreamLimiter = void 0;
        const stream_1 = __webpack_require__(17);
        const zlib = __webpack_require__(23);
        const compressed_source_1 = __webpack_require__(21);
        class StreamLimiter extends stream_1.Transform {
            constructor(stream, maxBytes) {
                super();
                this.stream = stream;
                this.maxBytes = maxBytes;
                this.stream.on("error", this.emit.bind(this, "error"));
                this.stream.pipe(this);
            }
            _transform(buffer, _encoding, callback) {
                var _a, _b, _c, _d, _e, _f;
                const length = Math.min(buffer.length, this.maxBytes);
                if (length > 0) {
                    this.push(buffer.slice(0, length));
                }
                this.maxBytes -= length;
                if (this.maxBytes === 0) {
                    (_b = (_a = this.stream).unpipe) === null || _b === void 0 ? void 0 : _b.call(_a, this);
                    this.push(null);
                    this.emit("finish");
                    (0, compressed_source_1.getRootStream)(this.stream).emit("end");
                    if (!(this.stream instanceof zlib.Gunzip)) {
                        (_d = (_c = this.stream).close) === null || _d === void 0 ? void 0 : _d.call(_c);
                    }
                    if (this.stream.constructor.name !== "JSLzmaStream") {
                        (_f = (_e = this.stream).destroy) === null || _f === void 0 ? void 0 : _f.call(_e);
                    }
                }
                callback();
            }
        }
        exports.StreamLimiter = StreamLimiter;
    }, module => {
        "use strict";
        module.exports = require("zlib");
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.SourceSource = void 0;
        const source_destination_1 = __webpack_require__(25);
        class SourceSource extends source_destination_1.SourceDestination {
            constructor(source) {
                super();
                this.source = source;
            }
            async _open() {
                await this.source.open();
            }
            async _close() {
                await this.source.close();
            }
        }
        exports.SourceSource = SourceSource;
        SourceSource.requiresRandomReadableSource = false;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.SourceDestination = exports.SparseStreamVerifier = exports.StreamVerifier = exports.Verifier = exports.SourceDestinationFs = exports.createHasher = exports.ProgressHashStream = exports.CountingHashStream = void 0;
        const stream_1 = __webpack_require__(17);
        const events_1 = __webpack_require__(26);
        const fileType = __webpack_require__(27);
        const partitioninfo_1 = __webpack_require__(28);
        const path_1 = __webpack_require__(15);
        const xxhash_addon_1 = __webpack_require__(52);
        const aligned_lockable_buffer_1 = __webpack_require__(7);
        const constants_1 = __webpack_require__(3);
        const errors_1 = __webpack_require__(4);
        const sparse_filter_stream_1 = __webpack_require__(54);
        const sparse_read_stream_1 = __webpack_require__(67);
        const utils_1 = __webpack_require__(6);
        const progress_1 = __webpack_require__(18);
        class HashStream extends stream_1.Transform {
            constructor(seed, outEnc) {
                super();
                if (outEnc && typeof outEnc !== "string" && !Buffer.isBuffer(outEnc)) {
                    outEnc = "buffer";
                }
                this._outEnc = outEnc;
                this._hash = new xxhash_addon_1.XXHash3(seed);
            }
            _transform(chunk, _encoding, callback) {
                this._hash.update(chunk);
                callback();
            }
            _flush(callback) {
                this.push(this._hash.digest(this._outEnc));
                callback();
            }
        }
        class CountingHashStream extends HashStream {
            constructor() {
                super(...arguments);
                this.bytesWritten = 0;
            }
            async __transform(chunk, encoding) {
                const unlock = (0, aligned_lockable_buffer_1.isAlignedLockableBuffer)(chunk) ? await chunk.rlock() : undefined;
                try {
                    await (0, utils_1.fromCallback)((callback => {
                        super._transform(chunk, encoding, callback);
                    }));
                } finally {
                    unlock === null || unlock === void 0 ? void 0 : unlock();
                }
                this.bytesWritten += chunk.length;
            }
            _transform(chunk, encoding, callback) {
                (0, utils_1.asCallback)(this.__transform(chunk, encoding), callback);
            }
        }
        exports.CountingHashStream = CountingHashStream;
        exports.ProgressHashStream = (0, progress_1.makeClassEmitProgressEvents)(CountingHashStream, "bytesWritten", "bytesWritten");
        function createHasher() {
            const hasher = new exports.ProgressHashStream(constants_1.XXHASH_SEED, "buffer");
            hasher.on("finish", (async () => {
                const checksum = (await (0, utils_1.streamToBuffer)(hasher)).toString("hex");
                hasher.emit("checksum", checksum);
            }));
            return hasher;
        }
        exports.createHasher = createHasher;
        class SourceDestinationFs {
            constructor(source) {
                this.source = source;
            }
            open(_path, _options, callback) {
                callback(null, 1);
            }
            close(_fd, callback) {
                callback(null);
            }
            fstat(_fd, callback) {
                this.source.getMetadata().then((metadata => {
                    if (metadata.size === undefined) {
                        callback(new Error("No size"));
                        return;
                    }
                    callback(null, {
                        size: metadata.size
                    });
                })).catch(callback);
            }
            read(_fd, buffer, bufferOffset, length, sourceOffset, callback) {
                this.source.read(buffer, bufferOffset, length, sourceOffset).then((res => {
                    callback(null, res.bytesRead, res.buffer);
                })).catch(callback);
            }
        }
        exports.SourceDestinationFs = SourceDestinationFs;
        class Verifier extends events_1.EventEmitter {
            constructor() {
                super(...arguments);
                this.progress = {
                    bytes: 0,
                    position: 0,
                    speed: 0,
                    averageSpeed: 0
                };
            }
            handleEventsAndPipe(stream, meter) {
                meter.on("progress", (progress => {
                    this.progress = progress;
                    this.emit("progress", progress);
                }));
                stream.on("end", this.emit.bind(this, "end"));
                meter.on("finish", this.emit.bind(this, "finish"));
                stream.once("error", (() => {
                    stream.unpipe(meter);
                    meter.end();
                }));
                stream.pipe(meter);
            }
        }
        exports.Verifier = Verifier;
        class StreamVerifier extends Verifier {
            constructor(source, checksum, size) {
                super();
                this.source = source;
                this.checksum = checksum;
                this.size = size;
            }
            async run() {
                const stream = await this.source.createReadStream({
                    end: this.size - 1,
                    alignment: this.source.getAlignment()
                });
                stream.on("error", this.emit.bind(this, "error"));
                const hasher = createHasher();
                hasher.on("error", this.emit.bind(this, "error"));
                hasher.on("checksum", (streamChecksum => {
                    if (streamChecksum !== this.checksum) {
                        this.emit("error", new errors_1.ChecksumVerificationError(`Source and destination checksums do not match: ${this.checksum} !== ${streamChecksum}`, streamChecksum, this.checksum));
                    }
                }));
                this.handleEventsAndPipe(stream, hasher);
            }
        }
        exports.StreamVerifier = StreamVerifier;
        class SparseStreamVerifier extends Verifier {
            constructor(source, blocks) {
                super();
                this.source = source;
                this.blocks = blocks;
            }
            async run() {
                const alignment = this.source.getAlignment();
                let stream;
                if (await this.source.canRead()) {
                    stream = new sparse_read_stream_1.SparseReadStream({
                        source: this.source,
                        blocks: this.blocks,
                        chunkSize: constants_1.CHUNK_SIZE,
                        verify: true,
                        generateChecksums: false,
                        alignment,
                        numBuffers: 2
                    });
                    stream.on("error", this.emit.bind(this, "error"));
                } else if (await this.source.canCreateReadStream()) {
                    const originalStream = await this.source.createReadStream();
                    originalStream.once("error", (error => {
                        originalStream.unpipe(transform);
                        this.emit("error", error);
                    }));
                    const transform = new sparse_filter_stream_1.SparseFilterStream({
                        blocks: this.blocks,
                        verify: true,
                        generateChecksums: false
                    });
                    transform.once("error", (error => {
                        originalStream.unpipe(transform);
                        if (typeof originalStream.destroy === "function") {
                            originalStream.destroy();
                        }
                        this.emit("error", error);
                    }));
                    originalStream.pipe(transform);
                    stream = transform;
                } else {
                    throw new errors_1.NotCapable;
                }
                const meter = new progress_1.ProgressWritable({
                    objectMode: true
                });
                this.handleEventsAndPipe(stream, meter);
            }
        }
        exports.SparseStreamVerifier = SparseStreamVerifier;
        class SourceDestination extends events_1.EventEmitter {
            constructor() {
                super(...arguments);
                this.isOpen = false;
            }
            static register(Cls) {
                if (Cls.mimetype !== undefined) {
                    SourceDestination.mimetypes.set(Cls.mimetype, Cls);
                }
            }
            getAlignment() {
                return undefined;
            }
            async canRead() {
                return false;
            }
            async canWrite() {
                return false;
            }
            async canCreateReadStream() {
                return false;
            }
            async canCreateSparseReadStream() {
                return false;
            }
            async canCreateWriteStream() {
                return false;
            }
            async canCreateSparseWriteStream() {
                return false;
            }
            async getMetadata() {
                if (this.metadata === undefined) {
                    this.metadata = await this._getMetadata();
                }
                return this.metadata;
            }
            async _getMetadata() {
                return {};
            }
            async read(_buffer, _bufferOffset, _length, _sourceOffset) {
                throw new errors_1.NotCapable;
            }
            async write(_buffer, _bufferOffset, _length, _fileOffset) {
                throw new errors_1.NotCapable;
            }
            async createReadStream(_options = {}) {
                throw new errors_1.NotCapable;
            }
            async createSparseReadStream(_options = {}) {
                throw new errors_1.NotCapable;
            }
            async getBlocks() {
                throw new errors_1.NotCapable;
            }
            async createWriteStream(_options = {}) {
                throw new errors_1.NotCapable;
            }
            async createSparseWriteStream(_options = {}) {
                throw new errors_1.NotCapable;
            }
            async open() {
                if (!this.isOpen) {
                    await this._open();
                    this.isOpen = true;
                }
            }
            async close() {
                if (this.isOpen) {
                    await this._close();
                    this.isOpen = false;
                }
            }
            async _open() {}
            async _close() {}
            createVerifier(checksumOrBlocks, size) {
                if (Array.isArray(checksumOrBlocks)) {
                    for (const block of checksumOrBlocks) {
                        if (block.checksumType === undefined || block.checksum === undefined) {
                            throw new Error("Block is missing checksum or checksumType attributes, can not create verifier");
                        }
                    }
                    return new SparseStreamVerifier(this, checksumOrBlocks);
                } else {
                    if (size === undefined) {
                        throw new Error("A size argument is required for creating a stream checksum verifier");
                    }
                    return new StreamVerifier(this, checksumOrBlocks, size);
                }
            }
            async getMimeTypeFromName() {
                const metadata = await this.getMetadata();
                if (metadata.name === undefined) {
                    return;
                }
                const extension = (0, path_1.extname)(metadata.name).toLowerCase();
                if (extension === ".dmg") {
                    return "application/x-apple-diskimage";
                }
            }
            async getMimeTypeFromContent() {
                let stream;
                try {
                    stream = await this.createReadStream({
                        end: 263,
                        alignment: this.getAlignment()
                    });
                } catch (error) {
                    if (error instanceof errors_1.NotCapable) {
                        return;
                    }
                    throw error;
                }
                const ft = fileType(await (0, utils_1.streamToBuffer)(stream));
                if (ft !== null) {
                    return ft.mime;
                }
            }
            async getInnerSourceHelper(mimetype) {
                if (mimetype === undefined) {
                    return this;
                }
                const Cls = SourceDestination.mimetypes.get(mimetype);
                if (Cls === undefined) {
                    return this;
                }
                if (Cls.requiresRandomReadableSource && !await this.canRead()) {
                    throw new errors_1.NotCapable(`Can not read a ${Cls.name} from a ${this.constructor.name}.`);
                }
                const innerSource = new Cls(this);
                return innerSource.getInnerSource();
            }
            async getInnerSource() {
                await this.open();
                const metadata = await this.getMetadata();
                if (metadata.isEtch === true) {
                    return this;
                }
                let mimetype = await this.getMimeTypeFromName();
                if (mimetype !== undefined) {
                    try {
                        return await this.getInnerSourceHelper(mimetype);
                    } catch (error) {
                        if (error instanceof errors_1.NotCapable) {
                            throw error;
                        }
                    }
                }
                mimetype = await this.getMimeTypeFromContent();
                return this.getInnerSourceHelper(mimetype);
            }
            async getPartitionTable() {
                const stream = await this.createReadStream({
                    end: 34 * 512,
                    alignment: this.getAlignment()
                });
                const buffer = await (0, utils_1.streamToBuffer)(stream);
                try {
                    return await (0, partitioninfo_1.getPartitions)(buffer, {
                        getLogical: false
                    });
                } catch (_a) {}
            }
        }
        exports.SourceDestination = SourceDestination;
        SourceDestination.imageExtensions = [ "img", "iso", "bin", "dsk", "hddimg", "raw", "dmg", "sdcard", "rpi-sdimg", "wic" ];
        SourceDestination.mimetypes = new Map;
    }, module => {
        "use strict";
        module.exports = require("events");
    }, module => {
        "use strict";
        const toBytes = s => [ ...s ].map((c => c.charCodeAt(0)));
        const xpiZipFilename = toBytes("META-INF/mozilla.rsa");
        const oxmlContentTypes = toBytes("[Content_Types].xml");
        const oxmlRels = toBytes("_rels/.rels");
        module.exports = input => {
            const buf = input instanceof Uint8Array ? input : new Uint8Array(input);
            if (!(buf && buf.length > 1)) {
                return null;
            }
            const check = (header, options) => {
                options = Object.assign({
                    offset: 0
                }, options);
                for (let i = 0; i < header.length; i++) {
                    if (options.mask) {
                        if (header[i] !== (options.mask[i] & buf[i + options.offset])) {
                            return false;
                        }
                    } else if (header[i] !== buf[i + options.offset]) {
                        return false;
                    }
                }
                return true;
            };
            const checkString = (header, options) => check(toBytes(header), options);
            if (check([ 255, 216, 255 ])) {
                return {
                    ext: "jpg",
                    mime: "image/jpeg"
                };
            }
            if (check([ 137, 80, 78, 71, 13, 10, 26, 10 ])) {
                return {
                    ext: "png",
                    mime: "image/png"
                };
            }
            if (check([ 71, 73, 70 ])) {
                return {
                    ext: "gif",
                    mime: "image/gif"
                };
            }
            if (check([ 87, 69, 66, 80 ], {
                offset: 8
            })) {
                return {
                    ext: "webp",
                    mime: "image/webp"
                };
            }
            if (check([ 70, 76, 73, 70 ])) {
                return {
                    ext: "flif",
                    mime: "image/flif"
                };
            }
            if ((check([ 73, 73, 42, 0 ]) || check([ 77, 77, 0, 42 ])) && check([ 67, 82 ], {
                offset: 8
            })) {
                return {
                    ext: "cr2",
                    mime: "image/x-canon-cr2"
                };
            }
            if (check([ 73, 73, 42, 0 ]) || check([ 77, 77, 0, 42 ])) {
                return {
                    ext: "tif",
                    mime: "image/tiff"
                };
            }
            if (check([ 66, 77 ])) {
                return {
                    ext: "bmp",
                    mime: "image/bmp"
                };
            }
            if (check([ 73, 73, 188 ])) {
                return {
                    ext: "jxr",
                    mime: "image/vnd.ms-photo"
                };
            }
            if (check([ 56, 66, 80, 83 ])) {
                return {
                    ext: "psd",
                    mime: "image/vnd.adobe.photoshop"
                };
            }
            if (check([ 80, 75, 3, 4 ])) {
                if (check([ 109, 105, 109, 101, 116, 121, 112, 101, 97, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 101, 112, 117, 98, 43, 122, 105, 112 ], {
                    offset: 30
                })) {
                    return {
                        ext: "epub",
                        mime: "application/epub+zip"
                    };
                }
                if (check(xpiZipFilename, {
                    offset: 30
                })) {
                    return {
                        ext: "xpi",
                        mime: "application/x-xpinstall"
                    };
                }
                if (checkString("mimetypeapplication/vnd.oasis.opendocument.text", {
                    offset: 30
                })) {
                    return {
                        ext: "odt",
                        mime: "application/vnd.oasis.opendocument.text"
                    };
                }
                if (checkString("mimetypeapplication/vnd.oasis.opendocument.spreadsheet", {
                    offset: 30
                })) {
                    return {
                        ext: "ods",
                        mime: "application/vnd.oasis.opendocument.spreadsheet"
                    };
                }
                if (checkString("mimetypeapplication/vnd.oasis.opendocument.presentation", {
                    offset: 30
                })) {
                    return {
                        ext: "odp",
                        mime: "application/vnd.oasis.opendocument.presentation"
                    };
                }
                if (check(oxmlContentTypes, {
                    offset: 30
                }) || check(oxmlRels, {
                    offset: 30
                })) {
                    const sliced = buf.subarray(4, 4 + 2e3);
                    const nextZipHeaderIndex = arr => arr.findIndex(((el, i, arr) => arr[i] === 80 && arr[i + 1] === 75 && arr[i + 2] === 3 && arr[i + 3] === 4));
                    const header2Pos = nextZipHeaderIndex(sliced);
                    if (header2Pos !== -1) {
                        const slicedAgain = buf.subarray(header2Pos + 8, header2Pos + 8 + 1e3);
                        const header3Pos = nextZipHeaderIndex(slicedAgain);
                        if (header3Pos !== -1) {
                            const offset = 8 + header2Pos + header3Pos + 30;
                            if (checkString("word/", {
                                offset
                            })) {
                                return {
                                    ext: "docx",
                                    mime: "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
                                };
                            }
                            if (checkString("ppt/", {
                                offset
                            })) {
                                return {
                                    ext: "pptx",
                                    mime: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
                                };
                            }
                            if (checkString("xl/", {
                                offset
                            })) {
                                return {
                                    ext: "xlsx",
                                    mime: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
                                };
                            }
                        }
                    }
                }
            }
            if (check([ 80, 75 ]) && (buf[2] === 3 || buf[2] === 5 || buf[2] === 7) && (buf[3] === 4 || buf[3] === 6 || buf[3] === 8)) {
                return {
                    ext: "zip",
                    mime: "application/zip"
                };
            }
            if (check([ 117, 115, 116, 97, 114 ], {
                offset: 257
            })) {
                return {
                    ext: "tar",
                    mime: "application/x-tar"
                };
            }
            if (check([ 82, 97, 114, 33, 26, 7 ]) && (buf[6] === 0 || buf[6] === 1)) {
                return {
                    ext: "rar",
                    mime: "application/x-rar-compressed"
                };
            }
            if (check([ 31, 139, 8 ])) {
                return {
                    ext: "gz",
                    mime: "application/gzip"
                };
            }
            if (check([ 66, 90, 104 ])) {
                return {
                    ext: "bz2",
                    mime: "application/x-bzip2"
                };
            }
            if (check([ 55, 122, 188, 175, 39, 28 ])) {
                return {
                    ext: "7z",
                    mime: "application/x-7z-compressed"
                };
            }
            if (check([ 120, 1 ])) {
                return {
                    ext: "dmg",
                    mime: "application/x-apple-diskimage"
                };
            }
            if (check([ 51, 103, 112, 53 ]) || check([ 0, 0, 0 ]) && check([ 102, 116, 121, 112 ], {
                offset: 4
            }) && (check([ 109, 112, 52, 49 ], {
                offset: 8
            }) || check([ 109, 112, 52, 50 ], {
                offset: 8
            }) || check([ 105, 115, 111, 109 ], {
                offset: 8
            }) || check([ 105, 115, 111, 50 ], {
                offset: 8
            }) || check([ 109, 109, 112, 52 ], {
                offset: 8
            }) || check([ 77, 52, 86 ], {
                offset: 8
            }) || check([ 100, 97, 115, 104 ], {
                offset: 8
            }))) {
                return {
                    ext: "mp4",
                    mime: "video/mp4"
                };
            }
            if (check([ 77, 84, 104, 100 ])) {
                return {
                    ext: "mid",
                    mime: "audio/midi"
                };
            }
            if (check([ 26, 69, 223, 163 ])) {
                const sliced = buf.subarray(4, 4 + 4096);
                const idPos = sliced.findIndex(((el, i, arr) => arr[i] === 66 && arr[i + 1] === 130));
                if (idPos !== -1) {
                    const docTypePos = idPos + 3;
                    const findDocType = type => [ ...type ].every(((c, i) => sliced[docTypePos + i] === c.charCodeAt(0)));
                    if (findDocType("matroska")) {
                        return {
                            ext: "mkv",
                            mime: "video/x-matroska"
                        };
                    }
                    if (findDocType("webm")) {
                        return {
                            ext: "webm",
                            mime: "video/webm"
                        };
                    }
                }
            }
            if (check([ 0, 0, 0, 20, 102, 116, 121, 112, 113, 116, 32, 32 ]) || check([ 102, 114, 101, 101 ], {
                offset: 4
            }) || check([ 102, 116, 121, 112, 113, 116, 32, 32 ], {
                offset: 4
            }) || check([ 109, 100, 97, 116 ], {
                offset: 4
            }) || check([ 119, 105, 100, 101 ], {
                offset: 4
            })) {
                return {
                    ext: "mov",
                    mime: "video/quicktime"
                };
            }
            if (check([ 82, 73, 70, 70 ])) {
                if (check([ 65, 86, 73 ], {
                    offset: 8
                })) {
                    return {
                        ext: "avi",
                        mime: "video/x-msvideo"
                    };
                }
                if (check([ 87, 65, 86, 69 ], {
                    offset: 8
                })) {
                    return {
                        ext: "wav",
                        mime: "audio/x-wav"
                    };
                }
                if (check([ 81, 76, 67, 77 ], {
                    offset: 8
                })) {
                    return {
                        ext: "qcp",
                        mime: "audio/qcelp"
                    };
                }
            }
            if (check([ 48, 38, 178, 117, 142, 102, 207, 17, 166, 217 ])) {
                return {
                    ext: "wmv",
                    mime: "video/x-ms-wmv"
                };
            }
            if (check([ 0, 0, 1, 186 ]) || check([ 0, 0, 1, 179 ])) {
                return {
                    ext: "mpg",
                    mime: "video/mpeg"
                };
            }
            if (check([ 102, 116, 121, 112, 51, 103 ], {
                offset: 4
            })) {
                return {
                    ext: "3gp",
                    mime: "video/3gpp"
                };
            }
            for (let start = 0; start < 2 && start < buf.length - 16; start++) {
                if (check([ 73, 68, 51 ], {
                    offset: start
                }) || check([ 255, 226 ], {
                    offset: start,
                    mask: [ 255, 226 ]
                })) {
                    return {
                        ext: "mp3",
                        mime: "audio/mpeg"
                    };
                }
                if (check([ 255, 228 ], {
                    offset: start,
                    mask: [ 255, 228 ]
                })) {
                    return {
                        ext: "mp2",
                        mime: "audio/mpeg"
                    };
                }
                if (check([ 255, 248 ], {
                    offset: start,
                    mask: [ 255, 252 ]
                })) {
                    return {
                        ext: "mp2",
                        mime: "audio/mpeg"
                    };
                }
                if (check([ 255, 240 ], {
                    offset: start,
                    mask: [ 255, 252 ]
                })) {
                    return {
                        ext: "mp4",
                        mime: "audio/mpeg"
                    };
                }
            }
            if (check([ 102, 116, 121, 112, 77, 52, 65 ], {
                offset: 4
            }) || check([ 77, 52, 65, 32 ])) {
                return {
                    ext: "m4a",
                    mime: "audio/m4a"
                };
            }
            if (check([ 79, 112, 117, 115, 72, 101, 97, 100 ], {
                offset: 28
            })) {
                return {
                    ext: "opus",
                    mime: "audio/opus"
                };
            }
            if (check([ 79, 103, 103, 83 ])) {
                if (check([ 128, 116, 104, 101, 111, 114, 97 ], {
                    offset: 28
                })) {
                    return {
                        ext: "ogv",
                        mime: "video/ogg"
                    };
                }
                if (check([ 1, 118, 105, 100, 101, 111, 0 ], {
                    offset: 28
                })) {
                    return {
                        ext: "ogm",
                        mime: "video/ogg"
                    };
                }
                if (check([ 127, 70, 76, 65, 67 ], {
                    offset: 28
                })) {
                    return {
                        ext: "oga",
                        mime: "audio/ogg"
                    };
                }
                if (check([ 83, 112, 101, 101, 120, 32, 32 ], {
                    offset: 28
                })) {
                    return {
                        ext: "spx",
                        mime: "audio/ogg"
                    };
                }
                if (check([ 1, 118, 111, 114, 98, 105, 115 ], {
                    offset: 28
                })) {
                    return {
                        ext: "ogg",
                        mime: "audio/ogg"
                    };
                }
                return {
                    ext: "ogx",
                    mime: "application/ogg"
                };
            }
            if (check([ 102, 76, 97, 67 ])) {
                return {
                    ext: "flac",
                    mime: "audio/x-flac"
                };
            }
            if (check([ 77, 65, 67, 32 ])) {
                return {
                    ext: "ape",
                    mime: "audio/ape"
                };
            }
            if (check([ 35, 33, 65, 77, 82, 10 ])) {
                return {
                    ext: "amr",
                    mime: "audio/amr"
                };
            }
            if (check([ 37, 80, 68, 70 ])) {
                return {
                    ext: "pdf",
                    mime: "application/pdf"
                };
            }
            if (check([ 77, 90 ])) {
                return {
                    ext: "exe",
                    mime: "application/x-msdownload"
                };
            }
            if ((buf[0] === 67 || buf[0] === 70) && check([ 87, 83 ], {
                offset: 1
            })) {
                return {
                    ext: "swf",
                    mime: "application/x-shockwave-flash"
                };
            }
            if (check([ 123, 92, 114, 116, 102 ])) {
                return {
                    ext: "rtf",
                    mime: "application/rtf"
                };
            }
            if (check([ 0, 97, 115, 109 ])) {
                return {
                    ext: "wasm",
                    mime: "application/wasm"
                };
            }
            if (check([ 119, 79, 70, 70 ]) && (check([ 0, 1, 0, 0 ], {
                offset: 4
            }) || check([ 79, 84, 84, 79 ], {
                offset: 4
            }))) {
                return {
                    ext: "woff",
                    mime: "font/woff"
                };
            }
            if (check([ 119, 79, 70, 50 ]) && (check([ 0, 1, 0, 0 ], {
                offset: 4
            }) || check([ 79, 84, 84, 79 ], {
                offset: 4
            }))) {
                return {
                    ext: "woff2",
                    mime: "font/woff2"
                };
            }
            if (check([ 76, 80 ], {
                offset: 34
            }) && (check([ 0, 0, 1 ], {
                offset: 8
            }) || check([ 1, 0, 2 ], {
                offset: 8
            }) || check([ 2, 0, 2 ], {
                offset: 8
            }))) {
                return {
                    ext: "eot",
                    mime: "application/octet-stream"
                };
            }
            if (check([ 0, 1, 0, 0, 0 ])) {
                return {
                    ext: "ttf",
                    mime: "font/ttf"
                };
            }
            if (check([ 79, 84, 84, 79, 0 ])) {
                return {
                    ext: "otf",
                    mime: "font/otf"
                };
            }
            if (check([ 0, 0, 1, 0 ])) {
                return {
                    ext: "ico",
                    mime: "image/x-icon"
                };
            }
            if (check([ 0, 0, 2, 0 ])) {
                return {
                    ext: "cur",
                    mime: "image/x-icon"
                };
            }
            if (check([ 70, 76, 86, 1 ])) {
                return {
                    ext: "flv",
                    mime: "video/x-flv"
                };
            }
            if (check([ 37, 33 ])) {
                return {
                    ext: "ps",
                    mime: "application/postscript"
                };
            }
            if (check([ 253, 55, 122, 88, 90, 0 ])) {
                return {
                    ext: "xz",
                    mime: "application/x-xz"
                };
            }
            if (check([ 83, 81, 76, 105 ])) {
                return {
                    ext: "sqlite",
                    mime: "application/x-sqlite3"
                };
            }
            if (check([ 78, 69, 83, 26 ])) {
                return {
                    ext: "nes",
                    mime: "application/x-nintendo-nes-rom"
                };
            }
            if (check([ 67, 114, 50, 52 ])) {
                return {
                    ext: "crx",
                    mime: "application/x-google-chrome-extension"
                };
            }
            if (check([ 77, 83, 67, 70 ]) || check([ 73, 83, 99, 40 ])) {
                return {
                    ext: "cab",
                    mime: "application/vnd.ms-cab-compressed"
                };
            }
            if (check([ 33, 60, 97, 114, 99, 104, 62, 10, 100, 101, 98, 105, 97, 110, 45, 98, 105, 110, 97, 114, 121 ])) {
                return {
                    ext: "deb",
                    mime: "application/x-deb"
                };
            }
            if (check([ 33, 60, 97, 114, 99, 104, 62 ])) {
                return {
                    ext: "ar",
                    mime: "application/x-unix-archive"
                };
            }
            if (check([ 237, 171, 238, 219 ])) {
                return {
                    ext: "rpm",
                    mime: "application/x-rpm"
                };
            }
            if (check([ 31, 160 ]) || check([ 31, 157 ])) {
                return {
                    ext: "Z",
                    mime: "application/x-compress"
                };
            }
            if (check([ 76, 90, 73, 80 ])) {
                return {
                    ext: "lz",
                    mime: "application/x-lzip"
                };
            }
            if (check([ 208, 207, 17, 224, 161, 177, 26, 225 ])) {
                return {
                    ext: "msi",
                    mime: "application/x-msi"
                };
            }
            if (check([ 6, 14, 43, 52, 2, 5, 1, 1, 13, 1, 2, 1, 1, 2 ])) {
                return {
                    ext: "mxf",
                    mime: "application/mxf"
                };
            }
            if (check([ 71 ], {
                offset: 4
            }) && (check([ 71 ], {
                offset: 192
            }) || check([ 71 ], {
                offset: 196
            }))) {
                return {
                    ext: "mts",
                    mime: "video/mp2t"
                };
            }
            if (check([ 66, 76, 69, 78, 68, 69, 82 ])) {
                return {
                    ext: "blend",
                    mime: "application/x-blender"
                };
            }
            if (check([ 66, 80, 71, 251 ])) {
                return {
                    ext: "bpg",
                    mime: "image/bpg"
                };
            }
            if (check([ 0, 0, 0, 12, 106, 80, 32, 32, 13, 10, 135, 10 ])) {
                if (check([ 106, 112, 50, 32 ], {
                    offset: 20
                })) {
                    return {
                        ext: "jp2",
                        mime: "image/jp2"
                    };
                }
                if (check([ 106, 112, 120, 32 ], {
                    offset: 20
                })) {
                    return {
                        ext: "jpx",
                        mime: "image/jpx"
                    };
                }
                if (check([ 106, 112, 109, 32 ], {
                    offset: 20
                })) {
                    return {
                        ext: "jpm",
                        mime: "image/jpm"
                    };
                }
                if (check([ 109, 106, 112, 50 ], {
                    offset: 20
                })) {
                    return {
                        ext: "mj2",
                        mime: "image/mj2"
                    };
                }
            }
            if (check([ 70, 79, 82, 77, 0 ])) {
                return {
                    ext: "aif",
                    mime: "audio/aiff"
                };
            }
            if (checkString("<?xml ")) {
                return {
                    ext: "xml",
                    mime: "application/xml"
                };
            }
            if (check([ 66, 79, 79, 75, 77, 79, 66, 73 ], {
                offset: 60
            })) {
                return {
                    ext: "mobi",
                    mime: "application/x-mobipocket-ebook"
                };
            }
            if (check([ 102, 116, 121, 112 ], {
                offset: 4
            })) {
                if (check([ 109, 105, 102, 49 ], {
                    offset: 8
                })) {
                    return {
                        ext: "heic",
                        mime: "image/heif"
                    };
                }
                if (check([ 109, 115, 102, 49 ], {
                    offset: 8
                })) {
                    return {
                        ext: "heic",
                        mime: "image/heif-sequence"
                    };
                }
                if (check([ 104, 101, 105, 99 ], {
                    offset: 8
                }) || check([ 104, 101, 105, 120 ], {
                    offset: 8
                })) {
                    return {
                        ext: "heic",
                        mime: "image/heic"
                    };
                }
                if (check([ 104, 101, 118, 99 ], {
                    offset: 8
                }) || check([ 104, 101, 118, 120 ], {
                    offset: 8
                })) {
                    return {
                        ext: "heic",
                        mime: "image/heic-sequence"
                    };
                }
            }
            if (check([ 171, 75, 84, 88, 32, 49, 49, 187, 13, 10, 26, 10 ])) {
                return {
                    ext: "ktx",
                    mime: "image/ktx"
                };
            }
            return null;
        };
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.getPartitions = exports.get = exports.PartitionNotFound = void 0;
        const file_disk_1 = __webpack_require__(29);
        const GPT = __webpack_require__(33);
        const MBR = __webpack_require__(38);
        const typed_error_1 = __webpack_require__(51);
        const MBR_SIZE = 512;
        const GPT_SIZE = 512 * 41;
        const GPT_PROTECTIVE_MBR = 238;
        const MBR_LAST_PRIMARY_PARTITION = 4;
        const MBR_FIRST_LOGICAL_PARTITION = 5;
        function mbrPartitionDict(p, offset, index) {
            return {
                offset: offset + p.byteOffset(),
                size: p.byteSize(),
                type: p.type,
                index
            };
        }
        function gptPartitionDict(gpt, p, index) {
            return {
                offset: p.firstLBA * gpt.blockSize,
                size: (p.lastLBA - p.firstLBA + 1) * gpt.blockSize,
                type: p.type,
                guid: p.guid,
                name: p.name,
                index
            };
        }
        function getPartitionsFromMBRBuf(buf) {
            return new MBR(buf).partitions.filter((p => p.type));
        }
        async function readFromDisk(disk, offset, size) {
            const {buffer} = await disk.read(Buffer.alloc(size), 0, size, offset);
            return buffer;
        }
        async function getLogicalPartitions(disk, index, offset, extendedPartitionOffset, limit) {
            if (extendedPartitionOffset === undefined) {
                extendedPartitionOffset = offset;
            }
            if (limit === undefined) {
                limit = Infinity;
            }
            const result = [];
            if (limit <= 0) {
                return result;
            }
            const buf = await readFromDisk(disk, offset, MBR_SIZE);
            for (const p of getPartitionsFromMBRBuf(buf)) {
                if (!p.extended) {
                    result.push(mbrPartitionDict(p, offset, index));
                } else if (limit > 0) {
                    const logicalPartitions = await getLogicalPartitions(disk, index + 1, extendedPartitionOffset + p.byteOffset(), extendedPartitionOffset, limit - 1);
                    result.push(...logicalPartitions);
                    return result;
                }
            }
            return result;
        }
        function detectGPT(buffer) {
            let blockSize = MBR_SIZE;
            let lastError;
            while (blockSize <= 4096) {
                try {
                    return GPT.parse(buffer.slice(blockSize));
                } catch (error) {
                    lastError = error;
                }
                blockSize *= 2;
            }
            throw lastError;
        }
        async function getDiskPartitions(disk, {offset, includeExtended, getLogical}) {
            let extended = null;
            const mbrBuf = await readFromDisk(disk, offset, MBR_SIZE);
            const partitions = getPartitionsFromMBRBuf(mbrBuf);
            if (partitions.length >= 1 && partitions[0].type === GPT_PROTECTIVE_MBR) {
                const gptBuf = await readFromDisk(disk, 0, GPT_SIZE);
                const gpt = detectGPT(gptBuf);
                return {
                    type: "gpt",
                    partitions: gpt.partitions.map(((partition, index) => gptPartitionDict(gpt, partition, index + 1)))
                };
            } else {
                const mbrPartitions = [];
                for (let index = 0; index < partitions.length; index++) {
                    const p = partitions[index];
                    if (p.extended) {
                        extended = p;
                        if (includeExtended) {
                            mbrPartitions.push(mbrPartitionDict(p, offset, index + 1));
                        }
                    } else {
                        mbrPartitions.push(mbrPartitionDict(p, offset, index + 1));
                    }
                }
                if (extended != null && getLogical) {
                    const logicalPartitions = await getLogicalPartitions(disk, MBR_FIRST_LOGICAL_PARTITION, extended.byteOffset());
                    mbrPartitions.push(...logicalPartitions);
                }
                return {
                    type: "mbr",
                    partitions: mbrPartitions
                };
            }
        }
        class PartitionNotFound extends typed_error_1.TypedError {
            constructor(partitionNumber) {
                super(`Partition not found: ${partitionNumber}.`);
            }
        }
        exports.PartitionNotFound = PartitionNotFound;
        async function getPartition(disk, partitionNumber) {
            if (partitionNumber < 1) {
                throw new Error("The partition number must be at least 1.");
            }
            const info = await getDiskPartitions(disk, {
                includeExtended: true,
                offset: 0,
                getLogical: false
            });
            if (info.type === "gpt") {
                if (info.partitions.length < partitionNumber) {
                    throw new PartitionNotFound(partitionNumber);
                } else {
                    return info.partitions[partitionNumber - 1];
                }
            }
            if (partitionNumber <= MBR_LAST_PRIMARY_PARTITION) {
                if (partitionNumber <= info.partitions.length) {
                    return info.partitions[partitionNumber - 1];
                } else {
                    throw new PartitionNotFound(partitionNumber);
                }
            }
            const extended = info.partitions.find((p => MBR.Partition.isExtended(p.type)));
            if (!extended) {
                throw new PartitionNotFound(partitionNumber);
            } else {
                const logicalPartitionPosition = partitionNumber - MBR_FIRST_LOGICAL_PARTITION;
                const logicalPartitions = await getLogicalPartitions(disk, MBR_FIRST_LOGICAL_PARTITION, extended.offset, extended.offset, logicalPartitionPosition + 1);
                if (logicalPartitionPosition < logicalPartitions.length) {
                    return logicalPartitions[logicalPartitionPosition];
                } else {
                    throw new PartitionNotFound(partitionNumber);
                }
            }
        }
        function isString(x) {
            return typeof x === "string";
        }
        async function callWithDisk(fn, pathOrBufferOrDisk, arg) {
            if (isString(pathOrBufferOrDisk)) {
                return await file_disk_1.withOpenFile(pathOrBufferOrDisk, "r", (async fd => await fn(new file_disk_1.FileDisk(fd), arg)));
            } else if (Buffer.isBuffer(pathOrBufferOrDisk)) {
                return await fn(new file_disk_1.BufferDisk(pathOrBufferOrDisk), arg);
            } else {
                return await fn(pathOrBufferOrDisk, arg);
            }
        }
        async function get(disk, partitionNumber) {
            return await callWithDisk(getPartition, disk, partitionNumber);
        }
        exports.get = get;
        async function getPartitions(disk, {offset = 0, includeExtended = true, getLogical = true} = {
            offset: 0,
            includeExtended: true,
            getLogical: true
        }) {
            return await callWithDisk(getDiskPartitions, disk, {
                offset,
                includeExtended,
                getLogical
            });
        }
        exports.getPartitions = getPartitions;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.BufferDisk = exports.FileDisk = exports.Disk = exports.withOpenFile = exports.DiskStream = exports.DiskChunk = exports.DiscardDiskChunk = exports.BufferDiskChunk = void 0;
        const fs_1 = __webpack_require__(14);
        const stream_1 = __webpack_require__(17);
        const diskchunk_1 = __webpack_require__(30);
        Object.defineProperty(exports, "BufferDiskChunk", {
            enumerable: true,
            get: function() {
                return diskchunk_1.BufferDiskChunk;
            }
        });
        Object.defineProperty(exports, "DiscardDiskChunk", {
            enumerable: true,
            get: function() {
                return diskchunk_1.DiscardDiskChunk;
            }
        });
        Object.defineProperty(exports, "DiskChunk", {
            enumerable: true,
            get: function() {
                return diskchunk_1.DiskChunk;
            }
        });
        const interval_intersection_1 = __webpack_require__(31);
        const mapped_ranges_1 = __webpack_require__(32);
        const MIN_HIGH_WATER_MARK = 16;
        const DEFAULT_HIGH_WATER_MARK = 16384;
        class DiskStream extends stream_1.Readable {
            constructor(disk, capacity, highWaterMark, position) {
                super({
                    highWaterMark: Math.max(highWaterMark, MIN_HIGH_WATER_MARK)
                });
                this.disk = disk;
                this.capacity = capacity;
                this.position = position;
                this.isReading = false;
            }
            async __read(size) {
                if (this.isReading) {
                    return;
                }
                this.isReading = true;
                while (this.isReading) {
                    const length = Math.min(size, this.capacity - this.position);
                    if (length <= 0) {
                        this.isReading = this.push(null);
                        return;
                    }
                    let bytesRead;
                    let buffer;
                    try {
                        ({bytesRead, buffer} = await this.disk.read(Buffer.allocUnsafe(length), 0, length, this.position));
                    } catch (err) {
                        this.emit("error", err);
                        return;
                    }
                    this.position += bytesRead;
                    this.isReading = this.push(buffer);
                }
            }
            _read(size) {
                this.__read(size);
            }
        }
        exports.DiskStream = DiskStream;
        class DiskTransformStream extends stream_1.Transform {
            constructor(disk) {
                super();
                this.disk = disk;
                this.position = 0;
                this.chunks = this.getKnownChunks();
                this.currentChunk = this.chunks.next().value;
            }
            * getKnownChunks() {
                for (const chunk of this.disk.knownChunks) {
                    if (chunk instanceof diskchunk_1.BufferDiskChunk) {
                        yield chunk;
                    }
                }
            }
            _transform(chunk, _enc, cb) {
                const start = this.position;
                const end = start + chunk.length - 1;
                const interval = [ start, end ];
                while (this.currentChunk) {
                    if (interval_intersection_1.intervalIntersection(this.currentChunk.interval(), interval)) {
                        const buf = this.currentChunk.data();
                        const startShift = this.currentChunk.start - start;
                        const endShift = this.currentChunk.end - end;
                        const sourceStart = startShift < 0 ? -startShift : 0;
                        const sourceEnd = buf.length - Math.max(endShift, 0);
                        const targetStart = Math.max(startShift, 0);
                        buf.copy(chunk, targetStart, sourceStart, sourceEnd);
                    }
                    if (this.currentChunk.end > end) {
                        break;
                    } else {
                        this.currentChunk = this.chunks.next().value;
                    }
                }
                this.push(chunk);
                this.position = end + 1;
                cb();
            }
        }
        async function withOpenFile(path, flags, fn) {
            const handle = await fs_1.promises.open(path, flags);
            try {
                return await fn(handle);
            } finally {
                await handle.close();
            }
        }
        exports.withOpenFile = withOpenFile;
        class Disk {
            constructor(readOnly = false, recordWrites = false, recordReads = false, discardIsZero = true) {
                this.readOnly = readOnly;
                this.recordWrites = recordWrites;
                this.recordReads = recordReads;
                this.discardIsZero = discardIsZero;
                this.knownChunks = [];
                this.capacity = null;
            }
            getTransformStream() {
                return new DiskTransformStream(this);
            }
            async read(buffer, _bufferOffset, length, fileOffset) {
                const plan = this.createReadPlan(fileOffset, length);
                return await this.readAccordingToPlan(buffer, plan);
            }
            async write(buffer, bufferOffset, length, fileOffset) {
                if (this.recordWrites) {
                    const chunk = new diskchunk_1.BufferDiskChunk(buffer.slice(bufferOffset, bufferOffset + length), fileOffset);
                    await this.insertDiskChunk(chunk);
                } else {
                    const chunk = new diskchunk_1.DiscardDiskChunk(fileOffset, length);
                    await this.insertDiskChunk(chunk, false);
                }
                if (this.readOnly) {
                    return {
                        bytesWritten: length,
                        buffer
                    };
                } else {
                    return await this._write(buffer, bufferOffset, length, fileOffset);
                }
            }
            async flush() {
                if (!this.readOnly) {
                    return await this._flush();
                }
            }
            async discard(offset, length) {
                await this.insertDiskChunk(new diskchunk_1.DiscardDiskChunk(offset, length));
            }
            async getCapacity() {
                if (this.capacity === null) {
                    this.capacity = await this._getCapacity();
                }
                return this.capacity;
            }
            async getStream(position = 0, length = null, highWaterMark = DEFAULT_HIGH_WATER_MARK) {
                let end = await this.getCapacity();
                if (length !== null) {
                    end = Math.min(position + length, end);
                }
                return new DiskStream(this, end, highWaterMark, position);
            }
            getDiscardedChunks() {
                return this.knownChunks.filter((chunk => chunk instanceof diskchunk_1.DiscardDiskChunk));
            }
            async getRanges(blockSize) {
                return Array.from(await mapped_ranges_1.getRanges(this, blockSize));
            }
            async insertDiskChunk(chunk, insert = true) {
                const capacity = await this.getCapacity();
                if (chunk.start < 0 || chunk.end > capacity) {
                    return;
                }
                let insertAt = 0;
                for (let i = 0; i < this.knownChunks.length; i++) {
                    const other = this.knownChunks[i];
                    if (other.start > chunk.end) {
                        break;
                    }
                    if (other.start < chunk.start) {
                        insertAt = i + 1;
                    } else {
                        insertAt = i;
                    }
                    if (!chunk.intersects(other)) {
                        continue;
                    } else if (other.includedIn(chunk)) {
                        this.knownChunks.splice(i, 1);
                        i--;
                    } else {
                        const newChunks = other.cut(chunk);
                        this.knownChunks.splice(i, 1, ...newChunks);
                        i += newChunks.length - 1;
                    }
                }
                if (insert) {
                    this.knownChunks.splice(insertAt, 0, chunk);
                }
            }
            createReadPlan(offset, length) {
                const end = offset + length - 1;
                const interval = [ offset, end ];
                let chunks = this.knownChunks;
                if (!this.discardIsZero) {
                    chunks = chunks.filter((c => !(c instanceof diskchunk_1.DiscardDiskChunk)));
                }
                const intersections = [];
                chunks.forEach((c => {
                    const inter = interval_intersection_1.intervalIntersection(interval, c.interval());
                    if (inter !== null) {
                        intersections.push(c.slice(inter[0], inter[1]));
                    }
                }));
                if (intersections.length === 0) {
                    return [ interval ];
                }
                const readPlan = [];
                let chunk;
                for (chunk of intersections) {
                    if (offset < chunk.start) {
                        readPlan.push([ offset, chunk.start - 1 ]);
                    }
                    readPlan.push(chunk);
                    offset = chunk.end + 1;
                }
                if (chunk && end > chunk.end) {
                    readPlan.push([ chunk.end + 1, end ]);
                }
                return readPlan;
            }
            async readAccordingToPlan(buffer, plan) {
                let offset = 0;
                for (const entry of plan) {
                    if (entry instanceof diskchunk_1.DiskChunk) {
                        const data = entry.data();
                        const length = Math.min(data.length, buffer.length - offset);
                        data.copy(buffer, offset, 0, length);
                        offset += length;
                    } else {
                        const length = entry[1] - entry[0] + 1;
                        await this._read(buffer, offset, length, entry[0]);
                        if (this.recordReads) {
                            const chunk = new diskchunk_1.BufferDiskChunk(Buffer.from(buffer.slice(offset, offset + length)), entry[0]);
                            await this.insertDiskChunk(chunk);
                        }
                        offset += length;
                    }
                }
                return {
                    bytesRead: offset,
                    buffer
                };
            }
        }
        exports.Disk = Disk;
        class FileDisk extends Disk {
            constructor(handle, readOnly = false, recordWrites = false, recordReads = false, discardIsZero = true) {
                super(readOnly, recordWrites, recordReads, discardIsZero);
                this.handle = handle;
            }
            async _getCapacity() {
                const stats = await this.handle.stat();
                return stats.size;
            }
            async _read(buffer, bufferOffset, length, fileOffset) {
                return await this.handle.read(buffer, bufferOffset, length, fileOffset);
            }
            async _write(buffer, bufferOffset, length, fileOffset) {
                return await this.handle.write(buffer, bufferOffset, length, fileOffset);
            }
            async _flush() {
                await this.handle.datasync();
            }
        }
        exports.FileDisk = FileDisk;
        class BufferDisk extends Disk {
            constructor(buffer, readOnly = false, recordWrites = false, recordReads = false, discardIsZero = true) {
                super(readOnly, recordWrites, recordReads, discardIsZero);
                this.buffer = buffer;
            }
            async _getCapacity() {
                return this.buffer.length;
            }
            async _read(buffer, bufferOffset, length, fileOffset) {
                const bytesRead = this.buffer.copy(buffer, bufferOffset, fileOffset, fileOffset + length);
                return {
                    buffer,
                    bytesRead
                };
            }
            async _write(buffer, bufferOffset, length, fileOffset) {
                const bytesWritten = buffer.copy(this.buffer, fileOffset, bufferOffset, bufferOffset + length);
                return {
                    buffer,
                    bytesWritten
                };
            }
            async _flush() {}
        }
        exports.BufferDisk = BufferDisk;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.DiscardDiskChunk = exports.BufferDiskChunk = exports.DiskChunk = void 0;
        const interval_intersection_1 = __webpack_require__(31);
        class DiskChunk {
            constructor(start, end) {
                this.start = start;
                this.end = end;
            }
            interval() {
                return [ this.start, this.end ];
            }
            intersection(other) {
                return interval_intersection_1.intervalIntersection(this.interval(), other.interval());
            }
            intersects(other) {
                return this.intersection(other) !== null;
            }
            includedIn(other) {
                return this.start >= other.start && this.end <= other.end;
            }
            cut(other) {
                const result = [];
                const intersection = this.intersection(other);
                if (intersection === null) {
                    throw new Error("`other` must be an overlapping `DiskChunk`");
                }
                if (intersection[0] > this.start) {
                    result.push(this.slice(this.start, intersection[0] - 1));
                }
                if (this.end > intersection[1]) {
                    result.push(this.slice(intersection[1] + 1, this.end));
                }
                return result;
            }
        }
        exports.DiskChunk = DiskChunk;
        class BufferDiskChunk extends DiskChunk {
            constructor(buffer, offset, copy = true) {
                super(offset, offset + buffer.length - 1);
                if (copy) {
                    this.buffer = Buffer.from(buffer);
                } else {
                    this.buffer = buffer;
                }
            }
            data() {
                return this.buffer;
            }
            slice(start, end) {
                const startInBuffer = start - this.start;
                return new BufferDiskChunk(this.buffer.slice(startInBuffer, startInBuffer + end - start + 1), start, false);
            }
        }
        exports.BufferDiskChunk = BufferDiskChunk;
        class DiscardDiskChunk extends DiskChunk {
            constructor(offset, length) {
                super(offset, offset + length - 1);
            }
            data() {
                return Buffer.alloc(this.end - this.start + 1);
            }
            slice(start, end) {
                return new DiscardDiskChunk(start, end - start + 1);
            }
        }
        exports.DiscardDiskChunk = DiscardDiskChunk;
    }, (__unused_webpack_module, exports) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.intervalIntersection = void 0;
        function intervalIntersection(a, b) {
            const start = Math.max(a[0], b[0]);
            const end = Math.min(a[1], b[1]);
            if (start > end) {
                return null;
            }
            return [ start, end ];
        }
        exports.intervalIntersection = intervalIntersection;
    }, (__unused_webpack_module, exports) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.getRanges = void 0;
        function* mapIterable(source, transform) {
            for (const value of source) {
                yield transform(value);
            }
        }
        async function getNotDiscardedIntervals(disk) {
            return notDiscardedIntervalsIterator(disk.getDiscardedChunks(), await disk.getCapacity());
        }
        function* notDiscardedIntervalsIterator(discardedChunks, capacity) {
            let lastStart = 0;
            for (const discardedChunk of discardedChunks) {
                yield [ lastStart, discardedChunk.start - 1 ];
                lastStart = discardedChunk.end + 1;
            }
            if (lastStart < capacity) {
                yield [ lastStart, capacity - 1 ];
            }
        }
        function* mergeIntervals(intervals) {
            let current;
            for (const interval of intervals) {
                if (current === undefined) {
                    current = interval.slice();
                } else if (interval[0] > current[1] + 1) {
                    yield current;
                    current = interval.slice();
                } else {
                    current[1] = interval[1];
                }
            }
            if (current !== undefined) {
                yield current;
            }
        }
        async function getRanges(disk, blockSize) {
            const intervals = await getNotDiscardedIntervals(disk);
            const blockSizedIntervals = mapIterable(intervals, (chunk => [ Math.floor(chunk[0] / blockSize), Math.floor(chunk[1] / blockSize) ]));
            const mergedBlockSizedIntervals = mergeIntervals(blockSizedIntervals);
            return mapIterable(mergedBlockSizedIntervals, (interval => {
                const offset = interval[0] * blockSize;
                const length = (interval[1] - interval[0] + 1) * blockSize;
                return {
                    offset,
                    length
                };
            }));
        }
        exports.getRanges = getRanges;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var crc32 = __webpack_require__(34);
        var uint64 = __webpack_require__(35);
        function GPT(options) {
            if (!(this instanceof GPT)) {
                return new GPT(options);
            }
            options = options != null ? options : {};
            this.blockSize = options.blockSize || 512;
            this.guid = options.guid || GPT.GUID.ZERO;
            this.revision = options.revision || 65536;
            this.headerSize = options.headerSize || GPT.HEADER_SIZE;
            this.headerChecksum = 0;
            this.currentLBA = options.currentLBA || 1;
            this.backupLBA = options.backupLBA || 0;
            this.firstLBA = options.firstLBA || 34;
            this.lastLBA = options.lastLBA || 0;
            this.tableOffset = options.tableOffset || GPT.TABLE_OFFSET;
            this.entries = options.entries || GPT.TABLE_ENTRIES;
            this.entrySize = options.entrySize || GPT.TABLE_ENTRY_SIZE;
            this.tableChecksum = 0;
            this.partitions = [];
        }
        module.exports = GPT;
        GPT.SIGNATURE = "EFI PART";
        GPT.HEADER_SIZE = 92;
        GPT.TABLE_OFFSET = 2;
        GPT.TABLE_MIN_SIZE = 16384;
        GPT.TABLE_ENTRIES = 128;
        GPT.TABLE_ENTRY_SIZE = 128;
        GPT.GUID = __webpack_require__(36);
        GPT.PartitionEntry = __webpack_require__(37);
        GPT.parse = function(buffer, offset) {
            return (new GPT).parse(buffer, offset);
        };
        GPT.parseBackup = function(buffer, offset) {
            return (new GPT).parseBackup(buffer, offset);
        };
        function align(value, boundary) {
            return value + (boundary - value % boundary) % boundary;
        }
        GPT.prototype = {
            constructor: GPT,
            get tableSize() {
                return Math.max(align(this.entrySize * this.entries, this.blockSize), GPT.TABLE_MIN_SIZE);
            },
            verify() {
                return this.verifyHeader() && this.verifyTable();
            },
            verifyHeader() {
                return this.checksumHeader() === this.headerChecksum;
            },
            verifyTable() {
                return this.checksumTable() === this.tableChecksum;
            },
            checksumHeader(buffer, offset) {
                offset = offset || 0;
                buffer = buffer || this.writeHeader(null, 0, true);
                var storedChecksum = buffer.readUInt32LE(offset + 16);
                buffer.writeUInt32LE(0, offset + 16);
                var checksum = crc32(buffer) >>> 0;
                buffer.writeUInt32LE(storedChecksum, offset + 16);
                return checksum;
            },
            checksumTable(buffer, offset) {
                var tableSize = this.tableSize;
                offset = offset || 0;
                if (buffer == null) {
                    buffer = Buffer.alloc(tableSize);
                    this.writeTable(this.partitions, buffer, offset);
                } else if (buffer.length - offset >= tableSize) {
                    buffer = buffer.length !== tableSize ? buffer.slice(offset, offset + tableSize) : buffer;
                } else {
                    throw new Error(`Buffer smaller than table size (${buffer.length - offset} < ${tableSize})`);
                }
                return crc32(buffer) >>> 0;
            },
            parse(buffer, offset) {
                offset = offset || 0;
                this.partitions.length = 0;
                this.parseHeader(buffer, offset);
                var tableOffset = (this.tableOffset - this.currentLBA) * this.blockSize;
                this.parseTable(buffer, offset + tableOffset, offset + tableOffset + this.tableSize);
                return this;
            },
            parseBackup(buffer, offset) {
                offset = offset || 0;
                this.partitions.length = 0;
                this.parseHeader(buffer, offset + this.tableSize);
                this.parseTable(buffer, offset, offset + this.tableSize);
                return this;
            },
            parseHeader(buffer, offset) {
                offset = offset || 0;
                if (buffer.length - offset < GPT.HEADER_SIZE) {
                    throw new Error(`Buffer too small: Minimum header size is ${GPT.HEADER_SIZE} bytes, got ${buffer.length - offset} bytes`);
                }
                var signature = buffer.toString("ascii", offset + 0, offset + 8);
                if (signature !== GPT.SIGNATURE) {
                    throw new Error(`Invalid signature: Expected "${GPT.SIGNATURE}", saw "${signature}"`);
                }
                this.revision = buffer.readUInt32LE(offset + 8);
                this.headerSize = buffer.readUInt32LE(offset + 12);
                this.headerChecksum = buffer.readUInt32LE(offset + 16);
                this.currentLBA = uint64.readLE(buffer, offset + 24);
                this.backupLBA = uint64.readLE(buffer, offset + 32);
                this.firstLBA = uint64.readLE(buffer, offset + 40);
                this.lastLBA = uint64.readLE(buffer, offset + 48);
                this.guid = GPT.GUID.toString(buffer, offset + 56);
                this.tableOffset = uint64.readLE(buffer, offset + 72);
                this.entries = buffer.readUInt32LE(offset + 80);
                this.entrySize = buffer.readUInt32LE(offset + 84);
                this.tableChecksum = buffer.readUInt32LE(offset + 88);
                return this;
            },
            parseTable(buffer, offset, end) {
                offset = offset || 0;
                end = Math.min(end || buffer.length, buffer.length);
                var part = null;
                for (var i = 0; i < this.entries && offset + this.entrySize <= end; i++) {
                    part = GPT.PartitionEntry.parse(buffer, offset);
                    if (!part.isEmpty()) {
                        this.partitions.push(part);
                    }
                    offset += this.entrySize;
                }
                return this;
            },
            write(buffer, offset) {
                var tableOffset = (this.tableOffset - this.currentLBA) * this.blockSize;
                var length = this.blockSize + this.tableSize;
                offset = offset || 0;
                buffer = buffer || Buffer.alloc(offset + length, 0);
                this.writeTable(this.partitions, buffer, offset + tableOffset);
                this.tableChecksum = this.checksumTable(buffer, offset + tableOffset);
                this.writeHeader(buffer, offset);
                return buffer;
            },
            writeBackup(buffer, offset) {
                var tableSize = this.tableSize;
                var length = this.blockSize + tableSize;
                offset = offset || 0;
                buffer = buffer || Buffer.alloc(offset + length);
                this.writeTable(this.partitions, buffer, offset);
                this.tableChecksum = this.checksumTable(buffer, offset);
                this.writeHeader(buffer, offset + tableSize);
                return buffer;
            },
            writeBackupFromPrimary(buffer, offset) {
                var currentLBA = this.currentLBA;
                var backupLBA = this.backupLBA;
                var tableOffset = this.tableOffset;
                this.backupLBA = currentLBA;
                this.currentLBA = backupLBA;
                this.tableOffset = this.currentLBA - this.tableSize / this.blockSize;
                var output = this.writeBackup(buffer, offset);
                this.backupLBA = backupLBA;
                this.currentLBA = currentLBA;
                this.tableOffset = tableOffset;
                return output;
            },
            writeHeader(buffer, offset, noChecksum) {
                offset = offset || 0;
                buffer = buffer || Buffer.alloc(offset + this.headerSize);
                buffer.write(GPT.SIGNATURE, offset + 0, offset + 8, "ascii");
                buffer.writeUInt32LE(this.revision, offset + 8);
                buffer.writeUInt32LE(this.headerSize, offset + 12);
                buffer.writeUInt32LE(this.headerChecksum, offset + 16);
                uint64.writeLE(buffer, this.currentLBA, offset + 24);
                uint64.writeLE(buffer, this.backupLBA, offset + 32);
                uint64.writeLE(buffer, this.firstLBA, offset + 40);
                uint64.writeLE(buffer, this.lastLBA, offset + 48);
                GPT.GUID.write(this.guid, buffer, offset + 56);
                uint64.writeLE(buffer, this.tableOffset, offset + 72);
                buffer.writeUInt32LE(this.entries, offset + 80);
                buffer.writeUInt32LE(this.entrySize, offset + 84);
                buffer.writeUInt32LE(this.tableChecksum, offset + 88);
                if (!noChecksum) {
                    this.headerChecksum = this.checksumHeader(buffer.slice(offset, offset + this.headerSize));
                    buffer.writeUInt32LE(this.headerChecksum, offset + 16);
                }
                return buffer;
            },
            writeTable(entries, buffer, offset) {
                offset = offset || 0;
                buffer = buffer || Buffer.alloc(offset + this.entrySize * entries.length);
                for (var i = 0; i < entries.length; i++) {
                    entries[i].write(buffer, offset + i * this.entrySize);
                }
                return buffer;
            }
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var stream = __webpack_require__(17);
        function crc32(buffer, seed, table) {
            var crc = seed ^ -1;
            var length = buffer.length - 15;
            var TABLE = table || crc32.TABLE.DEFAULT;
            var i = 0;
            while (i < length) {
                crc = crc >>> 8 ^ TABLE[255 & (crc ^ buffer[i++])];
                crc = crc >>> 8 ^ TABLE[255 & (crc ^ buffer[i++])];
                crc = crc >>> 8 ^ TABLE[255 & (crc ^ buffer[i++])];
                crc = crc >>> 8 ^ TABLE[255 & (crc ^ buffer[i++])];
                crc = crc >>> 8 ^ TABLE[255 & (crc ^ buffer[i++])];
                crc = crc >>> 8 ^ TABLE[255 & (crc ^ buffer[i++])];
                crc = crc >>> 8 ^ TABLE[255 & (crc ^ buffer[i++])];
                crc = crc >>> 8 ^ TABLE[255 & (crc ^ buffer[i++])];
                crc = crc >>> 8 ^ TABLE[255 & (crc ^ buffer[i++])];
                crc = crc >>> 8 ^ TABLE[255 & (crc ^ buffer[i++])];
                crc = crc >>> 8 ^ TABLE[255 & (crc ^ buffer[i++])];
                crc = crc >>> 8 ^ TABLE[255 & (crc ^ buffer[i++])];
                crc = crc >>> 8 ^ TABLE[255 & (crc ^ buffer[i++])];
                crc = crc >>> 8 ^ TABLE[255 & (crc ^ buffer[i++])];
                crc = crc >>> 8 ^ TABLE[255 & (crc ^ buffer[i++])];
                crc = crc >>> 8 ^ TABLE[255 & (crc ^ buffer[i++])];
            }
            length = length + 15;
            while (i < length) crc = crc >>> 8 ^ TABLE[(crc ^ buffer[i++]) & 255];
            return crc ^ -1;
        }
        module.exports = crc32;
        crc32.TABLE = {
            DEFAULT: new Int32Array([ 0, 1996959894, 3993919788, 2567524794, 124634137, 1886057615, 3915621685, 2657392035, 249268274, 2044508324, 3772115230, 2547177864, 162941995, 2125561021, 3887607047, 2428444049, 498536548, 1789927666, 4089016648, 2227061214, 450548861, 1843258603, 4107580753, 2211677639, 325883990, 1684777152, 4251122042, 2321926636, 335633487, 1661365465, 4195302755, 2366115317, 997073096, 1281953886, 3579855332, 2724688242, 1006888145, 1258607687, 3524101629, 2768942443, 901097722, 1119000684, 3686517206, 2898065728, 853044451, 1172266101, 3705015759, 2882616665, 651767980, 1373503546, 3369554304, 3218104598, 565507253, 1454621731, 3485111705, 3099436303, 671266974, 1594198024, 3322730930, 2970347812, 795835527, 1483230225, 3244367275, 3060149565, 1994146192, 31158534, 2563907772, 4023717930, 1907459465, 112637215, 2680153253, 3904427059, 2013776290, 251722036, 2517215374, 3775830040, 2137656763, 141376813, 2439277719, 3865271297, 1802195444, 476864866, 2238001368, 4066508878, 1812370925, 453092731, 2181625025, 4111451223, 1706088902, 314042704, 2344532202, 4240017532, 1658658271, 366619977, 2362670323, 4224994405, 1303535960, 984961486, 2747007092, 3569037538, 1256170817, 1037604311, 2765210733, 3554079995, 1131014506, 879679996, 2909243462, 3663771856, 1141124467, 855842277, 2852801631, 3708648649, 1342533948, 654459306, 3188396048, 3373015174, 1466479909, 544179635, 3110523913, 3462522015, 1591671054, 702138776, 2966460450, 3352799412, 1504918807, 783551873, 3082640443, 3233442989, 3988292384, 2596254646, 62317068, 1957810842, 3939845945, 2647816111, 81470997, 1943803523, 3814918930, 2489596804, 225274430, 2053790376, 3826175755, 2466906013, 167816743, 2097651377, 4027552580, 2265490386, 503444072, 1762050814, 4150417245, 2154129355, 426522225, 1852507879, 4275313526, 2312317920, 282753626, 1742555852, 4189708143, 2394877945, 397917763, 1622183637, 3604390888, 2714866558, 953729732, 1340076626, 3518719985, 2797360999, 1068828381, 1219638859, 3624741850, 2936675148, 906185462, 1090812512, 3747672003, 2825379669, 829329135, 1181335161, 3412177804, 3160834842, 628085408, 1382605366, 3423369109, 3138078467, 570562233, 1426400815, 3317316542, 2998733608, 733239954, 1555261956, 3268935591, 3050360625, 752459403, 1541320221, 2607071920, 3965973030, 1969922972, 40735498, 2617837225, 3943577151, 1913087877, 83908371, 2512341634, 3803740692, 2075208622, 213261112, 2463272603, 3855990285, 2094854071, 198958881, 2262029012, 4057260610, 1759359992, 534414190, 2176718541, 4139329115, 1873836001, 414664567, 2282248934, 4279200368, 1711684554, 285281116, 2405801727, 4167216745, 1634467795, 376229701, 2685067896, 3608007406, 1308918612, 956543938, 2808555105, 3495958263, 1231636301, 1047427035, 2932959818, 3654703836, 1088359270, 936918e3, 2847714899, 3736837829, 1202900863, 817233897, 3183342108, 3401237130, 1404277552, 615818150, 3134207493, 3453421203, 1423857449, 601450431, 3009837614, 3294710456, 1567103746, 711928724, 3020668471, 3272380065, 1510334235, 755167117 ]),
            CASTAGNOLI: new Int32Array([ 0, 4067132163, 3778769143, 324072436, 3348797215, 904991772, 648144872, 3570033899, 2329499855, 2024987596, 1809983544, 2575936315, 1296289744, 3207089363, 2893594407, 1578318884, 274646895, 3795141740, 4049975192, 51262619, 3619967088, 632279923, 922689671, 3298075524, 2592579488, 1760304291, 2075979607, 2312596564, 1562183871, 2943781820, 3156637768, 1313733451, 549293790, 3537243613, 3246849577, 871202090, 3878099393, 357341890, 102525238, 4101499445, 2858735121, 1477399826, 1264559846, 3107202533, 1845379342, 2677391885, 2361733625, 2125378298, 820201905, 3263744690, 3520608582, 598981189, 4151959214, 85089709, 373468761, 3827903834, 3124367742, 1213305469, 1526817161, 2842354314, 2107672161, 2412447074, 2627466902, 1861252501, 1098587580, 3004210879, 2688576843, 1378610760, 2262928035, 1955203488, 1742404180, 2511436119, 3416409459, 969524848, 714683780, 3639785095, 205050476, 4266873199, 3976438427, 526918040, 1361435347, 2739821008, 2954799652, 1114974503, 2529119692, 1691668175, 2005155131, 2247081528, 3690758684, 697762079, 986182379, 3366744552, 476452099, 3993867776, 4250756596, 255256311, 1640403810, 2477592673, 2164122517, 1922457750, 2791048317, 1412925310, 1197962378, 3037525897, 3944729517, 427051182, 170179418, 4165941337, 746937522, 3740196785, 3451792453, 1070968646, 1905808397, 2213795598, 2426610938, 1657317369, 3053634322, 1147748369, 1463399397, 2773627110, 4215344322, 153784257, 444234805, 3893493558, 1021025245, 3467647198, 3722505002, 797665321, 2197175160, 1889384571, 1674398607, 2443626636, 1164749927, 3070701412, 2757221520, 1446797203, 137323447, 4198817972, 3910406976, 461344835, 3484808360, 1037989803, 781091935, 3705997148, 2460548119, 1623424788, 1939049696, 2180517859, 1429367560, 2807687179, 3020495871, 1180866812, 410100952, 3927582683, 4182430767, 186734380, 3756733383, 763408580, 1053836080, 3434856499, 2722870694, 1344288421, 1131464017, 2971354706, 1708204729, 2545590714, 2229949006, 1988219213, 680717673, 3673779818, 3383336350, 1002577565, 4010310262, 493091189, 238226049, 4233660802, 2987750089, 1082061258, 1395524158, 2705686845, 1972364758, 2279892693, 2494862625, 1725896226, 952904198, 3399985413, 3656866545, 731699698, 4283874585, 222117402, 510512622, 3959836397, 3280807620, 837199303, 582374963, 3504198960, 68661723, 4135334616, 3844915500, 390545967, 1230274059, 3141532936, 2825850620, 1510247935, 2395924756, 2091215383, 1878366691, 2644384480, 3553878443, 565732008, 854102364, 3229815391, 340358836, 3861050807, 4117890627, 119113024, 1493875044, 2875275879, 3090270611, 1247431312, 2660249211, 1828433272, 2141937292, 2378227087, 3811616794, 291187481, 34330861, 4032846830, 615137029, 3603020806, 3314634738, 939183345, 1776939221, 2609017814, 2295496738, 2058945313, 2926798794, 1545135305, 1330124605, 3173225534, 4084100981, 17165430, 307568514, 3762199681, 888469610, 3332340585, 3587147933, 665062302, 2042050490, 2346497209, 2559330125, 1793573966, 3190661285, 1279665062, 1595330642, 2910671697 ])
        };
        crc32.Hash = class CRC32Stream extends stream.Transform {
            constructor(options) {
                super(options);
                this.bytesRead = 0;
                this.bytesWritten = 0;
                this.crc = options && options.seed != null ? options.seed : 0;
                this.crcTable = options && (options.table || crc32.TABLE.DEFAULT);
            }
            update(data, encoding) {
                this.write(data, encoding);
                return this;
            }
            digest(encoding) {
                var buffer = Buffer.alloc(4, 0);
                buffer.writeInt32BE(this.crc, 0);
                return encoding == null ? buffer : buffer.toString(encoding);
            }
            _transform(chunk, _, next) {
                this.bytesRead += chunk.length;
                this.crc = crc32(chunk, this.crc, this.crcTable);
                next();
            }
            _flush(done) {
                this.push(this.digest());
                this.bytesWritten += 4;
                done();
            }
        };
        crc32.createHash = function createHash() {
            return new crc32.Hash;
        };
    }, module => {
        var uint64 = module.exports;
        var MAX_UINT32 = Math.pow(2, 32);
        uint64.readLE = function(buffer, offset) {
            offset = offset || 0;
            var hi = buffer.readUInt32LE(offset + 4);
            var lo = buffer.readUInt32LE(offset);
            return hi * MAX_UINT32 + lo;
        };
        uint64.writeLE = function(buffer, value, offset) {
            offset = offset || 0;
            var hi = Math.floor(value / MAX_UINT32);
            var lo = value - hi * MAX_UINT32;
            buffer.writeUInt32LE(hi, offset + 4);
            buffer.writeUInt32LE(lo, offset);
            return offset + 8;
        };
        uint64.readBE = function(buffer, offset) {
            offset = offset || 0;
            var hi = buffer.readUInt32BE(offset);
            var lo = buffer.readUInt32BE(offset + 4);
            return hi * MAX_UINT32 + lo;
        };
        uint64.writeBE = function(buffer, value, offset) {
            offset = offset || 0;
            var hi = Math.floor(value / MAX_UINT32);
            var lo = value - hi * MAX_UINT32;
            buffer.writeUInt32BE(hi, offset);
            buffer.writeUInt32BE(lo, offset + 4);
            return offset + 8;
        };
    }, module => {
        var GUID = module.exports;
        GUID.ZERO = "00000000-0000-0000-0000-000000000000";
        GUID.HEX = [];
        GUID.DEC = new Map;
        void function() {
            var hex = "";
            for (var i = 0; i < 256; i++) {
                hex = (i + 256).toString(16).substr(1).toUpperCase();
                GUID.HEX[i] = hex;
                GUID.DEC.set(hex, i);
            }
        }();
        GUID.toString = function(buffer, offset) {
            offset = offset || 0;
            var guid = GUID.HEX[buffer[offset + 3]] + GUID.HEX[buffer[offset + 2]] + GUID.HEX[buffer[offset + 1]] + GUID.HEX[buffer[offset + 0]] + "-" + GUID.HEX[buffer[offset + 5]] + GUID.HEX[buffer[offset + 4]] + "-" + GUID.HEX[buffer[offset + 7]] + GUID.HEX[buffer[offset + 6]] + "-" + GUID.HEX[buffer[offset + 8]] + GUID.HEX[buffer[offset + 9]] + "-" + GUID.HEX[buffer[offset + 10]] + GUID.HEX[buffer[offset + 11]] + GUID.HEX[buffer[offset + 12]] + GUID.HEX[buffer[offset + 13]] + GUID.HEX[buffer[offset + 14]] + GUID.HEX[buffer[offset + 15]];
            return guid.toUpperCase();
        };
        GUID.write = function(value, buffer, offset) {
            offset = offset || 0;
            buffer = buffer || Buffer.allocUnsafe(offset + 16);
            var pattern = /[0-9A-F]{2}/g;
            var values = value.toUpperCase().match(pattern);
            buffer[offset + 3] = GUID.DEC.get(values[0]);
            buffer[offset + 2] = GUID.DEC.get(values[1]);
            buffer[offset + 1] = GUID.DEC.get(values[2]);
            buffer[offset + 0] = GUID.DEC.get(values[3]);
            buffer[offset + 5] = GUID.DEC.get(values[4]);
            buffer[offset + 4] = GUID.DEC.get(values[5]);
            buffer[offset + 7] = GUID.DEC.get(values[6]);
            buffer[offset + 6] = GUID.DEC.get(values[7]);
            buffer[offset + 8] = GUID.DEC.get(values[8]);
            buffer[offset + 9] = GUID.DEC.get(values[9]);
            buffer[offset + 10] = GUID.DEC.get(values[10]);
            buffer[offset + 11] = GUID.DEC.get(values[11]);
            buffer[offset + 12] = GUID.DEC.get(values[12]);
            buffer[offset + 13] = GUID.DEC.get(values[13]);
            buffer[offset + 14] = GUID.DEC.get(values[14]);
            buffer[offset + 15] = GUID.DEC.get(values[15]);
            return buffer;
        };
        module.exports = GUID;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var GUID = __webpack_require__(36);
        var GPT = __webpack_require__(33);
        var uint64 = __webpack_require__(35);
        function PartitionEntry(options) {
            if (!(this instanceof PartitionEntry)) {
                return new PartitionEntry(options);
            }
            options = options != null ? options : {};
            this.type = options.type || GUID.ZERO;
            this.guid = options.guid || GUID.ZERO;
            this.name = options.name || "";
            this.firstLBA = options.firstLBA || 0;
            this.lastLBA = options.lastLBA || 0;
            this.attr = options.attr || 0;
        }
        PartitionEntry.parse = function(buffer, offset) {
            return (new PartitionEntry).parse(buffer, offset);
        };
        PartitionEntry.prototype = {
            constructor: PartitionEntry,
            isEmpty() {
                return this.type.toString() === GUID.ZERO;
            },
            parse(buffer, offset) {
                offset = offset || 0;
                this.type = GUID.toString(buffer, offset + 0);
                this.guid = GUID.toString(buffer, offset + 16);
                this.firstLBA = uint64.readLE(buffer, offset + 32);
                this.lastLBA = uint64.readLE(buffer, offset + 40);
                this.attr = uint64.readLE(buffer, offset + 48);
                this.name = buffer.toString("ucs2", offset + 56, offset + GPT.TABLE_ENTRY_SIZE).replace(/\x00+/g, "");
                return this;
            },
            write(buffer, offset) {
                buffer = buffer || Buffer.alloc(GPT.TABLE_ENTRY_SIZE, 0);
                offset = offset || 0;
                GPT.GUID.write(this.type, buffer, offset + 0);
                GPT.GUID.write(this.guid, buffer, offset + 16);
                uint64.writeLE(buffer, this.firstLBA, offset + 32);
                uint64.writeLE(buffer, this.lastLBA, offset + 40);
                uint64.writeLE(buffer, this.attr, offset + 48);
                buffer.fill(0, offset + 56, offset + GPT.TABLE_ENTRY_SIZE);
                buffer.write(this.name, offset + 56, offset + GPT.TABLE_ENTRY_SIZE, "ucs2");
                return buffer;
            }
        };
        module.exports = PartitionEntry;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        function MBR(buffer, start, end) {
            if (!(this instanceof MBR) || this.format === "MBR") {
                return MBR.parse(buffer, start, end);
            }
            this.partitions = [];
            this.code = [];
            for (var i = 0; i < this.partitionEntries; i++) {
                this.partitions.push(new MBR.Partition);
            }
            if (Buffer.isBuffer(buffer)) {
                this.parse(buffer, start, end);
            }
        }
        MBR.TABLE_OFFSET = 446;
        MBR.PARTITION_ENTRIES = 4;
        MBR.Partition = __webpack_require__(39);
        MBR.Code = __webpack_require__(41);
        MBR.parse = function(buffer, start, end) {
            var buffer = buffer.slice(start, end);
            var format = MBR.detectFormat(buffer);
            return new MBR[format](buffer);
        };
        MBR.detectFormat = function(buffer) {
            if (!Buffer.isBuffer(buffer)) throw new TypeError("Argument must be a Buffer");
            if (buffer.length < 512) throw new Error("Buffer too small (must be at least 512 bytes)");
            if (buffer.readUInt16LE(510) !== 43605) {
                throw new SyntaxError("Invalid MBR boot signature. Expected 0xAA55, " + "but saw 0x" + buffer.readUInt16LE(510).toString(16).toUpperCase());
            }
            if (buffer[380] === 90 && buffer[381] === 165) {
                return "AST";
            } else if (buffer[252] === 170 && buffer[253] === 85) {
                return "DM";
            } else if (buffer.readUIntBE(2, 6) === 86059724325970) {
                return "NEWLDR";
            } else if (buffer[428] === 120 && buffer[429] === 86) {
                return "AAP";
            } else if (buffer[218] === 0 && buffer[219] === 0) {
                return "MODERN";
            } else {
                return "CLASSIC";
            }
        };
        MBR.createBuffer = function() {
            var buffer = new Buffer(512);
            buffer.fill(0);
            buffer[510] = 85;
            buffer[511] = 170;
            return buffer;
        };
        MBR.isExtendedPartition = function(partition) {
            return MBR.Partition.isExtended(partition.type);
        };
        MBR.prototype = {
            constructor: MBR,
            get buffer() {
                throw new Error("Not implemented");
            },
            set buffer(value) {
                throw new Error("Not implemented");
            },
            get format() {
                return this.constructor.name.toUpperCase();
            },
            get tableOffset() {
                return this.constructor.TABLE_OFFSET;
            },
            get partitionEntries() {
                return this.constructor.PARTITION_ENTRIES;
            },
            parse: function(buffer, start, end) {
                this.buffer = buffer.slice(start, end);
            },
            getEFIPart: function() {
                var i = 0;
                var part = null;
                for (var i = 0; i < this.partitions.length; i++) {
                    part = this.partitions[i];
                    if (part.type === 238 || part.type === 239) {
                        return part;
                    }
                }
                return null;
            }
        };
        module.exports = MBR;
        MBR.CLASSIC = __webpack_require__(42);
        MBR.MODERN = __webpack_require__(44);
        MBR.AAP = __webpack_require__(45);
        MBR.NEWLDR = __webpack_require__(47);
        MBR.AST = __webpack_require__(49);
        MBR.DM = __webpack_require__(50);
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var CHS = __webpack_require__(40);
        function Partition(buffer, start, end) {
            if (!(this instanceof Partition)) return new Partition(buffer, start, end);
            if (buffer != null && !Buffer.isBuffer(buffer)) throw new TypeError("Argument must be a Buffer");
            this.status = 0;
            this.type = 0;
            this.sectors = 0;
            this.firstLBA = 0;
            this.firstCHS = new CHS;
            this.lastCHS = new CHS;
            if (buffer != null) {
                this.buffer = buffer.slice(start, end);
            }
        }
        Partition.EXTENDED = [ 5, 15, 133, 21, 31, 145, 155, 94, 95, 207, 213, 197 ];
        Partition.parse = function(buffer, start, end) {
            return new Partition(buffer, start, end);
        };
        Partition.isExtended = function(type) {
            return !!~Partition.EXTENDED.indexOf(type);
        };
        Partition.prototype = {
            constructor: Partition,
            get statusText() {
                switch (this.status) {
                  case 128:
                    return "active";
                    break;

                  case 0:
                    return "inactive";
                    break;

                  default:
                    return "invalid";
                    break;
                }
            },
            get active() {
                return this.status === 128;
            },
            get inactive() {
                return this.status === 0;
            },
            get invalid() {
                return !this.active && !this.inactive;
            },
            get extended() {
                return Partition.isExtended(this.type);
            },
            get lastLBA() {
                return this.firstLBA + this.sectors;
            },
            byteOffset: function(blockSize) {
                blockSize = blockSize || 512;
                return this.firstLBA * blockSize;
            },
            byteSize: function(blockSize) {
                blockSize = blockSize || 512;
                return this.sectors * blockSize;
            },
            parse: function(buffer, start, end) {
                this.buffer = buffer.slice(start, end);
            },
            get buffer() {
                var buffer = new Buffer(16);
                buffer.fill(0);
                buffer.writeUInt8(this.status, 0);
                buffer.writeUInt8(this.type, 4);
                buffer.writeUInt32LE(this.firstLBA, 8);
                buffer.writeUInt32LE(this.sectors, 12);
                this.firstCHS.buffer.copy(buffer, 1);
                this.lastCHS.buffer.copy(buffer, 5);
                return buffer;
            },
            set buffer(value) {
                if (!Buffer.isBuffer(value)) throw new TypeError("Argument must be a Buffer");
                if (value.length < 16) {
                    throw new SyntaxError("Partition entry size unacceptable:" + "expected 16 bytes, but got " + data.length);
                }
                this.status = value.readUInt8(0);
                this.type = value.readUInt8(4);
                this.firstLBA = value.readUInt32LE(8);
                this.sectors = value.readUInt32LE(12);
                this.firstCHS.buffer = value.slice(1, 4);
                this.lastCHS.buffer = value.slice(5, 8);
            }
        };
        module.exports = Partition;
    }, module => {
        function CHS(cylinder, head, sector) {
            if (!(this instanceof CHS)) return new CHS(cylinder, head, sector);
            if (Buffer.isBuffer(cylinder)) return CHS.fromBuffer(cylinder);
            this.cylinder = cylinder & 1023;
            this.head = head & 255;
            this.sector = sector & 63;
        }
        CHS.fromBuffer = function(buffer, offset) {
            return (new CHS).parse(buffer, offset);
        };
        CHS.fromLBA = function(lba, hpt, spt) {
            return (new CHS).setLBA(lba, hpt, spt);
        };
        CHS.prototype = {
            constructor: CHS,
            set buffer(value) {
                return this.parse(value);
            },
            get buffer() {
                return this.toBuffer();
            },
            setLBA: function(lba, hpt, spt) {
                this.cylinder = lba / (spt * hpt) | 0;
                this.head = lba / spt % hpt;
                this.sector = lba % spt + 1;
                return this;
            },
            getLBA: function(hpt, spt) {
                return (this.cylinder * hpt + this.head) * spt + (this.sector - 1);
            },
            toLBA: function(hpt, spt) {
                return this.getLBA(hpt, spt);
            },
            clone: function() {
                return new CHS(this.cylinder, this.head, this.sector);
            },
            copy: function(target) {
                target.cylinder = this.cylinder;
                target.head = this.head;
                target.sector = this.sector;
                return target;
            },
            parse: function(buffer, offset) {
                if (!Buffer.isBuffer(buffer)) throw new TypeError("Value must be a buffer");
                offset = offset || 0;
                return this.fromNumber(buffer.readUIntLE(offset, 3));
            },
            write: function(buffer, offset) {
                offset = offset || 0;
                buffer.writeUIntLE(this.toNumber(), offset, 3);
                return buffer;
            },
            toBuffer: function() {
                return this.write(Buffer.alloc(3));
            },
            fromNumber: function(value) {
                this.head = (value & 16711680) >>> 16;
                this.cylinder = (value & 65472) >>> 6;
                this.sector = value & 63;
                return this;
            },
            toNumber: function() {
                var value = (this.head & 255) << 16;
                value = value | this.cylinder << 6 & 65472;
                value = value | this.sector & 63;
                return value;
            }
        };
        module.exports = CHS;
    }, module => {
        function Code(buffer, start, end) {
            if (!(this instanceof Code)) return new Code(buffer, start, end);
            this.offset = start || 0;
            if (Buffer.isBuffer(buffer)) {
                this.data = buffer.slice(start, end);
            } else {
                this.data = new Buffer(446);
                this.data.fill(0);
            }
        }
        Code.prototype = {
            constructor: Code,
            get length() {
                return this.data.length;
            }
        };
        module.exports = Code;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var inherit = __webpack_require__(43);
        var MBR = __webpack_require__(38);
        function CLASSIC(buffer, start, end) {
            if (!(this instanceof CLASSIC)) return new CLASSIC(buffer, start, end);
            MBR.call(this, buffer, start, end);
        }
        CLASSIC.TABLE_OFFSET = 446;
        CLASSIC.PARTITION_ENTRIES = 4;
        CLASSIC.prototype = {
            constructor: CLASSIC,
            get buffer() {
                var buffer = MBR.createBuffer();
                var offset = this.tableOffset;
                for (var i = 0; i < this.code.length; i++) {
                    this.code[i].data.copy(buffer, this.code[i].offset);
                }
                this.partitions[0].buffer.copy(buffer, offset);
                this.partitions[1].buffer.copy(buffer, offset += 16);
                this.partitions[2].buffer.copy(buffer, offset += 16);
                this.partitions[3].buffer.copy(buffer, offset += 16);
                return buffer;
            },
            set buffer(value) {
                if (!Buffer.isBuffer(value)) throw new TypeError("Value must be a Buffer");
                this.code = [ new MBR.Code(value, 0, 446) ];
                var i, count = this.partitionEntries;
                var offset = this.tableOffset;
                for (i = 0; i < count; i++) {
                    this.partitions[i].buffer = value.slice(offset, offset += 16);
                }
            }
        };
        inherit(CLASSIC, MBR);
        module.exports = CLASSIC;
    }, module => {
        function describe(object) {
            return Object.getOwnPropertyNames(object).reduce((function(desc, key) {
                desc[key] = Object.getOwnPropertyDescriptor(object, key);
                return desc;
            }), Object.create(null));
        }
        function inherit(ctor, sctor) {
            ctor.prototype = Object.create(sctor.prototype, describe(ctor.prototype));
        }
        module.exports = inherit;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var inherit = __webpack_require__(43);
        var MBR = __webpack_require__(38);
        function MODERN(buffer, start, end) {
            if (!(this instanceof MODERN)) return new MODERN(buffer, start, end);
            this.physicalDrive = 128;
            this.timestamp = {
                seconds: 0,
                minutes: 0,
                hours: 0
            };
            this.signature = null;
            this.copyProtected = false;
            MBR.call(this, buffer, start, end);
        }
        MODERN.TABLE_OFFSET = 446;
        MODERN.PARTITION_ENTRIES = 4;
        MODERN.prototype = {
            constructor: MODERN,
            get buffer() {
                var buffer = MBR.createBuffer();
                for (var i = 0; i < this.code.length; i++) {
                    this.code[i].data.copy(buffer, this.code[i].offset);
                }
                buffer[220] = this.physicalDrive;
                buffer[221] = this.timestamp.seconds;
                buffer[222] = this.timestamp.minutes;
                buffer[223] = this.timestamp.hours;
                if (this.code[1] && this.code[1].data.length === 216) {
                    buffer.writeUInt32LE(this.signature, 440);
                    this.copyProtected ? buffer.writeUInt16LE(23130, 444) : buffer.writeUInt16LE(0, 444);
                }
                var offset = this.tableOffset;
                this.partitions[0].buffer.copy(buffer, offset);
                this.partitions[1].buffer.copy(buffer, offset += 16);
                this.partitions[2].buffer.copy(buffer, offset += 16);
                this.partitions[3].buffer.copy(buffer, offset += 16);
                return buffer;
            },
            set buffer(value) {
                if (!Buffer.isBuffer(value)) throw new TypeError("Value must be a Buffer");
                this.physicalDrive = value.readUInt8(220);
                this.timestamp.seconds = value[221];
                this.timestamp.minutes = value[222];
                this.timestamp.hours = value[223];
                var marker = value.readUInt16LE(444);
                this.copyProtected = marker === 23130;
                this.signature = marker === 0 || this.copyProtected ? value.readUInt32LE(440) : null;
                var endOfCode = this.signature == null ? 446 : 440;
                this.code = [ new MBR.Code(value, 0, 218), new MBR.Code(value, 224, endOfCode) ];
                var i, count = this.partitionEntries;
                var offset = this.tableOffset;
                for (i = 0; i < count; i++) {
                    this.partitions[i].buffer = value.slice(offset, offset += 16);
                }
            }
        };
        inherit(MODERN, MBR);
        module.exports = MODERN;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var inherit = __webpack_require__(43);
        var MBR = __webpack_require__(38);
        function AAP(buffer, start, end) {
            if (!(this instanceof AAP)) return new AAP(buffer, start, end);
            this.aap = new AAP.Record;
            MBR.call(this, buffer, start, end);
        }
        AAP.TABLE_OFFSET = 446;
        AAP.PARTITION_ENTRIES = 4;
        AAP.Record = __webpack_require__(46);
        AAP.prototype = {
            constructor: AAP,
            get buffer() {
                var buffer = MBR.createBuffer();
                var offset = this.tableOffset;
                for (var i = 0; i < this.code.length; i++) {
                    this.code[i].data.copy(buffer, this.code[i].offset);
                }
                this.aap.buffer.copy(buffer, 430);
                this.partitions[0].buffer.copy(buffer, offset);
                this.partitions[1].buffer.copy(buffer, offset += 16);
                this.partitions[2].buffer.copy(buffer, offset += 16);
                this.partitions[3].buffer.copy(buffer, offset += 16);
                return buffer;
            },
            set buffer(value) {
                if (!Buffer.isBuffer(value)) throw new TypeError("Value must be a Buffer");
                this.code = [ new MBR.Code(value, 0, 427) ];
                this.aap.buffer = value.slice(430, 442);
                var i, count = this.partitionEntries;
                var offset = this.tableOffset;
                for (i = 0; i < count; i++) {
                    this.partitions[i].buffer = value.slice(offset, offset += 16);
                }
            }
        };
        inherit(AAP, MBR);
        module.exports = AAP;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var CHS = __webpack_require__(40);
        function Record(buffer, start, end) {
            if (!(this instanceof Record)) return new Record(buffer, start, end);
            this.physicalDrive = 0;
            this.firstCHS = new CHS;
            this.partitionType = 0;
            this.lastCHS = new CHS;
            this.firstLBA = 0;
            this.sectors = 0;
            if (Buffer.isBuffer(buffer)) {
                this.buffer = buffer.slice(start, end);
            }
        }
        Record.prototype = {
            constructor: Record,
            get buffer() {
                var buffer = new Buffer(16);
                buffer.writeUInt8(this.physicalDrive, 0);
                buffer.writeUInt8(this.partitionType, 4);
                buffer.writeUInt32LE(this.firstLBA, 8);
                buffer.writeUInt32LE(this.sectors, 12);
                this.firstCHS.buffer.copy(buffer, 1);
                this.lastCHS.buffer.copy(buffer, 5);
                return buffer;
            },
            set buffer(value) {
                if (!Buffer.isBuffer(value)) throw new TypeError("Value must be a Buffer");
                this.physicalDrive = value.readUInt8(0);
                this.firstCHS.buffer = value.slice(1, 4);
                this.partitionType = value.readUInt8(4);
                this.lastCHS.buffer = value.slice(5, 8);
                this.firstLBA = value.readUInt32LE(8);
                this.sectors = value.readUInt32LE(12);
                return this;
            }
        };
        module.exports = Record;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var inherit = __webpack_require__(43);
        var MBR = __webpack_require__(38);
        function NEWLDR(buffer, start, end) {
            if (!(this instanceof NEWLDR)) return new NEWLDR(buffer, start, end);
            this.newldr = new NEWLDR.Record;
            this.aap = new MBR.AAP.Record;
            MBR.call(this, buffer, start, end);
        }
        NEWLDR.TABLE_OFFSET = 446;
        NEWLDR.PARTITION_ENTRIES = 4;
        NEWLDR.Record = __webpack_require__(48);
        NEWLDR.prototype = {
            constructor: NEWLDR,
            get buffer() {
                var buffer = MBR.createBuffer();
                var offset = this.tableOffset;
                for (var i = 0; i < this.code.length; i++) {
                    this.code[i].data.copy(buffer, this.code[i].offset);
                }
                this.newldr.buffer.copy(buffer);
                this.aap.buffer.copy(buffer, 430);
                this.partitions[0].buffer.copy(buffer, offset);
                this.partitions[1].buffer.copy(buffer, offset += 16);
                this.partitions[2].buffer.copy(buffer, offset += 16);
                this.partitions[3].buffer.copy(buffer, offset += 16);
                return buffer;
            },
            set buffer(value) {
                if (!Buffer.isBuffer(value)) throw new TypeError("Value must be a Buffer");
                this.code = [ new MBR.Code(value, value[1], 428) ];
                this.newldr.buffer = value.slice(0, value[1]);
                this.aap.buffer = value.slice(430, 446);
                var i, count = this.partitionEntries;
                var offset = this.tableOffset;
                for (i = 0; i < count; i++) {
                    this.partitions[i].buffer = value.slice(offset, offset += 16);
                }
            }
        };
        inherit(NEWLDR, MBR);
        module.exports = NEWLDR;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var CHS = __webpack_require__(40);
        function Record(buffer, start, end) {
            if (!(this instanceof Record)) return new Record(buffer, start, end);
            this.size = 22;
            this.physicalDrive = 0;
            this.firstCHS = new CHS;
            this.minDL = 0;
            this.firstLBA = 0;
            this.patchOffset = 0;
            this.checksum = 0;
            this.signature = "MSWIN4";
            if (Buffer.isBuffer(buffer)) {
                this.buffer = buffer.slice(start, end);
            }
        }
        Record.prototype = {
            constructor: Record,
            get buffer() {
                var buffer = new Buffer(30);
                buffer.fill(0);
                buffer[0] = 235;
                buffer.writeUInt8(this.size, 1);
                buffer.write("NEWLDR", 2, "ascii");
                buffer.writeUInt8(this.physicalDrive, 8);
                this.firstCHS.buffer.copy(buffer, 9);
                buffer.writeUInt8(this.minDL, 12);
                buffer.writeUInt32LE(this.firstLBA, 16);
                buffer.writeUInt16LE(this.patchOffset, 20);
                buffer.writeUInt16LE(this.checksum, 22);
                buffer.write(this.signature, 24, "ascii");
                return buffer;
            },
            set buffer(value) {
                if (!Buffer.isBuffer(value)) throw new TypeError("Value must be a Buffer");
                this.size = value.readUInt8(1);
                this.physicalDrive = value.readUInt8(8);
                this.firstCHS.buffer = value.slice(9, 12);
                this.minDL = value.readUInt8(12);
                this.firstLBA = value.readUInt32LE(16);
                this.patchOffset = value.readUInt16LE(20);
                this.checksum = value.readUInt16LE(22);
                this.signature = value.toString("ascii", 24);
            }
        };
        module.exports = Record;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var inherit = __webpack_require__(43);
        var MBR = __webpack_require__(38);
        function AST(buffer, start, end) {
            if (!(this instanceof AST)) return new AST(buffer, start, end);
            MBR.call(this, buffer, start, end);
        }
        AST.TABLE_OFFSET = 382;
        AST.PARTITION_ENTRIES = 8;
        AST.prototype = {
            constructor: AST,
            get buffer() {
                var buffer = MBR.createBuffer();
                var offset = this.tableOffset;
                for (var i = 0; i < this.code.length; i++) {
                    this.code[i].data.copy(buffer, this.code[i].offset);
                }
                this.partitions[4].buffer.copy(buffer, offset);
                this.partitions[5].buffer.copy(buffer, offset += 16);
                this.partitions[6].buffer.copy(buffer, offset += 16);
                this.partitions[7].buffer.copy(buffer, offset += 16);
                this.partitions[0].buffer.copy(buffer, offset += 16);
                this.partitions[1].buffer.copy(buffer, offset += 16);
                this.partitions[2].buffer.copy(buffer, offset += 16);
                this.partitions[3].buffer.copy(buffer, offset += 16);
                return buffer;
            },
            set buffer(value) {
                if (!Buffer.isBuffer(value)) throw new TypeError("Value must be a Buffer");
                this.code = [ new MBR.Code(value, 0, 382) ];
                var i, count = 4;
                var offset = 446;
                for (i = 0; i < count; i++) {
                    this.partitions[i].buffer = value.slice(offset, offset += 16);
                }
                count += count;
                offset = this.tableOffset;
                for (i = 4; i < count; i++) {
                    this.partitions[i].buffer = value.slice(offset, offset += 16);
                }
            }
        };
        inherit(AST, MBR);
        module.exports = AST;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var inherit = __webpack_require__(43);
        var MBR = __webpack_require__(38);
        function DM(buffer, start, end) {
            if (!(this instanceof DM)) return new DM(buffer, start, end);
            MBR.call(this, buffer, start, end);
        }
        DM.TABLE_OFFSET = 254;
        DM.PARTITION_ENTRIES = 16;
        DM.prototype = {
            constructor: DM,
            get buffer() {
                var buffer = MBR.createBuffer();
                var offset = this.tableOffset;
                for (var i = 0; i < this.code.length; i++) {
                    this.code[i].data.copy(buffer, this.code[i].offset);
                }
                for (var i = 4; i < DM.PARTITION_ENTRIES; i++) {
                    this.partitions[i].buffer.copy(buffer, offset);
                    offset += 16;
                }
                for (var i = 0; i < 4; i++) {
                    this.partitions[i].buffer.copy(buffer, offset);
                    offset += 16;
                }
                return buffer;
            },
            set buffer(value) {
                if (!Buffer.isBuffer(value)) throw new TypeError("Value must be a Buffer");
                this.code = [ new MBR.Code(value, 0, 254) ];
                var i, count = 4;
                var offset = 446;
                for (i = 0; i < count; i++) {
                    this.partitions[i].buffer = value.slice(offset, offset += 16);
                }
                count *= 4;
                offset = this.tableOffset;
                for (i = 4; i < count; i++) {
                    this.partitions[i].buffer = value.slice(offset, offset += 16);
                }
            }
        };
        inherit(DM, MBR);
        module.exports = DM;
    }, (__unused_webpack_module, exports) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.TypedError = void 0;
        let getStackTrace;
        if (Error.captureStackTrace != null) {
            const captureStackTrace = Error.captureStackTrace;
            getStackTrace = e => {
                captureStackTrace(e, e.constructor);
            };
        } else {
            getStackTrace = (e, err) => {
                if (!(err instanceof Error)) {
                    err = new Error(err);
                }
                if (err.stack != null) {
                    e.stack = err.stack;
                }
            };
        }
        class TypedError extends Error {
            constructor(err = "") {
                super();
                this.stack = "";
                if (err instanceof Error) {
                    this.message = err.message;
                } else {
                    this.message = err;
                }
                Object.setPrototypeOf(this, new.target.prototype);
                this.name = this.constructor.name;
                getStackTrace(this, err);
            }
        }
        exports.TypedError = TypedError;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const addon = __webpack_require__(53);
        const XXHash32 = addon.XXHash32, XXHash64 = addon.XXHash64, XXHash3 = addon.XXHash3, XXHash128 = addon.XXHash128;
        module.exports = {
            XXHash32,
            XXHash64,
            XXHash3,
            XXHash128
        };
    }, module => {
        module.exports = require("./modules/xxhash-addon/build/Release/addon.node");
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.SparseFilterStream = void 0;
        const stream_1 = __webpack_require__(17);
        const shared_1 = __webpack_require__(55);
        class SparseFilterStream extends stream_1.Transform {
            constructor({blocks, verify, generateChecksums}) {
                super({
                    objectMode: true
                });
                this.position = 0;
                this.blocks = blocks;
                this.stateIterator = (0, shared_1.createSparseReaderStateIterator)(blocks, verify, generateChecksums);
                this.nextBlock();
            }
            nextBlock() {
                this.state = this.stateIterator.next().value;
            }
            _transform(chunk, _encoding, callback) {
                let error;
                try {
                    this.__transform(chunk);
                } catch (err) {
                    error = err;
                }
                callback(error);
            }
            __transform(buffer) {
                while (true) {
                    if (this.state === undefined) {
                        this.position += buffer.length;
                        return;
                    }
                    if (this.position >= this.state.subBlock.offset + this.state.subBlock.length) {
                        this.nextBlock();
                        continue;
                    }
                    if (buffer.length === 0) {
                        return;
                    }
                    if (this.position < this.state.subBlock.offset) {
                        const toSkip = Math.min(this.state.subBlock.offset - this.position, buffer.length);
                        this.position += toSkip;
                        if (toSkip >= buffer.length) {
                            return;
                        }
                        buffer = buffer.slice(toSkip);
                    }
                    const bytesLeftInBlock = this.state.subBlock.offset + this.state.subBlock.length - this.position;
                    const length = Math.min(bytesLeftInBlock, buffer.length);
                    const bufferToPush = buffer.slice(0, length);
                    if (this.state.hasher !== undefined) {
                        this.state.hasher.update(bufferToPush);
                    }
                    this.push({
                        buffer: bufferToPush,
                        position: this.position
                    });
                    this.position += length;
                    buffer = buffer.slice(length);
                }
            }
        }
        exports.SparseFilterStream = SparseFilterStream;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.blocksLength = exports.createSparseReaderStateIterator = void 0;
        const crypto_1 = __webpack_require__(56);
        const constants_1 = __webpack_require__(3);
        const errors_1 = __webpack_require__(4);
        const lazy_1 = __webpack_require__(57);
        function createHasher(checksumType) {
            if (checksumType === "crc32") {
                return (0, lazy_1.getCrc)().createHash();
            } else if (checksumType === "sha1" || checksumType === "sha256") {
                return (0, crypto_1.createHash)(checksumType);
            } else if (checksumType === "xxhash3") {
                const {XXHash3} = (0, lazy_1.getXXHash)();
                return new XXHash3(constants_1.XXHASH_SEED);
            }
        }
        function* createSparseReaderStateIterator(blocks, verify, generateChecksums) {
            if (verify && generateChecksums) {
                throw new Error("verify and generateChecksums are mutually exclusive");
            }
            if (generateChecksums) {
                for (const block of blocks) {
                    if (block.checksumType === undefined) {
                        throw new Error("All blocks must have a checksumType if generateChecksums is true");
                    }
                }
            }
            for (const block of blocks) {
                const hasher = createHasher(block.checksumType);
                for (const subBlock of block.blocks) {
                    yield {
                        block,
                        subBlock,
                        hasher
                    };
                }
                verifyOrGenerateChecksum(hasher, block, verify, generateChecksums);
            }
        }
        exports.createSparseReaderStateIterator = createSparseReaderStateIterator;
        function verifyOrGenerateChecksum(hasher, blocks, verify, generateChecksums) {
            var _a;
            if (hasher !== undefined) {
                const checksum = hasher.digest("hex");
                if (generateChecksums) {
                    blocks.checksum = checksum;
                } else if (verify && ((_a = blocks.checksum) === null || _a === void 0 ? void 0 : _a.toString()) !== checksum.toString()) {
                    throw new errors_1.BlocksVerificationError(blocks, checksum);
                }
            }
        }
        function blocksLength(blocks) {
            let sum = 0;
            for (const block of blocks) {
                for (const blk of block.blocks) {
                    sum += blk.length;
                }
            }
            return sum;
        }
        exports.blocksLength = blocksLength;
    }, module => {
        "use strict";
        module.exports = require("crypto");
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.getCrc = exports.getUnmountDisk = exports.getXXHash = exports.getRaspberrypiUsbboot = void 0;
        const util_1 = __webpack_require__(58);
        const utils_1 = __webpack_require__(6);
        exports.getRaspberrypiUsbboot = (0, utils_1.once)((() => {
            try {
                return __webpack_require__(59);
            } catch (e) {
                console.warn("Failed to import node-raspberrypi-usbboot:", e);
            }
        }));
        exports.getXXHash = (0, utils_1.once)((() => __webpack_require__(52)));
        exports.getUnmountDisk = (0, utils_1.once)((() => (0, util_1.promisify)(__webpack_require__(65).unmountDisk)));
        exports.getCrc = (0, utils_1.once)((() => __webpack_require__(34)));
    }, module => {
        "use strict";
        module.exports = require("util");
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        var __dirname = "node_modules\\node-raspberrypi-usbboot\\build";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.UsbbootScanner = exports.CM4 = exports.CM3 = exports.UsbbootDevice = exports.isUsbBootCapableUSBDevice = void 0;
        const usb = __webpack_require__(60);
        const _debug = __webpack_require__(63);
        const events_1 = __webpack_require__(26);
        const fs_1 = __webpack_require__(14);
        const Path = __webpack_require__(15);
        const util_1 = __webpack_require__(58);
        async function delay(ms) {
            await new Promise((resolve => {
                setTimeout(resolve, ms);
            }));
        }
        function fromCallback(fn) {
            return new Promise(((resolve, reject) => {
                fn(((error, result) => {
                    if (error == null) {
                        resolve(result);
                    } else {
                        reject(error);
                    }
                }));
            }));
        }
        const readFile = util_1.promisify(fs_1.readFile);
        const debug = _debug("node-raspberrypi-usbboot");
        const POLLING_INTERVAL_MS = 2e3;
        const TRANSFER_BLOCK_SIZE = 1024 ** 2;
        const NULL_BUFFER = Buffer.alloc(0);
        const BOOT_MESSAGE_BOOTCODE_LENGTH_SIZE = 4;
        const BOOT_MESSAGE_BOOTCODE_LENGTH_OFFSET = 0;
        const BOOT_MESSAGE_SIGNATURE_SIZE = 20;
        const FILE_MESSAGE_COMMAND_OFFSET = 0;
        const FILE_MESSAGE_COMMAND_SIZE = 4;
        const FILE_MESSAGE_FILE_NAME_OFFSET = FILE_MESSAGE_COMMAND_SIZE;
        const FILE_MESSAGE_FILE_NAME_SIZE = 256;
        const USB_REQUEST_CODE_GET_STATUS = 0;
        const USBBOOT_MESSAGE_MAX_BUFFER_LENGTH = 65535;
        const CONTROL_TRANSFER_INDEX_RIGHT_BIT_SHIFT = 16;
        const FILE_MESSAGE_SIZE = FILE_MESSAGE_COMMAND_SIZE + FILE_MESSAGE_FILE_NAME_SIZE;
        const RETURN_CODE_SUCCESS = 0;
        const RETURN_CODE_LENGTH = 4;
        const USB_CONTROL_TRANSFER_TIMEOUT_MS = 1e4;
        const USB_BULK_TRANSFER_TIMEOUT_MS = 1e4;
        const USB_ENDPOINT_INTERFACES_SOC_BCM2835 = 1;
        const USB_VENDOR_ID_BROADCOM_CORPORATION = 2652;
        const USB_PRODUCT_ID_BCM2708_BOOT = 10083;
        const USB_PRODUCT_ID_BCM2710_BOOT = 10084;
        const USB_PRODUCT_ID_BCM2711_BOOT = 10001;
        const USB_PRODUCT_ID_BCM2711_MASS_STORAGE = 1;
        const USB_VENDOR_ID_NETCHIP_TECHNOLOGY = 1317;
        const USB_PRODUCT_ID_POCKETBOOK_PRO_903 = 42149;
        const DEVICE_UNPLUG_TIMEOUT = 5e3;
        const READ_ERROR_DELAY = 100;
        var FileMessageCommand;
        (function(FileMessageCommand) {
            FileMessageCommand[FileMessageCommand["GetFileSize"] = 0] = "GetFileSize";
            FileMessageCommand[FileMessageCommand["ReadFile"] = 1] = "ReadFile";
            FileMessageCommand[FileMessageCommand["Done"] = 2] = "Done";
        })(FileMessageCommand || (FileMessageCommand = {}));
        const getCommand = fileMessageBuffer => {
            const command = fileMessageBuffer.readInt32LE(FILE_MESSAGE_COMMAND_OFFSET);
            if (!(command in FileMessageCommand)) {
                throw new Error(`Invalid file message command code: ${command}`);
            }
            return command;
        };
        const getFilename = fileMessageBuffer => {
            let end = fileMessageBuffer.indexOf(0, FILE_MESSAGE_FILE_NAME_OFFSET);
            if (end === -1) {
                end = fileMessageBuffer.length;
            }
            return fileMessageBuffer.slice(FILE_MESSAGE_FILE_NAME_OFFSET, end).toString("ascii");
        };
        const parseFileMessageBuffer = fileMessageBuffer => {
            let command = getCommand(fileMessageBuffer);
            const filename = getFilename(fileMessageBuffer);
            if (filename === "") {
                command = FileMessageCommand.Done;
            }
            return {
                command,
                filename
            };
        };
        const performControlTransfer = async (device, bmRequestType, bRequest, wValue, wIndex, dataOrLength) => {
            const previousTimeout = device.timeout;
            device.timeout = USB_CONTROL_TRANSFER_TIMEOUT_MS;
            const result = await fromCallback((callback => {
                device.controlTransfer(bmRequestType, bRequest, wValue, wIndex, dataOrLength, callback);
            }));
            device.timeout = previousTimeout;
            return result;
        };
        const isUsbBootCapableUSBDevice = (idVendor, idProduct) => idVendor === USB_VENDOR_ID_BROADCOM_CORPORATION && (idProduct === USB_PRODUCT_ID_BCM2708_BOOT || idProduct === USB_PRODUCT_ID_BCM2710_BOOT || idProduct === USB_PRODUCT_ID_BCM2711_BOOT);
        exports.isUsbBootCapableUSBDevice = isUsbBootCapableUSBDevice;
        const isUsbBootCapableUSBDevice$ = device => exports.isUsbBootCapableUSBDevice(device.deviceDescriptor.idVendor, device.deviceDescriptor.idProduct);
        const isRaspberryPiInMassStorageMode = device => device.deviceDescriptor.idVendor === USB_VENDOR_ID_NETCHIP_TECHNOLOGY && device.deviceDescriptor.idProduct === USB_PRODUCT_ID_POCKETBOOK_PRO_903;
        const isComputeModule4InMassStorageMode = device => device.deviceDescriptor.idVendor === USB_VENDOR_ID_BROADCOM_CORPORATION && device.deviceDescriptor.idProduct === USB_PRODUCT_ID_BCM2711_MASS_STORAGE;
        const initializeDevice = device => {
            device.open();
            let interfaceNumber;
            let endpointNumber;
            if (device.configDescriptor.bNumInterfaces === USB_ENDPOINT_INTERFACES_SOC_BCM2835) {
                interfaceNumber = 0;
                endpointNumber = 1;
            } else {
                interfaceNumber = 1;
                endpointNumber = 3;
            }
            const iface = device.interface(interfaceNumber);
            iface.claim();
            const endpoint = iface.endpoint(endpointNumber);
            if (!(endpoint instanceof usb.OutEndpoint)) {
                throw new Error("endpoint is not an usb.OutEndpoint");
            }
            debug("Initialized device correctly", devicePortId(device));
            return {
                iface,
                endpoint
            };
        };
        const sendSize = async (device, size) => {
            await performControlTransfer(device, usb.LIBUSB_REQUEST_TYPE_VENDOR, USB_REQUEST_CODE_GET_STATUS, size & USBBOOT_MESSAGE_MAX_BUFFER_LENGTH, size >> CONTROL_TRANSFER_INDEX_RIGHT_BIT_SHIFT, NULL_BUFFER);
        };
        function* chunks(buffer, size) {
            for (let start = 0; start < buffer.length; start += size) {
                yield buffer.slice(start, start + size);
            }
        }
        const transfer = async (endpoint, chunk) => {
            endpoint.timeout = USB_BULK_TRANSFER_TIMEOUT_MS;
            for (let tries = 0; tries < 3; tries++) {
                if (tries > 0) {
                    debug("Transfer stall, retrying");
                }
                try {
                    await fromCallback((callback => {
                        endpoint.transfer(chunk, callback);
                    }));
                    return;
                } catch (error) {
                    if (error.errno === usb.LIBUSB_TRANSFER_STALL) {
                        continue;
                    }
                    throw error;
                }
            }
        };
        const epWrite = async (buffer, device, endpoint) => {
            debug("Sending buffer size", buffer.length);
            await sendSize(device, buffer.length);
            if (buffer.length > 0) {
                for (const chunk of chunks(buffer, TRANSFER_BLOCK_SIZE)) {
                    debug("Sending chunk of size", chunk.length);
                    await transfer(endpoint, chunk);
                }
            }
        };
        const epRead = async (device, bytesToRead) => await performControlTransfer(device, usb.LIBUSB_REQUEST_TYPE_VENDOR | usb.LIBUSB_ENDPOINT_IN, USB_REQUEST_CODE_GET_STATUS, bytesToRead & USBBOOT_MESSAGE_MAX_BUFFER_LENGTH, bytesToRead >> CONTROL_TRANSFER_INDEX_RIGHT_BIT_SHIFT, bytesToRead);
        const getDeviceId = device => `${device.busNumber}:${device.deviceAddress}`;
        const safeReadFile = async filename => {
            try {
                const {app, remote} = __webpack_require__(1);
                return await readFile(Path.join((app || remote.app).getAppPath().replace(/\.asar$/, (() => process.platform === "darwin" ? "-" + process.arch : "")), "generated", __dirname.replace("node_modules", "modules"), "..", "blobs", filename));
            } catch (e) {}
        };
        const getFileBuffer = async (device, filename) => {
            const folder = device.deviceDescriptor.idProduct === USB_PRODUCT_ID_BCM2711_BOOT ? "cm4" : "raspberrypi";
            const buffer = await safeReadFile(Path.join(folder, filename));
            if (buffer === undefined) {
                debug("Can't read file", filename);
            }
            return buffer;
        };
        const createBootMessageBuffer = bootCodeBufferLength => {
            const bootMessageBufferSize = BOOT_MESSAGE_BOOTCODE_LENGTH_SIZE + BOOT_MESSAGE_SIGNATURE_SIZE;
            const bootMessageBuffer = Buffer.alloc(bootMessageBufferSize);
            bootMessageBuffer.writeInt32LE(bootCodeBufferLength, BOOT_MESSAGE_BOOTCODE_LENGTH_OFFSET);
            return bootMessageBuffer;
        };
        const secondStageBoot = async (device, endpoint) => {
            const bootcodeBuffer = await getFileBuffer(device, "bootcode.bin");
            if (bootcodeBuffer === undefined) {
                throw new Error("Can't find bootcode.bin");
            }
            const bootMessage = createBootMessageBuffer(bootcodeBuffer.length);
            await epWrite(bootMessage, device, endpoint);
            debug(`Writing ${bootMessage.length} bytes`, devicePortId(device));
            await epWrite(bootcodeBuffer, device, endpoint);
            const data = await epRead(device, RETURN_CODE_LENGTH);
            const returnCode = data.readInt32LE(0);
            if (returnCode !== RETURN_CODE_SUCCESS) {
                throw new Error(`Couldn't write the bootcode, got return code ${returnCode} from device`);
            }
        };
        class UsbbootDevice extends events_1.EventEmitter {
            constructor(portId) {
                super();
                this.portId = portId;
                this._step = 0;
            }
            get progress() {
                return Math.round(this._step / this.LAST_STEP * 100);
            }
            get step() {
                return this._step;
            }
            set step(step) {
                this._step = step;
                this.emit("progress", this.progress);
            }
        }
        exports.UsbbootDevice = UsbbootDevice;
        class CM3 extends UsbbootDevice {
            constructor() {
                super(...arguments);
                this.LAST_STEP = 40;
            }
        }
        exports.CM3 = CM3;
        class CM4 extends UsbbootDevice {
            constructor() {
                super(...arguments);
                this.LAST_STEP = 10;
            }
        }
        exports.CM4 = CM4;
        class UsbbootScanner extends events_1.EventEmitter {
            constructor() {
                super();
                this.usbbootDevices = new Map;
                this.attachedDeviceIds = new Set;
                this.boundAttachDevice = this.attachDevice.bind(this);
                this.boundDetachDevice = this.detachDevice.bind(this);
            }
            start() {
                debug("Waiting for BCM2835/6/7/2711");
                usb.getDeviceList().map(this.boundAttachDevice);
                this.emit("ready");
                usb.on("attach", this.boundAttachDevice);
                usb.on("detach", this.boundDetachDevice);
                this.interval = setInterval((() => {}), POLLING_INTERVAL_MS);
            }
            stop() {
                usb.removeListener("attach", this.boundAttachDevice);
                usb.removeListener("detach", this.boundDetachDevice);
                clearInterval(this.interval);
                this.usbbootDevices.clear();
            }
            step(device, step) {
                const usbbootDevice = this.getOrCreate(device);
                usbbootDevice.step = step;
                if (step === usbbootDevice.LAST_STEP) {
                    this.remove(device);
                }
            }
            get(device) {
                const key = devicePortId(device);
                return this.usbbootDevices.get(key);
            }
            getOrCreate(device) {
                const key = devicePortId(device);
                let usbbootDevice = this.usbbootDevices.get(key);
                if (usbbootDevice === undefined) {
                    const Cls = device.deviceDescriptor.idProduct === USB_PRODUCT_ID_BCM2711_BOOT ? CM4 : CM3;
                    usbbootDevice = new Cls(key);
                    this.usbbootDevices.set(key, usbbootDevice);
                    this.emit("attach", usbbootDevice);
                }
                return usbbootDevice;
            }
            remove(device) {
                const key = devicePortId(device);
                const usbbootDevice = this.usbbootDevices.get(key);
                if (usbbootDevice !== undefined) {
                    this.usbbootDevices.delete(key);
                    this.emit("detach", usbbootDevice);
                }
            }
            async attachDevice(device) {
                if (this.attachedDeviceIds.has(getDeviceId(device))) {
                    return;
                }
                this.attachedDeviceIds.add(getDeviceId(device));
                const usbbootDevice = this.get(device);
                if ((isRaspberryPiInMassStorageMode(device) || isComputeModule4InMassStorageMode(device)) && usbbootDevice !== undefined) {
                    this.step(device, usbbootDevice.LAST_STEP);
                    return;
                }
                if (!isUsbBootCapableUSBDevice$(device)) {
                    return;
                }
                debug("Found serial number", device.deviceDescriptor.iSerialNumber);
                debug("port id", devicePortId(device));
                try {
                    const {endpoint} = initializeDevice(device);
                    if (device.deviceDescriptor.iSerialNumber === 0 || device.deviceDescriptor.iSerialNumber === 3) {
                        debug("Sending bootcode.bin", devicePortId(device));
                        this.step(device, 0);
                        await secondStageBoot(device, endpoint);
                    } else {
                        debug("Second stage boot server", devicePortId(device));
                        await this.fileServer(device, endpoint, 2);
                    }
                    device.close();
                } catch (error) {
                    debug("error", error, devicePortId(device));
                    this.remove(device);
                }
            }
            detachDevice(device) {
                this.attachedDeviceIds.delete(getDeviceId(device));
                if (!isUsbBootCapableUSBDevice$(device)) {
                    return;
                }
                const usbbootDevice = this.getOrCreate(device);
                const step = device.deviceDescriptor.iSerialNumber === 1 ? usbbootDevice.LAST_STEP - 1 : 1;
                debug("detach", devicePortId(device), step);
                this.step(device, step);
                setTimeout((() => {
                    const $usbbootDevice = this.get(device);
                    if ($usbbootDevice !== undefined && $usbbootDevice.step === step) {
                        debug("device", devicePortId(device), "did not reattached after", DEVICE_UNPLUG_TIMEOUT, "ms.");
                        this.remove(device);
                    }
                }), DEVICE_UNPLUG_TIMEOUT);
            }
            async fileServer(device, endpoint, step) {
                while (true) {
                    let data;
                    try {
                        data = await epRead(device, FILE_MESSAGE_SIZE);
                    } catch (error) {
                        if (error.message === "LIBUSB_ERROR_NO_DEVICE" || error.message === "LIBUSB_ERROR_IO") {
                            break;
                        }
                        await delay(READ_ERROR_DELAY);
                        continue;
                    }
                    this.step(device, step);
                    step += 1;
                    const message = parseFileMessageBuffer(data);
                    debug("Received message", FileMessageCommand[message.command], message.filename, devicePortId(device));
                    if (message.command === FileMessageCommand.GetFileSize || message.command === FileMessageCommand.ReadFile) {
                        const buffer = await getFileBuffer(device, message.filename);
                        if (buffer === undefined) {
                            debug(`Couldn't find ${message.filename}`, devicePortId(device));
                            await sendSize(device, 0);
                        } else {
                            if (message.command === FileMessageCommand.GetFileSize) {
                                await sendSize(device, buffer.length);
                            } else {
                                await epWrite(buffer, device, endpoint);
                            }
                        }
                    } else if (message.command === FileMessageCommand.Done) {
                        break;
                    }
                }
                debug("File server done", devicePortId(device));
                await delay(2e3);
                try {
                    device.open();
                } catch (_a) {}
            }
        }
        exports.UsbbootScanner = UsbbootScanner;
        const devicePortId = device => {
            let result = `${device.busNumber}`;
            if (device.portNumbers !== undefined) {
                result += `-${device.portNumbers.join(".")}`;
            }
            return result;
        };
    }, (module, exports, __webpack_require__) => {
        var __dirname = "node_modules\\@balena.io\\usb";
        var binary = __webpack_require__(61);
        var path = __webpack_require__(15);
        var binding_path = binary.find(path.resolve(path.join(__dirname, "./package.json")));
        var usb = exports = module.exports = __webpack_require__(62);
        var events = __webpack_require__(26);
        var util = __webpack_require__(58);
        if (usb.INIT_ERROR) {
            console.warn("Failed to initialize libusb.");
            usb.Device = function() {
                throw new Error("Device cannot be instantiated directly.");
            };
            usb.Transfer = function() {
                throw new Error("Transfer cannot be instantiated directly.");
            };
            usb.setDebugLevel = function() {};
            usb.getDeviceList = function() {
                return [];
            };
            usb._enableHotplugEvents = function() {};
            usb._disableHotplugEvents = function() {};
        }
        Object.keys(events.EventEmitter.prototype).forEach((function(key) {
            exports[key] = events.EventEmitter.prototype[key];
        }));
        exports.findByIds = function(vid, pid) {
            var devices = usb.getDeviceList();
            for (var i = 0; i < devices.length; i++) {
                var deviceDesc = devices[i].deviceDescriptor;
                if (deviceDesc.idVendor == vid && deviceDesc.idProduct == pid) {
                    return devices[i];
                }
            }
        };
        usb.Device.prototype.timeout = 1e3;
        usb.Device.prototype.open = function(defaultConfig) {
            this.__open();
            if (defaultConfig === false) return;
            this.interfaces = [];
            var len = this.configDescriptor.interfaces.length;
            for (var i = 0; i < len; i++) {
                this.interfaces[i] = new Interface(this, i);
            }
        };
        usb.Device.prototype.close = function() {
            this.__close();
            this.interfaces = null;
        };
        Object.defineProperty(usb.Device.prototype, "configDescriptor", {
            get: function() {
                return this._configDescriptor || (this._configDescriptor = this.__getConfigDescriptor());
            }
        });
        Object.defineProperty(usb.Device.prototype, "allConfigDescriptors", {
            get: function() {
                return this._allConfigDescriptors || (this._allConfigDescriptors = this.__getAllConfigDescriptors());
            }
        });
        Object.defineProperty(usb.Device.prototype, "parent", {
            get: function() {
                return this._parent || (this._parent = this.__getParent());
            }
        });
        usb.Device.prototype.interface = function(addr) {
            if (!this.interfaces) {
                throw new Error("Device must be open before searching for interfaces");
            }
            addr = addr || 0;
            for (var i = 0; i < this.interfaces.length; i++) {
                if (this.interfaces[i].interfaceNumber == addr) {
                    return this.interfaces[i];
                }
            }
        };
        var SETUP_SIZE = usb.LIBUSB_CONTROL_SETUP_SIZE;
        usb.Device.prototype.controlTransfer = function(bmRequestType, bRequest, wValue, wIndex, data_or_length, callback) {
            var self = this;
            var isIn = !!(bmRequestType & usb.LIBUSB_ENDPOINT_IN);
            var wLength;
            if (isIn) {
                if (!(data_or_length >= 0)) {
                    throw new TypeError("Expected size number for IN transfer (based on bmRequestType)");
                }
                wLength = data_or_length;
            } else {
                if (!Buffer.isBuffer(data_or_length)) {
                    throw new TypeError("Expected buffer for OUT transfer (based on bmRequestType)");
                }
                wLength = data_or_length.length;
            }
            var buf = new Buffer(wLength + SETUP_SIZE);
            buf.writeUInt8(bmRequestType, 0);
            buf.writeUInt8(bRequest, 1);
            buf.writeUInt16LE(wValue, 2);
            buf.writeUInt16LE(wIndex, 4);
            buf.writeUInt16LE(wLength, 6);
            if (!isIn) {
                data_or_length.copy(buf, SETUP_SIZE);
            }
            var transfer = new usb.Transfer(this, 0, usb.LIBUSB_TRANSFER_TYPE_CONTROL, this.timeout, (function(error, buf, actual) {
                if (callback) {
                    if (isIn) {
                        callback.call(self, error, buf.slice(SETUP_SIZE, SETUP_SIZE + actual));
                    } else {
                        callback.call(self, error);
                    }
                }
            }));
            try {
                transfer.submit(buf);
            } catch (e) {
                if (callback) {
                    process.nextTick((function() {
                        callback.call(self, e);
                    }));
                }
            }
            return this;
        };
        usb.Device.prototype.getStringDescriptor = function(desc_index, callback) {
            var langid = 1033;
            var length = 255;
            this.controlTransfer(usb.LIBUSB_ENDPOINT_IN, usb.LIBUSB_REQUEST_GET_DESCRIPTOR, usb.LIBUSB_DT_STRING << 8 | desc_index, langid, length, (function(error, buf) {
                if (error) return callback(error);
                callback(undefined, buf.toString("utf16le", 2));
            }));
        };
        usb.Device.prototype.setConfiguration = function(desired, cb) {
            var self = this;
            this.__setConfiguration(desired, (function(err) {
                if (!err) {
                    this.interfaces = [];
                    var len = this.configDescriptor.interfaces.length;
                    for (var i = 0; i < len; i++) {
                        this.interfaces[i] = new Interface(this, i);
                    }
                }
                cb.call(self, err);
            }));
        };
        function Interface(device, id) {
            this.device = device;
            this.id = id;
            this.altSetting = 0;
            this.__refresh();
        }
        Interface.prototype.__refresh = function() {
            this.descriptor = this.device.configDescriptor.interfaces[this.id][this.altSetting];
            this.interfaceNumber = this.descriptor.bInterfaceNumber;
            this.endpoints = [];
            var len = this.descriptor.endpoints.length;
            for (var i = 0; i < len; i++) {
                var desc = this.descriptor.endpoints[i];
                var c = desc.bEndpointAddress & usb.LIBUSB_ENDPOINT_IN ? InEndpoint : OutEndpoint;
                this.endpoints[i] = new c(this.device, desc);
            }
        };
        Interface.prototype.claim = function() {
            this.device.__claimInterface(this.id);
        };
        Interface.prototype.release = function(closeEndpoints, cb) {
            var self = this;
            if (typeof closeEndpoints == "function") {
                cb = closeEndpoints;
                closeEndpoints = null;
            }
            if (!closeEndpoints || this.endpoints.length == 0) {
                next();
            } else {
                var n = self.endpoints.length;
                self.endpoints.forEach((function(ep, i) {
                    if (ep.pollActive) {
                        ep.once("end", (function() {
                            if (--n == 0) next();
                        }));
                        ep.stopPoll();
                    } else {
                        if (--n == 0) next();
                    }
                }));
            }
            function next() {
                self.device.__releaseInterface(self.id, (function(err) {
                    if (!err) {
                        self.altSetting = 0;
                        self.__refresh();
                    }
                    cb.call(self, err);
                }));
            }
        };
        Interface.prototype.isKernelDriverActive = function() {
            return this.device.__isKernelDriverActive(this.id);
        };
        Interface.prototype.detachKernelDriver = function() {
            return this.device.__detachKernelDriver(this.id);
        };
        Interface.prototype.attachKernelDriver = function() {
            return this.device.__attachKernelDriver(this.id);
        };
        Interface.prototype.setAltSetting = function(altSetting, cb) {
            var self = this;
            this.device.__setInterface(this.id, altSetting, (function(err) {
                if (!err) {
                    self.altSetting = altSetting;
                    self.__refresh();
                }
                cb.call(self, err);
            }));
        };
        Interface.prototype.endpoint = function(addr) {
            for (var i = 0; i < this.endpoints.length; i++) {
                if (this.endpoints[i].address == addr) {
                    return this.endpoints[i];
                }
            }
        };
        function Endpoint(device, descriptor) {
            this.device = device;
            this.descriptor = descriptor;
            this.address = descriptor.bEndpointAddress;
            this.transferType = descriptor.bmAttributes & 3;
        }
        util.inherits(Endpoint, events.EventEmitter);
        Endpoint.prototype.timeout = 0;
        Endpoint.prototype.makeTransfer = function(timeout, callback) {
            return new usb.Transfer(this.device, this.address, this.transferType, timeout, callback);
        };
        Endpoint.prototype.startPoll = function(nTransfers, transferSize, callback) {
            if (this.pollTransfers) {
                throw new Error("Polling already active");
            }
            nTransfers = nTransfers || 3;
            this.pollTransferSize = transferSize || this.descriptor.wMaxPacketSize;
            this.pollActive = true;
            this.pollPending = 0;
            var transfers = [];
            for (var i = 0; i < nTransfers; i++) {
                transfers[i] = this.makeTransfer(0, callback);
            }
            return transfers;
        };
        Endpoint.prototype.stopPoll = function(cb) {
            if (!this.pollTransfers) {
                throw new Error("Polling is not active.");
            }
            for (var i = 0; i < this.pollTransfers.length; i++) {
                try {
                    this.pollTransfers[i].cancel();
                } catch (err) {
                    this.emit("error", err);
                }
            }
            this.pollActive = false;
            if (cb) this.once("end", cb);
        };
        function InEndpoint(device, descriptor) {
            Endpoint.call(this, device, descriptor);
        }
        exports.InEndpoint = InEndpoint;
        util.inherits(InEndpoint, Endpoint);
        InEndpoint.prototype.direction = "in";
        InEndpoint.prototype.transfer = function(length, cb) {
            var self = this;
            var buffer = new Buffer(length);
            function callback(error, buf, actual) {
                cb.call(self, error, buffer.slice(0, actual));
            }
            try {
                this.makeTransfer(this.timeout, callback).submit(buffer);
            } catch (e) {
                process.nextTick((function() {
                    cb.call(self, e);
                }));
            }
            return this;
        };
        InEndpoint.prototype.startPoll = function(nTransfers, transferSize) {
            var self = this;
            this.pollTransfers = InEndpoint.super_.prototype.startPoll.call(this, nTransfers, transferSize, transferDone);
            function transferDone(error, buf, actual) {
                if (!error) {
                    self.emit("data", buf.slice(0, actual));
                } else if (error.errno != usb.LIBUSB_TRANSFER_CANCELLED) {
                    self.emit("error", error);
                    self.stopPoll();
                }
                if (self.pollActive) {
                    startTransfer(this);
                } else {
                    self.pollPending--;
                    if (self.pollPending == 0) {
                        self.emit("end");
                    }
                }
            }
            function startTransfer(t) {
                try {
                    t.submit(new Buffer(self.pollTransferSize), transferDone);
                } catch (e) {
                    self.emit("error", e);
                    self.stopPoll();
                }
            }
            this.pollTransfers.forEach(startTransfer);
            self.pollPending = this.pollTransfers.length;
        };
        function OutEndpoint(device, descriptor) {
            Endpoint.call(this, device, descriptor);
        }
        exports.OutEndpoint = OutEndpoint;
        util.inherits(OutEndpoint, Endpoint);
        OutEndpoint.prototype.direction = "out";
        OutEndpoint.prototype.transfer = function(buffer, cb) {
            var self = this;
            if (!buffer) {
                buffer = new Buffer(0);
            } else if (!Buffer.isBuffer(buffer)) {
                buffer = new Buffer(buffer);
            }
            function callback(error, buf, actual) {
                if (cb) cb.call(self, error);
            }
            try {
                this.makeTransfer(this.timeout, callback).submit(buffer);
            } catch (e) {
                process.nextTick((function() {
                    callback(e);
                }));
            }
            return this;
        };
        OutEndpoint.prototype.transferWithZLP = function(buf, cb) {
            if (buf.length % this.descriptor.wMaxPacketSize == 0) {
                this.transfer(buf);
                this.transfer(new Buffer(0), cb);
            } else {
                this.transfer(buf, cb);
            }
        };
        var hotplugListeners = 0;
        exports.on("newListener", (function(name) {
            if (name !== "attach" && name !== "detach") return;
            if (++hotplugListeners === 1) {
                usb._enableHotplugEvents();
            }
        }));
        exports.on("removeListener", (function(name) {
            if (name !== "attach" && name !== "detach") return;
            if (--hotplugListeners === 0) {
                usb._disableHotplugEvents();
            }
        }));
    }, module => {
        "use strict";
        module.exports = {
            find: () => {}
        };
    }, module => {
        module.exports = require("./modules/@balena.io/usb/build/Release/usb_bindings.node");
    }, (module, exports, __webpack_require__) => {
        exports.formatArgs = formatArgs;
        exports.save = save;
        exports.load = load;
        exports.useColors = useColors;
        exports.storage = localstorage();
        exports.destroy = (() => {
            let warned = false;
            return () => {
                if (!warned) {
                    warned = true;
                    console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
                }
            };
        })();
        exports.colors = [ "#0000CC", "#0000FF", "#0033CC", "#0033FF", "#0066CC", "#0066FF", "#0099CC", "#0099FF", "#00CC00", "#00CC33", "#00CC66", "#00CC99", "#00CCCC", "#00CCFF", "#3300CC", "#3300FF", "#3333CC", "#3333FF", "#3366CC", "#3366FF", "#3399CC", "#3399FF", "#33CC00", "#33CC33", "#33CC66", "#33CC99", "#33CCCC", "#33CCFF", "#6600CC", "#6600FF", "#6633CC", "#6633FF", "#66CC00", "#66CC33", "#9900CC", "#9900FF", "#9933CC", "#9933FF", "#99CC00", "#99CC33", "#CC0000", "#CC0033", "#CC0066", "#CC0099", "#CC00CC", "#CC00FF", "#CC3300", "#CC3333", "#CC3366", "#CC3399", "#CC33CC", "#CC33FF", "#CC6600", "#CC6633", "#CC9900", "#CC9933", "#CCCC00", "#CCCC33", "#FF0000", "#FF0033", "#FF0066", "#FF0099", "#FF00CC", "#FF00FF", "#FF3300", "#FF3333", "#FF3366", "#FF3399", "#FF33CC", "#FF33FF", "#FF6600", "#FF6633", "#FF9900", "#FF9933", "#FFCC00", "#FFCC33" ];
        function useColors() {
            if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
                return true;
            }
            if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
                return false;
            }
            return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
        }
        function formatArgs(args) {
            args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
            if (!this.useColors) {
                return;
            }
            const c = "color: " + this.color;
            args.splice(1, 0, c, "color: inherit");
            let index = 0;
            let lastC = 0;
            args[0].replace(/%[a-zA-Z%]/g, (match => {
                if (match === "%%") {
                    return;
                }
                index++;
                if (match === "%c") {
                    lastC = index;
                }
            }));
            args.splice(lastC, 0, c);
        }
        exports.log = console.debug || console.log || (() => {});
        function save(namespaces) {
            try {
                if (namespaces) {
                    exports.storage.setItem("debug", namespaces);
                } else {
                    exports.storage.removeItem("debug");
                }
            } catch (error) {}
        }
        function load() {
            let r;
            try {
                r = exports.storage.getItem("debug");
            } catch (error) {}
            if (!r && typeof process !== "undefined" && "env" in process) {
                r = process.env.DEBUG;
            }
            return r;
        }
        function localstorage() {
            try {
                return localStorage;
            } catch (error) {}
        }
        module.exports = __webpack_require__(64)(exports);
        const {formatters} = module.exports;
        formatters.j = function(v) {
            try {
                return JSON.stringify(v);
            } catch (error) {
                return "[UnexpectedJSONParseError]: " + error.message;
            }
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        function setup(env) {
            createDebug.debug = createDebug;
            createDebug.default = createDebug;
            createDebug.coerce = coerce;
            createDebug.disable = disable;
            createDebug.enable = enable;
            createDebug.enabled = enabled;
            createDebug.humanize = __webpack_require__(12);
            createDebug.destroy = destroy;
            Object.keys(env).forEach((key => {
                createDebug[key] = env[key];
            }));
            createDebug.names = [];
            createDebug.skips = [];
            createDebug.formatters = {};
            function selectColor(namespace) {
                let hash = 0;
                for (let i = 0; i < namespace.length; i++) {
                    hash = (hash << 5) - hash + namespace.charCodeAt(i);
                    hash |= 0;
                }
                return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
            }
            createDebug.selectColor = selectColor;
            function createDebug(namespace) {
                let prevTime;
                let enableOverride = null;
                function debug(...args) {
                    if (!debug.enabled) {
                        return;
                    }
                    const self = debug;
                    const curr = Number(new Date);
                    const ms = curr - (prevTime || curr);
                    self.diff = ms;
                    self.prev = prevTime;
                    self.curr = curr;
                    prevTime = curr;
                    args[0] = createDebug.coerce(args[0]);
                    if (typeof args[0] !== "string") {
                        args.unshift("%O");
                    }
                    let index = 0;
                    args[0] = args[0].replace(/%([a-zA-Z%])/g, ((match, format) => {
                        if (match === "%%") {
                            return "%";
                        }
                        index++;
                        const formatter = createDebug.formatters[format];
                        if (typeof formatter === "function") {
                            const val = args[index];
                            match = formatter.call(self, val);
                            args.splice(index, 1);
                            index--;
                        }
                        return match;
                    }));
                    createDebug.formatArgs.call(self, args);
                    const logFn = self.log || createDebug.log;
                    logFn.apply(self, args);
                }
                debug.namespace = namespace;
                debug.useColors = createDebug.useColors();
                debug.color = createDebug.selectColor(namespace);
                debug.extend = extend;
                debug.destroy = createDebug.destroy;
                Object.defineProperty(debug, "enabled", {
                    enumerable: true,
                    configurable: false,
                    get: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride,
                    set: v => {
                        enableOverride = v;
                    }
                });
                if (typeof createDebug.init === "function") {
                    createDebug.init(debug);
                }
                return debug;
            }
            function extend(namespace, delimiter) {
                const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
                newDebug.log = this.log;
                return newDebug;
            }
            function enable(namespaces) {
                createDebug.save(namespaces);
                createDebug.names = [];
                createDebug.skips = [];
                let i;
                const split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
                const len = split.length;
                for (i = 0; i < len; i++) {
                    if (!split[i]) {
                        continue;
                    }
                    namespaces = split[i].replace(/\*/g, ".*?");
                    if (namespaces[0] === "-") {
                        createDebug.skips.push(new RegExp("^" + namespaces.substr(1) + "$"));
                    } else {
                        createDebug.names.push(new RegExp("^" + namespaces + "$"));
                    }
                }
            }
            function disable() {
                const namespaces = [ ...createDebug.names.map(toNamespace), ...createDebug.skips.map(toNamespace).map((namespace => "-" + namespace)) ].join(",");
                createDebug.enable("");
                return namespaces;
            }
            function enabled(name) {
                if (name[name.length - 1] === "*") {
                    return true;
                }
                let i;
                let len;
                for (i = 0, len = createDebug.skips.length; i < len; i++) {
                    if (createDebug.skips[i].test(name)) {
                        return false;
                    }
                }
                for (i = 0, len = createDebug.names.length; i < len; i++) {
                    if (createDebug.names[i].test(name)) {
                        return true;
                    }
                }
                return false;
            }
            function toNamespace(regexp) {
                return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
            }
            function coerce(val) {
                if (val instanceof Error) {
                    return val.stack || val.message;
                }
                return val;
            }
            function destroy() {
                console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
            }
            createDebug.enable(createDebug.load());
            return createDebug;
        }
        module.exports = setup;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        module.exports = __webpack_require__(66);
    }, module => {
        module.exports = require("./modules/mountutils/build/Release/MountUtils.node");
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.SparseReadStream = void 0;
        const stream_1 = __webpack_require__(17);
        const aligned_lockable_buffer_1 = __webpack_require__(7);
        const shared_1 = __webpack_require__(55);
        class SparseReadStream extends stream_1.Readable {
            constructor({source, blocks, chunkSize, verify, generateChecksums, alignment, numBuffers = 2}) {
                super({
                    objectMode: true,
                    highWaterMark: numBuffers - 1
                });
                this.positionInBlock = 0;
                this.source = source;
                this.blocks = blocks;
                this.chunkSize = chunkSize;
                if (alignment !== undefined) {
                    this.alignedReadableState = new aligned_lockable_buffer_1.AlignedReadableState(chunkSize, alignment, numBuffers);
                }
                this.stateIterator = (0, shared_1.createSparseReaderStateIterator)(blocks, verify, generateChecksums);
                this.nextBlock();
            }
            async _read() {
                try {
                    this.push(await this.__read());
                } catch (error) {
                    this.emit("error", error);
                    this.push(null);
                }
            }
            nextBlock() {
                this.state = this.stateIterator.next().value;
                this.positionInBlock = 0;
            }
            async __read() {
                var _a;
                if (this.state === undefined) {
                    return null;
                }
                const length = Math.min(this.chunkSize, this.state.subBlock.length - this.positionInBlock);
                const buffer = this.alignedReadableState !== undefined ? this.alignedReadableState.getCurrentBuffer().slice(0, length) : Buffer.allocUnsafe(length);
                const unlock = (0, aligned_lockable_buffer_1.isAlignedLockableBuffer)(buffer) ? await buffer.lock() : undefined;
                try {
                    await this.source.read(buffer, 0, length, this.state.subBlock.offset + this.positionInBlock);
                    (_a = this.state.hasher) === null || _a === void 0 ? void 0 : _a.update(buffer);
                } finally {
                    unlock === null || unlock === void 0 ? void 0 : unlock();
                }
                const chunk = {
                    buffer,
                    position: this.state.subBlock.offset + this.positionInBlock
                };
                this.positionInBlock += length;
                if (this.positionInBlock === this.state.subBlock.length) {
                    this.nextBlock();
                }
                return chunk;
            }
        }
        exports.SparseReadStream = SparseReadStream;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.ConfiguredSource = exports.SourceDisk = void 0;
        const balena_image_fs_1 = __webpack_require__(69);
        const _debug = __webpack_require__(90);
        const file_disk_1 = __webpack_require__(29);
        const partitioninfo_1 = __webpack_require__(28);
        const constants_1 = __webpack_require__(3);
        const errors_1 = __webpack_require__(4);
        const shared_1 = __webpack_require__(55);
        const sparse_filter_stream_1 = __webpack_require__(54);
        const sparse_read_stream_1 = __webpack_require__(67);
        const block_device_1 = __webpack_require__(92);
        const source_source_1 = __webpack_require__(24);
        const configure_1 = __webpack_require__(101);
        const debug = _debug("etcher-sdk:configured-source");
        class SourceDisk extends file_disk_1.Disk {
            constructor(source) {
                super(true, true, true, true);
                this.source = source;
                if (source instanceof block_device_1.BlockDevice && source.oDirect) {
                    throw new Error("Can't create a SourceDisk from a BlockDevice opened with O_DIRECT");
                }
            }
            async _getCapacity() {
                const size = (await this.source.getMetadata()).size;
                if (size === undefined) {
                    throw new errors_1.NotCapable;
                }
                return size;
            }
            async _read(buffer, bufferOffset, length, fileOffset) {
                return await this.source.read(buffer, bufferOffset, length, fileOffset);
            }
            async _write(_buffer, _bufferOffset, _length, _fileOffset) {
                throw new Error("Can't write to a SourceDisk");
            }
            async _flush() {}
        }
        exports.SourceDisk = SourceDisk;
        class ConfiguredSource extends source_source_1.SourceSource {
            constructor({source, shouldTrimPartitions, createStreamFromDisk, configure, checksumType = "xxhash3", chunkSize = constants_1.CHUNK_SIZE}) {
                super(source);
                this.shouldTrimPartitions = shouldTrimPartitions;
                this.createStreamFromDisk = createStreamFromDisk;
                this.checksumType = checksumType;
                this.chunkSize = chunkSize;
                this.disk = new SourceDisk(source);
                if (configure === "legacy") {
                    this.configure = configure_1.configure;
                } else {
                    this.configure = configure;
                }
            }
            async getBlocks() {
                const blocks = await this.disk.getRanges(this.chunkSize);
                if (blocks.length) {
                    const lastBlock = blocks[blocks.length - 1];
                    const metadata = await this.source.getMetadata();
                    const overflow = lastBlock.offset + lastBlock.length - metadata.size;
                    if (overflow > 0) {
                        lastBlock.length -= overflow;
                    }
                }
                return blocks.map((block => ({
                    blocks: [ block ]
                })));
            }
            async getBlocksWithChecksumType(generateChecksums) {
                let blocks = await this.getBlocks();
                if (generateChecksums) {
                    blocks = blocks.map((block => ({
                        ...block,
                        checksumType: this.checksumType
                    })));
                }
                return blocks;
            }
            async canRead() {
                return true;
            }
            async canCreateReadStream() {
                return true;
            }
            async canCreateSparseReadStream() {
                return true;
            }
            async read(buffer, bufferOffset, length, sourceOffset) {
                return await this.disk.read(buffer, bufferOffset, length, sourceOffset);
            }
            async createReadStream(options) {
                const imageStream = await this.source.createReadStream(options);
                const transform = this.disk.getTransformStream();
                imageStream.on("error", (err => {
                    transform.emit("error", err);
                }));
                imageStream.pipe(transform);
                return transform;
            }
            async createSparseReadStreamFromDisk(generateChecksums, alignment, numBuffers = 2) {
                return new sparse_read_stream_1.SparseReadStream({
                    source: this,
                    blocks: await this.getBlocksWithChecksumType(generateChecksums),
                    chunkSize: constants_1.CHUNK_SIZE,
                    verify: false,
                    generateChecksums,
                    alignment,
                    numBuffers
                });
            }
            async createSparseReadStreamFromStream(generateChecksums, alignment, numBuffers = 2) {
                const stream = await this.createReadStream({
                    alignment,
                    numBuffers
                });
                const transform = new sparse_filter_stream_1.SparseFilterStream({
                    blocks: await this.getBlocksWithChecksumType(generateChecksums),
                    verify: false,
                    generateChecksums
                });
                stream.on("error", transform.emit.bind(transform, "error"));
                stream.pipe(transform);
                return transform;
            }
            async createSparseReadStream({generateChecksums = false, alignment, numBuffers = 2} = {}) {
                if (this.createStreamFromDisk) {
                    return await this.createSparseReadStreamFromDisk(generateChecksums, alignment, numBuffers);
                } else {
                    return await this.createSparseReadStreamFromStream(generateChecksums, alignment, numBuffers);
                }
            }
            async _getMetadata() {
                const sourceMetadata = await this.source.getMetadata();
                const blocks = await this.getBlocks();
                const blockmappedSize = (0, shared_1.blocksLength)(blocks);
                return {
                    ...sourceMetadata,
                    blocks,
                    blockmappedSize
                };
            }
            async trimPartitions() {
                let partitions;
                try {
                    ({partitions} = await (0, partitioninfo_1.getPartitions)(this.disk, {
                        includeExtended: false
                    }));
                } catch (error) {
                    debug("Couldn't read partition table", error);
                    return;
                }
                for (const partition of partitions) {
                    try {
                        await (0, balena_image_fs_1.interact)(this.disk, partition.index, (async fs => {
                            if (fs.trim !== undefined) {
                                await fs.trim();
                            }
                        }));
                    } catch (_a) {}
                }
                const discards = this.disk.getDiscardedChunks();
                const discardedBytes = discards.map((d => d.end - d.start + 1)).reduce(((a, b) => a + b), 0);
                const metadata = await this.getMetadata();
                if (metadata.size !== undefined) {
                    const percentage = Math.round(discardedBytes / metadata.size * 100);
                    debug(`discarded ${discards.length} chunks, ${discardedBytes} bytes, ${percentage}% of the image`);
                }
            }
            async _open() {
                await super._open();
                if (this.configure !== undefined) {
                    await this.configure(this.disk);
                }
                if (this.shouldTrimPartitions) {
                    await this.trimPartitions();
                }
                this.disk.recordReads = false;
            }
            async _close() {
                await super._close();
            }
        }
        exports.ConfiguredSource = ConfiguredSource;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.interact = void 0;
        const ext2fs = __webpack_require__(70);
        const fatfs = __webpack_require__(80);
        const file_disk_1 = __webpack_require__(29);
        const partitioninfo = __webpack_require__(28);
        const typed_error_1 = __webpack_require__(51);
        class MountError extends typed_error_1.TypedError {}
        const SECTOR_SIZE = 512;
        async function runInFat(disk, offset, size, fn) {
            function sectorPosition(sector) {
                return offset + sector * SECTOR_SIZE;
            }
            const fat = fatfs.createFileSystem({
                sectorSize: SECTOR_SIZE,
                numSectors: size / SECTOR_SIZE,
                readSectors: async (sector, dest, callback) => {
                    try {
                        const {bytesRead, buffer} = await disk.read(dest, 0, dest.length, sectorPosition(sector));
                        callback(null, bytesRead, buffer);
                    } catch (e) {
                        callback(e);
                    }
                },
                writeSectors: async (sector, data, callback) => {
                    try {
                        const {bytesWritten, buffer} = await disk.write(data, 0, data.length, sectorPosition(sector));
                        callback(null, bytesWritten, buffer);
                    } catch (e) {
                        callback(e);
                    }
                }
            });
            await new Promise((function(resolve, reject) {
                fat.on("error", (e => {
                    reject(new MountError(e));
                }));
                fat.on("ready", resolve);
            }));
            return await fn(fat);
        }
        async function runInExt(disk, offset, fn) {
            let fs;
            try {
                fs = await ext2fs.mount(disk, offset);
            } catch (e) {
                throw new MountError(e);
            }
            try {
                return await fn(fs);
            } finally {
                await ext2fs.umount(fs);
            }
        }
        async function tryInteract(disk, offset, size, fn) {
            try {
                return await runInFat(disk, offset, size, fn);
            } catch (e) {
                if (!(e instanceof MountError)) {
                    throw e;
                }
                try {
                    return await runInExt(disk, offset, fn);
                } catch (e2) {
                    if (!(e2 instanceof MountError)) {
                        throw e2;
                    }
                    throw new Error("Unsupported filesystem.");
                }
            }
        }
        async function getPartitionOffset(disk, partition) {
            if (partition === undefined) {
                const size = await disk.getCapacity();
                return {
                    offset: 0,
                    size
                };
            } else {
                return await partitioninfo.get(disk, partition);
            }
        }
        async function diskInteract(disk, partition, fn) {
            const {offset, size} = await getPartitionOffset(disk, partition);
            return await tryInteract(disk, offset, size, fn);
        }
        async function interact(disk, partition, fn) {
            if (typeof disk === "string") {
                return await file_disk_1.withOpenFile(disk, "r+", (async handle => {
                    disk = new file_disk_1.FileDisk(handle);
                    return await diskInteract(disk, partition, fn);
                }));
            } else if (disk instanceof file_disk_1.Disk) {
                return await diskInteract(disk, partition, fn);
            } else {
                throw new Error("image must be a String (file path) or a Disk instance");
            }
        }
        exports.interact = interact;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        module.exports = __webpack_require__(71);
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        const {DiskWrapper} = __webpack_require__(72);
        const createFs = __webpack_require__(73);
        const Module = __webpack_require__(75);
        const {ccallThrowAsync} = __webpack_require__(77);
        const ready = new Promise((resolve => {
            Module.onRuntimeInitialized = resolve;
        }));
        exports.mount = async function(disk, offset = 0) {
            await ready;
            const wrapper = new DiskWrapper(disk, offset);
            const diskId = Module.setObject(wrapper);
            let fsPointer;
            try {
                fsPointer = await ccallThrowAsync("node_ext2fs_mount", "number", [ "number" ], [ diskId ]);
            } catch (error) {
                Module.deleteObject(diskId);
                throw error;
            }
            const fs = createFs(fsPointer);
            fs.trim = async () => {
                await ccallThrowAsync("node_ext2fs_trim", "number", [ "number" ], [ fsPointer ]);
            };
            fs.diskId = diskId;
            return fs;
        };
        exports.umount = async function(fs) {
            await fs.closeAllFileDescriptors();
            await ccallThrowAsync("node_ext2fs_umount", "number", [ "number" ], [ fs.fsPointer ]);
            Module.deleteObject(fs.diskId);
        };
        exports.withMountedDisk = async function(disk, offset, fn) {
            const fs = await exports.mount(disk, offset);
            try {
                return await fn(fs);
            } finally {
                await exports.umount(fs);
            }
        };
    }, (__unused_webpack_module, exports) => {
        "use strict";
        class DiskWrapper {
            constructor(disk, offset = 0) {
                this.disk = disk;
                this.offset = offset;
            }
            async read(buffer, bufferOffset, length, fileOffset) {
                return await this.disk.read(buffer, bufferOffset, length, fileOffset + this.offset);
            }
            async write(buffer, bufferOffset, length, fileOffset) {
                return await this.disk.write(buffer, bufferOffset, length, fileOffset + this.offset);
            }
            async discard(offset, length) {
                return await this.disk.discard(offset + this.offset, length);
            }
            async flush() {
                return await this.disk.flush();
            }
        }
        exports.DiskWrapper = DiskWrapper;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        const constants = {
            O_RDONLY: 0,
            O_WRONLY: 1,
            O_RDWR: 2,
            S_IFMT: 61440,
            S_IFREG: 32768,
            S_IFDIR: 16384,
            S_IFCHR: 8192,
            S_IFBLK: 24576,
            S_IFIFO: 4096,
            S_IFLNK: 40960,
            S_IFSOCK: 49152,
            O_CREAT: 64,
            O_EXCL: 128,
            O_NOCTTY: 256,
            O_TRUNC: 512,
            O_APPEND: 1024,
            O_DIRECTORY: 65536,
            O_NOATIME: 262144,
            O_NOFOLLOW: 131072,
            O_SYNC: 1052672,
            O_DIRECT: 16384,
            O_NONBLOCK: 2048,
            S_IRWXU: 448,
            S_IRUSR: 256,
            S_IWUSR: 128,
            S_IXUSR: 64,
            S_IRWXG: 56,
            S_IRGRP: 32,
            S_IWGRP: 16,
            S_IXGRP: 8,
            S_IRWXO: 7,
            S_IROTH: 4,
            S_IWOTH: 2,
            S_IXOTH: 1,
            F_OK: 0,
            R_OK: 4,
            W_OK: 2,
            X_OK: 1
        };
        function assertEncoding(encoding) {
            if (encoding && !Buffer.isEncoding(encoding)) {
                throw new Error(`Unknown encoding: ${encoding}`);
            }
        }
        function stringToFlags(flag) {
            if (typeof flag === "number") {
                return flag;
            }
            switch (flag) {
              case "r":
                return constants.O_RDONLY;

              case "rs":
              case "sr":
                return constants.O_RDONLY | constants.O_SYNC;

              case "r+":
                return constants.O_RDWR;

              case "rs+":
              case "sr+":
                return constants.O_RDWR | constants.O_SYNC;

              case "w":
                return constants.O_TRUNC | constants.O_CREAT | constants.O_WRONLY;

              case "wx":
              case "xw":
                return constants.O_TRUNC | constants.O_CREAT | constants.O_WRONLY | constants.O_EXCL;

              case "w+":
                return constants.O_TRUNC | constants.O_CREAT | constants.O_RDWR;

              case "wx+":
              case "xw+":
                return constants.O_TRUNC | constants.O_CREAT | constants.O_RDWR | constants.O_EXCL;

              case "a":
                return constants.O_APPEND | constants.O_CREAT | constants.O_WRONLY;

              case "ax":
              case "xa":
                return constants.O_APPEND | constants.O_CREAT | constants.O_WRONLY | constants.O_EXCL;

              case "a+":
                return constants.O_APPEND | constants.O_CREAT | constants.O_RDWR;

              case "ax+":
              case "xa+":
                return constants.O_APPEND | constants.O_CREAT | constants.O_RDWR | constants.O_EXCL;
            }
            throw new Error("Unknown file open flag: " + flag);
        }
        module.exports = function(fsPointer) {
            const util = __webpack_require__(58);
            const pathModule = __webpack_require__(15);
            const binding = __webpack_require__(74)(constants, fsPointer);
            const fs = {};
            fs.fsPointer = fsPointer;
            fs.closeAllFileDescriptors = binding.closeAllFileDescriptors;
            fs.openFiles = binding.openFiles;
            const Buffer = __webpack_require__(79).Buffer;
            const Stream = __webpack_require__(17).Stream;
            const FSReqWrap = binding.FSReqWrap;
            Object.defineProperty(fs, "constants", {
                configurable: false,
                enumerable: true,
                value: constants
            });
            const Readable = Stream.Readable;
            const Writable = Stream.Writable;
            const kMinPoolSpace = 128;
            const kMaxLength = __webpack_require__(79).kMaxLength;
            const isWindows = false;
            const DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
            function getOptions(options, defaultOptions) {
                if (options === null || options === undefined || typeof options === "function") {
                    return defaultOptions;
                }
                if (typeof options === "string") {
                    defaultOptions = util._extend({}, defaultOptions);
                    defaultOptions.encoding = options;
                    options = defaultOptions;
                } else if (typeof options !== "object") {
                    throw new TypeError('"options" must be a string or an object, got ' + typeof options + " instead.");
                }
                if (options.encoding !== "buffer") assertEncoding(options.encoding);
                return options;
            }
            function copyObject(source) {
                const target = {};
                for (const key in source) target[key] = source[key];
                return target;
            }
            function rethrow() {
                process.emitWarning("Calling an asynchronous function without callback is deprecated.", "DeprecationWarning", rethrow);
                if (DEBUG) {
                    var backtrace = new Error;
                    return function(err) {
                        if (err) {
                            backtrace.stack = err.name + ": " + err.message + backtrace.stack.substr(backtrace.name.length);
                            throw backtrace;
                        }
                    };
                }
                return function(err) {
                    if (err) {
                        throw err;
                    }
                };
            }
            function maybeCallback(cb) {
                return typeof cb === "function" ? cb : rethrow();
            }
            function makeCallback(cb) {
                if (cb === undefined) {
                    return rethrow();
                }
                if (typeof cb !== "function") {
                    throw new TypeError('"callback" argument must be a function');
                }
                return function() {
                    return cb.apply(null, arguments);
                };
            }
            function nullCheck(path, callback) {
                if (("" + path).indexOf("\0") !== -1) {
                    var er = new Error("Path must be a string without null bytes");
                    er.code = "ENOENT";
                    if (typeof callback !== "function") throw er;
                    process.nextTick(callback, er);
                    return false;
                }
                return true;
            }
            function isFd(path) {
                return path >>> 0 === path;
            }
            fs.Stats = function(dev, mode, nlink, uid, gid, rdev, blksize, ino, size, blocks, atim_msec, mtim_msec, ctim_msec, birthtim_msec) {
                this.dev = dev;
                this.mode = mode;
                this.nlink = nlink;
                this.uid = uid;
                this.gid = gid;
                this.rdev = rdev;
                this.blksize = blksize;
                this.ino = ino;
                this.size = size;
                this.blocks = blocks;
                this.atime = new Date(atim_msec);
                this.mtime = new Date(mtim_msec);
                this.ctime = new Date(ctim_msec);
                this.birthtime = new Date(birthtim_msec);
            };
            binding.FSInitialize(fs.Stats);
            fs.Stats.prototype._checkModeProperty = function(property) {
                return (this.mode & constants.S_IFMT) === property;
            };
            fs.Stats.prototype.isDirectory = function() {
                return this._checkModeProperty(constants.S_IFDIR);
            };
            fs.Stats.prototype.isFile = function() {
                return this._checkModeProperty(constants.S_IFREG);
            };
            fs.Stats.prototype.isBlockDevice = function() {
                return this._checkModeProperty(constants.S_IFBLK);
            };
            fs.Stats.prototype.isCharacterDevice = function() {
                return this._checkModeProperty(constants.S_IFCHR);
            };
            fs.Stats.prototype.isSymbolicLink = function() {
                return this._checkModeProperty(constants.S_IFLNK);
            };
            fs.Stats.prototype.isFIFO = function() {
                return this._checkModeProperty(constants.S_IFIFO);
            };
            fs.Stats.prototype.isSocket = function() {
                return this._checkModeProperty(constants.S_IFSOCK);
            };
            [ "F_OK", "R_OK", "W_OK", "X_OK" ].forEach((function(key) {
                Object.defineProperty(fs, key, {
                    enumerable: true,
                    value: constants[key] || 0,
                    writable: false
                });
            }));
            fs.access = function(path, mode, callback) {
                if (typeof mode === "function") {
                    callback = mode;
                    mode = fs.F_OK;
                } else if (typeof callback !== "function") {
                    throw new TypeError('"callback" argument must be a function');
                }
                if (!nullCheck(path, callback)) return;
                mode = mode | 0;
                var req = new FSReqWrap;
                req.oncomplete = makeCallback(callback);
                binding.access(path, mode, req);
            };
            fs.exists = function(path, callback) {
                if (!nullCheck(path, cb)) return;
                var req = new FSReqWrap;
                req.oncomplete = cb;
                binding.stat(path, req);
                function cb(err, stats) {
                    if (callback) callback(err ? false : true);
                }
            };
            fs.readFile = function(path, options, callback) {
                callback = maybeCallback(arguments[arguments.length - 1]);
                options = getOptions(options, {
                    flag: "r"
                });
                if (!nullCheck(path, callback)) return;
                var context = new ReadFileContext(callback, options.encoding);
                context.isUserFd = isFd(path);
                var req = new FSReqWrap;
                req.context = context;
                req.oncomplete = readFileAfterOpen;
                if (context.isUserFd) {
                    process.nextTick((function() {
                        req.oncomplete(null, path);
                    }));
                    return;
                }
                binding.open(path, stringToFlags(options.flag || "r"), 438, req);
            };
            const kReadFileBufferLength = 8 * 1024;
            function ReadFileContext(callback, encoding) {
                this.fd = undefined;
                this.isUserFd = undefined;
                this.size = undefined;
                this.callback = callback;
                this.buffers = null;
                this.buffer = null;
                this.pos = 0;
                this.encoding = encoding;
                this.err = null;
            }
            ReadFileContext.prototype.read = function() {
                var buffer;
                var offset;
                var length;
                if (this.size === 0) {
                    buffer = this.buffer = Buffer.allocUnsafeSlow(kReadFileBufferLength);
                    offset = 0;
                    length = kReadFileBufferLength;
                } else {
                    buffer = this.buffer;
                    offset = this.pos;
                    length = this.size - this.pos;
                }
                var req = new FSReqWrap;
                req.oncomplete = readFileAfterRead;
                req.context = this;
                binding.read(this.fd, buffer, offset, length, -1, req);
            };
            ReadFileContext.prototype.close = function(err) {
                var req = new FSReqWrap;
                req.oncomplete = readFileAfterClose;
                req.context = this;
                this.err = err;
                if (this.isUserFd) {
                    process.nextTick((function() {
                        req.oncomplete(null);
                    }));
                    return;
                }
                binding.close(this.fd, req);
            };
            function readFileAfterOpen(err, fd) {
                var context = this.context;
                if (err) {
                    context.callback(err);
                    return;
                }
                context.fd = fd;
                var req = new FSReqWrap;
                req.oncomplete = readFileAfterStat;
                req.context = context;
                binding.fstat(fd, req);
            }
            function readFileAfterStat(err, st) {
                var context = this.context;
                if (err) return context.close(err);
                var size = context.size = st.isFile() ? st.size : 0;
                if (size === 0) {
                    context.buffers = [];
                    context.read();
                    return;
                }
                if (size > kMaxLength) {
                    err = new RangeError("File size is greater than possible Buffer: " + `0x${kMaxLength.toString(16)} bytes`);
                    return context.close(err);
                }
                context.buffer = Buffer.allocUnsafeSlow(size);
                context.read();
            }
            function readFileAfterRead(err, bytesRead) {
                var context = this.context;
                if (err) return context.close(err);
                if (bytesRead === 0) return context.close();
                context.pos += bytesRead;
                if (context.size !== 0) {
                    if (context.pos === context.size) context.close(); else context.read();
                } else {
                    context.buffers.push(context.buffer.slice(0, bytesRead));
                    context.read();
                }
            }
            function readFileAfterClose(err) {
                var context = this.context;
                var buffer = null;
                var callback = context.callback;
                if (context.err) return callback(context.err);
                if (context.size === 0) buffer = Buffer.concat(context.buffers, context.pos); else if (context.pos < context.size) buffer = context.buffer.slice(0, context.pos); else buffer = context.buffer;
                if (err) return callback(err, buffer);
                if (context.encoding) {
                    return tryToString(buffer, context.encoding, callback);
                }
                callback(null, buffer);
            }
            function tryToString(buf, encoding, callback) {
                var e = null;
                try {
                    buf = buf.toString(encoding);
                } catch (err) {
                    e = err;
                }
                callback(e, buf);
            }
            fs.close = function(fd, callback) {
                var req = new FSReqWrap;
                req.oncomplete = makeCallback(callback);
                binding.close(fd, req);
            };
            function modeNum(m, def) {
                if (typeof m === "number") return m;
                if (typeof m === "string") return parseInt(m, 8);
                if (def) return modeNum(def);
                return undefined;
            }
            fs.open = function(path, flags, mode, callback_) {
                var callback = makeCallback(arguments[arguments.length - 1]);
                mode = modeNum(mode, 438);
                if (!nullCheck(path, callback)) return;
                var req = new FSReqWrap;
                req.oncomplete = callback;
                binding.open(path, stringToFlags(flags), mode, req);
            };
            var readWarned = false;
            fs.read = function(fd, buffer, offset, length, position, callback) {
                if (!(buffer instanceof Buffer)) {
                    if (!readWarned) {
                        readWarned = true;
                        process.emitWarning("fs.read's legacy String interface is deprecated. Use the Buffer " + "API as mentioned in the documentation instead.", "DeprecationWarning");
                    }
                    const cb = arguments[4];
                    const encoding = arguments[3];
                    assertEncoding(encoding);
                    position = arguments[2];
                    length = arguments[1];
                    buffer = Buffer.allocUnsafe(length);
                    offset = 0;
                    callback = function(err, bytesRead) {
                        if (!cb) return;
                        if (err) return cb(err);
                        if (bytesRead > 0) {
                            tryToStringWithEnd(buffer, encoding, bytesRead, cb);
                        } else {
                            cb(err, "", bytesRead);
                        }
                    };
                }
                if (length === 0) {
                    return process.nextTick((function() {
                        callback && callback(null, 0, buffer);
                    }));
                }
                function wrapper(err, bytesRead) {
                    callback && callback(err, bytesRead || 0, buffer);
                }
                var req = new FSReqWrap;
                req.oncomplete = wrapper;
                binding.read(fd, buffer, offset, length, position, req);
            };
            function tryToStringWithEnd(buf, encoding, end, callback) {
                var e;
                try {
                    buf = buf.toString(encoding, 0, end);
                } catch (err) {
                    e = err;
                }
                callback(e, buf, end);
            }
            fs.write = function(fd, buffer, offset, length, position, callback) {
                function wrapper(err, written) {
                    callback(err, written || 0, buffer);
                }
                var req = new FSReqWrap;
                req.oncomplete = wrapper;
                if (buffer instanceof Buffer) {
                    callback = maybeCallback(callback || position || length || offset);
                    if (typeof offset !== "number") {
                        offset = 0;
                    }
                    if (typeof length !== "number") {
                        length = buffer.length - offset;
                    }
                    if (typeof position !== "number") {
                        position = null;
                    }
                    return binding.writeBuffer(fd, buffer, offset, length, position, req);
                }
                if (typeof buffer !== "string") buffer += "";
                if (typeof position !== "function") {
                    if (typeof offset === "function") {
                        position = offset;
                        offset = null;
                    } else {
                        position = length;
                    }
                    length = "utf8";
                }
                callback = maybeCallback(position);
                return binding.writeString(fd, buffer, offset, length, req);
            };
            fs.rename = function(oldPath, newPath, callback) {
                callback = makeCallback(callback);
                if (!nullCheck(oldPath, callback)) return;
                if (!nullCheck(newPath, callback)) return;
                var req = new FSReqWrap;
                req.oncomplete = callback;
                binding.rename(path, path, req);
            };
            fs.truncate = function(path, len, callback) {
                if (typeof path === "number") {
                    return fs.ftruncate(path, len, callback);
                }
                if (typeof len === "function") {
                    callback = len;
                    len = 0;
                } else if (len === undefined) {
                    len = 0;
                }
                callback = maybeCallback(callback);
                fs.open(path, "r+", (function(er, fd) {
                    if (er) return callback(er);
                    var req = new FSReqWrap;
                    req.oncomplete = function oncomplete(er) {
                        fs.close(fd, (function(er2) {
                            callback(er || er2);
                        }));
                    };
                    binding.ftruncate(fd, len, req);
                }));
            };
            fs.ftruncate = function(fd, len, callback) {
                if (typeof len === "function") {
                    callback = len;
                    len = 0;
                } else if (len === undefined) {
                    len = 0;
                }
                var req = new FSReqWrap;
                req.oncomplete = makeCallback(callback);
                binding.ftruncate(fd, len, req);
            };
            fs.rmdir = function(path, callback) {
                callback = maybeCallback(callback);
                if (!nullCheck(path, callback)) return;
                var req = new FSReqWrap;
                req.oncomplete = callback;
                binding.rmdir(path, req);
            };
            fs.fdatasync = function(fd, callback) {
                var req = new FSReqWrap;
                req.oncomplete = makeCallback(callback);
                binding.fdatasync(fd, req);
            };
            fs.fsync = function(fd, callback) {
                var req = new FSReqWrap;
                req.oncomplete = makeCallback(callback);
                binding.fsync(fd, req);
            };
            fs.mkdir = function(path, mode, callback) {
                if (typeof mode === "function") callback = mode;
                callback = makeCallback(callback);
                if (!nullCheck(path, callback)) return;
                var req = new FSReqWrap;
                req.oncomplete = callback;
                binding.mkdir(path, modeNum(mode, 511), req);
            };
            fs.readdir = function(path, options, callback) {
                callback = makeCallback(typeof options === "function" ? options : callback);
                options = getOptions(options, {});
                if (!nullCheck(path, callback)) return;
                var req = new FSReqWrap;
                req.oncomplete = callback;
                binding.readdir(path, options.encoding, req);
            };
            fs.fstat = function(fd, callback) {
                var req = new FSReqWrap;
                req.oncomplete = makeCallback(callback);
                binding.fstat(fd, req);
            };
            fs.lstat = function(path, callback) {
                callback = makeCallback(callback);
                if (!nullCheck(path, callback)) return;
                var req = new FSReqWrap;
                req.oncomplete = callback;
                binding.lstat(path, req);
            };
            fs.stat = function(path, callback) {
                callback = makeCallback(callback);
                if (!nullCheck(path, callback)) return;
                var req = new FSReqWrap;
                req.oncomplete = callback;
                binding.stat(path, req);
            };
            fs.readlink = function(path, options, callback) {
                callback = makeCallback(typeof options === "function" ? options : callback);
                options = getOptions(options, {});
                if (!nullCheck(path, callback)) return;
                var req = new FSReqWrap;
                req.oncomplete = callback;
                binding.readlink(path, options.encoding, req);
            };
            function preprocessSymlinkDestination(path, type, linkPath) {
                if (!isWindows) {
                    return path;
                } else if (type === "junction") {
                    path = pathModule.resolve(linkPath, "..", path);
                    return path;
                } else {
                    return ("" + path).replace(/\//g, "\\");
                }
            }
            fs.symlink = function(target, path, type_, callback_) {
                var type = typeof type_ === "string" ? type_ : null;
                var callback = makeCallback(arguments[arguments.length - 1]);
                if (!nullCheck(target, callback)) return;
                if (!nullCheck(path, callback)) return;
                var req = new FSReqWrap;
                req.oncomplete = callback;
                binding.symlink(preprocessSymlinkDestination(target, type, path), path, type, req);
            };
            fs.link = function(existingPath, newPath, callback) {
                callback = makeCallback(callback);
                if (!nullCheck(existingPath, callback)) return;
                if (!nullCheck(newPath, callback)) return;
                var req = new FSReqWrap;
                req.oncomplete = callback;
                binding.link(path, path, req);
            };
            fs.unlink = function(path, callback) {
                callback = makeCallback(callback);
                if (!nullCheck(path, callback)) return;
                var req = new FSReqWrap;
                req.oncomplete = callback;
                binding.unlink(path, req);
            };
            fs.fchmod = function(fd, mode, callback) {
                var req = new FSReqWrap;
                req.oncomplete = makeCallback(callback);
                binding.fchmod(fd, modeNum(mode), req);
            };
            if (constants.O_SYMLINK !== undefined) {
                fs.lchmod = function(path, mode, callback) {
                    callback = maybeCallback(callback);
                    fs.open(path, constants.O_WRONLY | constants.O_SYMLINK, (function(err, fd) {
                        if (err) {
                            callback(err);
                            return;
                        }
                        fs.fchmod(fd, mode, (function(err) {
                            fs.close(fd, (function(err2) {
                                callback(err || err2);
                            }));
                        }));
                    }));
                };
            }
            fs.chmod = function(path, mode, callback) {
                callback = makeCallback(callback);
                if (!nullCheck(path, callback)) return;
                var req = new FSReqWrap;
                req.oncomplete = callback;
                binding.chmod(path, modeNum(mode), req);
            };
            if (constants.O_SYMLINK !== undefined) {
                fs.lchown = function(path, uid, gid, callback) {
                    callback = maybeCallback(callback);
                    fs.open(path, constants.O_WRONLY | constants.O_SYMLINK, (function(err, fd) {
                        if (err) {
                            callback(err);
                            return;
                        }
                        fs.fchown(fd, uid, gid, callback);
                    }));
                };
            }
            fs.fchown = function(fd, uid, gid, callback) {
                var req = new FSReqWrap;
                req.oncomplete = makeCallback(callback);
                binding.fchown(fd, uid, gid, req);
            };
            fs.chown = function(path, uid, gid, callback) {
                callback = makeCallback(callback);
                if (!nullCheck(path, callback)) return;
                var req = new FSReqWrap;
                req.oncomplete = callback;
                binding.chown(path, uid, gid, req);
            };
            function toUnixTimestamp(time) {
                if (typeof time === "string" && +time == time) {
                    return +time;
                }
                if (typeof time === "number") {
                    if (!Number.isFinite(time) || time < 0) {
                        return Date.now() / 1e3;
                    }
                    return time;
                }
                if (util.isDate(time)) {
                    return time.getTime() / 1e3;
                }
                throw new Error("Cannot parse time: " + time);
            }
            fs._toUnixTimestamp = toUnixTimestamp;
            fs.utimes = function(path, atime, mtime, callback) {
                callback = makeCallback(callback);
                if (!nullCheck(path, callback)) return;
                var req = new FSReqWrap;
                req.oncomplete = callback;
                binding.utimes(path, toUnixTimestamp(atime), toUnixTimestamp(mtime), req);
            };
            fs.futimes = function(fd, atime, mtime, callback) {
                atime = toUnixTimestamp(atime);
                mtime = toUnixTimestamp(mtime);
                var req = new FSReqWrap;
                req.oncomplete = makeCallback(callback);
                binding.futimes(fd, atime, mtime, req);
            };
            function writeAll(fd, isUserFd, buffer, offset, length, position, callback_) {
                var callback = maybeCallback(arguments[arguments.length - 1]);
                fs.write(fd, buffer, offset, length, position, (function(writeErr, written) {
                    if (writeErr) {
                        if (isUserFd) {
                            callback(writeErr);
                        } else {
                            fs.close(fd, (function() {
                                callback(writeErr);
                            }));
                        }
                    } else {
                        if (written === length) {
                            if (isUserFd) {
                                callback(null);
                            } else {
                                fs.close(fd, callback);
                            }
                        } else {
                            offset += written;
                            length -= written;
                            if (position !== null) {
                                position += written;
                            }
                            writeAll(fd, isUserFd, buffer, offset, length, position, callback);
                        }
                    }
                }));
            }
            fs.writeFile = function(path, data, options, callback) {
                callback = maybeCallback(arguments[arguments.length - 1]);
                options = getOptions(options, {
                    encoding: "utf8",
                    mode: 438,
                    flag: "w"
                });
                const flag = options.flag || "w";
                if (isFd(path)) {
                    writeFd(path, true);
                    return;
                }
                fs.open(path, flag, options.mode, (function(openErr, fd) {
                    if (openErr) {
                        callback(openErr);
                    } else {
                        writeFd(fd, false);
                    }
                }));
                function writeFd(fd, isUserFd) {
                    var buffer = data instanceof Buffer ? data : Buffer.from("" + data, options.encoding || "utf8");
                    var position = /a/.test(flag) ? null : 0;
                    writeAll(fd, isUserFd, buffer, 0, buffer.length, position, callback);
                }
            };
            fs.appendFile = function(path, data, options, callback) {
                callback = maybeCallback(arguments[arguments.length - 1]);
                options = getOptions(options, {
                    encoding: "utf8",
                    mode: 438,
                    flag: "a"
                });
                options = copyObject(options);
                if (!options.flag || isFd(path)) options.flag = "a";
                fs.writeFile(path, data, options, callback);
            };
            const nextPartRe = isWindows ? /(.*?)(?:[/\\]+|$)/g : /(.*?)(?:[/]+|$)/g;
            const splitRootRe = isWindows ? /^(?:[a-zA-Z]:|[\\/]{2}[^\\/]+[\\/][^\\/]+)?[\\/]*/ : /^[/]*/;
            function encodeRealpathResult(result, options, err) {
                if (!options || !options.encoding || options.encoding === "utf8" || err) return result;
                const asBuffer = Buffer.from(result);
                if (options.encoding === "buffer") {
                    return asBuffer;
                } else {
                    return asBuffer.toString(options.encoding);
                }
            }
            fs.realpath = function realpath(p, options, callback) {
                callback = maybeCallback(typeof options === "function" ? options : callback);
                options = getOptions(options, {});
                if (!nullCheck(p, callback)) return;
                p = p.toString("utf8");
                p = pathModule.resolve(p);
                const seenLinks = {};
                const knownHard = {};
                var pos;
                var current;
                var base;
                var previous;
                start();
                function start() {
                    var m = splitRootRe.exec(p);
                    pos = m[0].length;
                    current = m[0];
                    base = m[0];
                    previous = "";
                    if (isWindows && !knownHard[base]) {
                        fs.lstat(base, (function(err) {
                            if (err) return callback(err);
                            knownHard[base] = true;
                            LOOP();
                        }));
                    } else {
                        process.nextTick(LOOP);
                    }
                }
                function LOOP() {
                    if (pos >= p.length) {
                        return callback(null, encodeRealpathResult(p, options));
                    }
                    nextPartRe.lastIndex = pos;
                    var result = nextPartRe.exec(p);
                    previous = current;
                    current += result[0];
                    base = previous + result[1];
                    pos = nextPartRe.lastIndex;
                    if (knownHard[base]) {
                        return process.nextTick(LOOP);
                    }
                    return fs.lstat(base, gotStat);
                }
                function gotStat(err, stat) {
                    if (err) return callback(err);
                    if (!stat.isSymbolicLink()) {
                        knownHard[base] = true;
                        return process.nextTick(LOOP);
                    }
                    let id;
                    if (!isWindows) {
                        id = `${stat.dev.toString(32)}:${stat.ino.toString(32)}`;
                        if (seenLinks.hasOwnProperty(id)) {
                            return gotTarget(null, seenLinks[id], base);
                        }
                    }
                    fs.stat(base, (function(err) {
                        if (err) return callback(err);
                        fs.readlink(base, (function(err, target) {
                            if (!isWindows) seenLinks[id] = target;
                            gotTarget(err, target);
                        }));
                    }));
                }
                function gotTarget(err, target, base) {
                    if (err) return callback(err);
                    var resolvedLink = pathModule.resolve(previous, target);
                    gotResolvedLink(resolvedLink);
                }
                function gotResolvedLink(resolvedLink) {
                    p = pathModule.resolve(resolvedLink, p.slice(pos));
                    start();
                }
            };
            fs.mkdtemp = function(prefix, options, callback) {
                callback = makeCallback(typeof options === "function" ? options : callback);
                options = getOptions(options, {});
                if (!prefix || typeof prefix !== "string") throw new TypeError("filename prefix is required");
                if (!nullCheck(prefix, callback)) {
                    return;
                }
                var req = new FSReqWrap;
                req.oncomplete = callback;
                binding.mkdtemp(prefix + "XXXXXX", options.encoding, req);
            };
            var pool;
            function allocNewPool(poolSize) {
                pool = Buffer.allocUnsafe(poolSize);
                pool.used = 0;
            }
            fs.createReadStream = function(path, options) {
                return new ReadStream(path, options);
            };
            util.inherits(ReadStream, Readable);
            fs.ReadStream = ReadStream;
            function ReadStream(path, options) {
                if (!(this instanceof ReadStream)) return new ReadStream(path, options);
                options = copyObject(getOptions(options, {}));
                if (options.highWaterMark === undefined) options.highWaterMark = 64 * 1024;
                Readable.call(this, options);
                this.path = path;
                this.fd = options.fd === undefined ? null : options.fd;
                this.flags = options.flags === undefined ? "r" : options.flags;
                this.mode = options.mode === undefined ? 438 : options.mode;
                this.start = options.start;
                this.end = options.end;
                this.autoClose = options.autoClose === undefined ? true : options.autoClose;
                this.pos = undefined;
                this.bytesRead = 0;
                if (this.start !== undefined) {
                    if (typeof this.start !== "number") {
                        throw new TypeError('"start" option must be a Number');
                    }
                    if (this.end === undefined) {
                        this.end = Infinity;
                    } else if (typeof this.end !== "number") {
                        throw new TypeError('"end" option must be a Number');
                    }
                    if (this.start > this.end) {
                        throw new Error('"start" option must be <= "end" option');
                    }
                    this.pos = this.start;
                }
                if (typeof this.fd !== "number") this.open();
                this.on("end", (function() {
                    if (this.autoClose) {
                        this.destroy();
                    }
                }));
            }
            fs.FileReadStream = fs.ReadStream;
            ReadStream.prototype.open = function() {
                var self = this;
                fs.open(this.path, this.flags, this.mode, (function(er, fd) {
                    if (er) {
                        if (self.autoClose) {
                            self.destroy();
                        }
                        self.emit("error", er);
                        return;
                    }
                    self.fd = fd;
                    self.emit("open", fd);
                    self.read();
                }));
            };
            ReadStream.prototype._read = function(n) {
                if (typeof this.fd !== "number") return this.once("open", (function() {
                    this._read(n);
                }));
                if (this.destroyed) return;
                if (!pool || pool.length - pool.used < kMinPoolSpace) {
                    allocNewPool(this._readableState.highWaterMark);
                }
                var thisPool = pool;
                var toRead = Math.min(pool.length - pool.used, n);
                var start = pool.used;
                if (this.pos !== undefined) toRead = Math.min(this.end - this.pos + 1, toRead);
                if (toRead <= 0) return this.push(null);
                var self = this;
                fs.read(this.fd, pool, pool.used, toRead, this.pos, onread);
                if (this.pos !== undefined) this.pos += toRead;
                pool.used += toRead;
                function onread(er, bytesRead) {
                    if (er) {
                        if (self.autoClose) {
                            self.destroy();
                        }
                        self.emit("error", er);
                    } else {
                        var b = null;
                        if (bytesRead > 0) {
                            self.bytesRead += bytesRead;
                            b = thisPool.slice(start, start + bytesRead);
                        }
                        self.push(b);
                    }
                }
            };
            ReadStream.prototype.destroy = function() {
                if (this.destroyed) return;
                this.destroyed = true;
                this.close();
            };
            ReadStream.prototype.close = function(cb) {
                var self = this;
                if (cb) this.once("close", cb);
                if (this.closed || typeof this.fd !== "number") {
                    if (typeof this.fd !== "number") {
                        this.once("open", close);
                        return;
                    }
                    return process.nextTick((() => this.emit("close")));
                }
                this.closed = true;
                close();
                function close(fd) {
                    fs.close(fd || self.fd, (function(er) {
                        if (er) self.emit("error", er); else self.emit("close");
                    }));
                    self.fd = null;
                }
            };
            fs.createWriteStream = function(path, options) {
                return new WriteStream(path, options);
            };
            util.inherits(WriteStream, Writable);
            fs.WriteStream = WriteStream;
            function WriteStream(path, options) {
                if (!(this instanceof WriteStream)) return new WriteStream(path, options);
                options = copyObject(getOptions(options, {}));
                Writable.call(this, options);
                this.path = path;
                this.fd = options.fd === undefined ? null : options.fd;
                this.flags = options.flags === undefined ? "w" : options.flags;
                this.mode = options.mode === undefined ? 438 : options.mode;
                this.start = options.start;
                this.autoClose = options.autoClose === undefined ? true : !!options.autoClose;
                this.pos = undefined;
                this.bytesWritten = 0;
                if (this.start !== undefined) {
                    if (typeof this.start !== "number") {
                        throw new TypeError('"start" option must be a Number');
                    }
                    if (this.start < 0) {
                        throw new Error('"start" must be >= zero');
                    }
                    this.pos = this.start;
                }
                if (options.encoding) this.setDefaultEncoding(options.encoding);
                if (typeof this.fd !== "number") this.open();
                this.once("finish", (function() {
                    if (this.autoClose) {
                        this.close();
                    }
                }));
            }
            fs.FileWriteStream = fs.WriteStream;
            WriteStream.prototype.open = function() {
                fs.open(this.path, this.flags, this.mode, function(er, fd) {
                    if (er) {
                        if (this.autoClose) {
                            this.destroy();
                        }
                        this.emit("error", er);
                        return;
                    }
                    this.fd = fd;
                    this.emit("open", fd);
                }.bind(this));
            };
            WriteStream.prototype._write = function(data, encoding, cb) {
                if (!(data instanceof Buffer)) return this.emit("error", new Error("Invalid data"));
                if (typeof this.fd !== "number") return this.once("open", (function() {
                    this._write(data, encoding, cb);
                }));
                var self = this;
                fs.write(this.fd, data, 0, data.length, this.pos, (function(er, bytes) {
                    if (er) {
                        if (self.autoClose) {
                            self.destroy();
                        }
                        return cb(er);
                    }
                    self.bytesWritten += bytes;
                    cb();
                }));
                if (this.pos !== undefined) this.pos += data.length;
            };
            function writev(fd, chunks, position, callback) {
                function wrapper(err, written) {
                    callback(err, written || 0, chunks);
                }
                const req = new FSReqWrap;
                req.oncomplete = wrapper;
                binding.writeBuffers(fd, chunks, position, req);
            }
            WriteStream.prototype._writev = function(data, cb) {
                if (typeof this.fd !== "number") return this.once("open", (function() {
                    this._writev(data, cb);
                }));
                const self = this;
                const len = data.length;
                const chunks = new Array(len);
                var size = 0;
                for (var i = 0; i < len; i++) {
                    var chunk = data[i].chunk;
                    chunks[i] = chunk;
                    size += chunk.length;
                }
                writev(this.fd, chunks, this.pos, (function(er, bytes) {
                    if (er) {
                        self.destroy();
                        return cb(er);
                    }
                    self.bytesWritten += bytes;
                    cb();
                }));
                if (this.pos !== undefined) this.pos += size;
            };
            WriteStream.prototype.destroy = ReadStream.prototype.destroy;
            WriteStream.prototype.close = ReadStream.prototype.close;
            WriteStream.prototype.destroySoon = WriteStream.prototype.end;
            return fs;
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        const Module = __webpack_require__(75);
        const {CODE_TO_ERRNO} = __webpack_require__(76);
        const {ErrnoException, ccallThrow, ccallThrowAsync, promiseToCallback, withHeapBuffer, withPathAsHeapBuffer} = __webpack_require__(77);
        function getCallback(req) {
            if (!req || typeof req.oncomplete !== "function") {
                throw new Error("A callback is required.");
            }
            return req.oncomplete.bind(req);
        }
        module.exports = function(constants, fsPointer) {
            const exports = {};
            const openFiles = new Map;
            exports.openFiles = openFiles;
            exports.FSReqWrap = function() {};
            let Stats;
            exports.FSInitialize = function(s) {
                Stats = s;
            };
            async function access(path, mode) {
                const X = constants.S_IXUSR | constants.S_IXGRP | constants.S_IXOTH;
                const stats = await stat(path);
                if ((mode & constants.X_OK) !== 0 && (stats.mode & X) === 0) {
                    throw new ErrnoException(CODE_TO_ERRNO["EACCES"], "access", [ path, mode ]);
                }
            }
            exports.access = function(path, mode, req) {
                promiseToCallback(access(path, mode), getCallback(req));
            };
            function checkFd(fd, syscall, args) {
                if (!openFiles.has(fd)) {
                    throw new ErrnoException(CODE_TO_ERRNO["EBADF"], syscall, args);
                }
            }
            async function chmod(path, mode) {
                const fd = await open(path, 0, 0);
                await fchmod(fd, mode);
            }
            exports.chmod = function(path, mode, req) {
                promiseToCallback(chmod(path, mode), getCallback(req));
            };
            async function chown(path, uid, gid) {
                const fd = await open(path, 0, 0);
                await fchown(fd, uid, gid);
            }
            exports.chown = function(path, uid, gid, req) {
                promiseToCallback(chown(path, uid, gid), getCallback(req));
            };
            async function close(fd) {
                checkFd(fd, "node_ext2fs_close", [ fd ]);
                await ccallThrowAsync("node_ext2fs_close", "number", [ "number" ], [ fd ]);
                openFiles.delete(fd);
            }
            exports.close = function(fd, req) {
                promiseToCallback(close(fd), getCallback(req));
            };
            async function fchmod(fd, mode) {
                checkFd(fd, "node_ext2fs_chmod", [ fd, mode ]);
                await ccallThrowAsync("node_ext2fs_chmod", "number", [ "number", "number" ], [ fd, mode ]);
            }
            exports.fchmod = function(fd, mode, req) {
                promiseToCallback(fchmod(fd, mode), getCallback(req));
            };
            async function fchown(fd, uid, gid) {
                checkFd(fd, "node_ext2fs_chown", [ fd, uid, gid ]);
                await ccallThrowAsync("node_ext2fs_chown", "number", [ "number", "number", "number" ], [ fd, uid, gid ]);
            }
            exports.fchown = function(fd, uid, gid, req) {
                promiseToCallback(fchown(fd, uid, gid), getCallback(req));
            };
            exports.fdatasync = function() {
                throw new Error("Unimplemented");
            };
            function fstat(fd) {
                checkFd(fd, "fstat", [ fd ]);
                function getAttr(name) {
                    return ccallThrow(`node_ext2fs_stat_${name}`, "number", [ "number" ], [ fd ]);
                }
                const ctime = getAttr("i_ctime") * 1e3;
                return new Stats(0, getAttr("i_mode"), getAttr("i_links_count"), getAttr("i_uid"), getAttr("i_gid"), 0, getAttr("blocksize"), getAttr("ino"), getAttr("i_size"), getAttr("i_blocks"), getAttr("i_atime") * 1e3, getAttr("i_mtime") * 1e3, ctime, ctime);
            }
            exports.fstat = function(fd, req) {
                const callback = getCallback(req);
                try {
                    callback(null, fstat(fd));
                } catch (error) {
                    callback(error);
                }
            };
            exports.fsync = function() {
                throw new Error("Unimplemented");
            };
            exports.ftruncate = function() {
                throw new Error("Unimplemented");
            };
            exports.futimes = function() {
                throw new Error("Unimplemented");
            };
            exports.link = function() {
                throw new Error("Unimplemented");
            };
            exports.lstat = function() {
                throw new Error("Unimplemented");
            };
            async function mkdir(path, mode) {
                return await withPathAsHeapBuffer(path, (async heapBufferPointer => {
                    await ccallThrowAsync("node_ext2fs_mkdir", "number", [ "number", "number", "number" ], [ fsPointer, heapBufferPointer, mode ]);
                }));
            }
            exports.mkdir = function(path, mode, req) {
                promiseToCallback(mkdir(path, mode), getCallback(req));
            };
            exports.mkdtemp = function() {
                throw new Error("Unimplemented");
            };
            async function open(path, flags, mode) {
                return await withPathAsHeapBuffer(path, (async heapBufferPointer => {
                    const fd = await ccallThrowAsync("node_ext2fs_open", "number", [ "number", "number", "number", "number" ], [ fsPointer, heapBufferPointer, flags, mode ]);
                    openFiles.set(fd, flags);
                    return fd;
                }));
            }
            exports.open = function(path, flags, mode, req) {
                promiseToCallback(open(path, flags, mode), getCallback(req));
            };
            async function read(fd, buffer, offset, length, position) {
                checkFd(fd, "node_ext2fs_read", [ fd, buffer, offset, length, position ]);
                return await withHeapBuffer(length, (async (heapBuffer, heapBufferPointer) => {
                    const got = await ccallThrowAsync("node_ext2fs_read", "number", [ "number", "number", "number", "number", "number" ], [ fd, openFiles.get(fd), heapBufferPointer, length, position ]);
                    heapBuffer.copy(buffer, offset);
                    return got;
                }));
            }
            exports.read = function(fd, buffer, offset, length, position, req) {
                promiseToCallback(read(fd, buffer, offset, length, typeof position !== "number" ? -1 : position), getCallback(req));
            };
            async function readdir(path, encoding) {
                if (encoding === undefined) {
                    encoding = "utf8";
                }
                const array = [];
                await Module.withObjectId(array, (async arrayId => {
                    await withPathAsHeapBuffer(path, (async heapBufferPointer => {
                        await ccallThrowAsync("node_ext2fs_readdir", "number", [ "number", "number", "number" ], [ fsPointer, heapBufferPointer, arrayId ]);
                    }));
                }));
                if (encoding === "buffer") {
                    return array;
                } else {
                    return array.map((b => b.toString(encoding)));
                }
            }
            exports.readdir = function(path, encoding, req) {
                promiseToCallback(readdir(path, encoding), getCallback(req));
            };
            exports.readlink = function() {
                throw new Error("Unimplemented");
            };
            exports.rename = function() {
                throw new Error("Unimplemented");
            };
            async function unlink(path, isdir) {
                await withPathAsHeapBuffer(path, (async heapBufferPointer => {
                    await ccallThrowAsync("node_ext2fs_unlink", "number", [ "number", "number", "number" ], [ fsPointer, heapBufferPointer, isdir ]);
                }));
            }
            exports.rmdir = function(path, req) {
                promiseToCallback(unlink(path, 1), getCallback(req));
            };
            async function stat(path) {
                const fd = await open(path, "r", 0);
                const stats = await fstat(fd);
                await close(fd);
                return stats;
            }
            exports.stat = function(path, req) {
                promiseToCallback(stat(path), getCallback(req));
            };
            exports.StatWatcher = function() {
                throw new Error("Unimplemented");
            };
            exports.symlink = function() {
                throw new Error("Unimplemented");
            };
            exports.unlink = function(path, req) {
                promiseToCallback(unlink(path, 0), getCallback(req));
            };
            exports.utimes = function() {
                throw new Error("Unimplemented");
            };
            async function writeBuffer(fd, buffer, offset, length, position) {
                checkFd(fd, "node_ext2fs_write", [ fd, buffer, offset, length, position ]);
                return await withHeapBuffer(length, (async (heapBuffer, heapBufferPointer) => {
                    buffer.copy(heapBuffer, 0, offset, offset + length);
                    return await ccallThrowAsync("node_ext2fs_write", "number", [ "number", "number", "number", "number", "number" ], [ fd, openFiles.get(fd), heapBufferPointer, length, position ]);
                }));
            }
            exports.writeBuffer = function(fd, buffer, offset, length, position, req) {
                promiseToCallback(writeBuffer(fd, buffer, offset, length, typeof position !== "number" ? -1 : position), getCallback(req));
            };
            exports.writeBuffers = function() {
                throw new Error("Unimplemented");
            };
            exports.writeString = function(fd, string, position, enc, req) {
                const buffer = Buffer.from(string, enc);
                exports.writeBuffer(fd, buffer, 0, buffer.length, position, req);
            };
            exports.closeAllFileDescriptors = async function() {
                for (const fd of openFiles.keys()) {
                    await close(fd);
                }
            };
            return exports;
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var __dirname = "node_modules\\ext2fs\\lib";
        var Module = typeof Module !== "undefined" ? Module : {};
        const objects = new Map;
        let nextId = 0;
        const idPool = [];
        function reserveId() {
            if (idPool.length === 0) {
                nextId += 1;
                idPool.push(nextId);
            }
            return idPool.shift();
        }
        function releaseId(id) {
            idPool.push(id);
        }
        function setObject(obj) {
            const id = reserveId();
            objects.set(id, obj);
            return id;
        }
        Module.setObject = setObject;
        function getObject(id) {
            return objects.get(id);
        }
        Module.getObject = getObject;
        function deleteObject(id) {
            objects.delete(id);
            releaseId(id);
        }
        Module.deleteObject = deleteObject;
        async function withObjectId(obj, fn) {
            const id = setObject(obj);
            try {
                return await fn(id);
            } finally {
                deleteObject(id);
            }
        }
        Module.withObjectId = withObjectId;
        function getBuffer(pointer, length) {
            return Buffer.from(Module.HEAP8.buffer, pointer, length);
        }
        Module.getBuffer = getBuffer;
        Module.EIO = 29;
        var moduleOverrides = {};
        var key;
        for (key in Module) {
            if (Module.hasOwnProperty(key)) {
                moduleOverrides[key] = Module[key];
            }
        }
        var arguments_ = [];
        var thisProgram = "./this.program";
        var quit_ = function(status, toThrow) {
            throw toThrow;
        };
        var ENVIRONMENT_IS_WEB = false;
        var ENVIRONMENT_IS_WORKER = false;
        var ENVIRONMENT_IS_NODE = false;
        var ENVIRONMENT_IS_SHELL = false;
        ENVIRONMENT_IS_WEB = typeof window === "object";
        ENVIRONMENT_IS_WORKER = typeof importScripts === "function";
        ENVIRONMENT_IS_NODE = typeof process === "object" && typeof process.versions === "object" && typeof process.versions.node === "string";
        ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;
        var scriptDirectory = "";
        function locateFile(path) {
            if (Module["locateFile"]) {
                return Module["locateFile"](path, scriptDirectory);
            }
            return scriptDirectory + path;
        }
        var read_, readAsync, readBinary, setWindowTitle;
        var nodeFS;
        var nodePath;
        if (ENVIRONMENT_IS_NODE) {
            if (ENVIRONMENT_IS_WORKER) {
                scriptDirectory = __webpack_require__(15).dirname(scriptDirectory) + "/";
            } else {
                const Path = __webpack_require__(15);
                let electron;
                try {
                    electron = __webpack_require__(1);
                } catch {}
                function appPath() {
                    return Path.isAbsolute(__dirname) ? __dirname : Path.join(electron.remote.app.getAppPath().replace(/\.asar$/, (() => process.platform === "darwin" ? "-" + process.arch : "")), "generated");
                }
                scriptDirectory = Path.join(appPath(), "modules", "ext2fs", "lib", "/");
            }
            read_ = function shell_read(filename, binary) {
                if (!nodeFS) nodeFS = __webpack_require__(14);
                if (!nodePath) nodePath = __webpack_require__(15);
                filename = nodePath["normalize"](filename);
                return nodeFS["readFileSync"](filename, binary ? null : "utf8");
            };
            readBinary = function readBinary(filename) {
                var ret = read_(filename, true);
                if (!ret.buffer) {
                    ret = new Uint8Array(ret);
                }
                assert(ret.buffer);
                return ret;
            };
            if (process["argv"].length > 1) {
                thisProgram = process["argv"][1].replace(/\\/g, "/");
            }
            arguments_ = process["argv"].slice(2);
            if (true) {
                module["exports"] = Module;
            }
            process["on"]("uncaughtException", (function(ex) {
                if (!(ex instanceof ExitStatus)) {
                    throw ex;
                }
            }));
            process["on"]("unhandledRejection", abort);
            quit_ = function(status) {
                process["exit"](status);
            };
            Module["inspect"] = function() {
                return "[Emscripten Module object]";
            };
        } else if (ENVIRONMENT_IS_SHELL) {
            if (typeof read != "undefined") {
                read_ = function shell_read(f) {
                    return read(f);
                };
            }
            readBinary = function readBinary(f) {
                var data;
                if (typeof readbuffer === "function") {
                    return new Uint8Array(readbuffer(f));
                }
                data = read(f, "binary");
                assert(typeof data === "object");
                return data;
            };
            if (typeof scriptArgs != "undefined") {
                arguments_ = scriptArgs;
            } else if (typeof arguments != "undefined") {
                arguments_ = arguments;
            }
            if (typeof quit === "function") {
                quit_ = function(status) {
                    quit(status);
                };
            }
            if (typeof print !== "undefined") {
                if (typeof console === "undefined") console = {};
                console.log = print;
                console.warn = console.error = typeof printErr !== "undefined" ? printErr : print;
            }
        } else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
            if (ENVIRONMENT_IS_WORKER) {
                scriptDirectory = self.location.href;
            } else if (document.currentScript) {
                scriptDirectory = document.currentScript.src;
            }
            if (scriptDirectory.indexOf("blob:") !== 0) {
                scriptDirectory = scriptDirectory.substr(0, scriptDirectory.lastIndexOf("/") + 1);
            } else {
                scriptDirectory = "";
            }
            {
                read_ = function shell_read(url) {
                    var xhr = new XMLHttpRequest;
                    xhr.open("GET", url, false);
                    xhr.send(null);
                    return xhr.responseText;
                };
                if (ENVIRONMENT_IS_WORKER) {
                    readBinary = function readBinary(url) {
                        var xhr = new XMLHttpRequest;
                        xhr.open("GET", url, false);
                        xhr.responseType = "arraybuffer";
                        xhr.send(null);
                        return new Uint8Array(xhr.response);
                    };
                }
                readAsync = function readAsync(url, onload, onerror) {
                    var xhr = new XMLHttpRequest;
                    xhr.open("GET", url, true);
                    xhr.responseType = "arraybuffer";
                    xhr.onload = function xhr_onload() {
                        if (xhr.status == 200 || xhr.status == 0 && xhr.response) {
                            onload(xhr.response);
                            return;
                        }
                        onerror();
                    };
                    xhr.onerror = onerror;
                    xhr.send(null);
                };
            }
            setWindowTitle = function(title) {
                document.title = title;
            };
        } else {}
        var out = Module["print"] || console.log.bind(console);
        var err = Module["printErr"] || console.warn.bind(console);
        for (key in moduleOverrides) {
            if (moduleOverrides.hasOwnProperty(key)) {
                Module[key] = moduleOverrides[key];
            }
        }
        moduleOverrides = null;
        if (Module["arguments"]) arguments_ = Module["arguments"];
        if (Module["thisProgram"]) thisProgram = Module["thisProgram"];
        if (Module["quit"]) quit_ = Module["quit"];
        var STACK_ALIGN = 16;
        function alignMemory(size, factor) {
            if (!factor) factor = STACK_ALIGN;
            return Math.ceil(size / factor) * factor;
        }
        var tempRet0 = 0;
        var setTempRet0 = function(value) {
            tempRet0 = value;
        };
        var wasmBinary;
        if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"];
        var noExitRuntime;
        if (Module["noExitRuntime"]) noExitRuntime = Module["noExitRuntime"];
        if (typeof WebAssembly !== "object") {
            abort("no native wasm support detected");
        }
        var wasmMemory;
        var wasmTable;
        var ABORT = false;
        var EXITSTATUS = 0;
        function assert(condition, text) {
            if (!condition) {
                abort("Assertion failed: " + text);
            }
        }
        function getCFunc(ident) {
            var func = Module["_" + ident];
            assert(func, "Cannot call unknown function " + ident + ", make sure it is exported");
            return func;
        }
        function ccall(ident, returnType, argTypes, args, opts) {
            var toC = {
                string: function(str) {
                    var ret = 0;
                    if (str !== null && str !== undefined && str !== 0) {
                        var len = (str.length << 2) + 1;
                        ret = stackAlloc(len);
                        stringToUTF8(str, ret, len);
                    }
                    return ret;
                },
                array: function(arr) {
                    var ret = stackAlloc(arr.length);
                    writeArrayToMemory(arr, ret);
                    return ret;
                }
            };
            function convertReturnValue(ret) {
                if (returnType === "string") return UTF8ToString(ret);
                if (returnType === "boolean") return Boolean(ret);
                return ret;
            }
            var func = getCFunc(ident);
            var cArgs = [];
            var stack = 0;
            if (args) {
                for (var i = 0; i < args.length; i++) {
                    var converter = toC[argTypes[i]];
                    if (converter) {
                        if (stack === 0) stack = stackSave();
                        cArgs[i] = converter(args[i]);
                    } else {
                        cArgs[i] = args[i];
                    }
                }
            }
            var ret = func.apply(null, cArgs);
            var asyncMode = opts && opts.async;
            var runningAsync = typeof Asyncify === "object" && Asyncify.currData;
            var prevRunningAsync = typeof Asyncify === "object" && Asyncify.asyncFinalizers.length > 0;
            if (runningAsync && !prevRunningAsync) {
                return new Promise((function(resolve) {
                    Asyncify.asyncFinalizers.push((function(ret) {
                        if (stack !== 0) stackRestore(stack);
                        resolve(convertReturnValue(ret));
                    }));
                }));
            }
            ret = convertReturnValue(ret);
            if (stack !== 0) stackRestore(stack);
            if (opts && opts.async) return Promise.resolve(ret);
            return ret;
        }
        var UTF8Decoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf8") : undefined;
        function UTF8ArrayToString(heap, idx, maxBytesToRead) {
            var endIdx = idx + maxBytesToRead;
            var endPtr = idx;
            while (heap[endPtr] && !(endPtr >= endIdx)) ++endPtr;
            if (endPtr - idx > 16 && heap.subarray && UTF8Decoder) {
                return UTF8Decoder.decode(heap.subarray(idx, endPtr));
            } else {
                var str = "";
                while (idx < endPtr) {
                    var u0 = heap[idx++];
                    if (!(u0 & 128)) {
                        str += String.fromCharCode(u0);
                        continue;
                    }
                    var u1 = heap[idx++] & 63;
                    if ((u0 & 224) == 192) {
                        str += String.fromCharCode((u0 & 31) << 6 | u1);
                        continue;
                    }
                    var u2 = heap[idx++] & 63;
                    if ((u0 & 240) == 224) {
                        u0 = (u0 & 15) << 12 | u1 << 6 | u2;
                    } else {
                        u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heap[idx++] & 63;
                    }
                    if (u0 < 65536) {
                        str += String.fromCharCode(u0);
                    } else {
                        var ch = u0 - 65536;
                        str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023);
                    }
                }
            }
            return str;
        }
        function UTF8ToString(ptr, maxBytesToRead) {
            return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : "";
        }
        function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) {
            if (!(maxBytesToWrite > 0)) return 0;
            var startIdx = outIdx;
            var endIdx = outIdx + maxBytesToWrite - 1;
            for (var i = 0; i < str.length; ++i) {
                var u = str.charCodeAt(i);
                if (u >= 55296 && u <= 57343) {
                    var u1 = str.charCodeAt(++i);
                    u = 65536 + ((u & 1023) << 10) | u1 & 1023;
                }
                if (u <= 127) {
                    if (outIdx >= endIdx) break;
                    heap[outIdx++] = u;
                } else if (u <= 2047) {
                    if (outIdx + 1 >= endIdx) break;
                    heap[outIdx++] = 192 | u >> 6;
                    heap[outIdx++] = 128 | u & 63;
                } else if (u <= 65535) {
                    if (outIdx + 2 >= endIdx) break;
                    heap[outIdx++] = 224 | u >> 12;
                    heap[outIdx++] = 128 | u >> 6 & 63;
                    heap[outIdx++] = 128 | u & 63;
                } else {
                    if (outIdx + 3 >= endIdx) break;
                    heap[outIdx++] = 240 | u >> 18;
                    heap[outIdx++] = 128 | u >> 12 & 63;
                    heap[outIdx++] = 128 | u >> 6 & 63;
                    heap[outIdx++] = 128 | u & 63;
                }
            }
            heap[outIdx] = 0;
            return outIdx - startIdx;
        }
        function stringToUTF8(str, outPtr, maxBytesToWrite) {
            return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite);
        }
        function lengthBytesUTF8(str) {
            var len = 0;
            for (var i = 0; i < str.length; ++i) {
                var u = str.charCodeAt(i);
                if (u >= 55296 && u <= 57343) u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023;
                if (u <= 127) ++len; else if (u <= 2047) len += 2; else if (u <= 65535) len += 3; else len += 4;
            }
            return len;
        }
        function writeArrayToMemory(array, buffer) {
            HEAP8.set(array, buffer);
        }
        function writeAsciiToMemory(str, buffer, dontAddNull) {
            for (var i = 0; i < str.length; ++i) {
                HEAP8[buffer++ >> 0] = str.charCodeAt(i);
            }
            if (!dontAddNull) HEAP8[buffer >> 0] = 0;
        }
        var WASM_PAGE_SIZE = 65536;
        var buffer, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64;
        function updateGlobalBufferAndViews(buf) {
            buffer = buf;
            Module["HEAP8"] = HEAP8 = new Int8Array(buf);
            Module["HEAP16"] = HEAP16 = new Int16Array(buf);
            Module["HEAP32"] = HEAP32 = new Int32Array(buf);
            Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf);
            Module["HEAPU16"] = HEAPU16 = new Uint16Array(buf);
            Module["HEAPU32"] = HEAPU32 = new Uint32Array(buf);
            Module["HEAPF32"] = HEAPF32 = new Float32Array(buf);
            Module["HEAPF64"] = HEAPF64 = new Float64Array(buf);
        }
        var INITIAL_INITIAL_MEMORY = Module["INITIAL_MEMORY"] || 16777216;
        if (Module["wasmMemory"]) {
            wasmMemory = Module["wasmMemory"];
        } else {
            wasmMemory = new WebAssembly.Memory({
                initial: INITIAL_INITIAL_MEMORY / WASM_PAGE_SIZE,
                maximum: INITIAL_INITIAL_MEMORY / WASM_PAGE_SIZE
            });
        }
        if (wasmMemory) {
            buffer = wasmMemory.buffer;
        }
        INITIAL_INITIAL_MEMORY = buffer.byteLength;
        updateGlobalBufferAndViews(buffer);
        var __ATPRERUN__ = [];
        var __ATINIT__ = [];
        var __ATMAIN__ = [];
        var __ATPOSTRUN__ = [];
        var runtimeInitialized = false;
        function preRun() {
            if (Module["preRun"]) {
                if (typeof Module["preRun"] == "function") Module["preRun"] = [ Module["preRun"] ];
                while (Module["preRun"].length) {
                    addOnPreRun(Module["preRun"].shift());
                }
            }
            callRuntimeCallbacks(__ATPRERUN__);
        }
        function initRuntime() {
            runtimeInitialized = true;
            if (!Module["noFSInit"] && !FS.init.initialized) FS.init();
            TTY.init();
            callRuntimeCallbacks(__ATINIT__);
        }
        function preMain() {
            FS.ignorePermissions = false;
            callRuntimeCallbacks(__ATMAIN__);
        }
        function postRun() {
            if (Module["postRun"]) {
                if (typeof Module["postRun"] == "function") Module["postRun"] = [ Module["postRun"] ];
                while (Module["postRun"].length) {
                    addOnPostRun(Module["postRun"].shift());
                }
            }
            callRuntimeCallbacks(__ATPOSTRUN__);
        }
        function addOnPreRun(cb) {
            __ATPRERUN__.unshift(cb);
        }
        function addOnPostRun(cb) {
            __ATPOSTRUN__.unshift(cb);
        }
        var runDependencies = 0;
        var runDependencyWatcher = null;
        var dependenciesFulfilled = null;
        function getUniqueRunDependency(id) {
            return id;
        }
        function addRunDependency(id) {
            runDependencies++;
            if (Module["monitorRunDependencies"]) {
                Module["monitorRunDependencies"](runDependencies);
            }
        }
        function removeRunDependency(id) {
            runDependencies--;
            if (Module["monitorRunDependencies"]) {
                Module["monitorRunDependencies"](runDependencies);
            }
            if (runDependencies == 0) {
                if (runDependencyWatcher !== null) {
                    clearInterval(runDependencyWatcher);
                    runDependencyWatcher = null;
                }
                if (dependenciesFulfilled) {
                    var callback = dependenciesFulfilled;
                    dependenciesFulfilled = null;
                    callback();
                }
            }
        }
        Module["preloadedImages"] = {};
        Module["preloadedAudios"] = {};
        function abort(what) {
            if (Module["onAbort"]) {
                Module["onAbort"](what);
            }
            what += "";
            err(what);
            ABORT = true;
            EXITSTATUS = 1;
            what = "abort(" + what + "). Build with -s ASSERTIONS=1 for more info.";
            var e = new WebAssembly.RuntimeError(what);
            throw e;
        }
        function hasPrefix(str, prefix) {
            return String.prototype.startsWith ? str.startsWith(prefix) : str.indexOf(prefix) === 0;
        }
        var dataURIPrefix = "data:application/octet-stream;base64,";
        function isDataURI(filename) {
            return hasPrefix(filename, dataURIPrefix);
        }
        var fileURIPrefix = "file://";
        function isFileURI(filename) {
            return hasPrefix(filename, fileURIPrefix);
        }
        var wasmBinaryFile = "libext2fs.wasm";
        if (!isDataURI(wasmBinaryFile)) {
            wasmBinaryFile = locateFile(wasmBinaryFile);
        }
        function getBinary() {
            try {
                if (wasmBinary) {
                    return new Uint8Array(wasmBinary);
                }
                if (readBinary) {
                    return readBinary(wasmBinaryFile);
                } else {
                    throw "both async and sync fetching of the wasm failed";
                }
            } catch (err) {
                abort(err);
            }
        }
        function getBinaryPromise() {
            if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) && typeof fetch === "function" && !isFileURI(wasmBinaryFile)) {
                return fetch(wasmBinaryFile, {
                    credentials: "same-origin"
                }).then((function(response) {
                    if (!response["ok"]) {
                        throw "failed to load wasm binary file at '" + wasmBinaryFile + "'";
                    }
                    return response["arrayBuffer"]();
                })).catch((function() {
                    return getBinary();
                }));
            }
            return Promise.resolve().then(getBinary);
        }
        function createWasm() {
            var info = {
                a: asmLibraryArg
            };
            function receiveInstance(instance, module) {
                var exports = instance.exports;
                exports = Asyncify.instrumentWasmExports(exports);
                Module["asm"] = exports;
                wasmTable = Module["asm"]["B"];
                removeRunDependency("wasm-instantiate");
            }
            addRunDependency("wasm-instantiate");
            function receiveInstantiatedSource(output) {
                receiveInstance(output["instance"]);
            }
            function instantiateArrayBuffer(receiver) {
                return getBinaryPromise().then((function(binary) {
                    return WebAssembly.instantiate(binary, info);
                })).then(receiver, (function(reason) {
                    err("failed to asynchronously prepare wasm: " + reason);
                    abort(reason);
                }));
            }
            function instantiateAsync() {
                if (!wasmBinary && typeof WebAssembly.instantiateStreaming === "function" && !isDataURI(wasmBinaryFile) && !isFileURI(wasmBinaryFile) && typeof fetch === "function") {
                    fetch(wasmBinaryFile, {
                        credentials: "same-origin"
                    }).then((function(response) {
                        var result = WebAssembly.instantiateStreaming(response, info);
                        return result.then(receiveInstantiatedSource, (function(reason) {
                            err("wasm streaming compile failed: " + reason);
                            err("falling back to ArrayBuffer instantiation");
                            return instantiateArrayBuffer(receiveInstantiatedSource);
                        }));
                    }));
                } else {
                    return instantiateArrayBuffer(receiveInstantiatedSource);
                }
            }
            if (Module["instantiateWasm"]) {
                try {
                    var exports = Module["instantiateWasm"](info, receiveInstance);
                    exports = Asyncify.instrumentWasmExports(exports);
                    return exports;
                } catch (e) {
                    err("Module.instantiateWasm callback failed with error: " + e);
                    return false;
                }
            }
            instantiateAsync();
            return {};
        }
        var tempDouble;
        var tempI64;
        function array_push_buffer(array_id, value, len) {
            const heapBuffer = Module.getBuffer(value, len);
            const buffer = Buffer.alloc(len);
            heapBuffer.copy(buffer);
            Module.getObject(array_id).push(buffer);
        }
        function blk_read(disk_id, block_size, block, count, data) {
            return Asyncify.handleAsync((async () => {
                const offset = block * block_size;
                const size = count < 0 ? -count : count * block_size;
                const buffer = Module.getBuffer(data, size);
                const disk = Module.getObject(disk_id);
                try {
                    await disk.read(buffer, 0, buffer.length, offset);
                    return 0;
                } catch (error) {
                    return Module.EIO;
                }
            }));
        }
        function blk_write(disk_id, block_size, block, count, data) {
            return Asyncify.handleAsync((async () => {
                const offset = block * block_size;
                const size = count < 0 ? -count : count * block_size;
                const buffer = Module.getBuffer(data, size);
                const disk = Module.getObject(disk_id);
                try {
                    await disk.write(buffer, 0, buffer.length, offset);
                    return 0;
                } catch (error) {
                    return Module.EIO;
                }
            }));
        }
        function discard(disk_id, block_size, block, count) {
            return Asyncify.handleAsync((async () => {
                const disk = Module.getObject(disk_id);
                const offset = block * block_size;
                const size = count < 0 ? -count : count * block_size;
                try {
                    await disk.discard(offset, size);
                    return 0;
                } catch (error) {
                    return Module.EIO;
                }
            }));
        }
        function flush(disk_id) {
            return Asyncify.handleAsync((async () => {
                const disk = Module.getObject(disk_id);
                try {
                    await disk.flush();
                    return 0;
                } catch (error) {
                    return Module.EIO;
                }
            }));
        }
        function callRuntimeCallbacks(callbacks) {
            while (callbacks.length > 0) {
                var callback = callbacks.shift();
                if (typeof callback == "function") {
                    callback(Module);
                    continue;
                }
                var func = callback.func;
                if (typeof func === "number") {
                    if (callback.arg === undefined) {
                        getDynCaller("v", func)();
                    } else {
                        getDynCaller("vi", func)(callback.arg);
                    }
                } else {
                    func(callback.arg === undefined ? null : callback.arg);
                }
            }
        }
        function demangle(func) {
            return func;
        }
        function demangleAll(text) {
            var regex = /\b_Z[\w\d_]+/g;
            return text.replace(regex, (function(x) {
                var y = demangle(x);
                return x === y ? x : y + " [" + x + "]";
            }));
        }
        function dynCallLegacy(sig, ptr, args) {
            if (args && args.length) {
                return Module["dynCall_" + sig].apply(null, [ ptr ].concat(args));
            }
            return Module["dynCall_" + sig].call(null, ptr);
        }
        function dynCall(sig, ptr, args) {
            return dynCallLegacy(sig, ptr, args);
        }
        function getDynCaller(sig, ptr) {
            var argCache = [];
            return function() {
                argCache.length = arguments.length;
                for (var i = 0; i < arguments.length; i++) {
                    argCache[i] = arguments[i];
                }
                return dynCall(sig, ptr, argCache);
            };
        }
        function jsStackTrace() {
            var error = new Error;
            if (!error.stack) {
                try {
                    throw new Error;
                } catch (e) {
                    error = e;
                }
                if (!error.stack) {
                    return "(no stack trace available)";
                }
            }
            return error.stack.toString();
        }
        function stackTrace() {
            var js = jsStackTrace();
            if (Module["extraStackTrace"]) js += "\n" + Module["extraStackTrace"]();
            return demangleAll(js);
        }
        var PATH = {
            splitPath: function(filename) {
                var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
                return splitPathRe.exec(filename).slice(1);
            },
            normalizeArray: function(parts, allowAboveRoot) {
                var up = 0;
                for (var i = parts.length - 1; i >= 0; i--) {
                    var last = parts[i];
                    if (last === ".") {
                        parts.splice(i, 1);
                    } else if (last === "..") {
                        parts.splice(i, 1);
                        up++;
                    } else if (up) {
                        parts.splice(i, 1);
                        up--;
                    }
                }
                if (allowAboveRoot) {
                    for (;up; up--) {
                        parts.unshift("..");
                    }
                }
                return parts;
            },
            normalize: function(path) {
                var isAbsolute = path.charAt(0) === "/", trailingSlash = path.substr(-1) === "/";
                path = PATH.normalizeArray(path.split("/").filter((function(p) {
                    return !!p;
                })), !isAbsolute).join("/");
                if (!path && !isAbsolute) {
                    path = ".";
                }
                if (path && trailingSlash) {
                    path += "/";
                }
                return (isAbsolute ? "/" : "") + path;
            },
            dirname: function(path) {
                var result = PATH.splitPath(path), root = result[0], dir = result[1];
                if (!root && !dir) {
                    return ".";
                }
                if (dir) {
                    dir = dir.substr(0, dir.length - 1);
                }
                return root + dir;
            },
            basename: function(path) {
                if (path === "/") return "/";
                path = PATH.normalize(path);
                path = path.replace(/\/$/, "");
                var lastSlash = path.lastIndexOf("/");
                if (lastSlash === -1) return path;
                return path.substr(lastSlash + 1);
            },
            extname: function(path) {
                return PATH.splitPath(path)[3];
            },
            join: function() {
                var paths = Array.prototype.slice.call(arguments, 0);
                return PATH.normalize(paths.join("/"));
            },
            join2: function(l, r) {
                return PATH.normalize(l + "/" + r);
            }
        };
        function setErrNo(value) {
            HEAP32[___errno_location() >> 2] = value;
            return value;
        }
        function getRandomDevice() {
            if (typeof crypto === "object" && typeof crypto["getRandomValues"] === "function") {
                var randomBuffer = new Uint8Array(1);
                return function() {
                    crypto.getRandomValues(randomBuffer);
                    return randomBuffer[0];
                };
            } else if (ENVIRONMENT_IS_NODE) {
                try {
                    var crypto_module = __webpack_require__(56);
                    return function() {
                        return crypto_module["randomBytes"](1)[0];
                    };
                } catch (e) {}
            }
            return function() {
                abort("randomDevice");
            };
        }
        var PATH_FS = {
            resolve: function() {
                var resolvedPath = "", resolvedAbsolute = false;
                for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
                    var path = i >= 0 ? arguments[i] : FS.cwd();
                    if (typeof path !== "string") {
                        throw new TypeError("Arguments to path.resolve must be strings");
                    } else if (!path) {
                        return "";
                    }
                    resolvedPath = path + "/" + resolvedPath;
                    resolvedAbsolute = path.charAt(0) === "/";
                }
                resolvedPath = PATH.normalizeArray(resolvedPath.split("/").filter((function(p) {
                    return !!p;
                })), !resolvedAbsolute).join("/");
                return (resolvedAbsolute ? "/" : "") + resolvedPath || ".";
            },
            relative: function(from, to) {
                from = PATH_FS.resolve(from).substr(1);
                to = PATH_FS.resolve(to).substr(1);
                function trim(arr) {
                    var start = 0;
                    for (;start < arr.length; start++) {
                        if (arr[start] !== "") break;
                    }
                    var end = arr.length - 1;
                    for (;end >= 0; end--) {
                        if (arr[end] !== "") break;
                    }
                    if (start > end) return [];
                    return arr.slice(start, end - start + 1);
                }
                var fromParts = trim(from.split("/"));
                var toParts = trim(to.split("/"));
                var length = Math.min(fromParts.length, toParts.length);
                var samePartsLength = length;
                for (var i = 0; i < length; i++) {
                    if (fromParts[i] !== toParts[i]) {
                        samePartsLength = i;
                        break;
                    }
                }
                var outputParts = [];
                for (var i = samePartsLength; i < fromParts.length; i++) {
                    outputParts.push("..");
                }
                outputParts = outputParts.concat(toParts.slice(samePartsLength));
                return outputParts.join("/");
            }
        };
        var TTY = {
            ttys: [],
            init: function() {},
            shutdown: function() {},
            register: function(dev, ops) {
                TTY.ttys[dev] = {
                    input: [],
                    output: [],
                    ops
                };
                FS.registerDevice(dev, TTY.stream_ops);
            },
            stream_ops: {
                open: function(stream) {
                    var tty = TTY.ttys[stream.node.rdev];
                    if (!tty) {
                        throw new FS.ErrnoError(43);
                    }
                    stream.tty = tty;
                    stream.seekable = false;
                },
                close: function(stream) {
                    stream.tty.ops.flush(stream.tty);
                },
                flush: function(stream) {
                    stream.tty.ops.flush(stream.tty);
                },
                read: function(stream, buffer, offset, length, pos) {
                    if (!stream.tty || !stream.tty.ops.get_char) {
                        throw new FS.ErrnoError(60);
                    }
                    var bytesRead = 0;
                    for (var i = 0; i < length; i++) {
                        var result;
                        try {
                            result = stream.tty.ops.get_char(stream.tty);
                        } catch (e) {
                            throw new FS.ErrnoError(29);
                        }
                        if (result === undefined && bytesRead === 0) {
                            throw new FS.ErrnoError(6);
                        }
                        if (result === null || result === undefined) break;
                        bytesRead++;
                        buffer[offset + i] = result;
                    }
                    if (bytesRead) {
                        stream.node.timestamp = Date.now();
                    }
                    return bytesRead;
                },
                write: function(stream, buffer, offset, length, pos) {
                    if (!stream.tty || !stream.tty.ops.put_char) {
                        throw new FS.ErrnoError(60);
                    }
                    try {
                        for (var i = 0; i < length; i++) {
                            stream.tty.ops.put_char(stream.tty, buffer[offset + i]);
                        }
                    } catch (e) {
                        throw new FS.ErrnoError(29);
                    }
                    if (length) {
                        stream.node.timestamp = Date.now();
                    }
                    return i;
                }
            },
            default_tty_ops: {
                get_char: function(tty) {
                    if (!tty.input.length) {
                        var result = null;
                        if (ENVIRONMENT_IS_NODE) {
                            var BUFSIZE = 256;
                            var buf = Buffer.alloc ? Buffer.alloc(BUFSIZE) : new Buffer(BUFSIZE);
                            var bytesRead = 0;
                            try {
                                bytesRead = nodeFS.readSync(process.stdin.fd, buf, 0, BUFSIZE, null);
                            } catch (e) {
                                if (e.toString().indexOf("EOF") != -1) bytesRead = 0; else throw e;
                            }
                            if (bytesRead > 0) {
                                result = buf.slice(0, bytesRead).toString("utf-8");
                            } else {
                                result = null;
                            }
                        } else if (typeof window != "undefined" && typeof window.prompt == "function") {
                            result = window.prompt("Input: ");
                            if (result !== null) {
                                result += "\n";
                            }
                        } else if (typeof readline == "function") {
                            result = readline();
                            if (result !== null) {
                                result += "\n";
                            }
                        }
                        if (!result) {
                            return null;
                        }
                        tty.input = intArrayFromString(result, true);
                    }
                    return tty.input.shift();
                },
                put_char: function(tty, val) {
                    if (val === null || val === 10) {
                        out(UTF8ArrayToString(tty.output, 0));
                        tty.output = [];
                    } else {
                        if (val != 0) tty.output.push(val);
                    }
                },
                flush: function(tty) {
                    if (tty.output && tty.output.length > 0) {
                        out(UTF8ArrayToString(tty.output, 0));
                        tty.output = [];
                    }
                }
            },
            default_tty1_ops: {
                put_char: function(tty, val) {
                    if (val === null || val === 10) {
                        err(UTF8ArrayToString(tty.output, 0));
                        tty.output = [];
                    } else {
                        if (val != 0) tty.output.push(val);
                    }
                },
                flush: function(tty) {
                    if (tty.output && tty.output.length > 0) {
                        err(UTF8ArrayToString(tty.output, 0));
                        tty.output = [];
                    }
                }
            }
        };
        function mmapAlloc(size) {
            var alignedSize = alignMemory(size, 16384);
            var ptr = _malloc(alignedSize);
            while (size < alignedSize) HEAP8[ptr + size++] = 0;
            return ptr;
        }
        var MEMFS = {
            ops_table: null,
            mount: function(mount) {
                return MEMFS.createNode(null, "/", 16384 | 511, 0);
            },
            createNode: function(parent, name, mode, dev) {
                if (FS.isBlkdev(mode) || FS.isFIFO(mode)) {
                    throw new FS.ErrnoError(63);
                }
                if (!MEMFS.ops_table) {
                    MEMFS.ops_table = {
                        dir: {
                            node: {
                                getattr: MEMFS.node_ops.getattr,
                                setattr: MEMFS.node_ops.setattr,
                                lookup: MEMFS.node_ops.lookup,
                                mknod: MEMFS.node_ops.mknod,
                                rename: MEMFS.node_ops.rename,
                                unlink: MEMFS.node_ops.unlink,
                                rmdir: MEMFS.node_ops.rmdir,
                                readdir: MEMFS.node_ops.readdir,
                                symlink: MEMFS.node_ops.symlink
                            },
                            stream: {
                                llseek: MEMFS.stream_ops.llseek
                            }
                        },
                        file: {
                            node: {
                                getattr: MEMFS.node_ops.getattr,
                                setattr: MEMFS.node_ops.setattr
                            },
                            stream: {
                                llseek: MEMFS.stream_ops.llseek,
                                read: MEMFS.stream_ops.read,
                                write: MEMFS.stream_ops.write,
                                allocate: MEMFS.stream_ops.allocate,
                                mmap: MEMFS.stream_ops.mmap,
                                msync: MEMFS.stream_ops.msync
                            }
                        },
                        link: {
                            node: {
                                getattr: MEMFS.node_ops.getattr,
                                setattr: MEMFS.node_ops.setattr,
                                readlink: MEMFS.node_ops.readlink
                            },
                            stream: {}
                        },
                        chrdev: {
                            node: {
                                getattr: MEMFS.node_ops.getattr,
                                setattr: MEMFS.node_ops.setattr
                            },
                            stream: FS.chrdev_stream_ops
                        }
                    };
                }
                var node = FS.createNode(parent, name, mode, dev);
                if (FS.isDir(node.mode)) {
                    node.node_ops = MEMFS.ops_table.dir.node;
                    node.stream_ops = MEMFS.ops_table.dir.stream;
                    node.contents = {};
                } else if (FS.isFile(node.mode)) {
                    node.node_ops = MEMFS.ops_table.file.node;
                    node.stream_ops = MEMFS.ops_table.file.stream;
                    node.usedBytes = 0;
                    node.contents = null;
                } else if (FS.isLink(node.mode)) {
                    node.node_ops = MEMFS.ops_table.link.node;
                    node.stream_ops = MEMFS.ops_table.link.stream;
                } else if (FS.isChrdev(node.mode)) {
                    node.node_ops = MEMFS.ops_table.chrdev.node;
                    node.stream_ops = MEMFS.ops_table.chrdev.stream;
                }
                node.timestamp = Date.now();
                if (parent) {
                    parent.contents[name] = node;
                }
                return node;
            },
            getFileDataAsRegularArray: function(node) {
                if (node.contents && node.contents.subarray) {
                    var arr = [];
                    for (var i = 0; i < node.usedBytes; ++i) arr.push(node.contents[i]);
                    return arr;
                }
                return node.contents;
            },
            getFileDataAsTypedArray: function(node) {
                if (!node.contents) return new Uint8Array(0);
                if (node.contents.subarray) return node.contents.subarray(0, node.usedBytes);
                return new Uint8Array(node.contents);
            },
            expandFileStorage: function(node, newCapacity) {
                var prevCapacity = node.contents ? node.contents.length : 0;
                if (prevCapacity >= newCapacity) return;
                var CAPACITY_DOUBLING_MAX = 1024 * 1024;
                newCapacity = Math.max(newCapacity, prevCapacity * (prevCapacity < CAPACITY_DOUBLING_MAX ? 2 : 1.125) >>> 0);
                if (prevCapacity != 0) newCapacity = Math.max(newCapacity, 256);
                var oldContents = node.contents;
                node.contents = new Uint8Array(newCapacity);
                if (node.usedBytes > 0) node.contents.set(oldContents.subarray(0, node.usedBytes), 0);
                return;
            },
            resizeFileStorage: function(node, newSize) {
                if (node.usedBytes == newSize) return;
                if (newSize == 0) {
                    node.contents = null;
                    node.usedBytes = 0;
                    return;
                }
                if (!node.contents || node.contents.subarray) {
                    var oldContents = node.contents;
                    node.contents = new Uint8Array(newSize);
                    if (oldContents) {
                        node.contents.set(oldContents.subarray(0, Math.min(newSize, node.usedBytes)));
                    }
                    node.usedBytes = newSize;
                    return;
                }
                if (!node.contents) node.contents = [];
                if (node.contents.length > newSize) node.contents.length = newSize; else while (node.contents.length < newSize) node.contents.push(0);
                node.usedBytes = newSize;
            },
            node_ops: {
                getattr: function(node) {
                    var attr = {};
                    attr.dev = FS.isChrdev(node.mode) ? node.id : 1;
                    attr.ino = node.id;
                    attr.mode = node.mode;
                    attr.nlink = 1;
                    attr.uid = 0;
                    attr.gid = 0;
                    attr.rdev = node.rdev;
                    if (FS.isDir(node.mode)) {
                        attr.size = 4096;
                    } else if (FS.isFile(node.mode)) {
                        attr.size = node.usedBytes;
                    } else if (FS.isLink(node.mode)) {
                        attr.size = node.link.length;
                    } else {
                        attr.size = 0;
                    }
                    attr.atime = new Date(node.timestamp);
                    attr.mtime = new Date(node.timestamp);
                    attr.ctime = new Date(node.timestamp);
                    attr.blksize = 4096;
                    attr.blocks = Math.ceil(attr.size / attr.blksize);
                    return attr;
                },
                setattr: function(node, attr) {
                    if (attr.mode !== undefined) {
                        node.mode = attr.mode;
                    }
                    if (attr.timestamp !== undefined) {
                        node.timestamp = attr.timestamp;
                    }
                    if (attr.size !== undefined) {
                        MEMFS.resizeFileStorage(node, attr.size);
                    }
                },
                lookup: function(parent, name) {
                    throw FS.genericErrors[44];
                },
                mknod: function(parent, name, mode, dev) {
                    return MEMFS.createNode(parent, name, mode, dev);
                },
                rename: function(old_node, new_dir, new_name) {
                    if (FS.isDir(old_node.mode)) {
                        var new_node;
                        try {
                            new_node = FS.lookupNode(new_dir, new_name);
                        } catch (e) {}
                        if (new_node) {
                            for (var i in new_node.contents) {
                                throw new FS.ErrnoError(55);
                            }
                        }
                    }
                    delete old_node.parent.contents[old_node.name];
                    old_node.name = new_name;
                    new_dir.contents[new_name] = old_node;
                    old_node.parent = new_dir;
                },
                unlink: function(parent, name) {
                    delete parent.contents[name];
                },
                rmdir: function(parent, name) {
                    var node = FS.lookupNode(parent, name);
                    for (var i in node.contents) {
                        throw new FS.ErrnoError(55);
                    }
                    delete parent.contents[name];
                },
                readdir: function(node) {
                    var entries = [ ".", ".." ];
                    for (var key in node.contents) {
                        if (!node.contents.hasOwnProperty(key)) {
                            continue;
                        }
                        entries.push(key);
                    }
                    return entries;
                },
                symlink: function(parent, newname, oldpath) {
                    var node = MEMFS.createNode(parent, newname, 511 | 40960, 0);
                    node.link = oldpath;
                    return node;
                },
                readlink: function(node) {
                    if (!FS.isLink(node.mode)) {
                        throw new FS.ErrnoError(28);
                    }
                    return node.link;
                }
            },
            stream_ops: {
                read: function(stream, buffer, offset, length, position) {
                    var contents = stream.node.contents;
                    if (position >= stream.node.usedBytes) return 0;
                    var size = Math.min(stream.node.usedBytes - position, length);
                    if (size > 8 && contents.subarray) {
                        buffer.set(contents.subarray(position, position + size), offset);
                    } else {
                        for (var i = 0; i < size; i++) buffer[offset + i] = contents[position + i];
                    }
                    return size;
                },
                write: function(stream, buffer, offset, length, position, canOwn) {
                    if (!length) return 0;
                    var node = stream.node;
                    node.timestamp = Date.now();
                    if (buffer.subarray && (!node.contents || node.contents.subarray)) {
                        if (canOwn) {
                            node.contents = buffer.subarray(offset, offset + length);
                            node.usedBytes = length;
                            return length;
                        } else if (node.usedBytes === 0 && position === 0) {
                            node.contents = buffer.slice(offset, offset + length);
                            node.usedBytes = length;
                            return length;
                        } else if (position + length <= node.usedBytes) {
                            node.contents.set(buffer.subarray(offset, offset + length), position);
                            return length;
                        }
                    }
                    MEMFS.expandFileStorage(node, position + length);
                    if (node.contents.subarray && buffer.subarray) {
                        node.contents.set(buffer.subarray(offset, offset + length), position);
                    } else {
                        for (var i = 0; i < length; i++) {
                            node.contents[position + i] = buffer[offset + i];
                        }
                    }
                    node.usedBytes = Math.max(node.usedBytes, position + length);
                    return length;
                },
                llseek: function(stream, offset, whence) {
                    var position = offset;
                    if (whence === 1) {
                        position += stream.position;
                    } else if (whence === 2) {
                        if (FS.isFile(stream.node.mode)) {
                            position += stream.node.usedBytes;
                        }
                    }
                    if (position < 0) {
                        throw new FS.ErrnoError(28);
                    }
                    return position;
                },
                allocate: function(stream, offset, length) {
                    MEMFS.expandFileStorage(stream.node, offset + length);
                    stream.node.usedBytes = Math.max(stream.node.usedBytes, offset + length);
                },
                mmap: function(stream, address, length, position, prot, flags) {
                    assert(address === 0);
                    if (!FS.isFile(stream.node.mode)) {
                        throw new FS.ErrnoError(43);
                    }
                    var ptr;
                    var allocated;
                    var contents = stream.node.contents;
                    if (!(flags & 2) && contents.buffer === buffer) {
                        allocated = false;
                        ptr = contents.byteOffset;
                    } else {
                        if (position > 0 || position + length < contents.length) {
                            if (contents.subarray) {
                                contents = contents.subarray(position, position + length);
                            } else {
                                contents = Array.prototype.slice.call(contents, position, position + length);
                            }
                        }
                        allocated = true;
                        ptr = mmapAlloc(length);
                        if (!ptr) {
                            throw new FS.ErrnoError(48);
                        }
                        HEAP8.set(contents, ptr);
                    }
                    return {
                        ptr,
                        allocated
                    };
                },
                msync: function(stream, buffer, offset, length, mmapFlags) {
                    if (!FS.isFile(stream.node.mode)) {
                        throw new FS.ErrnoError(43);
                    }
                    if (mmapFlags & 2) {
                        return 0;
                    }
                    var bytesWritten = MEMFS.stream_ops.write(stream, buffer, 0, length, offset, false);
                    return 0;
                }
            }
        };
        var FS = {
            root: null,
            mounts: [],
            devices: {},
            streams: [],
            nextInode: 1,
            nameTable: null,
            currentPath: "/",
            initialized: false,
            ignorePermissions: true,
            trackingDelegate: {},
            tracking: {
                openFlags: {
                    READ: 1,
                    WRITE: 2
                }
            },
            ErrnoError: null,
            genericErrors: {},
            filesystems: null,
            syncFSRequests: 0,
            handleFSError: function(e) {
                if (!(e instanceof FS.ErrnoError)) throw e + " : " + stackTrace();
                return setErrNo(e.errno);
            },
            lookupPath: function(path, opts) {
                path = PATH_FS.resolve(FS.cwd(), path);
                opts = opts || {};
                if (!path) return {
                    path: "",
                    node: null
                };
                var defaults = {
                    follow_mount: true,
                    recurse_count: 0
                };
                for (var key in defaults) {
                    if (opts[key] === undefined) {
                        opts[key] = defaults[key];
                    }
                }
                if (opts.recurse_count > 8) {
                    throw new FS.ErrnoError(32);
                }
                var parts = PATH.normalizeArray(path.split("/").filter((function(p) {
                    return !!p;
                })), false);
                var current = FS.root;
                var current_path = "/";
                for (var i = 0; i < parts.length; i++) {
                    var islast = i === parts.length - 1;
                    if (islast && opts.parent) {
                        break;
                    }
                    current = FS.lookupNode(current, parts[i]);
                    current_path = PATH.join2(current_path, parts[i]);
                    if (FS.isMountpoint(current)) {
                        if (!islast || islast && opts.follow_mount) {
                            current = current.mounted.root;
                        }
                    }
                    if (!islast || opts.follow) {
                        var count = 0;
                        while (FS.isLink(current.mode)) {
                            var link = FS.readlink(current_path);
                            current_path = PATH_FS.resolve(PATH.dirname(current_path), link);
                            var lookup = FS.lookupPath(current_path, {
                                recurse_count: opts.recurse_count
                            });
                            current = lookup.node;
                            if (count++ > 40) {
                                throw new FS.ErrnoError(32);
                            }
                        }
                    }
                }
                return {
                    path: current_path,
                    node: current
                };
            },
            getPath: function(node) {
                var path;
                while (true) {
                    if (FS.isRoot(node)) {
                        var mount = node.mount.mountpoint;
                        if (!path) return mount;
                        return mount[mount.length - 1] !== "/" ? mount + "/" + path : mount + path;
                    }
                    path = path ? node.name + "/" + path : node.name;
                    node = node.parent;
                }
            },
            hashName: function(parentid, name) {
                var hash = 0;
                for (var i = 0; i < name.length; i++) {
                    hash = (hash << 5) - hash + name.charCodeAt(i) | 0;
                }
                return (parentid + hash >>> 0) % FS.nameTable.length;
            },
            hashAddNode: function(node) {
                var hash = FS.hashName(node.parent.id, node.name);
                node.name_next = FS.nameTable[hash];
                FS.nameTable[hash] = node;
            },
            hashRemoveNode: function(node) {
                var hash = FS.hashName(node.parent.id, node.name);
                if (FS.nameTable[hash] === node) {
                    FS.nameTable[hash] = node.name_next;
                } else {
                    var current = FS.nameTable[hash];
                    while (current) {
                        if (current.name_next === node) {
                            current.name_next = node.name_next;
                            break;
                        }
                        current = current.name_next;
                    }
                }
            },
            lookupNode: function(parent, name) {
                var errCode = FS.mayLookup(parent);
                if (errCode) {
                    throw new FS.ErrnoError(errCode, parent);
                }
                var hash = FS.hashName(parent.id, name);
                for (var node = FS.nameTable[hash]; node; node = node.name_next) {
                    var nodeName = node.name;
                    if (node.parent.id === parent.id && nodeName === name) {
                        return node;
                    }
                }
                return FS.lookup(parent, name);
            },
            createNode: function(parent, name, mode, rdev) {
                var node = new FS.FSNode(parent, name, mode, rdev);
                FS.hashAddNode(node);
                return node;
            },
            destroyNode: function(node) {
                FS.hashRemoveNode(node);
            },
            isRoot: function(node) {
                return node === node.parent;
            },
            isMountpoint: function(node) {
                return !!node.mounted;
            },
            isFile: function(mode) {
                return (mode & 61440) === 32768;
            },
            isDir: function(mode) {
                return (mode & 61440) === 16384;
            },
            isLink: function(mode) {
                return (mode & 61440) === 40960;
            },
            isChrdev: function(mode) {
                return (mode & 61440) === 8192;
            },
            isBlkdev: function(mode) {
                return (mode & 61440) === 24576;
            },
            isFIFO: function(mode) {
                return (mode & 61440) === 4096;
            },
            isSocket: function(mode) {
                return (mode & 49152) === 49152;
            },
            flagModes: {
                r: 0,
                rs: 1052672,
                "r+": 2,
                w: 577,
                wx: 705,
                xw: 705,
                "w+": 578,
                "wx+": 706,
                "xw+": 706,
                a: 1089,
                ax: 1217,
                xa: 1217,
                "a+": 1090,
                "ax+": 1218,
                "xa+": 1218
            },
            modeStringToFlags: function(str) {
                var flags = FS.flagModes[str];
                if (typeof flags === "undefined") {
                    throw new Error("Unknown file open mode: " + str);
                }
                return flags;
            },
            flagsToPermissionString: function(flag) {
                var perms = [ "r", "w", "rw" ][flag & 3];
                if (flag & 512) {
                    perms += "w";
                }
                return perms;
            },
            nodePermissions: function(node, perms) {
                if (FS.ignorePermissions) {
                    return 0;
                }
                if (perms.indexOf("r") !== -1 && !(node.mode & 292)) {
                    return 2;
                } else if (perms.indexOf("w") !== -1 && !(node.mode & 146)) {
                    return 2;
                } else if (perms.indexOf("x") !== -1 && !(node.mode & 73)) {
                    return 2;
                }
                return 0;
            },
            mayLookup: function(dir) {
                var errCode = FS.nodePermissions(dir, "x");
                if (errCode) return errCode;
                if (!dir.node_ops.lookup) return 2;
                return 0;
            },
            mayCreate: function(dir, name) {
                try {
                    var node = FS.lookupNode(dir, name);
                    return 20;
                } catch (e) {}
                return FS.nodePermissions(dir, "wx");
            },
            mayDelete: function(dir, name, isdir) {
                var node;
                try {
                    node = FS.lookupNode(dir, name);
                } catch (e) {
                    return e.errno;
                }
                var errCode = FS.nodePermissions(dir, "wx");
                if (errCode) {
                    return errCode;
                }
                if (isdir) {
                    if (!FS.isDir(node.mode)) {
                        return 54;
                    }
                    if (FS.isRoot(node) || FS.getPath(node) === FS.cwd()) {
                        return 10;
                    }
                } else {
                    if (FS.isDir(node.mode)) {
                        return 31;
                    }
                }
                return 0;
            },
            mayOpen: function(node, flags) {
                if (!node) {
                    return 44;
                }
                if (FS.isLink(node.mode)) {
                    return 32;
                } else if (FS.isDir(node.mode)) {
                    if (FS.flagsToPermissionString(flags) !== "r" || flags & 512) {
                        return 31;
                    }
                }
                return FS.nodePermissions(node, FS.flagsToPermissionString(flags));
            },
            MAX_OPEN_FDS: 4096,
            nextfd: function(fd_start, fd_end) {
                fd_start = fd_start || 0;
                fd_end = fd_end || FS.MAX_OPEN_FDS;
                for (var fd = fd_start; fd <= fd_end; fd++) {
                    if (!FS.streams[fd]) {
                        return fd;
                    }
                }
                throw new FS.ErrnoError(33);
            },
            getStream: function(fd) {
                return FS.streams[fd];
            },
            createStream: function(stream, fd_start, fd_end) {
                if (!FS.FSStream) {
                    FS.FSStream = function() {};
                    FS.FSStream.prototype = {
                        object: {
                            get: function() {
                                return this.node;
                            },
                            set: function(val) {
                                this.node = val;
                            }
                        },
                        isRead: {
                            get: function() {
                                return (this.flags & 2097155) !== 1;
                            }
                        },
                        isWrite: {
                            get: function() {
                                return (this.flags & 2097155) !== 0;
                            }
                        },
                        isAppend: {
                            get: function() {
                                return this.flags & 1024;
                            }
                        }
                    };
                }
                var newStream = new FS.FSStream;
                for (var p in stream) {
                    newStream[p] = stream[p];
                }
                stream = newStream;
                var fd = FS.nextfd(fd_start, fd_end);
                stream.fd = fd;
                FS.streams[fd] = stream;
                return stream;
            },
            closeStream: function(fd) {
                FS.streams[fd] = null;
            },
            chrdev_stream_ops: {
                open: function(stream) {
                    var device = FS.getDevice(stream.node.rdev);
                    stream.stream_ops = device.stream_ops;
                    if (stream.stream_ops.open) {
                        stream.stream_ops.open(stream);
                    }
                },
                llseek: function() {
                    throw new FS.ErrnoError(70);
                }
            },
            major: function(dev) {
                return dev >> 8;
            },
            minor: function(dev) {
                return dev & 255;
            },
            makedev: function(ma, mi) {
                return ma << 8 | mi;
            },
            registerDevice: function(dev, ops) {
                FS.devices[dev] = {
                    stream_ops: ops
                };
            },
            getDevice: function(dev) {
                return FS.devices[dev];
            },
            getMounts: function(mount) {
                var mounts = [];
                var check = [ mount ];
                while (check.length) {
                    var m = check.pop();
                    mounts.push(m);
                    check.push.apply(check, m.mounts);
                }
                return mounts;
            },
            syncfs: function(populate, callback) {
                if (typeof populate === "function") {
                    callback = populate;
                    populate = false;
                }
                FS.syncFSRequests++;
                if (FS.syncFSRequests > 1) {
                    err("warning: " + FS.syncFSRequests + " FS.syncfs operations in flight at once, probably just doing extra work");
                }
                var mounts = FS.getMounts(FS.root.mount);
                var completed = 0;
                function doCallback(errCode) {
                    FS.syncFSRequests--;
                    return callback(errCode);
                }
                function done(errCode) {
                    if (errCode) {
                        if (!done.errored) {
                            done.errored = true;
                            return doCallback(errCode);
                        }
                        return;
                    }
                    if (++completed >= mounts.length) {
                        doCallback(null);
                    }
                }
                mounts.forEach((function(mount) {
                    if (!mount.type.syncfs) {
                        return done(null);
                    }
                    mount.type.syncfs(mount, populate, done);
                }));
            },
            mount: function(type, opts, mountpoint) {
                var root = mountpoint === "/";
                var pseudo = !mountpoint;
                var node;
                if (root && FS.root) {
                    throw new FS.ErrnoError(10);
                } else if (!root && !pseudo) {
                    var lookup = FS.lookupPath(mountpoint, {
                        follow_mount: false
                    });
                    mountpoint = lookup.path;
                    node = lookup.node;
                    if (FS.isMountpoint(node)) {
                        throw new FS.ErrnoError(10);
                    }
                    if (!FS.isDir(node.mode)) {
                        throw new FS.ErrnoError(54);
                    }
                }
                var mount = {
                    type,
                    opts,
                    mountpoint,
                    mounts: []
                };
                var mountRoot = type.mount(mount);
                mountRoot.mount = mount;
                mount.root = mountRoot;
                if (root) {
                    FS.root = mountRoot;
                } else if (node) {
                    node.mounted = mount;
                    if (node.mount) {
                        node.mount.mounts.push(mount);
                    }
                }
                return mountRoot;
            },
            unmount: function(mountpoint) {
                var lookup = FS.lookupPath(mountpoint, {
                    follow_mount: false
                });
                if (!FS.isMountpoint(lookup.node)) {
                    throw new FS.ErrnoError(28);
                }
                var node = lookup.node;
                var mount = node.mounted;
                var mounts = FS.getMounts(mount);
                Object.keys(FS.nameTable).forEach((function(hash) {
                    var current = FS.nameTable[hash];
                    while (current) {
                        var next = current.name_next;
                        if (mounts.indexOf(current.mount) !== -1) {
                            FS.destroyNode(current);
                        }
                        current = next;
                    }
                }));
                node.mounted = null;
                var idx = node.mount.mounts.indexOf(mount);
                node.mount.mounts.splice(idx, 1);
            },
            lookup: function(parent, name) {
                return parent.node_ops.lookup(parent, name);
            },
            mknod: function(path, mode, dev) {
                var lookup = FS.lookupPath(path, {
                    parent: true
                });
                var parent = lookup.node;
                var name = PATH.basename(path);
                if (!name || name === "." || name === "..") {
                    throw new FS.ErrnoError(28);
                }
                var errCode = FS.mayCreate(parent, name);
                if (errCode) {
                    throw new FS.ErrnoError(errCode);
                }
                if (!parent.node_ops.mknod) {
                    throw new FS.ErrnoError(63);
                }
                return parent.node_ops.mknod(parent, name, mode, dev);
            },
            create: function(path, mode) {
                mode = mode !== undefined ? mode : 438;
                mode &= 4095;
                mode |= 32768;
                return FS.mknod(path, mode, 0);
            },
            mkdir: function(path, mode) {
                mode = mode !== undefined ? mode : 511;
                mode &= 511 | 512;
                mode |= 16384;
                return FS.mknod(path, mode, 0);
            },
            mkdirTree: function(path, mode) {
                var dirs = path.split("/");
                var d = "";
                for (var i = 0; i < dirs.length; ++i) {
                    if (!dirs[i]) continue;
                    d += "/" + dirs[i];
                    try {
                        FS.mkdir(d, mode);
                    } catch (e) {
                        if (e.errno != 20) throw e;
                    }
                }
            },
            mkdev: function(path, mode, dev) {
                if (typeof dev === "undefined") {
                    dev = mode;
                    mode = 438;
                }
                mode |= 8192;
                return FS.mknod(path, mode, dev);
            },
            symlink: function(oldpath, newpath) {
                if (!PATH_FS.resolve(oldpath)) {
                    throw new FS.ErrnoError(44);
                }
                var lookup = FS.lookupPath(newpath, {
                    parent: true
                });
                var parent = lookup.node;
                if (!parent) {
                    throw new FS.ErrnoError(44);
                }
                var newname = PATH.basename(newpath);
                var errCode = FS.mayCreate(parent, newname);
                if (errCode) {
                    throw new FS.ErrnoError(errCode);
                }
                if (!parent.node_ops.symlink) {
                    throw new FS.ErrnoError(63);
                }
                return parent.node_ops.symlink(parent, newname, oldpath);
            },
            rename: function(old_path, new_path) {
                var old_dirname = PATH.dirname(old_path);
                var new_dirname = PATH.dirname(new_path);
                var old_name = PATH.basename(old_path);
                var new_name = PATH.basename(new_path);
                var lookup, old_dir, new_dir;
                lookup = FS.lookupPath(old_path, {
                    parent: true
                });
                old_dir = lookup.node;
                lookup = FS.lookupPath(new_path, {
                    parent: true
                });
                new_dir = lookup.node;
                if (!old_dir || !new_dir) throw new FS.ErrnoError(44);
                if (old_dir.mount !== new_dir.mount) {
                    throw new FS.ErrnoError(75);
                }
                var old_node = FS.lookupNode(old_dir, old_name);
                var relative = PATH_FS.relative(old_path, new_dirname);
                if (relative.charAt(0) !== ".") {
                    throw new FS.ErrnoError(28);
                }
                relative = PATH_FS.relative(new_path, old_dirname);
                if (relative.charAt(0) !== ".") {
                    throw new FS.ErrnoError(55);
                }
                var new_node;
                try {
                    new_node = FS.lookupNode(new_dir, new_name);
                } catch (e) {}
                if (old_node === new_node) {
                    return;
                }
                var isdir = FS.isDir(old_node.mode);
                var errCode = FS.mayDelete(old_dir, old_name, isdir);
                if (errCode) {
                    throw new FS.ErrnoError(errCode);
                }
                errCode = new_node ? FS.mayDelete(new_dir, new_name, isdir) : FS.mayCreate(new_dir, new_name);
                if (errCode) {
                    throw new FS.ErrnoError(errCode);
                }
                if (!old_dir.node_ops.rename) {
                    throw new FS.ErrnoError(63);
                }
                if (FS.isMountpoint(old_node) || new_node && FS.isMountpoint(new_node)) {
                    throw new FS.ErrnoError(10);
                }
                if (new_dir !== old_dir) {
                    errCode = FS.nodePermissions(old_dir, "w");
                    if (errCode) {
                        throw new FS.ErrnoError(errCode);
                    }
                }
                try {
                    if (FS.trackingDelegate["willMovePath"]) {
                        FS.trackingDelegate["willMovePath"](old_path, new_path);
                    }
                } catch (e) {
                    err("FS.trackingDelegate['willMovePath']('" + old_path + "', '" + new_path + "') threw an exception: " + e.message);
                }
                FS.hashRemoveNode(old_node);
                try {
                    old_dir.node_ops.rename(old_node, new_dir, new_name);
                } catch (e) {
                    throw e;
                } finally {
                    FS.hashAddNode(old_node);
                }
                try {
                    if (FS.trackingDelegate["onMovePath"]) FS.trackingDelegate["onMovePath"](old_path, new_path);
                } catch (e) {
                    err("FS.trackingDelegate['onMovePath']('" + old_path + "', '" + new_path + "') threw an exception: " + e.message);
                }
            },
            rmdir: function(path) {
                var lookup = FS.lookupPath(path, {
                    parent: true
                });
                var parent = lookup.node;
                var name = PATH.basename(path);
                var node = FS.lookupNode(parent, name);
                var errCode = FS.mayDelete(parent, name, true);
                if (errCode) {
                    throw new FS.ErrnoError(errCode);
                }
                if (!parent.node_ops.rmdir) {
                    throw new FS.ErrnoError(63);
                }
                if (FS.isMountpoint(node)) {
                    throw new FS.ErrnoError(10);
                }
                try {
                    if (FS.trackingDelegate["willDeletePath"]) {
                        FS.trackingDelegate["willDeletePath"](path);
                    }
                } catch (e) {
                    err("FS.trackingDelegate['willDeletePath']('" + path + "') threw an exception: " + e.message);
                }
                parent.node_ops.rmdir(parent, name);
                FS.destroyNode(node);
                try {
                    if (FS.trackingDelegate["onDeletePath"]) FS.trackingDelegate["onDeletePath"](path);
                } catch (e) {
                    err("FS.trackingDelegate['onDeletePath']('" + path + "') threw an exception: " + e.message);
                }
            },
            readdir: function(path) {
                var lookup = FS.lookupPath(path, {
                    follow: true
                });
                var node = lookup.node;
                if (!node.node_ops.readdir) {
                    throw new FS.ErrnoError(54);
                }
                return node.node_ops.readdir(node);
            },
            unlink: function(path) {
                var lookup = FS.lookupPath(path, {
                    parent: true
                });
                var parent = lookup.node;
                var name = PATH.basename(path);
                var node = FS.lookupNode(parent, name);
                var errCode = FS.mayDelete(parent, name, false);
                if (errCode) {
                    throw new FS.ErrnoError(errCode);
                }
                if (!parent.node_ops.unlink) {
                    throw new FS.ErrnoError(63);
                }
                if (FS.isMountpoint(node)) {
                    throw new FS.ErrnoError(10);
                }
                try {
                    if (FS.trackingDelegate["willDeletePath"]) {
                        FS.trackingDelegate["willDeletePath"](path);
                    }
                } catch (e) {
                    err("FS.trackingDelegate['willDeletePath']('" + path + "') threw an exception: " + e.message);
                }
                parent.node_ops.unlink(parent, name);
                FS.destroyNode(node);
                try {
                    if (FS.trackingDelegate["onDeletePath"]) FS.trackingDelegate["onDeletePath"](path);
                } catch (e) {
                    err("FS.trackingDelegate['onDeletePath']('" + path + "') threw an exception: " + e.message);
                }
            },
            readlink: function(path) {
                var lookup = FS.lookupPath(path);
                var link = lookup.node;
                if (!link) {
                    throw new FS.ErrnoError(44);
                }
                if (!link.node_ops.readlink) {
                    throw new FS.ErrnoError(28);
                }
                return PATH_FS.resolve(FS.getPath(link.parent), link.node_ops.readlink(link));
            },
            stat: function(path, dontFollow) {
                var lookup = FS.lookupPath(path, {
                    follow: !dontFollow
                });
                var node = lookup.node;
                if (!node) {
                    throw new FS.ErrnoError(44);
                }
                if (!node.node_ops.getattr) {
                    throw new FS.ErrnoError(63);
                }
                return node.node_ops.getattr(node);
            },
            lstat: function(path) {
                return FS.stat(path, true);
            },
            chmod: function(path, mode, dontFollow) {
                var node;
                if (typeof path === "string") {
                    var lookup = FS.lookupPath(path, {
                        follow: !dontFollow
                    });
                    node = lookup.node;
                } else {
                    node = path;
                }
                if (!node.node_ops.setattr) {
                    throw new FS.ErrnoError(63);
                }
                node.node_ops.setattr(node, {
                    mode: mode & 4095 | node.mode & ~4095,
                    timestamp: Date.now()
                });
            },
            lchmod: function(path, mode) {
                FS.chmod(path, mode, true);
            },
            fchmod: function(fd, mode) {
                var stream = FS.getStream(fd);
                if (!stream) {
                    throw new FS.ErrnoError(8);
                }
                FS.chmod(stream.node, mode);
            },
            chown: function(path, uid, gid, dontFollow) {
                var node;
                if (typeof path === "string") {
                    var lookup = FS.lookupPath(path, {
                        follow: !dontFollow
                    });
                    node = lookup.node;
                } else {
                    node = path;
                }
                if (!node.node_ops.setattr) {
                    throw new FS.ErrnoError(63);
                }
                node.node_ops.setattr(node, {
                    timestamp: Date.now()
                });
            },
            lchown: function(path, uid, gid) {
                FS.chown(path, uid, gid, true);
            },
            fchown: function(fd, uid, gid) {
                var stream = FS.getStream(fd);
                if (!stream) {
                    throw new FS.ErrnoError(8);
                }
                FS.chown(stream.node, uid, gid);
            },
            truncate: function(path, len) {
                if (len < 0) {
                    throw new FS.ErrnoError(28);
                }
                var node;
                if (typeof path === "string") {
                    var lookup = FS.lookupPath(path, {
                        follow: true
                    });
                    node = lookup.node;
                } else {
                    node = path;
                }
                if (!node.node_ops.setattr) {
                    throw new FS.ErrnoError(63);
                }
                if (FS.isDir(node.mode)) {
                    throw new FS.ErrnoError(31);
                }
                if (!FS.isFile(node.mode)) {
                    throw new FS.ErrnoError(28);
                }
                var errCode = FS.nodePermissions(node, "w");
                if (errCode) {
                    throw new FS.ErrnoError(errCode);
                }
                node.node_ops.setattr(node, {
                    size: len,
                    timestamp: Date.now()
                });
            },
            ftruncate: function(fd, len) {
                var stream = FS.getStream(fd);
                if (!stream) {
                    throw new FS.ErrnoError(8);
                }
                if ((stream.flags & 2097155) === 0) {
                    throw new FS.ErrnoError(28);
                }
                FS.truncate(stream.node, len);
            },
            utime: function(path, atime, mtime) {
                var lookup = FS.lookupPath(path, {
                    follow: true
                });
                var node = lookup.node;
                node.node_ops.setattr(node, {
                    timestamp: Math.max(atime, mtime)
                });
            },
            open: function(path, flags, mode, fd_start, fd_end) {
                if (path === "") {
                    throw new FS.ErrnoError(44);
                }
                flags = typeof flags === "string" ? FS.modeStringToFlags(flags) : flags;
                mode = typeof mode === "undefined" ? 438 : mode;
                if (flags & 64) {
                    mode = mode & 4095 | 32768;
                } else {
                    mode = 0;
                }
                var node;
                if (typeof path === "object") {
                    node = path;
                } else {
                    path = PATH.normalize(path);
                    try {
                        var lookup = FS.lookupPath(path, {
                            follow: !(flags & 131072)
                        });
                        node = lookup.node;
                    } catch (e) {}
                }
                var created = false;
                if (flags & 64) {
                    if (node) {
                        if (flags & 128) {
                            throw new FS.ErrnoError(20);
                        }
                    } else {
                        node = FS.mknod(path, mode, 0);
                        created = true;
                    }
                }
                if (!node) {
                    throw new FS.ErrnoError(44);
                }
                if (FS.isChrdev(node.mode)) {
                    flags &= ~512;
                }
                if (flags & 65536 && !FS.isDir(node.mode)) {
                    throw new FS.ErrnoError(54);
                }
                if (!created) {
                    var errCode = FS.mayOpen(node, flags);
                    if (errCode) {
                        throw new FS.ErrnoError(errCode);
                    }
                }
                if (flags & 512) {
                    FS.truncate(node, 0);
                }
                flags &= ~(128 | 512 | 131072);
                var stream = FS.createStream({
                    node,
                    path: FS.getPath(node),
                    flags,
                    seekable: true,
                    position: 0,
                    stream_ops: node.stream_ops,
                    ungotten: [],
                    error: false
                }, fd_start, fd_end);
                if (stream.stream_ops.open) {
                    stream.stream_ops.open(stream);
                }
                if (Module["logReadFiles"] && !(flags & 1)) {
                    if (!FS.readFiles) FS.readFiles = {};
                    if (!(path in FS.readFiles)) {
                        FS.readFiles[path] = 1;
                        err("FS.trackingDelegate error on read file: " + path);
                    }
                }
                try {
                    if (FS.trackingDelegate["onOpenFile"]) {
                        var trackingFlags = 0;
                        if ((flags & 2097155) !== 1) {
                            trackingFlags |= FS.tracking.openFlags.READ;
                        }
                        if ((flags & 2097155) !== 0) {
                            trackingFlags |= FS.tracking.openFlags.WRITE;
                        }
                        FS.trackingDelegate["onOpenFile"](path, trackingFlags);
                    }
                } catch (e) {
                    err("FS.trackingDelegate['onOpenFile']('" + path + "', flags) threw an exception: " + e.message);
                }
                return stream;
            },
            close: function(stream) {
                if (FS.isClosed(stream)) {
                    throw new FS.ErrnoError(8);
                }
                if (stream.getdents) stream.getdents = null;
                try {
                    if (stream.stream_ops.close) {
                        stream.stream_ops.close(stream);
                    }
                } catch (e) {
                    throw e;
                } finally {
                    FS.closeStream(stream.fd);
                }
                stream.fd = null;
            },
            isClosed: function(stream) {
                return stream.fd === null;
            },
            llseek: function(stream, offset, whence) {
                if (FS.isClosed(stream)) {
                    throw new FS.ErrnoError(8);
                }
                if (!stream.seekable || !stream.stream_ops.llseek) {
                    throw new FS.ErrnoError(70);
                }
                if (whence != 0 && whence != 1 && whence != 2) {
                    throw new FS.ErrnoError(28);
                }
                stream.position = stream.stream_ops.llseek(stream, offset, whence);
                stream.ungotten = [];
                return stream.position;
            },
            read: function(stream, buffer, offset, length, position) {
                if (length < 0 || position < 0) {
                    throw new FS.ErrnoError(28);
                }
                if (FS.isClosed(stream)) {
                    throw new FS.ErrnoError(8);
                }
                if ((stream.flags & 2097155) === 1) {
                    throw new FS.ErrnoError(8);
                }
                if (FS.isDir(stream.node.mode)) {
                    throw new FS.ErrnoError(31);
                }
                if (!stream.stream_ops.read) {
                    throw new FS.ErrnoError(28);
                }
                var seeking = typeof position !== "undefined";
                if (!seeking) {
                    position = stream.position;
                } else if (!stream.seekable) {
                    throw new FS.ErrnoError(70);
                }
                var bytesRead = stream.stream_ops.read(stream, buffer, offset, length, position);
                if (!seeking) stream.position += bytesRead;
                return bytesRead;
            },
            write: function(stream, buffer, offset, length, position, canOwn) {
                if (length < 0 || position < 0) {
                    throw new FS.ErrnoError(28);
                }
                if (FS.isClosed(stream)) {
                    throw new FS.ErrnoError(8);
                }
                if ((stream.flags & 2097155) === 0) {
                    throw new FS.ErrnoError(8);
                }
                if (FS.isDir(stream.node.mode)) {
                    throw new FS.ErrnoError(31);
                }
                if (!stream.stream_ops.write) {
                    throw new FS.ErrnoError(28);
                }
                if (stream.seekable && stream.flags & 1024) {
                    FS.llseek(stream, 0, 2);
                }
                var seeking = typeof position !== "undefined";
                if (!seeking) {
                    position = stream.position;
                } else if (!stream.seekable) {
                    throw new FS.ErrnoError(70);
                }
                var bytesWritten = stream.stream_ops.write(stream, buffer, offset, length, position, canOwn);
                if (!seeking) stream.position += bytesWritten;
                try {
                    if (stream.path && FS.trackingDelegate["onWriteToFile"]) FS.trackingDelegate["onWriteToFile"](stream.path);
                } catch (e) {
                    err("FS.trackingDelegate['onWriteToFile']('" + stream.path + "') threw an exception: " + e.message);
                }
                return bytesWritten;
            },
            allocate: function(stream, offset, length) {
                if (FS.isClosed(stream)) {
                    throw new FS.ErrnoError(8);
                }
                if (offset < 0 || length <= 0) {
                    throw new FS.ErrnoError(28);
                }
                if ((stream.flags & 2097155) === 0) {
                    throw new FS.ErrnoError(8);
                }
                if (!FS.isFile(stream.node.mode) && !FS.isDir(stream.node.mode)) {
                    throw new FS.ErrnoError(43);
                }
                if (!stream.stream_ops.allocate) {
                    throw new FS.ErrnoError(138);
                }
                stream.stream_ops.allocate(stream, offset, length);
            },
            mmap: function(stream, address, length, position, prot, flags) {
                if ((prot & 2) !== 0 && (flags & 2) === 0 && (stream.flags & 2097155) !== 2) {
                    throw new FS.ErrnoError(2);
                }
                if ((stream.flags & 2097155) === 1) {
                    throw new FS.ErrnoError(2);
                }
                if (!stream.stream_ops.mmap) {
                    throw new FS.ErrnoError(43);
                }
                return stream.stream_ops.mmap(stream, address, length, position, prot, flags);
            },
            msync: function(stream, buffer, offset, length, mmapFlags) {
                if (!stream || !stream.stream_ops.msync) {
                    return 0;
                }
                return stream.stream_ops.msync(stream, buffer, offset, length, mmapFlags);
            },
            munmap: function(stream) {
                return 0;
            },
            ioctl: function(stream, cmd, arg) {
                if (!stream.stream_ops.ioctl) {
                    throw new FS.ErrnoError(59);
                }
                return stream.stream_ops.ioctl(stream, cmd, arg);
            },
            readFile: function(path, opts) {
                opts = opts || {};
                opts.flags = opts.flags || "r";
                opts.encoding = opts.encoding || "binary";
                if (opts.encoding !== "utf8" && opts.encoding !== "binary") {
                    throw new Error('Invalid encoding type "' + opts.encoding + '"');
                }
                var ret;
                var stream = FS.open(path, opts.flags);
                var stat = FS.stat(path);
                var length = stat.size;
                var buf = new Uint8Array(length);
                FS.read(stream, buf, 0, length, 0);
                if (opts.encoding === "utf8") {
                    ret = UTF8ArrayToString(buf, 0);
                } else if (opts.encoding === "binary") {
                    ret = buf;
                }
                FS.close(stream);
                return ret;
            },
            writeFile: function(path, data, opts) {
                opts = opts || {};
                opts.flags = opts.flags || "w";
                var stream = FS.open(path, opts.flags, opts.mode);
                if (typeof data === "string") {
                    var buf = new Uint8Array(lengthBytesUTF8(data) + 1);
                    var actualNumBytes = stringToUTF8Array(data, buf, 0, buf.length);
                    FS.write(stream, buf, 0, actualNumBytes, undefined, opts.canOwn);
                } else if (ArrayBuffer.isView(data)) {
                    FS.write(stream, data, 0, data.byteLength, undefined, opts.canOwn);
                } else {
                    throw new Error("Unsupported data type");
                }
                FS.close(stream);
            },
            cwd: function() {
                return FS.currentPath;
            },
            chdir: function(path) {
                var lookup = FS.lookupPath(path, {
                    follow: true
                });
                if (lookup.node === null) {
                    throw new FS.ErrnoError(44);
                }
                if (!FS.isDir(lookup.node.mode)) {
                    throw new FS.ErrnoError(54);
                }
                var errCode = FS.nodePermissions(lookup.node, "x");
                if (errCode) {
                    throw new FS.ErrnoError(errCode);
                }
                FS.currentPath = lookup.path;
            },
            createDefaultDirectories: function() {
                FS.mkdir("/tmp");
                FS.mkdir("/home");
                FS.mkdir("/home/web_user");
            },
            createDefaultDevices: function() {
                FS.mkdir("/dev");
                FS.registerDevice(FS.makedev(1, 3), {
                    read: function() {
                        return 0;
                    },
                    write: function(stream, buffer, offset, length, pos) {
                        return length;
                    }
                });
                FS.mkdev("/dev/null", FS.makedev(1, 3));
                TTY.register(FS.makedev(5, 0), TTY.default_tty_ops);
                TTY.register(FS.makedev(6, 0), TTY.default_tty1_ops);
                FS.mkdev("/dev/tty", FS.makedev(5, 0));
                FS.mkdev("/dev/tty1", FS.makedev(6, 0));
                var random_device = getRandomDevice();
                FS.createDevice("/dev", "random", random_device);
                FS.createDevice("/dev", "urandom", random_device);
                FS.mkdir("/dev/shm");
                FS.mkdir("/dev/shm/tmp");
            },
            createSpecialDirectories: function() {
                FS.mkdir("/proc");
                FS.mkdir("/proc/self");
                FS.mkdir("/proc/self/fd");
                FS.mount({
                    mount: function() {
                        var node = FS.createNode("/proc/self", "fd", 16384 | 511, 73);
                        node.node_ops = {
                            lookup: function(parent, name) {
                                var fd = +name;
                                var stream = FS.getStream(fd);
                                if (!stream) throw new FS.ErrnoError(8);
                                var ret = {
                                    parent: null,
                                    mount: {
                                        mountpoint: "fake"
                                    },
                                    node_ops: {
                                        readlink: function() {
                                            return stream.path;
                                        }
                                    }
                                };
                                ret.parent = ret;
                                return ret;
                            }
                        };
                        return node;
                    }
                }, {}, "/proc/self/fd");
            },
            createStandardStreams: function() {
                if (Module["stdin"]) {
                    FS.createDevice("/dev", "stdin", Module["stdin"]);
                } else {
                    FS.symlink("/dev/tty", "/dev/stdin");
                }
                if (Module["stdout"]) {
                    FS.createDevice("/dev", "stdout", null, Module["stdout"]);
                } else {
                    FS.symlink("/dev/tty", "/dev/stdout");
                }
                if (Module["stderr"]) {
                    FS.createDevice("/dev", "stderr", null, Module["stderr"]);
                } else {
                    FS.symlink("/dev/tty1", "/dev/stderr");
                }
                var stdin = FS.open("/dev/stdin", "r");
                var stdout = FS.open("/dev/stdout", "w");
                var stderr = FS.open("/dev/stderr", "w");
            },
            ensureErrnoError: function() {
                if (FS.ErrnoError) return;
                FS.ErrnoError = function ErrnoError(errno, node) {
                    this.node = node;
                    this.setErrno = function(errno) {
                        this.errno = errno;
                    };
                    this.setErrno(errno);
                    this.message = "FS error";
                };
                FS.ErrnoError.prototype = new Error;
                FS.ErrnoError.prototype.constructor = FS.ErrnoError;
                [ 44 ].forEach((function(code) {
                    FS.genericErrors[code] = new FS.ErrnoError(code);
                    FS.genericErrors[code].stack = "<generic error, no stack>";
                }));
            },
            staticInit: function() {
                FS.ensureErrnoError();
                FS.nameTable = new Array(4096);
                FS.mount(MEMFS, {}, "/");
                FS.createDefaultDirectories();
                FS.createDefaultDevices();
                FS.createSpecialDirectories();
                FS.filesystems = {
                    MEMFS
                };
            },
            init: function(input, output, error) {
                FS.init.initialized = true;
                FS.ensureErrnoError();
                Module["stdin"] = input || Module["stdin"];
                Module["stdout"] = output || Module["stdout"];
                Module["stderr"] = error || Module["stderr"];
                FS.createStandardStreams();
            },
            quit: function() {
                FS.init.initialized = false;
                var fflush = Module["_fflush"];
                if (fflush) fflush(0);
                for (var i = 0; i < FS.streams.length; i++) {
                    var stream = FS.streams[i];
                    if (!stream) {
                        continue;
                    }
                    FS.close(stream);
                }
            },
            getMode: function(canRead, canWrite) {
                var mode = 0;
                if (canRead) mode |= 292 | 73;
                if (canWrite) mode |= 146;
                return mode;
            },
            findObject: function(path, dontResolveLastLink) {
                var ret = FS.analyzePath(path, dontResolveLastLink);
                if (ret.exists) {
                    return ret.object;
                } else {
                    setErrNo(ret.error);
                    return null;
                }
            },
            analyzePath: function(path, dontResolveLastLink) {
                try {
                    var lookup = FS.lookupPath(path, {
                        follow: !dontResolveLastLink
                    });
                    path = lookup.path;
                } catch (e) {}
                var ret = {
                    isRoot: false,
                    exists: false,
                    error: 0,
                    name: null,
                    path: null,
                    object: null,
                    parentExists: false,
                    parentPath: null,
                    parentObject: null
                };
                try {
                    var lookup = FS.lookupPath(path, {
                        parent: true
                    });
                    ret.parentExists = true;
                    ret.parentPath = lookup.path;
                    ret.parentObject = lookup.node;
                    ret.name = PATH.basename(path);
                    lookup = FS.lookupPath(path, {
                        follow: !dontResolveLastLink
                    });
                    ret.exists = true;
                    ret.path = lookup.path;
                    ret.object = lookup.node;
                    ret.name = lookup.node.name;
                    ret.isRoot = lookup.path === "/";
                } catch (e) {
                    ret.error = e.errno;
                }
                return ret;
            },
            createPath: function(parent, path, canRead, canWrite) {
                parent = typeof parent === "string" ? parent : FS.getPath(parent);
                var parts = path.split("/").reverse();
                while (parts.length) {
                    var part = parts.pop();
                    if (!part) continue;
                    var current = PATH.join2(parent, part);
                    try {
                        FS.mkdir(current);
                    } catch (e) {}
                    parent = current;
                }
                return current;
            },
            createFile: function(parent, name, properties, canRead, canWrite) {
                var path = PATH.join2(typeof parent === "string" ? parent : FS.getPath(parent), name);
                var mode = FS.getMode(canRead, canWrite);
                return FS.create(path, mode);
            },
            createDataFile: function(parent, name, data, canRead, canWrite, canOwn) {
                var path = name ? PATH.join2(typeof parent === "string" ? parent : FS.getPath(parent), name) : parent;
                var mode = FS.getMode(canRead, canWrite);
                var node = FS.create(path, mode);
                if (data) {
                    if (typeof data === "string") {
                        var arr = new Array(data.length);
                        for (var i = 0, len = data.length; i < len; ++i) arr[i] = data.charCodeAt(i);
                        data = arr;
                    }
                    FS.chmod(node, mode | 146);
                    var stream = FS.open(node, "w");
                    FS.write(stream, data, 0, data.length, 0, canOwn);
                    FS.close(stream);
                    FS.chmod(node, mode);
                }
                return node;
            },
            createDevice: function(parent, name, input, output) {
                var path = PATH.join2(typeof parent === "string" ? parent : FS.getPath(parent), name);
                var mode = FS.getMode(!!input, !!output);
                if (!FS.createDevice.major) FS.createDevice.major = 64;
                var dev = FS.makedev(FS.createDevice.major++, 0);
                FS.registerDevice(dev, {
                    open: function(stream) {
                        stream.seekable = false;
                    },
                    close: function(stream) {
                        if (output && output.buffer && output.buffer.length) {
                            output(10);
                        }
                    },
                    read: function(stream, buffer, offset, length, pos) {
                        var bytesRead = 0;
                        for (var i = 0; i < length; i++) {
                            var result;
                            try {
                                result = input();
                            } catch (e) {
                                throw new FS.ErrnoError(29);
                            }
                            if (result === undefined && bytesRead === 0) {
                                throw new FS.ErrnoError(6);
                            }
                            if (result === null || result === undefined) break;
                            bytesRead++;
                            buffer[offset + i] = result;
                        }
                        if (bytesRead) {
                            stream.node.timestamp = Date.now();
                        }
                        return bytesRead;
                    },
                    write: function(stream, buffer, offset, length, pos) {
                        for (var i = 0; i < length; i++) {
                            try {
                                output(buffer[offset + i]);
                            } catch (e) {
                                throw new FS.ErrnoError(29);
                            }
                        }
                        if (length) {
                            stream.node.timestamp = Date.now();
                        }
                        return i;
                    }
                });
                return FS.mkdev(path, mode, dev);
            },
            forceLoadFile: function(obj) {
                if (obj.isDevice || obj.isFolder || obj.link || obj.contents) return true;
                var success = true;
                if (typeof XMLHttpRequest !== "undefined") {
                    throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");
                } else if (read_) {
                    try {
                        obj.contents = intArrayFromString(read_(obj.url), true);
                        obj.usedBytes = obj.contents.length;
                    } catch (e) {
                        success = false;
                    }
                } else {
                    throw new Error("Cannot load without read() or XMLHttpRequest.");
                }
                if (!success) setErrNo(29);
                return success;
            },
            createLazyFile: function(parent, name, url, canRead, canWrite) {
                function LazyUint8Array() {
                    this.lengthKnown = false;
                    this.chunks = [];
                }
                LazyUint8Array.prototype.get = function LazyUint8Array_get(idx) {
                    if (idx > this.length - 1 || idx < 0) {
                        return undefined;
                    }
                    var chunkOffset = idx % this.chunkSize;
                    var chunkNum = idx / this.chunkSize | 0;
                    return this.getter(chunkNum)[chunkOffset];
                };
                LazyUint8Array.prototype.setDataGetter = function LazyUint8Array_setDataGetter(getter) {
                    this.getter = getter;
                };
                LazyUint8Array.prototype.cacheLength = function LazyUint8Array_cacheLength() {
                    var xhr = new XMLHttpRequest;
                    xhr.open("HEAD", url, false);
                    xhr.send(null);
                    if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error("Couldn't load " + url + ". Status: " + xhr.status);
                    var datalength = Number(xhr.getResponseHeader("Content-length"));
                    var header;
                    var hasByteServing = (header = xhr.getResponseHeader("Accept-Ranges")) && header === "bytes";
                    var usesGzip = (header = xhr.getResponseHeader("Content-Encoding")) && header === "gzip";
                    var chunkSize = 1024 * 1024;
                    if (!hasByteServing) chunkSize = datalength;
                    var doXHR = function(from, to) {
                        if (from > to) throw new Error("invalid range (" + from + ", " + to + ") or no bytes requested!");
                        if (to > datalength - 1) throw new Error("only " + datalength + " bytes available! programmer error!");
                        var xhr = new XMLHttpRequest;
                        xhr.open("GET", url, false);
                        if (datalength !== chunkSize) xhr.setRequestHeader("Range", "bytes=" + from + "-" + to);
                        if (typeof Uint8Array != "undefined") xhr.responseType = "arraybuffer";
                        if (xhr.overrideMimeType) {
                            xhr.overrideMimeType("text/plain; charset=x-user-defined");
                        }
                        xhr.send(null);
                        if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error("Couldn't load " + url + ". Status: " + xhr.status);
                        if (xhr.response !== undefined) {
                            return new Uint8Array(xhr.response || []);
                        } else {
                            return intArrayFromString(xhr.responseText || "", true);
                        }
                    };
                    var lazyArray = this;
                    lazyArray.setDataGetter((function(chunkNum) {
                        var start = chunkNum * chunkSize;
                        var end = (chunkNum + 1) * chunkSize - 1;
                        end = Math.min(end, datalength - 1);
                        if (typeof lazyArray.chunks[chunkNum] === "undefined") {
                            lazyArray.chunks[chunkNum] = doXHR(start, end);
                        }
                        if (typeof lazyArray.chunks[chunkNum] === "undefined") throw new Error("doXHR failed!");
                        return lazyArray.chunks[chunkNum];
                    }));
                    if (usesGzip || !datalength) {
                        chunkSize = datalength = 1;
                        datalength = this.getter(0).length;
                        chunkSize = datalength;
                        out("LazyFiles on gzip forces download of the whole file when length is accessed");
                    }
                    this._length = datalength;
                    this._chunkSize = chunkSize;
                    this.lengthKnown = true;
                };
                if (typeof XMLHttpRequest !== "undefined") {
                    if (!ENVIRONMENT_IS_WORKER) throw "Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";
                    var lazyArray = new LazyUint8Array;
                    Object.defineProperties(lazyArray, {
                        length: {
                            get: function() {
                                if (!this.lengthKnown) {
                                    this.cacheLength();
                                }
                                return this._length;
                            }
                        },
                        chunkSize: {
                            get: function() {
                                if (!this.lengthKnown) {
                                    this.cacheLength();
                                }
                                return this._chunkSize;
                            }
                        }
                    });
                    var properties = {
                        isDevice: false,
                        contents: lazyArray
                    };
                } else {
                    var properties = {
                        isDevice: false,
                        url
                    };
                }
                var node = FS.createFile(parent, name, properties, canRead, canWrite);
                if (properties.contents) {
                    node.contents = properties.contents;
                } else if (properties.url) {
                    node.contents = null;
                    node.url = properties.url;
                }
                Object.defineProperties(node, {
                    usedBytes: {
                        get: function() {
                            return this.contents.length;
                        }
                    }
                });
                var stream_ops = {};
                var keys = Object.keys(node.stream_ops);
                keys.forEach((function(key) {
                    var fn = node.stream_ops[key];
                    stream_ops[key] = function forceLoadLazyFile() {
                        if (!FS.forceLoadFile(node)) {
                            throw new FS.ErrnoError(29);
                        }
                        return fn.apply(null, arguments);
                    };
                }));
                stream_ops.read = function stream_ops_read(stream, buffer, offset, length, position) {
                    if (!FS.forceLoadFile(node)) {
                        throw new FS.ErrnoError(29);
                    }
                    var contents = stream.node.contents;
                    if (position >= contents.length) return 0;
                    var size = Math.min(contents.length - position, length);
                    if (contents.slice) {
                        for (var i = 0; i < size; i++) {
                            buffer[offset + i] = contents[position + i];
                        }
                    } else {
                        for (var i = 0; i < size; i++) {
                            buffer[offset + i] = contents.get(position + i);
                        }
                    }
                    return size;
                };
                node.stream_ops = stream_ops;
                return node;
            },
            createPreloadedFile: function(parent, name, url, canRead, canWrite, onload, onerror, dontCreateFile, canOwn, preFinish) {
                Browser.init();
                var fullname = name ? PATH_FS.resolve(PATH.join2(parent, name)) : parent;
                var dep = getUniqueRunDependency("cp " + fullname);
                function processData(byteArray) {
                    function finish(byteArray) {
                        if (preFinish) preFinish();
                        if (!dontCreateFile) {
                            FS.createDataFile(parent, name, byteArray, canRead, canWrite, canOwn);
                        }
                        if (onload) onload();
                        removeRunDependency(dep);
                    }
                    var handled = false;
                    Module["preloadPlugins"].forEach((function(plugin) {
                        if (handled) return;
                        if (plugin["canHandle"](fullname)) {
                            plugin["handle"](byteArray, fullname, finish, (function() {
                                if (onerror) onerror();
                                removeRunDependency(dep);
                            }));
                            handled = true;
                        }
                    }));
                    if (!handled) finish(byteArray);
                }
                addRunDependency(dep);
                if (typeof url == "string") {
                    Browser.asyncLoad(url, (function(byteArray) {
                        processData(byteArray);
                    }), onerror);
                } else {
                    processData(url);
                }
            },
            indexedDB: function() {
                return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
            },
            DB_NAME: function() {
                return "EM_FS_" + window.location.pathname;
            },
            DB_VERSION: 20,
            DB_STORE_NAME: "FILE_DATA",
            saveFilesToDB: function(paths, onload, onerror) {
                onload = onload || function() {};
                onerror = onerror || function() {};
                var indexedDB = FS.indexedDB();
                try {
                    var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);
                } catch (e) {
                    return onerror(e);
                }
                openRequest.onupgradeneeded = function openRequest_onupgradeneeded() {
                    out("creating db");
                    var db = openRequest.result;
                    db.createObjectStore(FS.DB_STORE_NAME);
                };
                openRequest.onsuccess = function openRequest_onsuccess() {
                    var db = openRequest.result;
                    var transaction = db.transaction([ FS.DB_STORE_NAME ], "readwrite");
                    var files = transaction.objectStore(FS.DB_STORE_NAME);
                    var ok = 0, fail = 0, total = paths.length;
                    function finish() {
                        if (fail == 0) onload(); else onerror();
                    }
                    paths.forEach((function(path) {
                        var putRequest = files.put(FS.analyzePath(path).object.contents, path);
                        putRequest.onsuccess = function putRequest_onsuccess() {
                            ok++;
                            if (ok + fail == total) finish();
                        };
                        putRequest.onerror = function putRequest_onerror() {
                            fail++;
                            if (ok + fail == total) finish();
                        };
                    }));
                    transaction.onerror = onerror;
                };
                openRequest.onerror = onerror;
            },
            loadFilesFromDB: function(paths, onload, onerror) {
                onload = onload || function() {};
                onerror = onerror || function() {};
                var indexedDB = FS.indexedDB();
                try {
                    var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);
                } catch (e) {
                    return onerror(e);
                }
                openRequest.onupgradeneeded = onerror;
                openRequest.onsuccess = function openRequest_onsuccess() {
                    var db = openRequest.result;
                    try {
                        var transaction = db.transaction([ FS.DB_STORE_NAME ], "readonly");
                    } catch (e) {
                        onerror(e);
                        return;
                    }
                    var files = transaction.objectStore(FS.DB_STORE_NAME);
                    var ok = 0, fail = 0, total = paths.length;
                    function finish() {
                        if (fail == 0) onload(); else onerror();
                    }
                    paths.forEach((function(path) {
                        var getRequest = files.get(path);
                        getRequest.onsuccess = function getRequest_onsuccess() {
                            if (FS.analyzePath(path).exists) {
                                FS.unlink(path);
                            }
                            FS.createDataFile(PATH.dirname(path), PATH.basename(path), getRequest.result, true, true, true);
                            ok++;
                            if (ok + fail == total) finish();
                        };
                        getRequest.onerror = function getRequest_onerror() {
                            fail++;
                            if (ok + fail == total) finish();
                        };
                    }));
                    transaction.onerror = onerror;
                };
                openRequest.onerror = onerror;
            }
        };
        var SYSCALLS = {
            mappings: {},
            DEFAULT_POLLMASK: 5,
            umask: 511,
            calculateAt: function(dirfd, path) {
                if (path[0] !== "/") {
                    var dir;
                    if (dirfd === -100) {
                        dir = FS.cwd();
                    } else {
                        var dirstream = FS.getStream(dirfd);
                        if (!dirstream) throw new FS.ErrnoError(8);
                        dir = dirstream.path;
                    }
                    path = PATH.join2(dir, path);
                }
                return path;
            },
            doStat: function(func, path, buf) {
                try {
                    var stat = func(path);
                } catch (e) {
                    if (e && e.node && PATH.normalize(path) !== PATH.normalize(FS.getPath(e.node))) {
                        return -54;
                    }
                    throw e;
                }
                HEAP32[buf >> 2] = stat.dev;
                HEAP32[buf + 4 >> 2] = 0;
                HEAP32[buf + 8 >> 2] = stat.ino;
                HEAP32[buf + 12 >> 2] = stat.mode;
                HEAP32[buf + 16 >> 2] = stat.nlink;
                HEAP32[buf + 20 >> 2] = stat.uid;
                HEAP32[buf + 24 >> 2] = stat.gid;
                HEAP32[buf + 28 >> 2] = stat.rdev;
                HEAP32[buf + 32 >> 2] = 0;
                tempI64 = [ stat.size >>> 0, (tempDouble = stat.size, +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (Math.min(+Math.floor(tempDouble / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> 0 : 0) ], 
                HEAP32[buf + 40 >> 2] = tempI64[0], HEAP32[buf + 44 >> 2] = tempI64[1];
                HEAP32[buf + 48 >> 2] = 4096;
                HEAP32[buf + 52 >> 2] = stat.blocks;
                HEAP32[buf + 56 >> 2] = stat.atime.getTime() / 1e3 | 0;
                HEAP32[buf + 60 >> 2] = 0;
                HEAP32[buf + 64 >> 2] = stat.mtime.getTime() / 1e3 | 0;
                HEAP32[buf + 68 >> 2] = 0;
                HEAP32[buf + 72 >> 2] = stat.ctime.getTime() / 1e3 | 0;
                HEAP32[buf + 76 >> 2] = 0;
                tempI64 = [ stat.ino >>> 0, (tempDouble = stat.ino, +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (Math.min(+Math.floor(tempDouble / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> 0 : 0) ], 
                HEAP32[buf + 80 >> 2] = tempI64[0], HEAP32[buf + 84 >> 2] = tempI64[1];
                return 0;
            },
            doMsync: function(addr, stream, len, flags, offset) {
                var buffer = HEAPU8.slice(addr, addr + len);
                FS.msync(stream, buffer, offset, len, flags);
            },
            doMkdir: function(path, mode) {
                path = PATH.normalize(path);
                if (path[path.length - 1] === "/") path = path.substr(0, path.length - 1);
                FS.mkdir(path, mode, 0);
                return 0;
            },
            doMknod: function(path, mode, dev) {
                switch (mode & 61440) {
                  case 32768:
                  case 8192:
                  case 24576:
                  case 4096:
                  case 49152:
                    break;

                  default:
                    return -28;
                }
                FS.mknod(path, mode, dev);
                return 0;
            },
            doReadlink: function(path, buf, bufsize) {
                if (bufsize <= 0) return -28;
                var ret = FS.readlink(path);
                var len = Math.min(bufsize, lengthBytesUTF8(ret));
                var endChar = HEAP8[buf + len];
                stringToUTF8(ret, buf, bufsize + 1);
                HEAP8[buf + len] = endChar;
                return len;
            },
            doAccess: function(path, amode) {
                if (amode & ~7) {
                    return -28;
                }
                var node;
                var lookup = FS.lookupPath(path, {
                    follow: true
                });
                node = lookup.node;
                if (!node) {
                    return -44;
                }
                var perms = "";
                if (amode & 4) perms += "r";
                if (amode & 2) perms += "w";
                if (amode & 1) perms += "x";
                if (perms && FS.nodePermissions(node, perms)) {
                    return -2;
                }
                return 0;
            },
            doDup: function(path, flags, suggestFD) {
                var suggest = FS.getStream(suggestFD);
                if (suggest) FS.close(suggest);
                return FS.open(path, flags, 0, suggestFD, suggestFD).fd;
            },
            doReadv: function(stream, iov, iovcnt, offset) {
                var ret = 0;
                for (var i = 0; i < iovcnt; i++) {
                    var ptr = HEAP32[iov + i * 8 >> 2];
                    var len = HEAP32[iov + (i * 8 + 4) >> 2];
                    var curr = FS.read(stream, HEAP8, ptr, len, offset);
                    if (curr < 0) return -1;
                    ret += curr;
                    if (curr < len) break;
                }
                return ret;
            },
            doWritev: function(stream, iov, iovcnt, offset) {
                var ret = 0;
                for (var i = 0; i < iovcnt; i++) {
                    var ptr = HEAP32[iov + i * 8 >> 2];
                    var len = HEAP32[iov + (i * 8 + 4) >> 2];
                    var curr = FS.write(stream, HEAP8, ptr, len, offset);
                    if (curr < 0) return -1;
                    ret += curr;
                }
                return ret;
            },
            varargs: undefined,
            get: function() {
                SYSCALLS.varargs += 4;
                var ret = HEAP32[SYSCALLS.varargs - 4 >> 2];
                return ret;
            },
            getStr: function(ptr) {
                var ret = UTF8ToString(ptr);
                return ret;
            },
            getStreamFromFD: function(fd) {
                var stream = FS.getStream(fd);
                if (!stream) throw new FS.ErrnoError(8);
                return stream;
            },
            get64: function(low, high) {
                return low;
            }
        };
        function ___sys_getpid() {
            return 42;
        }
        function ___sys_getegid32() {
            return 0;
        }
        function ___sys_getuid32() {
            return ___sys_getegid32();
        }
        function ___sys_ioctl(fd, op, varargs) {
            SYSCALLS.varargs = varargs;
            try {
                var stream = SYSCALLS.getStreamFromFD(fd);
                switch (op) {
                  case 21509:
                  case 21505:
                    {
                        if (!stream.tty) return -59;
                        return 0;
                    }

                  case 21510:
                  case 21511:
                  case 21512:
                  case 21506:
                  case 21507:
                  case 21508:
                    {
                        if (!stream.tty) return -59;
                        return 0;
                    }

                  case 21519:
                    {
                        if (!stream.tty) return -59;
                        var argp = SYSCALLS.get();
                        HEAP32[argp >> 2] = 0;
                        return 0;
                    }

                  case 21520:
                    {
                        if (!stream.tty) return -59;
                        return -28;
                    }

                  case 21531:
                    {
                        var argp = SYSCALLS.get();
                        return FS.ioctl(stream, op, argp);
                    }

                  case 21523:
                    {
                        if (!stream.tty) return -59;
                        return 0;
                    }

                  case 21524:
                    {
                        if (!stream.tty) return -59;
                        return 0;
                    }

                  default:
                    abort("bad ioctl syscall " + op);
                }
            } catch (e) {
                if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e);
                return -e.errno;
            }
        }
        function ___sys_open(path, flags, varargs) {
            SYSCALLS.varargs = varargs;
            try {
                var pathname = SYSCALLS.getStr(path);
                var mode = SYSCALLS.get();
                var stream = FS.open(pathname, flags, mode);
                return stream.fd;
            } catch (e) {
                if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e);
                return -e.errno;
            }
        }
        function ___sys_read(fd, buf, count) {
            try {
                var stream = SYSCALLS.getStreamFromFD(fd);
                return FS.read(stream, HEAP8, buf, count);
            } catch (e) {
                if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e);
                return -e.errno;
            }
        }
        function ___sys_uname(buf) {
            try {
                if (!buf) return -21;
                var layout = {
                    __size__: 390,
                    sysname: 0,
                    nodename: 65,
                    release: 130,
                    version: 195,
                    machine: 260,
                    domainname: 325
                };
                var copyString = function(element, value) {
                    var offset = layout[element];
                    writeAsciiToMemory(value, buf + offset);
                };
                copyString("sysname", "Emscripten");
                copyString("nodename", "emscripten");
                copyString("release", "1.0");
                copyString("version", "#1");
                copyString("machine", "x86-JS");
                return 0;
            } catch (e) {
                if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e);
                return -e.errno;
            }
        }
        function _abort() {
            abort();
        }
        var _emscripten_get_now;
        if (ENVIRONMENT_IS_NODE) {
            _emscripten_get_now = function() {
                var t = process["hrtime"]();
                return t[0] * 1e3 + t[1] / 1e6;
            };
        } else if (typeof dateNow !== "undefined") {
            _emscripten_get_now = dateNow;
        } else _emscripten_get_now = function() {
            return performance.now();
        };
        var _emscripten_get_now_is_monotonic = true;
        function _clock_gettime(clk_id, tp) {
            var now;
            if (clk_id === 0) {
                now = Date.now();
            } else if ((clk_id === 1 || clk_id === 4) && _emscripten_get_now_is_monotonic) {
                now = _emscripten_get_now();
            } else {
                setErrNo(28);
                return -1;
            }
            HEAP32[tp >> 2] = now / 1e3 | 0;
            HEAP32[tp + 4 >> 2] = now % 1e3 * 1e3 * 1e3 | 0;
            return 0;
        }
        function _emscripten_memcpy_big(dest, src, num) {
            HEAPU8.copyWithin(dest, src, src + num);
        }
        function abortOnCannotGrowMemory(requestedSize) {
            abort("OOM");
        }
        function _emscripten_resize_heap(requestedSize) {
            requestedSize = requestedSize >>> 0;
            abortOnCannotGrowMemory(requestedSize);
        }
        var ENV = {};
        function getExecutableName() {
            return thisProgram || "./this.program";
        }
        function getEnvStrings() {
            if (!getEnvStrings.strings) {
                var lang = (typeof navigator === "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8";
                var env = {
                    USER: "web_user",
                    LOGNAME: "web_user",
                    PATH: "/",
                    PWD: "/",
                    HOME: "/home/web_user",
                    LANG: lang,
                    _: getExecutableName()
                };
                for (var x in ENV) {
                    env[x] = ENV[x];
                }
                var strings = [];
                for (var x in env) {
                    strings.push(x + "=" + env[x]);
                }
                getEnvStrings.strings = strings;
            }
            return getEnvStrings.strings;
        }
        function _environ_get(__environ, environ_buf) {
            var bufSize = 0;
            getEnvStrings().forEach((function(string, i) {
                var ptr = environ_buf + bufSize;
                HEAP32[__environ + i * 4 >> 2] = ptr;
                writeAsciiToMemory(string, ptr);
                bufSize += string.length + 1;
            }));
            return 0;
        }
        function _environ_sizes_get(penviron_count, penviron_buf_size) {
            var strings = getEnvStrings();
            HEAP32[penviron_count >> 2] = strings.length;
            var bufSize = 0;
            strings.forEach((function(string) {
                bufSize += string.length + 1;
            }));
            HEAP32[penviron_buf_size >> 2] = bufSize;
            return 0;
        }
        function _fd_close(fd) {
            try {
                var stream = SYSCALLS.getStreamFromFD(fd);
                FS.close(stream);
                return 0;
            } catch (e) {
                if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e);
                return e.errno;
            }
        }
        function _fd_fdstat_get(fd, pbuf) {
            try {
                var stream = SYSCALLS.getStreamFromFD(fd);
                var type = stream.tty ? 2 : FS.isDir(stream.mode) ? 3 : FS.isLink(stream.mode) ? 7 : 4;
                HEAP8[pbuf >> 0] = type;
                return 0;
            } catch (e) {
                if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e);
                return e.errno;
            }
        }
        function _fd_seek(fd, offset_low, offset_high, whence, newOffset) {
            try {
                var stream = SYSCALLS.getStreamFromFD(fd);
                var HIGH_OFFSET = 4294967296;
                var offset = offset_high * HIGH_OFFSET + (offset_low >>> 0);
                var DOUBLE_LIMIT = 9007199254740992;
                if (offset <= -DOUBLE_LIMIT || offset >= DOUBLE_LIMIT) {
                    return -61;
                }
                FS.llseek(stream, offset, whence);
                tempI64 = [ stream.position >>> 0, (tempDouble = stream.position, +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (Math.min(+Math.floor(tempDouble / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> 0 : 0) ], 
                HEAP32[newOffset >> 2] = tempI64[0], HEAP32[newOffset + 4 >> 2] = tempI64[1];
                if (stream.getdents && offset === 0 && whence === 0) stream.getdents = null;
                return 0;
            } catch (e) {
                if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e);
                return e.errno;
            }
        }
        function _fd_write(fd, iov, iovcnt, pnum) {
            try {
                var stream = SYSCALLS.getStreamFromFD(fd);
                var num = SYSCALLS.doWritev(stream, iov, iovcnt);
                HEAP32[pnum >> 2] = num;
                return 0;
            } catch (e) {
                if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e);
                return e.errno;
            }
        }
        function _gettimeofday(ptr) {
            var now = Date.now();
            HEAP32[ptr >> 2] = now / 1e3 | 0;
            HEAP32[ptr + 4 >> 2] = now % 1e3 * 1e3 | 0;
            return 0;
        }
        function _usleep(useconds) {
            var start = _emscripten_get_now();
            while (_emscripten_get_now() - start < useconds / 1e3) {}
        }
        Module["_usleep"] = _usleep;
        function _nanosleep(rqtp, rmtp) {
            if (rqtp === 0) {
                setErrNo(28);
                return -1;
            }
            var seconds = HEAP32[rqtp >> 2];
            var nanoseconds = HEAP32[rqtp + 4 >> 2];
            if (nanoseconds < 0 || nanoseconds > 999999999 || seconds < 0) {
                setErrNo(28);
                return -1;
            }
            if (rmtp !== 0) {
                HEAP32[rmtp >> 2] = 0;
                HEAP32[rmtp + 4 >> 2] = 0;
            }
            return _usleep(seconds * 1e6 + nanoseconds / 1e3);
        }
        function _setTempRet0($i) {
            setTempRet0($i | 0);
        }
        function _sysconf(name) {
            switch (name) {
              case 30:
                return 16384;

              case 85:
                var maxHeapSize = HEAPU8.length;
                return maxHeapSize / 16384;

              case 132:
              case 133:
              case 12:
              case 137:
              case 138:
              case 15:
              case 235:
              case 16:
              case 17:
              case 18:
              case 19:
              case 20:
              case 149:
              case 13:
              case 10:
              case 236:
              case 153:
              case 9:
              case 21:
              case 22:
              case 159:
              case 154:
              case 14:
              case 77:
              case 78:
              case 139:
              case 80:
              case 81:
              case 82:
              case 68:
              case 67:
              case 164:
              case 11:
              case 29:
              case 47:
              case 48:
              case 95:
              case 52:
              case 51:
              case 46:
              case 79:
                return 200809;

              case 27:
              case 246:
              case 127:
              case 128:
              case 23:
              case 24:
              case 160:
              case 161:
              case 181:
              case 182:
              case 242:
              case 183:
              case 184:
              case 243:
              case 244:
              case 245:
              case 165:
              case 178:
              case 179:
              case 49:
              case 50:
              case 168:
              case 169:
              case 175:
              case 170:
              case 171:
              case 172:
              case 97:
              case 76:
              case 32:
              case 173:
              case 35:
                return -1;

              case 176:
              case 177:
              case 7:
              case 155:
              case 8:
              case 157:
              case 125:
              case 126:
              case 92:
              case 93:
              case 129:
              case 130:
              case 131:
              case 94:
              case 91:
                return 1;

              case 74:
              case 60:
              case 69:
              case 70:
              case 4:
                return 1024;

              case 31:
              case 42:
              case 72:
                return 32;

              case 87:
              case 26:
              case 33:
                return 2147483647;

              case 34:
              case 1:
                return 47839;

              case 38:
              case 36:
                return 99;

              case 43:
              case 37:
                return 2048;

              case 0:
                return 2097152;

              case 3:
                return 65536;

              case 28:
                return 32768;

              case 44:
                return 32767;

              case 75:
                return 16384;

              case 39:
                return 1e3;

              case 89:
                return 700;

              case 71:
                return 256;

              case 40:
                return 255;

              case 2:
                return 100;

              case 180:
                return 64;

              case 25:
                return 20;

              case 5:
                return 16;

              case 6:
                return 6;

              case 73:
                return 4;

              case 84:
                {
                    if (typeof navigator === "object") return navigator["hardwareConcurrency"] || 1;
                    return 1;
                }
            }
            setErrNo(28);
            return -1;
        }
        function _time(ptr) {
            var ret = Date.now() / 1e3 | 0;
            if (ptr) {
                HEAP32[ptr >> 2] = ret;
            }
            return ret;
        }
        function runAndAbortIfError(func) {
            try {
                return func();
            } catch (e) {
                abort(e);
            }
        }
        var Asyncify = {
            State: {
                Normal: 0,
                Unwinding: 1,
                Rewinding: 2
            },
            state: 0,
            StackSize: 4096,
            currData: null,
            handleSleepReturnValue: 0,
            exportCallStack: [],
            callStackNameToId: {},
            callStackIdToName: {},
            callStackId: 0,
            afterUnwind: null,
            asyncFinalizers: [],
            sleepCallbacks: [],
            getCallStackId: function(funcName) {
                var id = Asyncify.callStackNameToId[funcName];
                if (id === undefined) {
                    id = Asyncify.callStackId++;
                    Asyncify.callStackNameToId[funcName] = id;
                    Asyncify.callStackIdToName[id] = funcName;
                }
                return id;
            },
            instrumentWasmExports: function(exports) {
                var ret = {};
                for (var x in exports) {
                    (function(x) {
                        var original = exports[x];
                        if (typeof original === "function") {
                            ret[x] = function() {
                                Asyncify.exportCallStack.push(x);
                                try {
                                    return original.apply(null, arguments);
                                } finally {
                                    if (ABORT) return;
                                    var y = Asyncify.exportCallStack.pop();
                                    assert(y === x);
                                    Asyncify.maybeStopUnwind();
                                }
                            };
                        } else {
                            ret[x] = original;
                        }
                    })(x);
                }
                return ret;
            },
            maybeStopUnwind: function() {
                if (Asyncify.currData && Asyncify.state === Asyncify.State.Unwinding && Asyncify.exportCallStack.length === 0) {
                    Asyncify.state = Asyncify.State.Normal;
                    runAndAbortIfError(Module["_asyncify_stop_unwind"]);
                    if (typeof Fibers !== "undefined") {
                        Fibers.trampoline();
                    }
                    if (Asyncify.afterUnwind) {
                        Asyncify.afterUnwind();
                        Asyncify.afterUnwind = null;
                    }
                }
            },
            allocateData: function() {
                var ptr = _malloc(12 + Asyncify.StackSize);
                Asyncify.setDataHeader(ptr, ptr + 12, Asyncify.StackSize);
                Asyncify.setDataRewindFunc(ptr);
                return ptr;
            },
            setDataHeader: function(ptr, stack, stackSize) {
                HEAP32[ptr >> 2] = stack;
                HEAP32[ptr + 4 >> 2] = stack + stackSize;
            },
            setDataRewindFunc: function(ptr) {
                var bottomOfCallStack = Asyncify.exportCallStack[0];
                var rewindId = Asyncify.getCallStackId(bottomOfCallStack);
                HEAP32[ptr + 8 >> 2] = rewindId;
            },
            getDataRewindFunc: function(ptr) {
                var id = HEAP32[ptr + 8 >> 2];
                var name = Asyncify.callStackIdToName[id];
                var func = Module["asm"][name];
                return func;
            },
            handleSleep: function(startAsync) {
                if (ABORT) return;
                noExitRuntime = true;
                if (Asyncify.state === Asyncify.State.Normal) {
                    var reachedCallback = false;
                    var reachedAfterCallback = false;
                    startAsync((function(handleSleepReturnValue) {
                        if (ABORT) return;
                        Asyncify.handleSleepReturnValue = handleSleepReturnValue || 0;
                        reachedCallback = true;
                        if (!reachedAfterCallback) {
                            return;
                        }
                        Asyncify.state = Asyncify.State.Rewinding;
                        runAndAbortIfError((function() {
                            Module["_asyncify_start_rewind"](Asyncify.currData);
                        }));
                        if (typeof Browser !== "undefined" && Browser.mainLoop.func) {
                            Browser.mainLoop.resume();
                        }
                        var start = Asyncify.getDataRewindFunc(Asyncify.currData);
                        var asyncWasmReturnValue = start();
                        if (!Asyncify.currData) {
                            var asyncFinalizers = Asyncify.asyncFinalizers;
                            Asyncify.asyncFinalizers = [];
                            asyncFinalizers.forEach((function(func) {
                                func(asyncWasmReturnValue);
                            }));
                        }
                    }));
                    reachedAfterCallback = true;
                    if (!reachedCallback) {
                        Asyncify.state = Asyncify.State.Unwinding;
                        Asyncify.currData = Asyncify.allocateData();
                        runAndAbortIfError((function() {
                            Module["_asyncify_start_unwind"](Asyncify.currData);
                        }));
                        if (typeof Browser !== "undefined" && Browser.mainLoop.func) {
                            Browser.mainLoop.pause();
                        }
                    }
                } else if (Asyncify.state === Asyncify.State.Rewinding) {
                    Asyncify.state = Asyncify.State.Normal;
                    runAndAbortIfError(Module["_asyncify_stop_rewind"]);
                    _free(Asyncify.currData);
                    Asyncify.currData = null;
                    Asyncify.sleepCallbacks.forEach((function(func) {
                        func();
                    }));
                } else {
                    abort("invalid state: " + Asyncify.state);
                }
                return Asyncify.handleSleepReturnValue;
            },
            handleAsync: function(startAsync) {
                return Asyncify.handleSleep((function(wakeUp) {
                    startAsync().then(wakeUp);
                }));
            }
        };
        var FSNode = function(parent, name, mode, rdev) {
            if (!parent) {
                parent = this;
            }
            this.parent = parent;
            this.mount = parent.mount;
            this.mounted = null;
            this.id = FS.nextInode++;
            this.name = name;
            this.mode = mode;
            this.node_ops = {};
            this.stream_ops = {};
            this.rdev = rdev;
        };
        var readMode = 292 | 73;
        var writeMode = 146;
        Object.defineProperties(FSNode.prototype, {
            read: {
                get: function() {
                    return (this.mode & readMode) === readMode;
                },
                set: function(val) {
                    val ? this.mode |= readMode : this.mode &= ~readMode;
                }
            },
            write: {
                get: function() {
                    return (this.mode & writeMode) === writeMode;
                },
                set: function(val) {
                    val ? this.mode |= writeMode : this.mode &= ~writeMode;
                }
            },
            isFolder: {
                get: function() {
                    return FS.isDir(this.mode);
                }
            },
            isDevice: {
                get: function() {
                    return FS.isChrdev(this.mode);
                }
            }
        });
        FS.FSNode = FSNode;
        FS.staticInit();
        function intArrayFromString(stringy, dontAddNull, length) {
            var len = length > 0 ? length : lengthBytesUTF8(stringy) + 1;
            var u8array = new Array(len);
            var numBytesWritten = stringToUTF8Array(stringy, u8array, 0, u8array.length);
            if (dontAddNull) u8array.length = numBytesWritten;
            return u8array;
        }
        __ATINIT__.push({
            func: function() {
                ___wasm_call_ctors();
            }
        });
        var asmLibraryArg = {
            t: ___sys_getpid,
            v: ___sys_getuid32,
            y: ___sys_ioctl,
            z: ___sys_open,
            u: ___sys_read,
            w: ___sys_uname,
            A: _abort,
            k: array_push_buffer,
            f: blk_read,
            d: blk_write,
            g: _clock_gettime,
            e: discard,
            o: _emscripten_memcpy_big,
            p: _emscripten_resize_heap,
            q: _environ_get,
            r: _environ_sizes_get,
            i: _fd_close,
            s: _fd_fdstat_get,
            m: _fd_seek,
            h: _fd_write,
            j: flush,
            b: _gettimeofday,
            a: wasmMemory,
            x: _nanosleep,
            n: _setTempRet0,
            l: _sysconf,
            c: _time
        };
        var asm = createWasm();
        var ___wasm_call_ctors = Module["___wasm_call_ctors"] = function() {
            return (___wasm_call_ctors = Module["___wasm_call_ctors"] = Module["asm"]["C"]).apply(null, arguments);
        };
        var _free = Module["_free"] = function() {
            return (_free = Module["_free"] = Module["asm"]["D"]).apply(null, arguments);
        };
        var _malloc = Module["_malloc"] = function() {
            return (_malloc = Module["_malloc"] = Module["asm"]["E"]).apply(null, arguments);
        };
        var ___errno_location = Module["___errno_location"] = function() {
            return (___errno_location = Module["___errno_location"] = Module["asm"]["F"]).apply(null, arguments);
        };
        var _malloc_from_js = Module["_malloc_from_js"] = function() {
            return (_malloc_from_js = Module["_malloc_from_js"] = Module["asm"]["G"]).apply(null, arguments);
        };
        var _free_from_js = Module["_free_from_js"] = function() {
            return (_free_from_js = Module["_free_from_js"] = Module["asm"]["H"]).apply(null, arguments);
        };
        var _node_ext2fs_mount = Module["_node_ext2fs_mount"] = function() {
            return (_node_ext2fs_mount = Module["_node_ext2fs_mount"] = Module["asm"]["I"]).apply(null, arguments);
        };
        var _node_ext2fs_trim = Module["_node_ext2fs_trim"] = function() {
            return (_node_ext2fs_trim = Module["_node_ext2fs_trim"] = Module["asm"]["J"]).apply(null, arguments);
        };
        var _node_ext2fs_readdir = Module["_node_ext2fs_readdir"] = function() {
            return (_node_ext2fs_readdir = Module["_node_ext2fs_readdir"] = Module["asm"]["K"]).apply(null, arguments);
        };
        var _node_ext2fs_open = Module["_node_ext2fs_open"] = function() {
            return (_node_ext2fs_open = Module["_node_ext2fs_open"] = Module["asm"]["L"]).apply(null, arguments);
        };
        var _node_ext2fs_read = Module["_node_ext2fs_read"] = function() {
            return (_node_ext2fs_read = Module["_node_ext2fs_read"] = Module["asm"]["M"]).apply(null, arguments);
        };
        var _node_ext2fs_write = Module["_node_ext2fs_write"] = function() {
            return (_node_ext2fs_write = Module["_node_ext2fs_write"] = Module["asm"]["N"]).apply(null, arguments);
        };
        var _node_ext2fs_mkdir = Module["_node_ext2fs_mkdir"] = function() {
            return (_node_ext2fs_mkdir = Module["_node_ext2fs_mkdir"] = Module["asm"]["O"]).apply(null, arguments);
        };
        var _node_ext2fs_unlink = Module["_node_ext2fs_unlink"] = function() {
            return (_node_ext2fs_unlink = Module["_node_ext2fs_unlink"] = Module["asm"]["P"]).apply(null, arguments);
        };
        var _node_ext2fs_chmod = Module["_node_ext2fs_chmod"] = function() {
            return (_node_ext2fs_chmod = Module["_node_ext2fs_chmod"] = Module["asm"]["Q"]).apply(null, arguments);
        };
        var _node_ext2fs_chown = Module["_node_ext2fs_chown"] = function() {
            return (_node_ext2fs_chown = Module["_node_ext2fs_chown"] = Module["asm"]["R"]).apply(null, arguments);
        };
        var _node_ext2fs_close = Module["_node_ext2fs_close"] = function() {
            return (_node_ext2fs_close = Module["_node_ext2fs_close"] = Module["asm"]["S"]).apply(null, arguments);
        };
        var _node_ext2fs_stat_i_mode = Module["_node_ext2fs_stat_i_mode"] = function() {
            return (_node_ext2fs_stat_i_mode = Module["_node_ext2fs_stat_i_mode"] = Module["asm"]["T"]).apply(null, arguments);
        };
        var _node_ext2fs_stat_i_links_count = Module["_node_ext2fs_stat_i_links_count"] = function() {
            return (_node_ext2fs_stat_i_links_count = Module["_node_ext2fs_stat_i_links_count"] = Module["asm"]["U"]).apply(null, arguments);
        };
        var _node_ext2fs_stat_i_uid = Module["_node_ext2fs_stat_i_uid"] = function() {
            return (_node_ext2fs_stat_i_uid = Module["_node_ext2fs_stat_i_uid"] = Module["asm"]["V"]).apply(null, arguments);
        };
        var _node_ext2fs_stat_i_gid = Module["_node_ext2fs_stat_i_gid"] = function() {
            return (_node_ext2fs_stat_i_gid = Module["_node_ext2fs_stat_i_gid"] = Module["asm"]["W"]).apply(null, arguments);
        };
        var _node_ext2fs_stat_blocksize = Module["_node_ext2fs_stat_blocksize"] = function() {
            return (_node_ext2fs_stat_blocksize = Module["_node_ext2fs_stat_blocksize"] = Module["asm"]["X"]).apply(null, arguments);
        };
        var _node_ext2fs_stat_i_size = Module["_node_ext2fs_stat_i_size"] = function() {
            return (_node_ext2fs_stat_i_size = Module["_node_ext2fs_stat_i_size"] = Module["asm"]["Y"]).apply(null, arguments);
        };
        var _node_ext2fs_stat_ino = Module["_node_ext2fs_stat_ino"] = function() {
            return (_node_ext2fs_stat_ino = Module["_node_ext2fs_stat_ino"] = Module["asm"]["Z"]).apply(null, arguments);
        };
        var _node_ext2fs_stat_i_blocks = Module["_node_ext2fs_stat_i_blocks"] = function() {
            return (_node_ext2fs_stat_i_blocks = Module["_node_ext2fs_stat_i_blocks"] = Module["asm"]["_"]).apply(null, arguments);
        };
        var _node_ext2fs_stat_i_atime = Module["_node_ext2fs_stat_i_atime"] = function() {
            return (_node_ext2fs_stat_i_atime = Module["_node_ext2fs_stat_i_atime"] = Module["asm"]["$"]).apply(null, arguments);
        };
        var _node_ext2fs_stat_i_mtime = Module["_node_ext2fs_stat_i_mtime"] = function() {
            return (_node_ext2fs_stat_i_mtime = Module["_node_ext2fs_stat_i_mtime"] = Module["asm"]["aa"]).apply(null, arguments);
        };
        var _node_ext2fs_stat_i_ctime = Module["_node_ext2fs_stat_i_ctime"] = function() {
            return (_node_ext2fs_stat_i_ctime = Module["_node_ext2fs_stat_i_ctime"] = Module["asm"]["ba"]).apply(null, arguments);
        };
        var _node_ext2fs_umount = Module["_node_ext2fs_umount"] = function() {
            return (_node_ext2fs_umount = Module["_node_ext2fs_umount"] = Module["asm"]["ca"]).apply(null, arguments);
        };
        var stackSave = Module["stackSave"] = function() {
            return (stackSave = Module["stackSave"] = Module["asm"]["da"]).apply(null, arguments);
        };
        var stackRestore = Module["stackRestore"] = function() {
            return (stackRestore = Module["stackRestore"] = Module["asm"]["ea"]).apply(null, arguments);
        };
        var stackAlloc = Module["stackAlloc"] = function() {
            return (stackAlloc = Module["stackAlloc"] = Module["asm"]["fa"]).apply(null, arguments);
        };
        var dynCall_ii = Module["dynCall_ii"] = function() {
            return (dynCall_ii = Module["dynCall_ii"] = Module["asm"]["ga"]).apply(null, arguments);
        };
        var dynCall_iii = Module["dynCall_iii"] = function() {
            return (dynCall_iii = Module["dynCall_iii"] = Module["asm"]["ha"]).apply(null, arguments);
        };
        var dynCall_vi = Module["dynCall_vi"] = function() {
            return (dynCall_vi = Module["dynCall_vi"] = Module["asm"]["ia"]).apply(null, arguments);
        };
        var dynCall_iijj = Module["dynCall_iijj"] = function() {
            return (dynCall_iijj = Module["dynCall_iijj"] = Module["asm"]["ja"]).apply(null, arguments);
        };
        var dynCall_iij = Module["dynCall_iij"] = function() {
            return (dynCall_iij = Module["dynCall_iij"] = Module["asm"]["ka"]).apply(null, arguments);
        };
        var dynCall_viji = Module["dynCall_viji"] = function() {
            return (dynCall_viji = Module["dynCall_viji"] = Module["asm"]["la"]).apply(null, arguments);
        };
        var dynCall_iiji = Module["dynCall_iiji"] = function() {
            return (dynCall_iiji = Module["dynCall_iiji"] = Module["asm"]["ma"]).apply(null, arguments);
        };
        var dynCall_iijii = Module["dynCall_iijii"] = function() {
            return (dynCall_iijii = Module["dynCall_iijii"] = Module["asm"]["na"]).apply(null, arguments);
        };
        var dynCall_iijji = Module["dynCall_iijji"] = function() {
            return (dynCall_iijji = Module["dynCall_iijji"] = Module["asm"]["oa"]).apply(null, arguments);
        };
        var dynCall_iiijjii = Module["dynCall_iiijjii"] = function() {
            return (dynCall_iiijjii = Module["dynCall_iiijjii"] = Module["asm"]["pa"]).apply(null, arguments);
        };
        var dynCall_iiiiiiii = Module["dynCall_iiiiiiii"] = function() {
            return (dynCall_iiiiiiii = Module["dynCall_iiiiiiii"] = Module["asm"]["qa"]).apply(null, arguments);
        };
        var dynCall_iiiiii = Module["dynCall_iiiiii"] = function() {
            return (dynCall_iiiiii = Module["dynCall_iiiiii"] = Module["asm"]["ra"]).apply(null, arguments);
        };
        var dynCall_viiii = Module["dynCall_viiii"] = function() {
            return (dynCall_viiii = Module["dynCall_viiii"] = Module["asm"]["sa"]).apply(null, arguments);
        };
        var dynCall_iiiii = Module["dynCall_iiiii"] = function() {
            return (dynCall_iiiii = Module["dynCall_iiiii"] = Module["asm"]["ta"]).apply(null, arguments);
        };
        var dynCall_iiii = Module["dynCall_iiii"] = function() {
            return (dynCall_iiii = Module["dynCall_iiii"] = Module["asm"]["ua"]).apply(null, arguments);
        };
        var dynCall_iidiiii = Module["dynCall_iidiiii"] = function() {
            return (dynCall_iidiiii = Module["dynCall_iidiiii"] = Module["asm"]["va"]).apply(null, arguments);
        };
        var dynCall_vii = Module["dynCall_vii"] = function() {
            return (dynCall_vii = Module["dynCall_vii"] = Module["asm"]["wa"]).apply(null, arguments);
        };
        var dynCall_jiji = Module["dynCall_jiji"] = function() {
            return (dynCall_jiji = Module["dynCall_jiji"] = Module["asm"]["xa"]).apply(null, arguments);
        };
        var _asyncify_start_unwind = Module["_asyncify_start_unwind"] = function() {
            return (_asyncify_start_unwind = Module["_asyncify_start_unwind"] = Module["asm"]["ya"]).apply(null, arguments);
        };
        var _asyncify_stop_unwind = Module["_asyncify_stop_unwind"] = function() {
            return (_asyncify_stop_unwind = Module["_asyncify_stop_unwind"] = Module["asm"]["za"]).apply(null, arguments);
        };
        var _asyncify_start_rewind = Module["_asyncify_start_rewind"] = function() {
            return (_asyncify_start_rewind = Module["_asyncify_start_rewind"] = Module["asm"]["Aa"]).apply(null, arguments);
        };
        var _asyncify_stop_rewind = Module["_asyncify_stop_rewind"] = function() {
            return (_asyncify_stop_rewind = Module["_asyncify_stop_rewind"] = Module["asm"]["Ba"]).apply(null, arguments);
        };
        Module["ccall"] = ccall;
        var calledRun;
        function ExitStatus(status) {
            this.name = "ExitStatus";
            this.message = "Program terminated with exit(" + status + ")";
            this.status = status;
        }
        dependenciesFulfilled = function runCaller() {
            if (!calledRun) run();
            if (!calledRun) dependenciesFulfilled = runCaller;
        };
        function run(args) {
            args = args || arguments_;
            if (runDependencies > 0) {
                return;
            }
            preRun();
            if (runDependencies > 0) return;
            function doRun() {
                if (calledRun) return;
                calledRun = true;
                Module["calledRun"] = true;
                if (ABORT) return;
                initRuntime();
                preMain();
                if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"]();
                postRun();
            }
            if (Module["setStatus"]) {
                Module["setStatus"]("Running...");
                setTimeout((function() {
                    setTimeout((function() {
                        Module["setStatus"]("");
                    }), 1);
                    doRun();
                }), 1);
            } else {
                doRun();
            }
        }
        Module["run"] = run;
        if (Module["preInit"]) {
            if (typeof Module["preInit"] == "function") Module["preInit"] = [ Module["preInit"] ];
            while (Module["preInit"].length > 0) {
                Module["preInit"].pop()();
            }
        }
        noExitRuntime = true;
        run();
    }, (__unused_webpack_module, exports) => {
        "use strict";
        exports.CODE_TO_ERRNO = {
            E2BIG: 1,
            EACCES: 2,
            EADDRINUSE: 3,
            EADDRNOTAVAIL: 4,
            EAFNOSUPPORT: 5,
            EAGAIN: 6,
            EALREADY: 7,
            EBADF: 8,
            EBADMSG: 9,
            EBUSY: 10,
            ECANCELED: 11,
            ECHILD: 12,
            ECONNABORTED: 13,
            ECONNREFUSED: 14,
            ECONNRESET: 15,
            EDEADLOCK: 16,
            EDESTADDRREQ: 17,
            EDOM: 18,
            EDQUOT: 19,
            EEXIST: 20,
            EFAULT: 21,
            EFBIG: 22,
            EHOSTUNREACH: 23,
            EIDRM: 24,
            EILSEQ: 25,
            EINPROGRESS: 26,
            EINTR: 27,
            EINVAL: 28,
            EIO: 29,
            EISCONN: 30,
            EISDIR: 31,
            ELOOP: 32,
            EMFILE: 33,
            EMLINK: 34,
            EMSGSIZE: 35,
            EMULTIHOP: 36,
            ENAMETOOLONG: 37,
            ENETDOWN: 38,
            ENETRESET: 39,
            ENETUNREACH: 40,
            ENFILE: 41,
            ENOBUFS: 42,
            ENODEV: 43,
            ENOENT: 44,
            ENOEXEC: 45,
            ENOLCK: 46,
            ENOLINK: 47,
            ENOMEM: 48,
            ENOMSG: 49,
            ENOPROTOOPT: 50,
            ENOSPC: 51,
            ENOSYS: 52,
            ENOTCONN: 53,
            ENOTDIR: 54,
            ENOTEMPTY: 55,
            ENOTRECOVERABLE: 56,
            ENOTSOCK: 57,
            ENOTTY: 59,
            ENXIO: 60,
            EOVERFLOW: 61,
            EOWNERDEAD: 62,
            EPERM: 63,
            EPIPE: 64,
            EPROTO: 65,
            EPROTONOSUPPORT: 66,
            EPROTOTYPE: 67,
            ERANGE: 68,
            EROFS: 69,
            ESPIPE: 70,
            ESRCH: 71,
            ESTALE: 72,
            ETIMEDOUT: 73,
            ETXTBSY: 74,
            EXDEV: 75
        };
        exports.ERRNO_TO_CODE = {};
        for (const [key, value] of Object.entries(exports.CODE_TO_ERRNO)) {
            exports.ERRNO_TO_CODE[value] = key;
        }
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        const {ERRNO_TO_CODE} = __webpack_require__(76);
        const Module = __webpack_require__(75);
        const queue = __webpack_require__(78);
        async function promiseToCallback(promise, callback) {
            try {
                const result = await promise;
                callback(null, result);
            } catch (error) {
                callback(error);
            }
        }
        exports.promiseToCallback = promiseToCallback;
        class ErrnoException extends Error {
            constructor(errno, syscall, args) {
                const code = ERRNO_TO_CODE[errno] || "UNKNOWN";
                super(`${syscall} ${code} (${errno}) args: ${JSON.stringify(args)}`);
                this.name = "ErrnoException";
                this.errno = errno;
                this.syscall = syscall;
                this.code = code;
            }
        }
        exports.ErrnoException = ErrnoException;
        function ccallThrow(name, returnType, argsType, args) {
            const result = Module.ccall(name, returnType, argsType, args);
            if (result < 0) {
                throw new ErrnoException(-result, name, args);
            }
            return result;
        }
        exports.ccallThrow = ccallThrow;
        async function ccallThrowAsync(name, returnType, argsType, args) {
            const result = await queue.addOperation(Module.ccall, [ name, returnType, argsType, args, {
                async: true
            } ]);
            if (result < 0) {
                throw new ErrnoException(-result, name, args);
            }
            return result;
        }
        exports.ccallThrowAsync = ccallThrowAsync;
        async function withHeapBuffer(length, fn) {
            const heapBufferPointer = ccallThrow("malloc_from_js", "number", [ "number" ], [ length ]);
            const heapBuffer = Module.getBuffer(heapBufferPointer, length);
            try {
                return await fn(heapBuffer, heapBufferPointer);
            } finally {
                ccallThrow("free_from_js", "void", [ "number" ], [ heapBufferPointer ]);
            }
        }
        exports.withHeapBuffer = withHeapBuffer;
        function rstripSlashesBuffer(buf) {
            while (buf[buf.length - 1] === 47) {
                buf = buf.slice(0, buf.length - 1);
            }
            return buf;
        }
        async function withPathAsHeapBuffer(path, fn) {
            if (!Buffer.isBuffer(path)) {
                path = Buffer.from(path);
            }
            path = rstripSlashesBuffer(path);
            const length = path.length + 1;
            return await withHeapBuffer(length, (async (heapBuffer, heapBufferPointer) => {
                heapBuffer[length - 1] = 0;
                path.copy(heapBuffer);
                return await fn(heapBufferPointer);
            }));
        }
        exports.withPathAsHeapBuffer = withPathAsHeapBuffer;
    }, (__unused_webpack_module, exports) => {
        "use strict";
        let running = false;
        const queue = [];
        async function run() {
            running = true;
            if (queue.length === 0) {
                running = false;
                return;
            }
            const {fn, args, resolve, reject} = queue.shift();
            try {
                resolve(await fn(...args));
            } catch (error) {
                reject(error);
            } finally {
                await run();
            }
        }
        exports.addOperation = function(fn, args) {
            return new Promise(((resolve, reject) => {
                queue.push({
                    fn,
                    args,
                    resolve,
                    reject
                });
                if (!running) {
                    run();
                }
            }));
        };
    }, module => {
        "use strict";
        module.exports = require("buffer");
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        var events = __webpack_require__(26), streams = __webpack_require__(17), fifolock = __webpack_require__(81), S = __webpack_require__(82), _ = __webpack_require__(84);
        exports.createFileSystem = function(volume, opts, cb) {
            if (typeof opts === "function") {
                cb = opts;
                opts = null;
            }
            opts = _.extend({
                ro: false,
                noatime: true,
                modmode: 73,
                umask: "umask" in process ? process.umask() : 18,
                uid: "getuid" in process ? process.getuid() : 0,
                gid: "getgid" in process ? process.getgid() : 0
            }, opts);
            if (!volume.writeSectors) opts.ro = true;
            if (opts.ro) opts.noatime = true;
            var fs = new events.EventEmitter, vol = null, dir = __webpack_require__(86), c = __webpack_require__(87), q = fifolock();
            var GROUP = _.log.level < _.log.INFO ? q.TRANSACTION_WRAPPER.bind({
                postAcquire: function(proceed) {
                    _.log(_.log.DBG, "=== Starting GROUP ===");
                    proceed();
                },
                preRelease: function(finish) {
                    _.log(_.log.DBG, "=== Finishing GROUP ===");
                    finish();
                }
            }) : q.TRANSACTION_WRAPPER;
            q.acquire((function(unlock) {
                var d = _.allocBuffer(volume.sectorSize);
                volume.readSectors(0, d, (function(e) {
                    if (e) fs.emit("error", e); else {
                        try {
                            init(d);
                        } catch (e) {
                            fs.emit("error", e);
                            unlock();
                            return;
                        }
                        fs.emit("ready");
                    }
                    unlock();
                }));
            }));
            if (cb) fs.on("error", cb).on("ready", cb.bind(null, null));
            function init(bootSector) {
                vol = __webpack_require__(88).init(volume, opts, bootSector);
                fs._dirIterator = dir.iterator.bind(dir);
                var entryInfoByPath = {}, baseEntry = {
                    _refs: 0,
                    _record: function() {
                        entryInfoByPath[this.path] = this;
                        if (this.parent) this.parent.retain();
                        return this;
                    },
                    retain: function() {
                        if (!this._refs) this._record();
                        this._refs += 1;
                        return this;
                    },
                    release: function() {
                        this._refs -= 1;
                        if (!this._refs) this._rescind();
                    },
                    _rescind: function() {
                        if (this.parent) this.parent.release();
                        delete entryInfoByPath[this.path];
                    }
                };
                fs._createSharedEntry = function(path, entry, chain, parent) {
                    return _.extend(Object.create(baseEntry), {
                        _refs: 0,
                        path,
                        entry,
                        chain,
                        parent
                    }).retain();
                };
                fs._createSharedEntry("/", {
                    Attr: {
                        directory: true
                    }
                }, vol.rootDirectoryChain);
                fs._sharedEntryForSteps = function(steps, opts, cb) {
                    var path = steps.join("/") || "/", name = steps.pop(), info = entryInfoByPath[path];
                    if (info) cb(null, info.retain()); else fs._sharedEntryForSteps(steps, {}, (function(e, parentInfo) {
                        if (e) cb(e); else if (!parentInfo.entry.Attr.directory) cb(S.err.NOTDIR()); else dir.findInDirectory(vol, parentInfo.chain, name, opts, (function(e, entry) {
                            if (e && !opts.prepareForCreate) cb(e); else if (e) cb(e, {
                                missingChild: _.extend(entry, {
                                    name
                                }),
                                parent: parentInfo
                            }); else cb(null, fs._createSharedEntry(path, entry, vol.chainForCluster(entry._firstCluster), parentInfo));
                        }));
                    }));
                };
                fs._updateEntry = dir.updateEntry.bind(dir, vol);
                fs._makeStat = dir.makeStat.bind(dir, vol);
                fs._addFile = dir.addFile.bind(dir, vol);
                fs._initDir = dir.init.bind(dir, vol);
            }
            var fileDescriptors = [ null, null, null ];
            fs.open = function(path, flags, mode, cb, _n_) {
                if (typeof mode === "function") {
                    _n_ = cb;
                    cb = mode;
                    mode = 438;
                }
                cb = GROUP(cb, (function() {
                    var _fd = {
                        flags: null,
                        entry: null,
                        chain: null,
                        pos: 0
                    }, f = _.parseFlags(flags);
                    if (vol.opts.ro && (f.write || f.create || f.truncate)) return _.delayedCall(cb, S.err.ROFS()); else _fd.flags = f;
                    fs._sharedEntryForSteps(_.absoluteSteps(path), {
                        prepareForCreate: f.create
                    }, (function(e, info) {
                        if (e && !(e.code === "NOENT" && f.create && info)) cb(e); else if (e) fs._addFile(info.parent.chain, info.missingChild, {
                            dir: f._openDir
                        }, (function(e, newEntry, newChain) {
                            if (e) cb(e); else finish(fs._createSharedEntry(_.absolutePath(path), newEntry, newChain, info.parent));
                        })); else if (info && f.exclusive) cb(S.err.EXIST()); else if (info.entry.Attr.directory && !f._openDir) cb(S.err.ISDIR()); else if (f.write && info.entry.Attr.readonly) cb(S.err.ACCES()); else finish(info);
                        function finish(fileInfo) {
                            var fd = fileDescriptors.push(_fd) - 1;
                            _fd.info = fileInfo;
                            _fd.entry = fileInfo.entry;
                            _fd.chain = fileInfo.chain;
                            if (f.append) _fd.pos = _fd.entry._size;
                            if (f._openDir) _fd.chain.cacheAdvice = "WILLNEED";
                            if (f.truncate && _fd.entry._size) fs.ftruncate(fd, 0, (function(e) {
                                cb(e, fd);
                            }), "_nested_"); else _.delayedCall(cb, null, fd);
                        }
                    }));
                }), _n_ === "_nested_");
            };
            fs.fstat = function(fd, cb, _n_) {
                cb = GROUP(cb, (function() {
                    var _fd = fileDescriptors[fd];
                    if (!_fd || !_fd.flags.read) _.delayedCall(cb, S.err.BADF()); else _.delayedCall(cb, null, fs._makeStat(_fd.entry));
                }), _n_ === "_nested_");
            };
            fs.futimes = function(fd, atime, mtime, cb, _n_) {
                cb = GROUP(cb, (function() {
                    var _fd = fileDescriptors[fd];
                    if (!_fd || !_fd.flags.write) _.delayedCall(cb, S.err.BADF()); else fs._updateEntry(_fd.entry, {
                        atime: atime || true,
                        mtime: mtime || true
                    }, cb);
                }), _n_ === "_nested_");
            };
            fs.fchmod = function(fd, mode, cb, _n_) {
                cb = GROUP(cb, (function() {
                    var _fd = fileDescriptors[fd];
                    if (!_fd || !_fd.flags.write) _.delayedCall(cb, S.err.BADF()); else {
                        mode &= S._I._chmoddable;
                        if (_fd.entry.Attr.directory) mode |= S._I.FDIR; else if (!_fd.entry.Attr.volume_id) mode |= S._I.FREG;
                        fs._updateEntry(_fd.entry, {
                            mode
                        }, cb);
                    }
                }), _n_ === "_nested_");
            };
            fs.read = function(fd, buf, off, len, pos, cb, _n_) {
                cb = GROUP(cb, (function() {
                    var _fd = fileDescriptors[fd];
                    if (!_fd || !_fd.flags.read) _.delayedCall(cb, S.err.BADF());
                    var _pos = pos === null ? _fd.pos : pos, _len = Math.min(len, _fd.entry._size - _pos), _buf = buf.slice(off, off + _len);
                    _fd.chain.readFromPosition(_pos, _buf, (function(e, bytes, slice) {
                        if (_.workaroundTessel380) _buf.copy(buf, off);
                        _fd.pos = _pos + bytes;
                        if (e || vol.opts.noatime) finish(e); else fs._updateEntry(_fd.entry, {
                            atime: true
                        }, finish);
                        function finish(e) {
                            cb(e, bytes, buf);
                        }
                    }));
                }), _n_ === "_nested_");
            };
            fs._readdir = function(fd, cb, _n_) {
                cb = GROUP(cb, (function() {
                    var _fd = fileDescriptors[fd];
                    if (!_fd || !_fd.flags.read) _.delayedCall(cb, S.err.BADF()); else {
                        var entryNames = [], getNextEntry = fs._dirIterator(_fd.chain);
                        function processNext() {
                            getNextEntry((function(e, d) {
                                if (e) cb(e); else if (!d && !entryNames.length) cb(null, entryNames); else if (!d) cb(null, entryNames.sort()); else {
                                    if (d._name !== "." && d._name !== "..") entryNames.push(d._name);
                                    processNext();
                                }
                            }));
                        }
                        processNext();
                    }
                }), _n_ === "_nested_");
            };
            fs._mkdir = function(fd, cb, _n_) {
                cb = GROUP(cb, (function() {
                    var _fd = fileDescriptors[fd];
                    if (!_fd || !_fd.flags.write) _.delayedCall(cb, S.err.BADF()); else fs._initDir(_fd.info, cb);
                }), _n_ === "_nested_");
            };
            fs.write = function(fd, buf, off, len, pos, cb, _n_) {
                cb = GROUP(cb, (function() {
                    var _fd = fileDescriptors[fd];
                    if (!_fd || !_fd.flags.write) _.delayedCall(cb, S.err.BADF());
                    var _pos = pos === null || _fd.flags.append ? _fd.pos : pos, _buf = buf.slice(off, off + len);
                    if (_pos > _fd.entry._size) {
                        var padLen = _pos - _fd.entry._size, padBuf = _.allocBuffer(padLen + _buf.length);
                        padBuf.fill(0, 0, padLen);
                        _buf.copy(padBuf, padLen);
                        _pos = _fd.entry._size;
                        _buf = padBuf;
                    }
                    _fd.chain.writeToPosition(_pos, _buf, (function(e) {
                        _fd.pos = _pos + len;
                        var newSize = Math.max(_fd.entry._size, _fd.pos), newInfo = {
                            size: newSize,
                            _touch: true
                        };
                        fs._updateEntry(_fd.entry, newInfo, (function(ee) {
                            cb(e || ee, len, buf);
                        }));
                    }));
                }), _n_ === "_nested_");
            };
            fs.ftruncate = function(fd, len, cb, _n_) {
                cb = GROUP(cb, (function() {
                    var _fd = fileDescriptors[fd];
                    if (!_fd || !_fd.flags.write) _.delayedCall(cb, S.err.BADF());
                    var newStats = {
                        size: len,
                        _touch: true
                    };
                    if (len === _fd.entry._size) _.delayedCall(cb); else if (len < _fd.entry._size) fs._updateEntry(_fd.entry, newStats, (function(e) {
                        if (e) cb(e); else _fd.chain.truncate(Math.ceil(len / _fd.chain.sectorSize), cb);
                    })); else _fd.chain.writeToPosition(_fd.entry._size, _.allocBuffer(len - _fd.entry._size, 0), (function(e) {
                        if (e) cb(e); else fs._updateEntry(_fd.entry, newStats, cb);
                    }));
                }), _n_ === "_nested_");
            };
            fs._fadviseSync = function(fd, off, len, advice) {
                if (off !== 0 || len !== 0) throw Error("Cache advise can currently be given only for whole file!");
                var _fd = fileDescriptors[fd];
                if (!_fd) throw S.err.BADF(); else _fd.chain.cacheAdvice = advice;
            };
            fs.fsync = function(fd, cb) {
                var _fd = fileDescriptors[fd];
                if (!_fd) _.delayedCall(cb, S.err.BADF()); else _.delayedCall(cb);
            };
            fs.close = function(fd, cb) {
                var _fd = fileDescriptors[fd];
                if (!_fd) _.delayedCall(cb, S.err.BADF()); else setTimeout(_fd.info.release.bind(_fd.info), 500), 
                _.delayedCall(cb, fileDescriptors[fd] = null);
            };
            var workaroundTessel436;
            try {
                new __webpack_require__(17).Readable({
                    encoding: "utf8"
                });
                new streams.Readable({
                    encoding: "utf8"
                });
            } catch (e) {
                workaroundTessel436 = true;
            }
            function _createStream(StreamType, path, opts) {
                if (workaroundTessel436 && "encoding" in opts) {
                    console.warn("Tessel does not currently support encoding option for Readable streams, discarding!");
                    delete opts.encoding;
                }
                var fd = opts.fd !== null ? opts.fd : "_opening_", pos = opts.start, stream = new StreamType(opts);
                if (fd === "_opening_") fs.open(path, opts.flags, opts.mode, (function(e, _fd) {
                    if (e) {
                        fd = "_open_error_";
                        stream.emit("error", e);
                    } else {
                        fd = _fd;
                        fs._fadviseSync(fd, 0, 0, "SEQUENTIAL");
                        stream.emit("open", fd);
                    }
                }));
                function autoClose(tombstone) {
                    if (opts.autoClose) fs.close(fd, (function(e) {
                        if (e) stream.emit("error", e); else stream.emit("close");
                    }));
                    fd = tombstone;
                }
                if (StreamType === streams.Readable) {
                    stream._read = function(n) {
                        var buf;
                        n = Math.min(n, opts.end - pos);
                        if (fd === "_opening_") stream.once("open", (function() {
                            stream._read(n);
                        })); else if (pos > opts.end) stream.push(null); else if (n > 0) buf = _.allocBuffer(n), 
                        fs.read(fd, buf, 0, n, pos, (function(e, n, d) {
                            if (e) {
                                autoClose("_read_error_");
                                stream.emit("error", e);
                            } else stream.push(n ? d.slice(0, n) : null);
                        })), pos += n; else stream.push(null);
                    };
                    stream.once("end", (function() {
                        autoClose("_ended_");
                    }));
                } else if (StreamType === streams.Writable) {
                    stream.bytesWritten = 0;
                    stream._write = function(data, _enc, cb) {
                        if (fd === "_opening_") stream.once("open", (function() {
                            stream._write(data, null, cb);
                        })); else fs.write(fd, data, 0, data.length, pos, (function(e, n) {
                            if (e) {
                                autoClose("_write_error_");
                                cb(e);
                            } else {
                                stream.bytesWritten += n;
                                cb();
                            }
                        })), pos += data.length;
                    };
                    stream.once("finish", (function() {
                        autoClose("_finished_");
                    }));
                }
                return stream;
            }
            fs.createReadStream = function(path, opts) {
                return _createStream(streams.Readable, path, _.extend({
                    start: 0,
                    end: Infinity,
                    flags: "r",
                    mode: 438,
                    encoding: null,
                    fd: null,
                    autoClose: true
                }, opts));
            };
            fs.createWriteStream = function(path, opts) {
                return _createStream(streams.Writable, path, _.extend({
                    start: 0,
                    flags: "w",
                    mode: 438,
                    fd: null,
                    autoClose: true
                }, opts, {
                    decodeStrings: true,
                    objectMode: false
                }));
            };
            function _fdOperation(path, opts, fn, cb) {
                cb = GROUP(cb, (function() {
                    opts.advice || (opts.advice = "NORMAL");
                    fs.open(path, opts.flag, (function(e, fd) {
                        if (e) cb(e); else fs._fadviseSync(fd, 0, 0, opts.advice), fn(fd, (function() {
                            var ctx = this, args = arguments;
                            fs.close(fd, (function(closeErr) {
                                cb.apply(ctx, args);
                            }), "_nested_");
                        }));
                    }), "_nested_");
                }));
            }
            fs.stat = fs.lstat = function(path, cb) {
                _fdOperation(path, {
                    flag: "r"
                }, (function(fd, cb) {
                    fs.fstat(fd, cb, "_nested_");
                }), cb);
            };
            fs.exists = function(path, cb) {
                fs.stat(path, (function(err) {
                    cb(err ? false : true);
                }));
            };
            fs.readFile = function(path, opts, cb) {
                if (typeof opts === "function") {
                    cb = opts;
                    opts = {};
                }
                opts.flag || (opts.flag = "r");
                opts.advice || (opts.advice = "NOREUSE");
                _fdOperation(path, opts, (function(fd, cb) {
                    fs.fstat(fd, (function(e, stat) {
                        if (e) return cb(e); else {
                            var buffer = _.allocBuffer(stat.size);
                            fs.read(fd, buffer, 0, buffer.length, null, (function(e) {
                                if (e) cb(e); else cb(null, opts.encoding ? buffer.toString(opts.encoding) : buffer);
                            }), "_nested_");
                        }
                    }), "_nested_");
                }), cb);
            };
            fs.writeFile = function(path, data, opts, cb) {
                if (typeof opts === "function") {
                    cb = opts;
                    opts = {};
                }
                opts.flag || (opts.flag = "w");
                opts.advice || (opts.advice = "NOREUSE");
                _fdOperation(path, opts, (function(fd, cb) {
                    if (typeof data === "string") data = _.bufferFrom(data, opts.encoding || "utf8");
                    fs.write(fd, data, 0, data.length, null, (function(e) {
                        cb(e);
                    }), "_nested_");
                }), cb);
            };
            fs.appendFile = function(path, data, opts, cb) {
                if (typeof opts === "function") {
                    cb = opts;
                    opts = {};
                }
                opts.flag || (opts.flag = "a");
                fs.writeFile(path, data, opts, cb);
            };
            fs.truncate = function(path, len, cb) {
                _fdOperation(path, {
                    flag: "r+"
                }, (function(fd, cb) {
                    fs.ftruncate(fd, len, cb, "_nested_");
                }), cb);
            };
            fs.readdir = function(path, cb) {
                _fdOperation(path, {
                    flag: "\\r"
                }, (function(fd, cb) {
                    fs._readdir(fd, cb, "_nested_");
                }), cb);
            };
            fs.mkdir = function(path, mode, cb) {
                if (typeof mode === "function") {
                    cb = mode;
                    mode = 511;
                }
                _fdOperation(path, {
                    flag: "\\wx"
                }, (function(fd, cb) {
                    fs._mkdir(fd, cb, "_nested_");
                }), cb);
            };
            fs.utimes = function(path, atime, mtime, cb) {
                _fdOperation(path, {
                    flag: "r+"
                }, (function(fd, cb) {
                    fs.futimes(fd, atime, mtime, cb, "_nested_");
                }), cb);
            };
            fs.chmod = fs.lchmod = function(path, mode, cb) {
                _fdOperation(path, {
                    flag: "\\r+"
                }, (function(fd, cb) {
                    fs.fchmod(fd, mode, cb, "_nested_");
                }), cb);
            };
            fs.chown = fs.lchown = function(path, uid, gid, cb) {
                _fdOperation(path, {
                    flag: "\\r+"
                }, (function(fd, cb) {
                    fs.fchown(fd, uid, gid, cb, "_nested_");
                }), cb);
            };
            fs.link = function(src, dst, cb) {
                _.delayedCall(cb, S.err.NOSYS());
            };
            fs.symlink = function(src, dst, type, cb) {
                if (typeof type === "function") {
                    cb = type;
                    type = null;
                }
                _.delayedCall(cb, S.err.NOSYS());
            };
            fs.readlink = function(path, cb) {
                _fdOperation(path, {
                    flag: "\\r"
                }, (function(fd, cb) {
                    cb(S.err.INVAL());
                }), cb);
            };
            fs.realpath = function(path, cache, cb) {
                if (typeof cache === "function") {
                    cb = cache;
                    cache = null;
                }
                if (cache) _.delayedCall(cb, S.err.NOSYS()); else _fdOperation(path, {
                    flag: "\\r"
                }, (function(fd, cb) {
                    cb(null, _.absolutePath(path));
                }), cb);
            };
            fs.fchown = function(fd, uid, gid, cb, _n_) {
                cb = GROUP(cb, (function() {
                    var _fd = fileDescriptors[fd];
                    if (!_fd || !_fd.flags.write) _.delayedCall(cb, S.err.BADF()); else _.delayedCall(cb, S.err.NOSYS());
                }), _n_ === "_nested_");
            };
            return fs;
        };
    }, module => {
        module.exports = function SerialQueue() {
            var q = {}, tasks = [];
            function runNext() {
                tasks[0]((function() {
                    tasks.shift();
                    if (tasks.length) runNext();
                }));
            }
            q.acquire = function(fn) {
                var len = tasks.push(fn);
                if (len === 1) process.nextTick(runNext);
            };
            q.TRANSACTION_WRAPPER = function(cb, proceed, nested) {
                if (nested) return process.nextTick(proceed), cb;
                var _releaseQueue;
                if ("postAcquire" in this) proceed = this.postAcquire.bind(q, proceed);
                q.acquire((function(releaseQueue) {
                    _releaseQueue = releaseQueue;
                    proceed();
                }));
                var capturedCB, finish = "preRelease" in this ? this.preRelease.bind(q, _finish) : _finish;
                function _finish() {
                    capturedCB();
                    _releaseQueue();
                }
                return function() {
                    capturedCB = Function.prototype.apply.bind(cb, this, arguments);
                    finish.call(null, Array.prototype.slice.call(arguments, 0), this);
                };
            };
            return q;
        };
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        var _ = __webpack_require__(83), __ = __webpack_require__(84);
        var bootBase = _.struct([ _.byte("jmpBoot", 3), _.char("OEMName", 8), _.uint16le("BytsPerSec"), _.uint8("SecPerClus"), _.uint16le("ResvdSecCnt"), _.uint8("NumFATs"), _.uint16le("RootEntCnt"), _.uint16le("TotSec16"), _.uint8("Media"), _.uint16le("FATSz16"), _.uint16le("SecPerTrk"), _.uint16le("NumHeads"), _.uint32le("HiddSec"), _.uint32le("TotSec32") ]);
        var bootInfo = _.struct([ _.uint8("DrvNum"), _.uint8("Reserved1"), _.uint8("BootSig"), _.uint32le("VolID"), _.char("VolLab", 11), _.char("FilSysType", 8) ]);
        exports.boot16 = _.struct([ bootBase, bootInfo ]);
        exports.boot32 = _.struct([ bootBase, _.uint32le("FATSz32"), _.struct("ExtFlags", [ _.ubit("NumActiveFAT", 4), _.ubit("_reserved1", 3), _.bool("MirroredFAT"), _.ubit("_reserved2", 8) ].reverse()), _.struct("FSVer", [ _.uint8("Major"), _.uint8("Minor") ]), _.uint32le("RootClus"), _.uint16le("FSInfo"), _.uint16le("BkBootSec"), _.byte("Reserved", 12), bootInfo ]);
        var _time = _.struct([ _.ubit("hours", 5), _.ubit("minutes", 6), _.ubit("seconds_2", 5) ]), time = {
            valueFromBytes: function(buf, off) {
                off || (off = {
                    bytes: 0
                });
                var _buf = __.bufferFrom([ buf[off.bytes + 1], buf[off.bytes + 0] ]), val = _time.valueFromBytes(_buf);
                off.bytes += this.size;
                return val;
            },
            bytesFromValue: function(val, buf, off) {
                val || (val = {
                    hours: 0,
                    minutes: 0,
                    seconds_2: 0
                });
                buf || (buf = __.allocBuffer(this.size));
                off || (off = {
                    bytes: 0
                });
                var _buf = _time.bytesFromValue(val);
                buf[off.bytes + 1] = _buf[0];
                buf[off.bytes + 0] = _buf[1];
                off.bytes += this.size;
                return buf;
            },
            size: _time.size
        };
        var _date = _.struct([ _.ubit("year", 7), _.ubit("month", 4), _.ubit("day", 5) ]), date = {
            valueFromBytes: function(buf, off) {
                off || (off = {
                    bytes: 0
                });
                var _buf = __.bufferFrom([ buf[off.bytes + 1], buf[off.bytes + 0] ]), val = _date.valueFromBytes(_buf);
                off.bytes += this.size;
                return val;
            },
            bytesFromValue: function(val, buf, off) {
                val || (val = {
                    year: 0,
                    month: 0,
                    day: 0
                });
                buf || (buf = __.allocBuffer(this.size));
                off || (off = {
                    bytes: 0
                });
                var _buf = _date.bytesFromValue(val);
                buf[off.bytes + 1] = _buf[0];
                buf[off.bytes + 0] = _buf[1];
                off.bytes += this.size;
                return buf;
            },
            size: _date.size
        };
        exports.dirEntry = _.struct([ _.struct("Name", [ _.char("filename", 8), _.char("extension", 3) ]), _.struct("Attr", [ _.bool("readonly"), _.bool("hidden"), _.bool("system"), _.bool("volume_id"), _.bool("directory"), _.bool("archive"), _.ubit("reserved", 2) ].reverse()), _.byte("NTRes", 1), _.uint8("CrtTimeTenth"), _.struct("CrtTime", [ time ]), _.struct("CrtDate", [ date ]), _.struct("LstAccDate", [ date ]), _.uint16le("FstClusHI"), _.struct("WrtTime", [ time ]), _.struct("WrtDate", [ date ]), _.uint16le("FstClusLO"), _.uint32le("FileSize") ]);
        exports.entryDoneFlag = 0;
        exports.entryFreeFlag = 229;
        exports.entryIsE5Flag = 5;
        exports.dirEntry_simple = _.struct([ _.struct("Name", [ _.char("filename", 8), _.char("extension", 3) ]), _.padTo(exports.dirEntry.size) ]);
        exports.lastLongFlag = 64;
        exports.longDirFlag = 15;
        exports.longDirEntry = _.struct([ _.uint8("Ord"), _.char16le("Name1", 10), _.uint8("Attr_raw"), _.uint8("Type"), _.uint8("Chksum"), _.char16le("Name2", 12), _.uint16le("FstClusLO"), _.char16le("Name3", 4) ]);
        if (exports.longDirEntry.size !== exports.dirEntry.size) throw Error("Structs ain't right!");
        exports.fatField = {
            fat12: _.struct("Status", [ _.ubit("field0bc", 8), _.ubit("field1c", 4), _.ubit("field0a", 4), _.ubit("field1ab", 8) ]),
            fat16: _.uint16le("Status"),
            fat32: _.uint32le("Status")
        };
        exports.fatPrefix = {
            fat12: 3840,
            fat16: 65280,
            fat32: 268435200
        };
        exports.fatStat = {
            free: 0,
            _undef: 1,
            rsvMin: 240,
            bad: 247,
            eofMin: 248,
            eof: 255
        };
        exports._I = {
            RUSR: 256,
            WUSR: 128,
            XUSR: 64,
            RGRP: 32,
            WGRP: 16,
            XGRP: 8,
            ROTH: 4,
            WOTH: 2,
            XOTH: 1,
            SUID: 2048,
            SGID: 1024,
            SVTX: 512,
            FDIR: 16384,
            FREG: 32768
        };
        exports._I.RWXU = exports._I.RUSR | exports._I.WUSR | exports._I.XUSR;
        exports._I.RWXG = exports._I.RGRP | exports._I.WGRP | exports._I.XGRP;
        exports._I.RWXO = exports._I.ROTH | exports._I.WOTH | exports._I.XOTH;
        exports._I._sss = exports._I.SUID | exports._I.SGID | exports._I.SVTX;
        exports._I._chmoddable = exports._I.RWXU | exports._I.RWXG | exports._I.RWXO | exports._I._sss;
        var _errors = {
            IO: "Input/output error",
            NOENT: "No such file or directory",
            INVAL: "Invalid argument",
            EXIST: "File exists",
            NAMETOOLONG: "Filename too long",
            NOSPC: "No space left on device",
            NOSYS: "Function not supported",
            ROFS: "ROFLCopter file system",
            NOTDIR: "Not a directory",
            BADF: "Bad file descriptor",
            EXIST: "File exists",
            ISDIR: "Is a directory",
            ACCES: "Permission denied",
            NOSYS: "Function not implemented",
            _TODO: "Not implemented yet!"
        };
        exports.err = {};
        Object.keys(_errors).forEach((function(sym) {
            var msg = _errors[sym];
            exports.err[sym] = function() {
                var e = new Error(msg);
                e.code = sym;
                return e;
            };
        }));
    }, module => {
        var _ = {};
        function truncatedReadUInt32BE(buffer, offset) {
            var availableBytes = buffer.length - offset;
            if (availableBytes >= 4) {
                return buffer.readUInt32BE(offset);
            } else if (availableBytes === 3) {
                var first = buffer.readUInt16BE(offset);
                var second = buffer.readUInt8(offset + 2);
                return (first << 8) + second << 8 >>> 0;
            } else if (availableBytes === 2) {
                return buffer.readUInt16BE(offset) << 16 >>> 0;
            } else if (availableBytes === 1) {
                return buffer.readUInt8(offset) << 24 >>> 0;
            } else if (availableBytes <= 0) {
                return 0;
            }
        }
        function truncatedWriteUInt32BE(buffer, offset, data) {
            var availableBytes = buffer.length - offset;
            if (availableBytes >= 4) {
                buffer.writeUInt32BE(data, offset);
            } else if (availableBytes === 3) {
                buffer.writeUInt16BE(data >>> 16, offset);
                buffer.writeUInt8(data >>> 8 & 255, offset + 2);
            } else if (availableBytes === 2) {
                buffer.writeUInt16BE(data >>> 16, offset);
            } else if (availableBytes === 1) {
                buffer.writeUInt8(data >>> 24, offset);
            }
        }
        function newBuffer(size) {
            if (Buffer.alloc) {
                return Buffer.alloc(size);
            } else {
                return new Buffer(size);
            }
        }
        function extend(obj) {
            Array.prototype.slice.call(arguments, 1).forEach((function(ext) {
                Object.keys(ext).forEach((function(key) {
                    obj[key] = ext[key];
                }));
            }));
            return obj;
        }
        function addField(ctr, f) {
            if ("width" in f) {
                ctr.bits = (ctr.bits || 0) + f.width;
                while (ctr.bits > 7) {
                    ctr.bytes += 1;
                    ctr.bits -= 8;
                }
            } else if (!ctr.bits) {
                ctr.bytes += f.size;
            } else {
                throw Error("Improperly aligned bitfield before field: " + f.name);
            }
            return ctr;
        }
        function arrayizeField(f, count) {
            var f2 = typeof count === "number" ? extend({
                name: f.name,
                field: f,
                valueFromBytes: function(buf, off) {
                    off || (off = {
                        bytes: 0,
                        bits: 0
                    });
                    var arr = new Array(count);
                    for (var idx = 0, len = arr.length; idx < len; idx += 1) {
                        arr[idx] = f.valueFromBytes(buf, off);
                    }
                    return arr;
                },
                bytesFromValue: function(arr, buf, off) {
                    arr || (arr = new Array(count));
                    buf || (buf = newBuffer(this.size));
                    off || (off = {
                        bytes: 0,
                        bits: 0
                    });
                    for (var idx = 0, len = Math.min(arr.length, count); idx < len; idx += 1) {
                        f.bytesFromValue(arr[idx], buf, off);
                    }
                    while (idx++ < count) addField(off, f);
                    return buf;
                }
            }, "width" in f ? {
                width: f.width * count
            } : {
                size: f.size * count
            }) : f;
            f2.pack = f2.bytesFromValue;
            f2.unpack = f2.valueFromBytes;
            return f2;
        }
        _.struct = function(name, fields, count) {
            if (typeof name !== "string") {
                count = fields;
                fields = name;
                name = null;
            }
            var _size = {
                bytes: 0,
                bits: 0
            }, _padsById = Object.create(null), fieldsObj = fields.reduce((function(obj, f, i) {
                if ("_padTo" in f) {
                    f._id || (f._id = "id" + Math.random().toFixed(20).slice(2));
                    var _f = _padsById[f._id] = _size.bits ? {
                        width: 8 * (f._padTo - _size.bytes) - _size.bits
                    } : {
                        size: f._padTo - _size.bytes
                    };
                    if (_f.width < 0 || _f.size < 0) {
                        var xtraMsg = _size.bits ? " and " + _size.bits + " bits" : "";
                        throw Error("Invalid .padTo(" + f._padTo + ") field, struct is already " + _size.bytes + " byte(s)" + xtraMsg + "!");
                    }
                    f = _f;
                } else if (f._hoistFields) Object.keys(f._hoistFields).forEach((function(name) {
                    var _f = Object.create(f._hoistFields[name]);
                    if ("width" in _f) _f.offset = {
                        bytes: _f.offset.bytes + _size.bytes,
                        bits: _f.offset.bits
                    }; else _f.offset += _size.bytes;
                    obj[name] = _f;
                })); else if (f.name) {
                    f = Object.create(f);
                    f.offset = "width" in f ? {
                        bytes: _size.bytes,
                        bits: _size.bits
                    } : _size.bytes, obj[f.name] = f;
                }
                addField(_size, f);
                return obj;
            }), {});
            if (_size.bits) throw Error("Improperly aligned bitfield at end of struct: " + name);
            return arrayizeField({
                valueFromBytes: function(buf, off) {
                    off || (off = {
                        bytes: 0,
                        bits: 0
                    });
                    var obj = new Object;
                    fields.forEach((function(f) {
                        if ("_padTo" in f) return addField(off, _padsById[f._id]);
                        var value = f.valueFromBytes(buf, off);
                        if (f.name) obj[f.name] = value; else if (typeof value === "object") extend(obj, value);
                    }));
                    return obj;
                },
                bytesFromValue: function(obj, buf, off) {
                    obj || (obj = {});
                    buf || (buf = newBuffer(this.size));
                    off || (off = {
                        bytes: 0,
                        bits: 0
                    });
                    fields.forEach((function(f) {
                        if ("_padTo" in f) return addField(off, _padsById[f._id]);
                        var value = f.name ? obj[f.name] : obj;
                        f.bytesFromValue(value, buf, off);
                    }));
                    return buf;
                },
                _hoistFields: !name ? fieldsObj : null,
                fields: fieldsObj,
                size: _size.bytes,
                name
            }, count);
        };
        _.padTo = function(off) {
            return {
                _padTo: off
            };
        };
        var FULL = 4294967295;
        function bitfield(name, width, count) {
            width || (width = 1);
            if (width > 24) throw Error("Bitfields support a maximum width of 24 bits.");
            var impl = this, mask = FULL >>> 32 - width;
            return arrayizeField({
                valueFromBytes: function(buf, off) {
                    off || (off = {
                        bytes: 0,
                        bits: 0
                    });
                    var end = (off.bits || 0) + width, word = truncatedReadUInt32BE(buf, off.bytes) || 0, over = word >>> 32 - end;
                    addField(off, this);
                    return impl.b2v.call(this, over & mask);
                },
                bytesFromValue: function(val, buf, off) {
                    val = impl.v2b.call(this, val || 0);
                    off || (off = {
                        bytes: 0,
                        bits: 0
                    });
                    var end = (off.bits || 0) + width, word = truncatedReadUInt32BE(buf, off.bytes) || 0, zero = mask << 32 - end, over = (val & mask) << 32 - end;
                    word &= ~zero;
                    word |= over;
                    word >>>= 0;
                    truncatedWriteUInt32BE(buf, off.bytes, word);
                    addField(off, this);
                    return buf;
                },
                width,
                name
            }, count);
        }
        function swapBits(n, w) {
            var o = 0;
            while (w--) {
                o <<= 1;
                o |= n & 1;
                n >>>= 1;
            }
            return o;
        }
        _.bool = function(name, count) {
            return bitfield.call({
                b2v: function(b) {
                    return Boolean(b);
                },
                v2b: function(v) {
                    return v ? FULL : 0;
                }
            }, name, 1, count);
        };
        _.ubit = bitfield.bind({
            b2v: function(b) {
                return b;
            },
            v2b: function(v) {
                return v;
            }
        });
        _.ubitLE = bitfield.bind({
            b2v: function(b) {
                return swapBits(b, this.width);
            },
            v2b: function(v) {
                return swapBits(v, this.width);
            }
        });
        _.sbit = bitfield.bind({
            b2v: function(b) {
                var m = 1 << this.width - 1, s = b & m;
                return s ? -(b &= ~m) : b;
            },
            v2b: function(v) {
                var m = 1 << this.width - 1, s = v < 0;
                return s ? -v | m : v;
            }
        });
        function bytefield(name, size, count) {
            if (typeof name !== "string") {
                count = size;
                size = name;
                name = null;
            }
            size = typeof size === "number" ? size : 1;
            var impl = this;
            return arrayizeField({
                valueFromBytes: function(buf, off) {
                    off || (off = {
                        bytes: 0,
                        bits: 0
                    });
                    var val = buf.slice(off.bytes, off.bytes + this.size);
                    addField(off, this);
                    return impl.b2v.call(this, val);
                },
                bytesFromValue: function(val, buf, off) {
                    off || (off = {
                        bytes: 0
                    });
                    buf || (buf = newBuffer(this.size));
                    var blk = buf.slice(off.bytes, off.bytes + this.size), len = impl.vTb.call(this, val, blk);
                    if (len < blk.length) blk.fill(0, len);
                    addField(off, this);
                    return buf;
                },
                size,
                name
            }, count);
        }
        function swapBytesPairs(fromBuffer, toBuffer) {
            toBuffer = toBuffer || fromBuffer;
            var l = fromBuffer.length;
            for (var i = 1; i < l; i += 2) {
                var a = fromBuffer[i - 1];
                toBuffer[i - 1] = fromBuffer[i];
                toBuffer[i] = a;
            }
            return toBuffer;
        }
        _.byte = bytefield.bind({
            b2v: function(b) {
                return b;
            },
            vTb: function(v, b) {
                if (!v) return 0;
                v.copy(b);
                return v.length;
            }
        });
        _.char = bytefield.bind({
            b2v: function(b) {
                var v = b.toString("utf8"), z = v.indexOf("\0");
                return ~z ? v.slice(0, z) : v;
            },
            vTb: function(v, b) {
                v || (v = "");
                return b.write(v, "utf8");
            }
        });
        _.char16le = bytefield.bind({
            b2v: function(b) {
                var v = b.toString("utf16le"), z = v.indexOf("\0");
                return ~z ? v.slice(0, z) : v;
            },
            vTb: function(v, b) {
                v || (v = "");
                return b.write(v, "utf16le");
            }
        });
        _.char16be = bytefield.bind({
            b2v: function(b) {
                var temp = newBuffer(b.length);
                swapBytesPairs(b, temp);
                var v = temp.toString("utf16le"), z = v.indexOf("\0");
                return ~z ? v.slice(0, z) : v;
            },
            vTb: function(v, b) {
                v || (v = "");
                var len = b.write(v, "utf16le");
                swapBytesPairs(b);
                return len;
            }
        });
        function standardField(sig, size) {
            var read = "read" + sig, dump = "write" + sig;
            size || (size = +sig.match(/\d+/)[0] >> 3);
            return function(name, count) {
                if (typeof name !== "string") {
                    count = name;
                    name = null;
                }
                return arrayizeField({
                    valueFromBytes: function(buf, off) {
                        off || (off = {
                            bytes: 0
                        });
                        var val = buf[read](off.bytes);
                        addField(off, this);
                        return val;
                    },
                    bytesFromValue: function(val, buf, off) {
                        val || (val = 0);
                        buf || (buf = newBuffer(this.size));
                        off || (off = {
                            bytes: 0
                        });
                        buf[dump](val, off.bytes);
                        addField(off, this);
                        return buf;
                    },
                    size,
                    name
                }, count);
            };
        }
        _.float32 = standardField("FloatBE", 4);
        _.float64 = standardField("DoubleBE", 8);
        _.float32le = standardField("FloatLE", 4);
        _.float64le = standardField("DoubleLE", 8);
        _.uint8 = standardField("UInt8");
        _.uint16 = standardField("UInt16BE");
        _.uint32 = standardField("UInt32BE");
        _.uint16le = standardField("UInt16LE");
        _.uint32le = standardField("UInt32LE");
        _.int8 = standardField("Int8");
        _.int16 = standardField("Int16BE");
        _.int32 = standardField("Int32BE");
        _.int16le = standardField("Int16LE");
        _.int32le = standardField("Int32LE");
        _.derive = function(orig, pack, unpack) {
            return function(name, count) {
                if (typeof name !== "string") {
                    count = name;
                    name = null;
                }
                return arrayizeField(extend({
                    valueFromBytes: function(buf, off) {
                        return unpack(orig.valueFromBytes(buf, off));
                    },
                    bytesFromValue: function(val, buf, off) {
                        return orig.bytesFromValue(pack(val), buf, off);
                    },
                    name
                }, "width" in orig ? {
                    width: orig.width
                } : {
                    size: orig.size
                }), count);
            };
        };
        module.exports = _;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        var S = __webpack_require__(82), _xok = __webpack_require__(85);
        exports.allocBuffer = Buffer.alloc || function(len, val) {
            var b = Buffer(len);
            if (arguments.length > 1) b.fill(val);
            return b;
        };
        exports.bufferFrom = Buffer.from || function(arg0, arg1) {
            return arguments.length > 1 ? Buffer(arg0, arg1) : Buffer(arg0);
        };
        exports.workaroundTessel380 = !Buffer.from && function() {
            var b = Buffer([ 0 ]), s = b.slice(0);
            return (s[0] = 255) !== b[0];
        }();
        var oldslice;
        if (!Buffer.alloc && Buffer(5).slice(10).length < 0) oldslice = Buffer.prototype.slice, 
        Buffer.prototype.slice = function(s, e) {
            if (s > this.length) s = this.length;
            return arguments.length > 1 ? oldslice.call(this, s, e) : oldslice.call(this, s);
        };
        exports.absoluteSteps = function(path) {
            var steps = [];
            path.split("/").forEach((function(str) {
                if (str === "..") steps.pop(); else if (str && str !== ".") steps.push(str);
            }));
            return steps.map(exports.longname);
        };
        exports.absolutePath = function(path) {
            return "/" + exports.absoluteSteps(path).join("/");
        };
        exports.parseFlags = function(flags) {
            var info, _dir;
            if (flags[0] === "\\") {
                flags = flags.slice(1);
                _dir = true;
            }
            switch (flags) {
              case "r":
                info = {
                    read: true,
                    write: false,
                    create: false
                };
                break;

              case "r+":
                info = {
                    read: true,
                    write: true,
                    create: false
                };
                break;

              case "rs":
                info = {
                    read: true,
                    write: false,
                    create: false,
                    sync: true
                };
                break;

              case "rs+":
                info = {
                    read: true,
                    write: true,
                    create: false,
                    sync: true
                };
                break;

              case "w":
                info = {
                    read: false,
                    write: true,
                    create: true,
                    truncate: true
                };
                break;

              case "wx":
                info = {
                    read: false,
                    write: true,
                    create: true,
                    exclusive: true
                };
                break;

              case "w+":
                info = {
                    read: true,
                    write: true,
                    create: true,
                    truncate: true
                };
                break;

              case "wx+":
                info = {
                    read: true,
                    write: true,
                    create: true,
                    exclusive: true
                };
                break;

              case "a":
                info = {
                    read: false,
                    write: true,
                    create: true,
                    append: true
                };
                break;

              case "ax":
                info = {
                    read: false,
                    write: true,
                    create: true,
                    append: true,
                    exclusive: true
                };
                break;

              case "a+":
                info = {
                    read: true,
                    write: true,
                    create: true,
                    append: true
                };
                break;

              case "ax+":
                info = {
                    read: true,
                    write: true,
                    create: true,
                    append: true,
                    exclusive: true
                };
                break;

              default:
                throw Error("Uknown mode: " + flags);
            }
            if (info.sync) throw Error("Mode not implemented.");
            if (_dir) info._openDir = true;
            return info;
        };
        var _snInvalid = /[^A-Z0-9$%'-_@~`!(){}^#&.]/g;
        exports.shortname = function(name) {
            var lossy = false;
            name = name.toUpperCase().replace(/ /g, "").replace(/^\.+/, "");
            name = name.replace(_snInvalid, (function() {
                lossy = true;
                return "_";
            }));
            var parts = name.split("."), basis3 = parts.pop(), basis8 = parts.join("");
            if (!parts.length) {
                basis8 = basis3;
                basis3 = "   ";
            }
            if (basis8.length > 8) {
                basis8 = basis8.slice(0, 8);
                lossy = true;
            } else while (basis8.length < 8) basis8 += " ";
            if (basis3.length > 3) {
                basis3 = basis3.slice(0, 3);
                lossy = true;
            } else while (basis3.length < 3) basis3 += " ";
            return {
                filename: basis8,
                extension: basis3,
                _lossy: lossy
            };
            return {
                basis: [ basis8, basis3 ],
                lossy
            };
        };
        var _lnInvalid = /[^a-zA-Z0-9$%'-_@~`!(){}^#&.+,;=[\] ]/g;
        exports.longname = function(name) {
            name = name.trim().replace(/\.+$/, "").replace(_lnInvalid, (function(c) {
                if (c.length > 1) throw Error("Internal problem: unexpected match length!");
                if (c.charCodeAt(0) > 127) return c; else throw Error("Invalid character " + JSON.stringify(c) + " in name.");
                lossy = true;
                return "_";
            }));
            if (name.length > 255) throw Error("Name is too long.");
            return name;
        };
        function nameChkSum(sum, c) {
            return (sum & 1 ? 128 : 0) + (sum >>> 1) + c & 255;
        }
        function reduceBuffer(buf, start, end, fn, res) {
            for (var i = start; i < end; ++i) {
                res = fn(res, buf[i]);
            }
            return res;
        }
        exports.checksumName = function(buf, off) {
            off || (off = 0);
            var len = S.dirEntry.fields["Name"].size;
            return reduceBuffer(buf, off, off + len, nameChkSum, 0);
        };
        exports.fmtHex = function(n, ff) {
            return (1 + ff + n).toString(16).slice(1);
        };
        exports.delayedCall = function(fn) {
            if (!fn) throw Error("No function provided!");
            var ctx = this, args = Array.prototype.slice.call(arguments, 1);
            setImmediate((function() {
                fn.apply(ctx, args);
            }));
        };
        exports.adjustedPos = function(vol, pos, bytes) {
            var _pos = {
                chain: pos.chain,
                sector: pos.sector,
                offset: pos.offset + bytes
            }, secSize = vol._sectorSize;
            while (_pos.offset >= secSize) {
                _pos.sector += 1;
                _pos.offset -= secSize;
            }
            return _pos;
        };
        exports.extend = _xok;
        var _prevDbg = Date.now(), _thresh = 50;
        function log(level) {
            if (level < log.level) return;
            var now = Date.now(), diff = now - _prevDbg;
            arguments[0] = (diff < _thresh ? " " : "") + diff.toFixed(0) + "ms";
            console.log.apply(console, arguments);
            _prevDbg = now;
        }
        log.DBG = -4;
        log.INFO = -3;
        log.WARN = -2;
        log.ERR = -1;
        log.level = log.WARN;
        exports.log = log;
    }, module => {
        module.exports = function(obj) {
            Array.prototype.slice.call(arguments, 1).forEach((function(ext) {
                if (ext) Object.keys(ext).forEach((function(key) {
                    obj[key] = ext[key];
                }));
            }));
            return obj;
        };
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        var S = __webpack_require__(82), _ = __webpack_require__(84);
        var dir = exports;
        dir.iterator = function(dirChain, opts) {
            opts || (opts = {});
            var cache = {
                buffer: null,
                n: null
            };
            function getSectorBuffer(n, cb) {
                if (cache.n === n) cb(null, cache.buffer); else cache.n = cache.buffer = null, dirChain.readSectors(n, _.allocBuffer(dirChain.sectorSize), (function(e, d) {
                    if (e) cb(e); else if (!d) return cb(null, null); else {
                        cache.n = n;
                        cache.buffer = d;
                        getSectorBuffer(n, cb);
                    }
                }));
            }
            var secIdx = 0, off = {
                bytes: 0
            }, long = null;
            function getNextEntry(cb) {
                if (off.bytes >= dirChain.sectorSize) {
                    secIdx += 1;
                    off.bytes -= dirChain.sectorSize;
                }
                var entryPos = {
                    chain: dirChain,
                    sector: secIdx,
                    offset: off.bytes
                };
                getSectorBuffer(secIdx, (function(e, buf) {
                    if (e) return cb(S.err.IO()); else if (!buf) return cb(null, null, entryPos);
                    var entryIdx = off.bytes, signalByte = buf[entryIdx];
                    if (signalByte === S.entryDoneFlag) return cb(null, null, entryPos); else if (signalByte === S.entryFreeFlag) {
                        off.bytes += S.dirEntry.size;
                        long = null;
                        if (opts.includeFree) return cb(null, {
                            _free: true,
                            _pos: entryPos
                        }, entryPos); else return getNextEntry(cb);
                    }
                    var attrByte = buf[entryIdx + S.dirEntry.fields.Attr.offset], entryType = attrByte === S.longDirFlag ? S.longDirEntry : S.dirEntry_simple;
                    var entry = entryType.valueFromBytes(buf, off);
                    entry._pos = entryPos;
                    _.log(_.log.DBG, "entry:", entry, secIdx, entryIdx);
                    if (entryType === S.longDirEntry) {
                        var firstEntry;
                        if (entry.Ord & S.lastLongFlag) {
                            firstEntry = true;
                            entry.Ord &= ~S.lastLongFlag;
                            long = {
                                name: -1,
                                sum: entry.Chksum,
                                _rem: entry.Ord - 1,
                                _arr: []
                            };
                        }
                        if (firstEntry || long && entry.Chksum === long.sum && entry.Ord === long._rem--) {
                            var S_lde_f = S.longDirEntry.fields, namepart = entry.Name1;
                            if (entry.Name1.length === S_lde_f.Name1.size / 2) {
                                namepart += entry.Name2;
                                if (entry.Name2.length === S_lde_f.Name2.size / 2) {
                                    namepart += entry.Name3;
                                }
                            }
                            long._arr.push(namepart);
                            if (!long._rem) {
                                long.name = long._arr.reverse().join("");
                                delete long._arr;
                                delete long._rem;
                            }
                        } else long = null;
                    } else if ((attrByte & 8) === 0) {
                        var bestName = null;
                        if (long && long.name) {
                            var pos = entryIdx + S.dirEntry.fields["Name"].offset, sum = _.checksumName(buf, pos);
                            if (sum === long.sum) bestName = long.name;
                        }
                        if (!bestName) {
                            if (signalByte === S.entryIsE5Flag) entry.Name.filename = "å" + entry.Name.filename.slice(1);
                            var nam = entry.Name.filename.replace(/ +$/, ""), ext = entry.Name.extension.replace(/ +$/, "");
                            bestName = ext ? nam + "." + ext : nam;
                        }
                        entry._name = bestName;
                        var _entryBuffer = buf.slice(off.bytes - S.dirEntry.size, off.bytes);
                        entry._full = function() {
                            var _entry = S.dirEntry.valueFromBytes(_entryBuffer);
                            _.extend(entry, _entry);
                            entry._size = entry.FileSize;
                            entry._firstCluster = (entry.FstClusHI << 16) + entry.FstClusLO;
                            return entry;
                        };
                        long = null;
                        return cb(null, entry, entryPos);
                    } else long = null;
                    getNextEntry(cb);
                }));
            }
            function iter(cb) {
                getNextEntry(cb);
                return iter;
            }
            return iter;
        };
        function _updateEntry(vol, entry, newStats) {
            if ("size" in newStats) entry._size = entry.FileSize = newStats.size;
            if ("_touch" in newStats) newStats.archive = newStats.atime = newStats.mtime = true;
            if ("archive" in newStats) entry.Attr.archive = true;
            var _now;
            function applyDate(d, prefix, timeToo, tenthToo) {
                if (d === true) d = _now || (_now = new Date);
                entry[prefix + "Date"] = {
                    year: d.getFullYear() - 1980,
                    month: d.getMonth() + 1,
                    day: d.getDate()
                };
                if (timeToo) {
                    entry[prefix + "Time"] = {
                        hours: d.getHours(),
                        minutes: d.getMinutes(),
                        seconds_2: d.getSeconds() >>> 1
                    };
                    if (tenthToo) {
                        var msec = d.getSeconds() % 2 * 1e3 + d.getMilliseconds();
                        entry[prefix + "TimeTenth"] = Math.floor(msec / 100);
                    }
                }
            }
            if ("ctime" in newStats) applyDate(newStats.ctime, "Crt", true, true);
            if ("mtime" in newStats) applyDate(newStats.mtime, "Wrt", true);
            if ("atime" in newStats) applyDate(newStats.atime, "LstAcc");
            if ("mode" in newStats) {
                entry.Attr.directory = newStats.mode & S._I.FDIR ? true : false;
                entry.Attr.volume_id = newStats.mode & S._I.FREG ? false : true;
                if (vol.opts.modmode === 73) {
                    entry.Attr.archive = newStats.mode & S._I.XUSR ? true : false;
                    entry.Attr.system = newStats.mode & S._I.XGRP ? true : false;
                    entry.Attr.hidden = newStats.mode & S._I.XOTH ? true : false;
                    entry.Attr.readonly = newStats.mode & S._I.WUSR ? false : true;
                } else if (vol.opts.modmode === 3584) {
                    entry.Attr.archive = newStats.mode & S._I.SVTX ? true : false;
                    entry.Attr.system = newStats.mode & S._I.SGID ? true : false;
                    entry.Attr.hidden = newStats.mode & S._I.SUID ? true : false;
                    entry.Attr.readonly = newStats.mode & S._I.WUSR || newStats.mode & S._I.WGRP || newStats.mode & S._I.WOTH ? false : true;
                }
            }
            if ("firstCluster" in newStats) {
                entry.FstClusLO = newStats.firstCluster & 65535;
                entry.FstClusHI = newStats.firstCluster >>> 16;
                entry._firstCluster = newStats.firstCluster;
            }
            return entry;
        }
        dir.makeStat = function(vol, entry) {
            var stats = {};
            stats.isFile = function() {
                return !entry.Attr.volume_id && !entry.Attr.directory;
            };
            stats.isDirectory = function() {
                return entry.Attr.directory;
            };
            stats.isBlockDevice = function() {
                return false;
            };
            stats.isCharacterDevice = function() {
                return false;
            };
            stats.isSymbolicLink = function() {
                return false;
            };
            stats.isFIFO = function() {
                return false;
            };
            stats.isSocket = function() {
                return false;
            };
            stats.size = entry.FileSize;
            stats.blksize = vol._sectorsPerCluster * vol._sectorSize;
            stats.blocks = Math.ceil(stats.size / stats.blksize) || 1;
            stats.nlink = 1;
            stats.mode = S._I.RUSR | S._I.RGRP | S._I.ROTH;
            if (!entry.Attr.readonly) stats.mode |= S._I.WUSR | S._I.WGRP | S._I.WOTH;
            if (entry.Attr.directory) stats.mode |= S._I.FDIR; else if (!entry.Attr.volume_id) stats.mode |= S._I.FREG;
            if (vol.opts.modmode === 73) {
                if (entry.Attr.archive) stats.mode |= S._I.XUSR;
                if (entry.Attr.system) stats.mode |= S._I.XGRP;
                if (entry.Attr.hidden) stats.mode |= S._I.XOTH;
            } else if (vol.opts.modmode === 3584) {
                if (entry.Attr.archive) stats.mode |= S._I.SVTX;
                if (entry.Attr.system) stats.mode |= S._I.SGID;
                if (entry.Attr.hidden) stats.mode |= S._I.SUID;
            }
            stats.mode &= ~vol.opts.umask;
            stats.uid = vol.opts.uid;
            stats.gid = vol.opts.gid;
            function extractDate(prefix) {
                var date = entry[prefix + "Date"], time = entry[prefix + "Time"] || {
                    hours: 0,
                    minutes: 0,
                    seconds_2: 0
                }, secs = time.seconds_2 * 2, sect = entry[prefix + "TimeTenth"] || 0;
                if (sect > 100) {
                    secs += 1;
                    sect -= 100;
                }
                return new Date(date.year + 1980, date.month - 1, date.day, time.hours, time.minutes, secs, sect * 100);
            }
            stats.atime = extractDate("LstAcc");
            stats.mtime = extractDate("Wrt");
            stats.ctime = extractDate("Crt");
            entry = {
                Attr: _.extend({}, entry.Attr)
            };
            return stats;
        };
        dir.init = function(vol, dirInfo, cb) {
            var dirChain = dirInfo.chain, isRootDir = "numSectors" in dirChain, initialCluster = _.allocBuffer(dirChain.sectorSize * vol._sectorsPerCluster), entriesOffset = {
                bytes: 0
            };
            initialCluster.fill(0);
            function writeEntry(name, clusterNum) {
                while (name.length < 8) name += " ";
                S.dirEntry.bytesFromValue(_updateEntry(vol, {
                    Name: {
                        filename: name,
                        extension: "   "
                    },
                    Attr: {
                        directory: true
                    }
                }, {
                    firstCluster: clusterNum,
                    _touch: true,
                    ctime: true
                }), initialCluster, entriesOffset);
            }
            if (!isRootDir) {
                writeEntry(".", dirChain.firstCluster);
                writeEntry("..", dirInfo.parent.chain.firstCluster);
            }
            dirChain.writeToPosition(0, initialCluster, cb);
        };
        dir.addFile = function(vol, dirChain, entryInfo, opts, cb) {
            if (typeof opts === "function") {
                cb = opts;
                opts = {};
            }
            var name = entryInfo.name, entries = [], mainEntry;
            entries.push(mainEntry = {
                Name: _.shortname(name),
                Attr: {
                    directory: opts.dir || false
                },
                _name: name
            });
            if (true) {
                var workaroundTessel427 = "".length !== 1;
                if (workaroundTessel427) throw Error("Your JS runtime does not have proper Unicode string support. (If Tessel, is your firmware up-to-date?)");
                var S_lde_f = S.longDirEntry.fields, ENTRY_CHUNK_LEN = (S_lde_f.Name1.size + S_lde_f.Name2.size + S_lde_f.Name3.size) / 2, partialLen = name.length % ENTRY_CHUNK_LEN, paddingNeeded = partialLen && ENTRY_CHUNK_LEN - partialLen;
                if (paddingNeeded--) name += "\0";
                while (paddingNeeded-- > 0) name += "";
                var off = 0, ord = 1;
                while (off < name.length) entries.push({
                    Ord: ord++,
                    Name1: name.slice(off, off += S_lde_f.Name1.size / 2),
                    Attr_raw: S.longDirFlag,
                    Chksum: null,
                    Name2: name.slice(off, off += S_lde_f.Name2.size / 2),
                    Name3: name.slice(off, off += S_lde_f.Name3.size / 2)
                });
                entries[entries.length - 1].Ord |= S.lastLongFlag;
            }
            if (entryInfo.tail) {
                var name = mainEntry.Name.filename, suffix = "~" + entryInfo.tail, endIdx = name.indexOf(" "), sufIdx = ~endIdx ? Math.min(endIdx, name.length - suffix.length) : name.length - suffix.length;
                if (sufIdx < 0) return cb(S.err.NAMETOOLONG());
                mainEntry.Name.filename = name.slice(0, sufIdx) + suffix + name.slice(sufIdx + suffix.length);
                _.log(_.log.DBG, "Shortname amended to:", mainEntry.Name);
            }
            vol.allocateInFAT(dirChain.firstCluster || 2, (function(e, fileCluster) {
                if (e) return cb(e);
                var nameBuf = S.dirEntry.fields["Name"].bytesFromValue(mainEntry.Name), nameSum = _.checksumName(nameBuf);
                _updateEntry(vol, mainEntry, {
                    firstCluster: fileCluster,
                    size: 0,
                    ctime: true,
                    _touch: true
                });
                mainEntry._pos = _.adjustedPos(vol, entryInfo.target, S.dirEntry.size * (entries.length - 1));
                entries.slice(1).forEach((function(entry) {
                    entry.Chksum = nameSum;
                }));
                entries.reverse();
                if (entryInfo.lastEntry) entries.push({});
                var entriesData = _.allocBuffer(S.dirEntry.size * entries.length), dataOffset = {
                    bytes: 0
                };
                entries.forEach((function(entry) {
                    var entryType = "Ord" in entry ? S.longDirEntry : S.dirEntry;
                    entryType.bytesFromValue(entry, entriesData, dataOffset);
                }));
                _.log(_.log.DBG, "Writing", entriesData.length, "byte directory entry", mainEntry, "into", dirChain.toJSON(), "at", entryInfo.target);
                dirChain.writeToPosition(entryInfo.target, entriesData, (function(e) {
                    if (e) cb(e); else cb(null, mainEntry, vol.chainForCluster(fileCluster, dirChain));
                }));
            }));
        };
        dir.findInDirectory = function(vol, dirChain, name, opts, cb) {
            var matchName = name.toUpperCase(), tailName = opts.prepareForCreate ? _.shortname(name) : null, maxTail = 0;
            function processNext(next) {
                next = next((function(e, d, entryPos) {
                    if (e) cb(e); else if (!d) cb(S.err.NOENT(), {
                        tail: maxTail,
                        target: entryPos,
                        lastEntry: true
                    }); else if (d._free) processNext(next); else if (d._name.toUpperCase() === matchName) return cb(null, d._full()); else if (!opts.prepareForCreate) processNext(next); else {
                        var dNum = 1, dName = d.Name.filename, dTail = dName.match(/(.*)~(\d+)/);
                        if (dTail) {
                            dNum = +dTail[2];
                            dName = dTail[1];
                        }
                        if (tailName.extension === d.Name.extension && tailName.filename.indexOf(dName) === 0) {
                            maxTail = Math.max(dNum + 1, maxTail);
                        }
                        processNext(next);
                    }
                }));
            }
            processNext(dir.iterator(dirChain, {
                includeFree: 0 && 0
            }));
        };
        dir.updateEntry = function(vol, entry, newStats, cb) {
            if (!entry._pos || !entry._pos.chain) throw Error("Entry source unknown!");
            var entryPos = entry._pos, newEntry = _updateEntry(vol, entry, newStats), data = S.dirEntry.bytesFromValue(newEntry);
            _.log(_.log.DBG, "UPDATING ENTRY", newStats, newEntry, entryPos, data);
            entryPos.chain.writeToPosition(entryPos, data, cb);
        };
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        var S = __webpack_require__(82), _ = __webpack_require__(84);
        function _baseChain(vol) {
            var chain = {};
            chain.sectorSize = vol._sectorSize;
            function posFromOffset(off) {
                var secSize = chain.sectorSize, offset = off % secSize, sector = (off - offset) / secSize;
                return {
                    sector,
                    offset
                };
            }
            var sectorCache = vol._makeCache();
            Object.defineProperty(chain, "cacheAdvice", {
                enumerable: true,
                get: function() {
                    return sectorCache.advice();
                },
                set: function(v) {
                    sectorCache.advice(v);
                }
            });
            chain._vol_readSectors = vol._readSectors.bind(vol, sectorCache);
            chain._vol_writeSectors = vol._writeSectors.bind(vol, sectorCache);
            chain.readFromPosition = function(targetPos, buffer, cb) {
                if (typeof targetPos === "number") targetPos = posFromOffset(targetPos);
                if (typeof buffer === "number") buffer = _.allocBuffer(buffer);
                if (targetPos.offset) chain.readSectors(targetPos.sector, _.allocBuffer(chain.sectorSize), (function(e, d) {
                    if (e || !d) cb(e, 0, buffer); else {
                        var dBeg = targetPos.offset, dEnd = dBeg + buffer.length;
                        d.copy(buffer, 0, dBeg, dEnd);
                        if (dEnd > d.length) readMain(); else cb(null, buffer.length, buffer);
                    }
                })); else readMain();
                function readMain() {
                    var prefaceLen = targetPos.offset && chain.sectorSize - targetPos.offset, trailerLen = (buffer.length - prefaceLen) % chain.sectorSize, mainSector = prefaceLen ? targetPos.sector + 1 : targetPos.sector, mainBuffer = trailerLen ? buffer.slice(prefaceLen, -trailerLen) : buffer.slice(prefaceLen);
                    if (mainBuffer.length) chain.readSectors(mainSector, mainBuffer, (function(e, d) {
                        if (e || !d) cb(e, prefaceLen, buffer); else if (!trailerLen) cb(null, buffer.length, buffer); else readTrailer();
                    })); else readTrailer();
                    function readTrailer() {
                        var trailerSector = mainSector + mainBuffer.length / chain.sectorSize;
                        chain.readSectors(trailerSector, _.allocBuffer(chain.sectorSize), (function(e, d) {
                            if (e || !d) cb(e, buffer.length - trailerLen, buffer); else {
                                d.copy(buffer, buffer.length - trailerLen, 0, trailerLen);
                                cb(null, buffer.length, buffer);
                            }
                        }));
                    }
                }
            };
            chain.writeToPosition = function(targetPos, data, cb) {
                _.log(_.log.DBG, "WRITING", data.length, "bytes at", targetPos, "in", this.toJSON(), data);
                if (typeof targetPos === "number") targetPos = posFromOffset(targetPos);
                var prefaceBuffer = targetPos.offset ? data.slice(0, chain.sectorSize - targetPos.offset) : null;
                if (prefaceBuffer) _modifySector(targetPos.sector, targetPos.offset, prefaceBuffer, (function(e) {
                    if (e) cb(e); else if (prefaceBuffer.length < data.length) writeMain(); else cb();
                })); else writeMain();
                function writeMain() {
                    var prefaceLen = prefaceBuffer ? prefaceBuffer.length : 0, trailerLen = (data.length - prefaceLen) % chain.sectorSize, mainSector = prefaceLen ? targetPos.sector + 1 : targetPos.sector, mainBuffer = trailerLen ? data.slice(prefaceLen, -trailerLen) : data.slice(prefaceLen);
                    if (mainBuffer.length) chain.writeSectors(mainSector, mainBuffer, (function(e) {
                        if (e) cb(e); else if (!trailerLen) cb(); else writeTrailer();
                    })); else writeTrailer();
                    function writeTrailer() {
                        var trailerSector = mainSector + mainBuffer.length / chain.sectorSize, trailerBuffer = data.slice(data.length - trailerLen);
                        _modifySector(trailerSector, 0, trailerBuffer, cb);
                    }
                }
                function _modifySector(sec, off, data, cb) {
                    chain.readSectors(sec, _.allocBuffer(chain.sectorSize), (function(e, orig) {
                        if (e) return cb(e);
                        orig || (orig = _.allocBuffer(chain.sectorSize, 0));
                        data.copy(orig, off);
                        chain.writeSectors(sec, orig, cb);
                    }));
                }
            };
            return chain;
        }
        exports.clusterChain = function(vol, firstCluster, _parent) {
            var chain = _baseChain(vol), cache = [ firstCluster ];
            chain.firstCluster = firstCluster;
            function _cacheIsComplete() {
                return cache[cache.length - 1] === "eof";
            }
            function extendCacheToInclude(i, cb) {
                if (i < cache.length) cb(null, cache[i]); else if (_cacheIsComplete()) cb(null, "eof"); else vol.fetchFromFAT(cache[cache.length - 1], (function(e, d) {
                    if (e) cb(e); else if (typeof d === "string" && d !== "eof") cb(S.err.IO()); else {
                        cache.push(d);
                        extendCacheToInclude(i, cb);
                    }
                }));
            }
            function expandChainToLength(clusterCount, cb) {
                if (!_cacheIsComplete()) throw Error("Must be called only when cache is complete!"); else cache.pop();
                function addCluster(clustersNeeded, lastCluster) {
                    if (!clustersNeeded) cache.push("eof"), cb(); else vol.allocateInFAT(lastCluster, (function(e, newCluster) {
                        if (e) cb(e); else vol.storeToFAT(lastCluster, newCluster, (function(e) {
                            if (e) return cb(e);
                            cache.push(newCluster);
                            addCluster(clustersNeeded - 1, newCluster);
                        }));
                    }));
                }
                addCluster(clusterCount - cache.length, cache[cache.length - 1]);
            }
            function shrinkChainToLength(clusterCount, cb) {
                if (!_cacheIsComplete()) throw Error("Must be called only when cache is complete!"); else cache.pop();
                function removeClusters(count, cb) {
                    if (!count) cache.push("eof"), cb(); else vol.storeToFAT(cache.pop(), "free", (function(e) {
                        if (e) cb(e); else removeClusters(count - 1, cb);
                    }));
                }
                if (clusterCount) removeClusters(cache.length - clusterCount, cb); else removeClusters(cache.length - 1, cb);
            }
            function determineSectorGroups(sectorIdx, numSectors, alloc, cb) {
                var sectorOffset = sectorIdx % vol._sectorsPerCluster, clusterIdx = (sectorIdx - sectorOffset) / vol._sectorsPerCluster, numClusters = Math.ceil((numSectors + sectorOffset) / vol._sectorsPerCluster), chainLength = clusterIdx + numClusters;
                extendCacheToInclude(chainLength - 1, (function(e, c) {
                    if (e) cb(e); else if (c === "eof" && alloc) expandChainToLength(chainLength, (function(e) {
                        if (e) cb(e); else _determineSectorGroups();
                    })); else _determineSectorGroups();
                }));
                function _determineSectorGroups() {
                    var groups = [], _group = null;
                    for (var i = clusterIdx; i < chainLength; ++i) {
                        var c = i < cache.length ? cache[i] : "eof";
                        if (c === "eof") break; else if (_group && c !== _group._nextCluster) {
                            groups.push(_group);
                            _group = null;
                        }
                        if (!_group) _group = {
                            _nextCluster: c + 1,
                            firstSector: vol._firstSectorOfCluster(c) + sectorOffset,
                            numSectors: vol._sectorsPerCluster - sectorOffset
                        }; else {
                            _group._nextCluster += 1;
                            _group.numSectors += vol._sectorsPerCluster;
                        }
                        sectorOffset = 0;
                    }
                    if (_group) groups.push(_group);
                    cb(null, groups, i === chainLength);
                }
            }
            chain.readSectors = function(i, dest, cb) {
                var groupOffset = 0, groupsPending;
                determineSectorGroups(i, dest.length / chain.sectorSize, false, (function(e, groups, complete) {
                    if (e) cb(e); else if (!complete) groupsPending = -1, _pastEOF(cb); else if (groupsPending = groups.length) groups.forEach((function(group) {
                        var groupLength = group.numSectors * chain.sectorSize, groupBuffer = dest.slice(groupOffset, groupOffset += groupLength);
                        chain._vol_readSectors(group.firstSector, groupBuffer, (function(e, d) {
                            if (e && groupsPending !== -1) groupsPending = -1, cb(e); else if (--groupsPending === 0) cb(null, dest);
                        }));
                    })); else cb(null, dest);
                }));
            };
            chain.writeSectors = function(i, data, cb) {
                var groupOffset = 0, groupsPending;
                determineSectorGroups(i, data.length / chain.sectorSize, true, (function(e, groups) {
                    if (e) cb(e); else if (groupsPending = groups.length) groups.forEach((function(group) {
                        var groupLength = group.numSectors * chain.sectorSize, groupBuffer = data.slice(groupOffset, groupOffset += groupLength);
                        chain._vol_writeSectors(group.firstSector, groupBuffer, (function(e) {
                            if (e && groupsPending !== -1) groupsPending = -1, cb(e); else if (--groupsPending === 0) cb();
                        }));
                    })); else cb();
                }));
            };
            chain.truncate = function(numSectors, cb) {
                extendCacheToInclude(Infinity, (function(e, c) {
                    if (e) return cb(e);
                    var currentLength = cache.length - 1, clustersNeeded = Math.ceil(numSectors / vol._sectorsPerCluster);
                    if (clustersNeeded < currentLength) shrinkChainToLength(clustersNeeded, cb); else if (clustersNeeded > currentLength) expandChainToLength(clustersNeeded, cb); else cb();
                }));
            };
            chain.toJSON = function() {
                return {
                    firstCluster
                };
            };
            return chain;
        };
        exports.sectorChain = function(vol, firstSector, numSectors) {
            var chain = _baseChain(vol);
            chain.firstSector = firstSector;
            chain.numSectors = numSectors;
            chain.readSectors = function(i, dest, cb) {
                if (i < numSectors) chain._vol_readSectors(firstSector + i, dest, cb); else _pastEOF(cb);
            };
            chain.writeSectors = function(i, data, cb) {
                if (i < numSectors) chain._vol_writeSectors(firstSector + i, data, cb); else _.delayedCall(cb, S.err.NOSPC());
            };
            chain.truncate = function(i, cb) {
                _.delayedCall(cb, S.err.INVAL());
            };
            chain.toJSON = function() {
                return {
                    firstSector,
                    numSectors
                };
            };
            return chain;
        };
        function _pastEOF(cb) {
            _.delayedCall(cb, null, null);
        }
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        var S = __webpack_require__(82), c = __webpack_require__(87), $ = __webpack_require__(89), _ = __webpack_require__(84);
        exports.init = function(volume, opts, bootSector) {
            if (bootSector[510] !== 85 || bootSector[511] !== 170) throw Error("Invalid volume signature!");
            var isFAT16 = bootSector.readUInt16LE(S.boot16.fields["FATSz16"].offset), bootStruct = isFAT16 ? S.boot16 : S.boot32, BS = bootStruct.valueFromBytes(bootSector);
            _.log(_.log.DBG, "Boot sector info:", BS);
            bootSector = null;
            if (!BS.BytsPerSec) throw Error("This looks like an ExFAT volume! (unsupported)"); else if (BS.BytsPerSec !== volume.sectorSize) throw Error("Sector size mismatch with FAT table.");
            var FATSz = isFAT16 ? BS.FATSz16 : BS.FATSz32, rootDirSectors = Math.ceil(BS.RootEntCnt * 32 / BS.BytsPerSec), firstDataSector = BS.ResvdSecCnt + BS.NumFATs * FATSz + rootDirSectors, totSec = BS.TotSec16 ? BS.TotSec16 : BS.TotSec32, dataSec = totSec - firstDataSector, countofClusters = Math.floor(dataSec / BS.SecPerClus);
            if (totSec > volume.numSectors) throw Error("Volume size mismatch!");
            var fatType;
            if (countofClusters < 4085) {
                fatType = "fat12";
            } else if (countofClusters < 65525) {
                fatType = "fat16";
            } else {
                fatType = "fat32";
            }
            _.log(_.log.DBG, "rootDirSectors", rootDirSectors, "firstDataSector", firstDataSector, "countofClusters", countofClusters, "=>", fatType);
            var vol = {};
            vol.opts = opts;
            vol._sectorSize = BS.BytsPerSec;
            vol._sectorsPerCluster = BS.SecPerClus;
            vol._firstSectorOfCluster = function(n) {
                return firstDataSector + (n - 2) * vol._sectorsPerCluster;
            };
            vol._makeCache = function() {
                return $.wrapDriver(volume);
            };
            vol._readSectors = function(cache, secNum, dest, cb) {
                if (typeof dest === "function") {
                    cb = dest;
                    dest = _.allocBuffer(vol._sectorSize);
                }
                _.log(_.log.DBG, "vol._readSectors", secNum, dest.length);
                if (secNum < volume.numSectors) cache.readSectors(secNum, dest, (function(e) {
                    cb(e, dest);
                })); else throw Error("Invalid sector number!");
            };
            vol._writeSectors = function(cache, secNum, data, cb) {
                _.log(_.log.DBG, "vol._writeSectors", secNum, data.length);
                if (data.length % volume.sectorSize) throw Error("Buffer length not a multiple of sector size"); else if (opts.ro) throw Error("Read-only filesystem"); else if (secNum < volume.numSectors) cache.writeSectors(secNum, data, cb); else throw Error("Invalid sector number!");
            };
            function fatInfoForCluster(n) {
                var entryStruct = S.fatField[fatType], FATOffset = fatType === "fat12" ? Math.floor(n / 2) * entryStruct.size : n * entryStruct.size, SecNum = BS.ResvdSecCnt + Math.floor(FATOffset / BS.BytsPerSec);
                EntOffset = FATOffset % BS.BytsPerSec;
                return {
                    sector: SecNum - BS.ResvdSecCnt,
                    offset: EntOffset,
                    struct: entryStruct
                };
            }
            var fatChain = c.sectorChain(vol, BS.ResvdSecCnt, FATSz);
            fatChain.cacheAdvice = "RANDOM";
            vol.fetchFromFAT = function(clusterNum, cb) {
                var info = fatInfoForCluster(clusterNum);
                fatChain.readFromPosition(info, info.struct.size, (function(e, n, d) {
                    if (e) return cb(e);
                    var status = info.struct.valueFromBytes(d), prefix;
                    if (fatType === "fat12") {
                        if (clusterNum % 2) {
                            status = (status.field1ab << 4) + status.field1c;
                        } else {
                            status = (status.field0a << 8) + status.field0bc;
                        }
                    } else if (fatType === "fat32") {
                        status &= 268435455;
                    }
                    var prefix = S.fatPrefix[fatType];
                    if (status === S.fatStat.free) cb(null, "free"); else if (status === S.fatStat._undef) cb(null, "-invalid-"); else if (status > prefix + S.fatStat.eofMin) cb(null, "eof"); else if (status === prefix + S.fatStat.bad) cb(null, "bad"); else if (status > prefix + S.fatStat.rsvMin) cb(null, "reserved"); else cb(null, status);
                }));
            };
            vol.storeToFAT = function(clusterNum, status, cb) {
                if (typeof status === "string") {
                    status = S.fatStat[status];
                    status += S.fatPrefix[fatType];
                }
                var info = fatInfoForCluster(clusterNum);
                if (fatType === "fat12") fatChain.readFromPosition(info, info.struct.size, (function(e, n, d) {
                    var value = info.struct.valueFromBytes(d);
                    if (clusterNum % 2) {
                        value.field1ab = status >>> 4;
                        value.field1c = status & 15;
                    } else {
                        value.field0a = status >>> 8;
                        value.field0bc = status & 255;
                    }
                    var entry = info.struct.bytesFromValue(value);
                    fatChain.writeToPosition(info, entry, cb);
                })); else {
                    var entry = info.struct.bytesFromValue(status);
                    fatChain.writeToPosition(info, entry, cb);
                }
            };
            vol.allocateInFAT = function(hint, cb) {
                if (typeof hint === "function") {
                    cb = hint;
                    hint = 2;
                }
                function searchForFreeCluster(num, cb) {
                    if (num < countofClusters) vol.fetchFromFAT(num, (function(e, status) {
                        if (e) cb(e); else if (status === "free") cb(null, num); else searchForFreeCluster(num + 1, cb);
                    })); else cb(S.err.NOSPC());
                }
                searchForFreeCluster(hint, (function(e, clusterNum) {
                    if (e) cb(e); else vol.storeToFAT(clusterNum, "eof", cb.bind(null, null, clusterNum));
                }));
            };
            vol.rootDirectoryChain = isFAT16 ? c.sectorChain(vol, firstDataSector - rootDirSectors, rootDirSectors) : c.clusterChain(vol, BS.RootClus);
            vol.rootDirectoryChain.cacheAdvice = "WILLNEED";
            vol.chainForCluster = c.clusterChain.bind(c, vol);
            vol.chainFromJSON = function(d) {
                return "numSectors" in d ? c.sectorChain(vol, d.firstSector, d.numSectors) : c.clusterChain(vol, d.firstCluster);
            };
            return vol;
        };
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        var _ = __webpack_require__(84);
        exports.wrapDriver = function(volume, opts) {
            opts = _.extend({
                maxSectors: 2048
            }, opts);
            var cache = {}, advice = "NORMAL", secSize = volume.sectorSize;
            function _freezeBuffer(b) {
                var f = _.allocBuffer(b.length);
                b.copy(f);
                return f;
            }
            function addToCache(i, data) {
                if (advice === "SEQUENTIAL" || advice === "NOREUSE") return;
                data = _freezeBuffer(data);
                cache[i] = data;
                while (data.length > secSize) {
                    data = data.slice(secSize);
                    cache[++i] = data;
                }
                Object.keys(cache).sort().slice(opts.maxSectors).forEach((function(x) {
                    delete cache[x];
                }));
                _.log(_.log.DBG, "Cache now contains:", Object.keys(cache).join(","));
            }
            return {
                sectorSize: volume.sectorSize,
                numSectors: volume.numSectors,
                advice: function(val) {
                    if (!arguments.length) return advice; else advice = val;
                    if (advice === "SEQUENTIAL" || advice === "NOREUSE") cache = {};
                    return this;
                },
                readSectors: function(i, dest, cb) {
                    if (i in cache && dest.length === secSize) {
                        cache[i].copy(dest);
                        setImmediate(cb);
                    } else volume.readSectors(i, dest, (function(e) {
                        if (e) cb(e); else addToCache(i, dest), cb();
                    }));
                },
                writeSectors: !volume.writeSectors ? null : function(i, data, cb) {
                    volume.writeSectors(i, data, (function(e) {
                        if (e) cb(e); else addToCache(i, data), cb();
                    }));
                }
            };
        };
    }, (module, exports, __webpack_require__) => {
        "use strict";
        function _typeof(obj) {
            if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
                _typeof = function _typeof(obj) {
                    return typeof obj;
                };
            } else {
                _typeof = function _typeof(obj) {
                    return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
                };
            }
            return _typeof(obj);
        }
        exports.log = log;
        exports.formatArgs = formatArgs;
        exports.save = save;
        exports.load = load;
        exports.useColors = useColors;
        exports.storage = localstorage();
        exports.colors = [ "#0000CC", "#0000FF", "#0033CC", "#0033FF", "#0066CC", "#0066FF", "#0099CC", "#0099FF", "#00CC00", "#00CC33", "#00CC66", "#00CC99", "#00CCCC", "#00CCFF", "#3300CC", "#3300FF", "#3333CC", "#3333FF", "#3366CC", "#3366FF", "#3399CC", "#3399FF", "#33CC00", "#33CC33", "#33CC66", "#33CC99", "#33CCCC", "#33CCFF", "#6600CC", "#6600FF", "#6633CC", "#6633FF", "#66CC00", "#66CC33", "#9900CC", "#9900FF", "#9933CC", "#9933FF", "#99CC00", "#99CC33", "#CC0000", "#CC0033", "#CC0066", "#CC0099", "#CC00CC", "#CC00FF", "#CC3300", "#CC3333", "#CC3366", "#CC3399", "#CC33CC", "#CC33FF", "#CC6600", "#CC6633", "#CC9900", "#CC9933", "#CCCC00", "#CCCC33", "#FF0000", "#FF0033", "#FF0066", "#FF0099", "#FF00CC", "#FF00FF", "#FF3300", "#FF3333", "#FF3366", "#FF3399", "#FF33CC", "#FF33FF", "#FF6600", "#FF6633", "#FF9900", "#FF9933", "#FFCC00", "#FFCC33" ];
        function useColors() {
            if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
                return true;
            }
            if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
                return false;
            }
            return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
        }
        function formatArgs(args) {
            args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
            if (!this.useColors) {
                return;
            }
            var c = "color: " + this.color;
            args.splice(1, 0, c, "color: inherit");
            var index = 0;
            var lastC = 0;
            args[0].replace(/%[a-zA-Z%]/g, (function(match) {
                if (match === "%%") {
                    return;
                }
                index++;
                if (match === "%c") {
                    lastC = index;
                }
            }));
            args.splice(lastC, 0, c);
        }
        function log() {
            var _console;
            return (typeof console === "undefined" ? "undefined" : _typeof(console)) === "object" && console.log && (_console = console).log.apply(_console, arguments);
        }
        function save(namespaces) {
            try {
                if (namespaces) {
                    exports.storage.setItem("debug", namespaces);
                } else {
                    exports.storage.removeItem("debug");
                }
            } catch (error) {}
        }
        function load() {
            var r;
            try {
                r = exports.storage.getItem("debug");
            } catch (error) {}
            if (!r && typeof process !== "undefined" && "env" in process) {
                r = process.env.DEBUG;
            }
            return r;
        }
        function localstorage() {
            try {
                return localStorage;
            } catch (error) {}
        }
        module.exports = __webpack_require__(91)(exports);
        var formatters = module.exports.formatters;
        formatters.j = function(v) {
            try {
                return JSON.stringify(v);
            } catch (error) {
                return "[UnexpectedJSONParseError]: " + error.message;
            }
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        function setup(env) {
            createDebug.debug = createDebug;
            createDebug.default = createDebug;
            createDebug.coerce = coerce;
            createDebug.disable = disable;
            createDebug.enable = enable;
            createDebug.enabled = enabled;
            createDebug.humanize = __webpack_require__(12);
            Object.keys(env).forEach((function(key) {
                createDebug[key] = env[key];
            }));
            createDebug.instances = [];
            createDebug.names = [];
            createDebug.skips = [];
            createDebug.formatters = {};
            function selectColor(namespace) {
                var hash = 0;
                for (var i = 0; i < namespace.length; i++) {
                    hash = (hash << 5) - hash + namespace.charCodeAt(i);
                    hash |= 0;
                }
                return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
            }
            createDebug.selectColor = selectColor;
            function createDebug(namespace) {
                var prevTime;
                function debug() {
                    if (!debug.enabled) {
                        return;
                    }
                    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
                        args[_key] = arguments[_key];
                    }
                    var self = debug;
                    var curr = Number(new Date);
                    var ms = curr - (prevTime || curr);
                    self.diff = ms;
                    self.prev = prevTime;
                    self.curr = curr;
                    prevTime = curr;
                    args[0] = createDebug.coerce(args[0]);
                    if (typeof args[0] !== "string") {
                        args.unshift("%O");
                    }
                    var index = 0;
                    args[0] = args[0].replace(/%([a-zA-Z%])/g, (function(match, format) {
                        if (match === "%%") {
                            return match;
                        }
                        index++;
                        var formatter = createDebug.formatters[format];
                        if (typeof formatter === "function") {
                            var val = args[index];
                            match = formatter.call(self, val);
                            args.splice(index, 1);
                            index--;
                        }
                        return match;
                    }));
                    createDebug.formatArgs.call(self, args);
                    var logFn = self.log || createDebug.log;
                    logFn.apply(self, args);
                }
                debug.namespace = namespace;
                debug.enabled = createDebug.enabled(namespace);
                debug.useColors = createDebug.useColors();
                debug.color = selectColor(namespace);
                debug.destroy = destroy;
                debug.extend = extend;
                if (typeof createDebug.init === "function") {
                    createDebug.init(debug);
                }
                createDebug.instances.push(debug);
                return debug;
            }
            function destroy() {
                var index = createDebug.instances.indexOf(this);
                if (index !== -1) {
                    createDebug.instances.splice(index, 1);
                    return true;
                }
                return false;
            }
            function extend(namespace, delimiter) {
                return createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
            }
            function enable(namespaces) {
                createDebug.save(namespaces);
                createDebug.names = [];
                createDebug.skips = [];
                var i;
                var split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
                var len = split.length;
                for (i = 0; i < len; i++) {
                    if (!split[i]) {
                        continue;
                    }
                    namespaces = split[i].replace(/\*/g, ".*?");
                    if (namespaces[0] === "-") {
                        createDebug.skips.push(new RegExp("^" + namespaces.substr(1) + "$"));
                    } else {
                        createDebug.names.push(new RegExp("^" + namespaces + "$"));
                    }
                }
                for (i = 0; i < createDebug.instances.length; i++) {
                    var instance = createDebug.instances[i];
                    instance.enabled = createDebug.enabled(instance.namespace);
                }
            }
            function disable() {
                createDebug.enable("");
            }
            function enabled(name) {
                if (name[name.length - 1] === "*") {
                    return true;
                }
                var i;
                var len;
                for (i = 0, len = createDebug.skips.length; i < len; i++) {
                    if (createDebug.skips[i].test(name)) {
                        return false;
                    }
                }
                for (i = 0, len = createDebug.names.length; i < len; i++) {
                    if (createDebug.names[i].test(name)) {
                        return true;
                    }
                }
                return false;
            }
            function coerce(val) {
                if (val instanceof Error) {
                    return val.stack || val.message;
                }
                return val;
            }
            createDebug.enable(createDebug.load());
            return createDebug;
        }
        module.exports = setup;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.BlockDevice = void 0;
        const direct_io_1 = __webpack_require__(8);
        const fs_1 = __webpack_require__(14);
        const os_1 = __webpack_require__(93);
        const block_write_stream_1 = __webpack_require__(94);
        const constants_1 = __webpack_require__(3);
        const diskpart_1 = __webpack_require__(95);
        const lazy_1 = __webpack_require__(57);
        const sparse_write_stream_1 = __webpack_require__(99);
        const utils_1 = __webpack_require__(6);
        const file_1 = __webpack_require__(100);
        const UNMOUNT_ON_SUCCESS_TIMEOUT_MS = 2e3;
        const WIN32_FIRST_BYTES_TO_KEEP = 64 * 1024;
        class BlockDevice extends file_1.File {
            constructor({drive, unmountOnSuccess = false, write = false, direct = true}) {
                super({
                    path: drive.raw,
                    write
                });
                this.emitsProgress = false;
                this.drive = drive;
                this.unmountOnSuccess = unmountOnSuccess;
                this.oDirect = direct;
                this.alignment = Math.min(drive.blockSize || constants_1.DEFAULT_ALIGNMENT, 4 * 1024 ** 2);
            }
            getAlignment() {
                if (this.oDirect) {
                    return this.alignment;
                }
            }
            getOpenFlags() {
                let flags = this.oWrite ? fs_1.constants.O_RDWR : fs_1.constants.O_RDONLY;
                if (this.oDirect) {
                    flags |= fs_1.constants.O_DIRECT;
                }
                if (this.oWrite) {
                    const plat = (0, os_1.platform)();
                    if (plat === "linux") {
                        flags |= fs_1.constants.O_EXCL;
                    } else if (plat === "darwin") {
                        flags |= direct_io_1.O_EXLOCK;
                    }
                }
                return flags;
            }
            get isSystem() {
                return this.drive.isSystem;
            }
            get raw() {
                return this.drive.raw;
            }
            get device() {
                return this.drive.device;
            }
            get devicePath() {
                return this.drive.devicePath;
            }
            get description() {
                return this.drive.description;
            }
            get mountpoints() {
                return this.drive.mountpoints;
            }
            get size() {
                return this.drive.size;
            }
            async _getMetadata() {
                return {
                    size: this.drive.size || undefined,
                    name: this.drive.device
                };
            }
            async canWrite() {
                return !this.drive.isReadOnly;
            }
            async canCreateWriteStream() {
                return !this.drive.isReadOnly;
            }
            async canCreateSparseWriteStream() {
                return !this.drive.isReadOnly;
            }
            async createWriteStream({highWaterMark} = {}) {
                const stream = new block_write_stream_1.ProgressBlockWriteStream({
                    destination: this,
                    delayFirstBuffer: (0, os_1.platform)() === "win32",
                    highWaterMark
                });
                stream.on("finish", stream.emit.bind(stream, "done"));
                return stream;
            }
            async createSparseWriteStream({highWaterMark} = {}) {
                const stream = new sparse_write_stream_1.ProgressSparseWriteStream({
                    destination: this,
                    firstBytesToKeep: (0, os_1.platform)() === "win32" ? WIN32_FIRST_BYTES_TO_KEEP : 0,
                    highWaterMark
                });
                stream.on("finish", stream.emit.bind(stream, "done"));
                return stream;
            }
            async _open() {
                const plat = (0, os_1.platform)();
                if (this.oWrite) {
                    if (plat !== "win32") {
                        const unmountDisk = (0, lazy_1.getUnmountDisk)();
                        await unmountDisk(this.drive.device);
                    }
                    await (0, diskpart_1.clean)(this.drive.device);
                }
                await super._open();
                if (plat === "darwin") {
                    await (0, utils_1.fromCallback)((cb => {
                        (0, direct_io_1.setF_NOCACHE)(this.fileHandle.fd, 1, cb);
                    }));
                }
            }
            async _close() {
                await super._close();
                if (this.unmountOnSuccess) {
                    await (0, utils_1.delay)(UNMOUNT_ON_SUCCESS_TIMEOUT_MS);
                    const unmountDisk = (0, lazy_1.getUnmountDisk)();
                    await unmountDisk(this.drive.device);
                }
            }
            offsetIsAligned(offset) {
                return offset % this.alignment === 0;
            }
            alignOffsetBefore(offset) {
                return Math.floor(offset / this.alignment) * this.alignment;
            }
            alignOffsetAfter(offset) {
                return Math.ceil(offset / this.alignment) * this.alignment;
            }
            async alignedRead(buffer, bufferOffset, length, sourceOffset) {
                const start = this.alignOffsetBefore(sourceOffset);
                const end = this.alignOffsetAfter(sourceOffset + length);
                const alignedBuffer = (0, direct_io_1.getAlignedBuffer)(end - start, this.alignment);
                const {bytesRead} = await super.read(alignedBuffer, 0, alignedBuffer.length, start);
                const offset = sourceOffset - start;
                alignedBuffer.copy(buffer, bufferOffset, offset, offset + length);
                return {
                    buffer,
                    bytesRead: Math.min(length, bytesRead - offset)
                };
            }
            read(buffer, bufferOffset, length, sourceOffset) {
                if (!(this.offsetIsAligned(sourceOffset) && this.offsetIsAligned(length))) {
                    return this.alignedRead(buffer, bufferOffset, length, sourceOffset);
                } else {
                    return super.read(buffer, bufferOffset, length, sourceOffset);
                }
            }
            async alignedWrite(buffer, bufferOffset, length, fileOffset) {
                const start = this.alignOffsetBefore(fileOffset);
                const end = this.alignOffsetAfter(fileOffset + length);
                const alignedBuffer = (0, direct_io_1.getAlignedBuffer)(end - start, this.alignment);
                await super.read(alignedBuffer, 0, alignedBuffer.length, start);
                const offset = fileOffset - start;
                buffer.copy(alignedBuffer, offset, bufferOffset, length);
                await super.write(alignedBuffer, 0, alignedBuffer.length, start);
                return {
                    buffer,
                    bytesWritten: length
                };
            }
            write(buffer, bufferOffset, length, fileOffset) {
                if (!(this.offsetIsAligned(fileOffset) && this.offsetIsAligned(length))) {
                    return this.alignedWrite(buffer, bufferOffset, length, fileOffset);
                } else {
                    return super.write(buffer, bufferOffset, length, fileOffset);
                }
            }
        }
        exports.BlockDevice = BlockDevice;
    }, module => {
        "use strict";
        module.exports = require("os");
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.ProgressBlockWriteStream = exports.BlockWriteStream = void 0;
        const direct_io_1 = __webpack_require__(8);
        const _debug = __webpack_require__(90);
        const stream_1 = __webpack_require__(17);
        const constants_1 = __webpack_require__(3);
        const errors_1 = __webpack_require__(4);
        const progress_1 = __webpack_require__(18);
        const utils_1 = __webpack_require__(6);
        const debug = _debug("etcher:writer:block-write-stream");
        class BlockWriteStream extends stream_1.Writable {
            constructor({destination, highWaterMark, delayFirstBuffer = false, maxRetries = 5}) {
                super({
                    objectMode: true,
                    highWaterMark
                });
                this.bytesWritten = 0;
                this.position = 0;
                this.destination = destination;
                this.delayFirstBuffer = delayFirstBuffer;
                this.maxRetries = maxRetries;
            }
            async writeBuffer(buffer, position) {
                await (0, errors_1.retryOnTransientError)((async () => {
                    await this.destination.write(buffer, 0, buffer.length, position);
                }), this.maxRetries, constants_1.RETRY_BASE_TIMEOUT);
            }
            async __write(buffer) {
                const unlock = await buffer.rlock();
                debug("_write", buffer.length, this.position, this.bytesWritten);
                try {
                    if (this.delayFirstBuffer && this.firstBuffer === undefined) {
                        this.firstBuffer = (0, direct_io_1.getAlignedBuffer)(buffer.length, buffer.alignment);
                        buffer.copy(this.firstBuffer);
                    } else {
                        await this.writeBuffer(buffer, this.position);
                        this.bytesWritten += buffer.length;
                    }
                    this.position += buffer.length;
                } finally {
                    unlock();
                }
            }
            _write(buffer, _encoding, callback) {
                (0, utils_1.asCallback)(this.__write(buffer), callback);
            }
            async __final() {
                debug("_final");
                if (this.firstBuffer) {
                    try {
                        await this.writeBuffer(this.firstBuffer, 0);
                        this.bytesWritten += this.firstBuffer.length;
                    } catch (error) {
                        this.destroy();
                        throw error;
                    }
                }
            }
            _final(callback) {
                (0, utils_1.asCallback)(this.__final(), callback);
            }
        }
        exports.BlockWriteStream = BlockWriteStream;
        exports.ProgressBlockWriteStream = (0, progress_1.makeClassEmitProgressEvents)(BlockWriteStream, "bytesWritten", "bytesWritten");
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.clean = void 0;
        const child_process_1 = __webpack_require__(96);
        const _debug = __webpack_require__(90);
        const fs_1 = __webpack_require__(14);
        const os_1 = __webpack_require__(93);
        const RWMutex = __webpack_require__(9);
        const tmp_1 = __webpack_require__(97);
        const utils_1 = __webpack_require__(6);
        const debug = _debug("etcher-sdk:diskpart");
        const DISKPART_DELAY = 2e3;
        const DISKPART_RETRIES = 5;
        const PATTERN = /PHYSICALDRIVE(\d+)/i;
        const execFileAsync = async (command, args = [], options = {}) => await new Promise(((resolve, reject) => {
            (0, child_process_1.execFile)(command, args, options, ((error, stdout, stderr) => {
                if (error) {
                    reject(error);
                } else {
                    resolve({
                        stdout,
                        stderr
                    });
                }
            }));
        }));
        const diskpartMutex = new RWMutex;
        async function withDiskpartMutex(fn) {
            const unlock = await diskpartMutex.lock();
            try {
                return await fn();
            } finally {
                unlock();
            }
        }
        const runDiskpart = async commands => {
            if ((0, os_1.platform)() !== "win32") {
                return;
            }
            await (0, tmp_1.withTmpFile)({
                keepOpen: false
            }, (async file => {
                await fs_1.promises.writeFile(file.path, commands.join("\r\n"));
                await withDiskpartMutex((async () => {
                    const {stdout, stderr} = await execFileAsync("diskpart", [ "/s", file.path ]);
                    debug("stdout:", stdout);
                    debug("stderr:", stderr);
                }));
            }));
        };
        const clean = async device => {
            if ((0, os_1.platform)() !== "win32") {
                return;
            }
            const match = device.match(PATTERN);
            if (match === null) {
                throw new Error(`Invalid device: "${device}"`);
            }
            debug("clean", device);
            const deviceId = match.pop();
            let errorCount = 0;
            while (errorCount <= DISKPART_RETRIES) {
                try {
                    await runDiskpart([ `select disk ${deviceId}`, "clean", "rescan" ]);
                    return;
                } catch (error) {
                    if (error.code === 2147756042) {
                        return;
                    }
                    errorCount += 1;
                    if (errorCount <= DISKPART_RETRIES) {
                        await (0, utils_1.delay)(DISKPART_DELAY);
                    } else {
                        throw new Error(`Couldn't clean the drive, ${error.message} (code ${error.code})`);
                    }
                }
            }
        };
        exports.clean = clean;
    }, module => {
        "use strict";
        module.exports = require("child_process");
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.freeSpace = exports.withTmpFile = exports.tmpFile = exports.cleanupTmpFiles = void 0;
        const checkDiskSpace = __webpack_require__(98);
        const crypto_1 = __webpack_require__(56);
        const fs_1 = __webpack_require__(14);
        const os_1 = __webpack_require__(93);
        const path_1 = __webpack_require__(15);
        const TMP_RANDOM_BYTES = 6;
        const TMP_DIR = (0, path_1.join)((0, os_1.tmpdir)(), "etcher");
        const TRIES = 5;
        function randomFilePath(prefix, postfix) {
            return (0, path_1.join)(TMP_DIR, `${prefix}${(0, crypto_1.randomBytes)(TMP_RANDOM_BYTES).toString("hex")}${postfix}`);
        }
        async function cleanupTmpFiles(olderThan = Date.now(), prefix = "") {
            let dirents = [];
            try {
                dirents = await fs_1.promises.readdir(TMP_DIR, {
                    withFileTypes: true
                });
            } catch (_a) {
                return;
            }
            for (const dirent of dirents) {
                if (dirent.isFile()) {
                    if (dirent.name.startsWith(prefix)) {
                        const filename = (0, path_1.join)(TMP_DIR, dirent.name);
                        try {
                            const stats = await fs_1.promises.stat(filename);
                            if (stats.ctime.getTime() <= olderThan) {
                                await fs_1.promises.unlink(filename);
                            }
                        } catch (_b) {}
                    }
                }
            }
        }
        exports.cleanupTmpFiles = cleanupTmpFiles;
        async function createTmpRoot() {
            try {
                await fs_1.promises.mkdir(TMP_DIR, {
                    recursive: true
                });
            } catch (error) {
                if (error.code === "EEXIST" && !(await fs_1.promises.stat(TMP_DIR)).isDirectory()) {
                    await fs_1.promises.unlink(TMP_DIR);
                    await fs_1.promises.mkdir(TMP_DIR, {
                        recursive: true
                    });
                }
            }
        }
        async function tmpFile({keepOpen = true, prefix = "tmp-", postfix = ".tmp"}) {
            await createTmpRoot();
            let fileHandle;
            let path;
            let ok = false;
            for (let i = 0; i < TRIES; i++) {
                path = randomFilePath(prefix, postfix);
                try {
                    fileHandle = await fs_1.promises.open(path, "wx+");
                    ok = true;
                    break;
                } catch (error) {
                    if (error.code !== "EEXIST") {
                        throw error;
                    }
                }
            }
            if (!ok) {
                throw new Error(`Could not generate a temporary filename in ${TRIES} tries`);
            }
            if (!keepOpen && fileHandle !== undefined) {
                await fileHandle.close();
                fileHandle = undefined;
            }
            return {
                fileHandle,
                path
            };
        }
        exports.tmpFile = tmpFile;
        async function withTmpFile(options, fn) {
            const result = await tmpFile(options);
            try {
                return await fn(result);
            } finally {
                if (options.keepOpen && result.fileHandle !== undefined) {
                    await result.fileHandle.close();
                }
                try {
                    await fs_1.promises.unlink(result.path);
                } catch (error) {
                    if (error.code !== "ENOENT") {
                        throw error;
                    }
                }
            }
        }
        exports.withTmpFile = withTmpFile;
        async function freeSpace() {
            try {
                return (await checkDiskSpace(TMP_DIR)).free;
            } catch (error) {
                console.warn(`Could not check free disk space in "${TMP_DIR}": ${error}`);
                return 0;
            }
        }
        exports.freeSpace = freeSpace;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        const {exec} = __webpack_require__(96);
        const fs = __webpack_require__(14);
        const path = __webpack_require__(15);
        const util = __webpack_require__(58);
        const InvalidPathError = function(message) {
            Error.captureStackTrace(this, this.constructor);
            this.name = "InvalidPathError";
            this.message = message || "";
        };
        util.inherits(InvalidPathError, Error);
        const NoMatchError = function(message) {
            Error.captureStackTrace(this, this.constructor);
            this.name = "NoMatchError";
            this.message = message || "";
        };
        util.inherits(NoMatchError, Error);
        function mapOutput(stdout, filter, mapping, coefficient = 1) {
            const parsed = stdout.trim().split("\n").slice(1).map((line => line.trim().split(/\s+(?=[\d/])/)));
            let filtered = parsed.filter(filter);
            if (filtered.length === 0) {
                throw new NoMatchError;
            }
            filtered = filtered[0];
            return {
                diskPath: filtered[mapping.diskPath],
                free: parseInt(filtered[mapping.free], 10) * coefficient,
                size: parseInt(filtered[mapping.size], 10) * coefficient
            };
        }
        function check(cmd, filter, mapping, coefficient = 1) {
            return new Promise(((resolve, reject) => {
                exec(cmd, ((error, stdout) => {
                    if (error) {
                        reject(error);
                    }
                    try {
                        resolve(mapOutput(stdout, filter, mapping, coefficient));
                    } catch (error2) {
                        reject(error2);
                    }
                }));
            }));
        }
        function checkWin32(directoryPath) {
            if (directoryPath.charAt(1) !== ":") {
                return new Promise(((resolve, reject) => {
                    reject(new InvalidPathError(`The following path is invalid (should be X:\\...): ${directoryPath}`));
                }));
            }
            return check("wmic logicaldisk get size,freespace,caption", (driveData => {
                const driveLetter = driveData[0];
                return directoryPath.startsWith(driveLetter);
            }), {
                diskPath: 0,
                free: 1,
                size: 2
            });
        }
        function checkUnix(directoryPath) {
            if (!path.normalize(directoryPath).startsWith(path.sep)) {
                return new Promise(((resolve, reject) => {
                    reject(new InvalidPathError(`The following path is invalid (should start by ${path.sep}): ${directoryPath}`));
                }));
            }
            return check(`df -Pk "${module.exports.getFirstExistingParentPath(directoryPath)}"`, (() => true), {
                diskPath: 5,
                free: 3,
                size: 1
            }, 1024);
        }
        module.exports = process.platform === "win32" ? checkWin32 : checkUnix;
        module.exports.getFirstExistingParentPath = directoryPath => {
            let parentDirectoryPath = directoryPath;
            let parentDirectoryFound = fs.existsSync(parentDirectoryPath);
            while (!parentDirectoryFound) {
                parentDirectoryPath = path.normalize(parentDirectoryPath + "/..");
                parentDirectoryFound = fs.existsSync(parentDirectoryPath);
            }
            return parentDirectoryPath;
        };
        module.exports.InvalidPathError = InvalidPathError;
        module.exports.NoMatchError = NoMatchError;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.ProgressSparseWriteStream = exports.SparseWriteStream = void 0;
        const direct_io_1 = __webpack_require__(8);
        const stream_1 = __webpack_require__(17);
        const aligned_lockable_buffer_1 = __webpack_require__(7);
        const constants_1 = __webpack_require__(3);
        const errors_1 = __webpack_require__(4);
        const progress_1 = __webpack_require__(18);
        const utils_1 = __webpack_require__(6);
        class SparseWriteStream extends stream_1.Writable {
            constructor({destination, highWaterMark, firstBytesToKeep = 0, maxRetries = 5}) {
                super({
                    objectMode: true,
                    highWaterMark
                });
                this.bytesWritten = 0;
                this._firstChunks = [];
                this.destination = destination;
                this.firstBytesToKeep = firstBytesToKeep;
                this.maxRetries = maxRetries;
            }
            async writeChunk(chunk, flushing = false) {
                await (0, errors_1.retryOnTransientError)((async () => {
                    this.position = chunk.position;
                    await this.destination.write(chunk.buffer, 0, chunk.buffer.length, chunk.position);
                    if (!flushing) {
                        this.position += chunk.buffer.length;
                        this.bytesWritten += chunk.buffer.length;
                    }
                }), this.maxRetries, constants_1.RETRY_BASE_TIMEOUT);
            }
            copyChunk(chunk) {
                if ((0, aligned_lockable_buffer_1.isAlignedLockableBuffer)(chunk.buffer)) {
                    const buffer = (0, direct_io_1.getAlignedBuffer)(chunk.buffer.length, chunk.buffer.alignment);
                    chunk.buffer.copy(buffer);
                    return {
                        position: chunk.position,
                        buffer
                    };
                } else {
                    return chunk;
                }
            }
            async __write(chunk) {
                const unlock = (0, aligned_lockable_buffer_1.isAlignedLockableBuffer)(chunk.buffer) ? await chunk.buffer.rlock() : undefined;
                try {
                    if (chunk.position < this.firstBytesToKeep) {
                        const end = chunk.position + chunk.buffer.length;
                        if (end <= this.firstBytesToKeep) {
                            this._firstChunks.push(this.copyChunk(chunk));
                            this.position = chunk.position + chunk.buffer.length;
                            this.bytesWritten += chunk.buffer.length;
                        } else {
                            const difference = this.firstBytesToKeep - chunk.position;
                            this._firstChunks.push(this.copyChunk({
                                position: chunk.position,
                                buffer: chunk.buffer.slice(0, difference)
                            }));
                            this.position = this.firstBytesToKeep;
                            this.bytesWritten += difference;
                            const remainingBuffer = chunk.buffer.slice(difference);
                            await this.writeChunk({
                                position: this.firstBytesToKeep,
                                buffer: remainingBuffer
                            });
                        }
                    } else {
                        await this.writeChunk(chunk);
                    }
                } finally {
                    unlock === null || unlock === void 0 ? void 0 : unlock();
                }
            }
            _write(chunk, _enc, callback) {
                (0, utils_1.asCallback)(this.__write(chunk), callback);
            }
            async __final() {
                try {
                    for (const chunk of this._firstChunks) {
                        await this.writeChunk(chunk, true);
                    }
                } catch (error) {
                    this.destroy();
                    throw error;
                }
            }
            _final(callback) {
                (0, utils_1.asCallback)(this.__final(), callback);
            }
        }
        exports.SparseWriteStream = SparseWriteStream;
        exports.ProgressSparseWriteStream = (0, progress_1.makeClassEmitProgressEvents)(SparseWriteStream, "bytesWritten", "position");
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.File = exports.ProgressWriteStream = void 0;
        const fs_1 = __webpack_require__(14);
        const path_1 = __webpack_require__(15);
        const progress_1 = __webpack_require__(18);
        const source_destination_1 = __webpack_require__(25);
        const block_read_stream_1 = __webpack_require__(16);
        const constants_1 = __webpack_require__(3);
        const errors_1 = __webpack_require__(4);
        const sparse_write_stream_1 = __webpack_require__(99);
        exports.ProgressWriteStream = (0, progress_1.makeClassEmitProgressEvents)(fs_1.WriteStream, "bytesWritten", "bytesWritten");
        const READ_TRIES = 5;
        const readEndMarker = Buffer.from(`not the correct data ${Math.random()}`);
        class File extends source_destination_1.SourceDestination {
            constructor({path, write = false}) {
                super();
                this.path = path;
                this.oWrite = write;
            }
            getOpenFlags() {
                return this.oWrite ? fs_1.constants.O_CREAT | fs_1.constants.O_RDWR : fs_1.constants.O_RDONLY;
            }
            async canRead() {
                return true;
            }
            async canWrite() {
                return this.oWrite;
            }
            async canCreateReadStream() {
                return true;
            }
            canCreateWriteStream() {
                return this.canWrite();
            }
            canCreateSparseWriteStream() {
                return this.canWrite();
            }
            async _getMetadata() {
                return {
                    size: (await fs_1.promises.stat(this.path)).size,
                    name: (0, path_1.basename)(this.path)
                };
            }
            async read(buffer, bufferOffset, length, sourceOffset) {
                let result;
                let tries = READ_TRIES;
                const markerPosition = bufferOffset + length - readEndMarker.length;
                if (length >= readEndMarker.length) {
                    readEndMarker.copy(buffer, markerPosition);
                }
                do {
                    if (tries < READ_TRIES) {
                        console.warn("Incomplete read", {
                            path: this.path,
                            bufferOffset,
                            length,
                            sourceOffset,
                            bufferLength: buffer.length
                        });
                    }
                    result = await this.fileHandle.read(buffer, bufferOffset, length, sourceOffset);
                    tries -= 1;
                } while (tries > 0 && length >= readEndMarker.length && result.bytesRead === length && readEndMarker.compare(buffer, markerPosition, markerPosition + readEndMarker.length) === 0);
                return result;
            }
            write(buffer, bufferOffset, length, fileOffset) {
                return this.fileHandle.write(buffer, bufferOffset, length, fileOffset);
            }
            async createReadStream({emitProgress = false, start = 0, end, alignment, numBuffers} = {}) {
                await this.open();
                const metadata = await this.getMetadata();
                if (metadata.size !== 0) {
                    const lastByte = metadata.size - 1;
                    end = end === undefined ? lastByte : Math.min(end, lastByte);
                }
                if (emitProgress) {
                    return new block_read_stream_1.ProgressBlockReadStream({
                        source: this,
                        alignment,
                        start,
                        end,
                        numBuffers
                    });
                } else {
                    return new block_read_stream_1.BlockReadStream({
                        source: this,
                        alignment,
                        start,
                        end,
                        numBuffers
                    });
                }
            }
            async createWriteStream({highWaterMark} = {}) {
                const stream = new exports.ProgressWriteStream(null, {
                    fd: this.fileHandle.fd,
                    autoClose: false,
                    highWaterMark
                });
                stream.on("finish", stream.emit.bind(stream, "done"));
                return stream;
            }
            async createSparseWriteStream({highWaterMark} = {}) {
                const stream = new sparse_write_stream_1.ProgressSparseWriteStream({
                    destination: this,
                    highWaterMark
                });
                stream.on("finish", stream.emit.bind(stream, "done"));
                return stream;
            }
            async _open() {
                await (0, errors_1.retryOnTransientError)((async () => {
                    this.fileHandle = await fs_1.promises.open(this.path, this.getOpenFlags());
                }), 5, constants_1.RETRY_BASE_TIMEOUT);
            }
            async _close() {
                await this.fileHandle.close();
            }
        }
        exports.File = File;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.configure = exports.normalizePartition = exports.shouldRunOperation = void 0;
        const balena_image_fs_1 = __webpack_require__(69);
        const partitioninfo_1 = __webpack_require__(28);
        const util_1 = __webpack_require__(58);
        const configure_1 = __webpack_require__(102);
        const copy_1 = __webpack_require__(104);
        const MBR_LAST_PRIMARY_PARTITION = 4;
        function shouldRunOperation(options, operation) {
            var _a;
            const when = (_a = operation.when) !== null && _a !== void 0 ? _a : {};
            for (const [key, value] of Object.entries(when)) {
                if (options[key] !== value) {
                    return false;
                }
            }
            return true;
        }
        exports.shouldRunOperation = shouldRunOperation;
        function normalizePartition(partition) {
            if (typeof partition === "number") {
                return partition;
            }
            if (typeof partition.logical === "number") {
                return partition.logical + MBR_LAST_PRIMARY_PARTITION;
            }
            if (typeof partition.primary === "number") {
                return partition.primary;
            }
            throw new Error(`Invalid partition: ${partition}`);
        }
        exports.normalizePartition = normalizePartition;
        async function getDiskDeviceType(disk) {
            const partitions = await (0, partitioninfo_1.getPartitions)(disk);
            for (const partition of partitions.partitions) {
                if (partition.type === 14) {
                    const deviceType = await (0, balena_image_fs_1.interact)(disk, partition.index, (async fs => {
                        try {
                            return await (0, util_1.promisify)(fs.readFile)("/device-type.json");
                        } catch (error) {
                            return undefined;
                        }
                    }));
                    if (deviceType) {
                        return JSON.parse(deviceType.toString());
                    }
                }
            }
        }
        async function configure(disk, config) {
            var _a, _b, _c;
            const deviceType = await getDiskDeviceType(disk);
            const operations = (_b = (_a = deviceType === null || deviceType === void 0 ? void 0 : deviceType.configuration) === null || _a === void 0 ? void 0 : _a.operations) !== null && _b !== void 0 ? _b : [];
            const configPartition = (_c = deviceType === null || deviceType === void 0 ? void 0 : deviceType.configuration) === null || _c === void 0 ? void 0 : _c.config.partition;
            if (config !== undefined && configPartition !== undefined) {
                await (0, configure_1.configure)(disk, normalizePartition(configPartition), config);
            }
            for (const cpy of operations) {
                if (cpy.from.partition !== undefined && cpy.to.partition !== undefined && shouldRunOperation(config !== null && config !== void 0 ? config : {}, cpy)) {
                    await (0, copy_1.copy)(disk, normalizePartition(cpy.from.partition), cpy.from.path, disk, normalizePartition(cpy.to.partition), cpy.to.path);
                }
            }
        }
        exports.configure = configure;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.configure = void 0;
        const balena_image_fs_1 = __webpack_require__(69);
        const outdent_1 = __webpack_require__(103);
        const util_1 = __webpack_require__(58);
        function nmWifiConfig(index, options) {
            let config = (0, outdent_1.outdent)`
		[connection]
		id=balena-wifi-${pad(index)}
		type=wifi

		[wifi]
		hidden=true
		mode=infrastructure
		ssid=${options.wifiSsid}

		[ipv4]
	`;
            if (options.routeMetric) {
                config += (0, outdent_1.outdent)`

			route-metric=${options.routeMetric}
		`;
            }
            if (options.ip && options.netmask && options.gateway) {
                config += (0, outdent_1.outdent)`

			method=manual
			address1=${options.ip}/${options.netmask},${options.gateway}
		`;
            } else {
                config += (0, outdent_1.outdent)`

			method=auto
		`;
            }
            config += (0, outdent_1.outdent)`


		[ipv6]
		addr-gen-mode=stable-privacy
		method=auto
	`;
            if (options.wifiKey) {
                config += (0, outdent_1.outdent)`


			[wifi-security]
			auth-alg=open
			key-mgmt=wpa-psk
			psk=${options.wifiKey}
		`;
            }
            return config;
        }
        function createNetworkConfigFiles(networks) {
            return {
                ethernet: networks.map((n => n.configuration)).filter((n => !!n)),
                wifi: networks.filter((n => !!n.wifiSsid)).map(((network, index) => nmWifiConfig(index + 1, network)))
            };
        }
        function pad(num) {
            return `${num}`.padStart(2, "0");
        }
        async function configure(disk, partition, config) {
            const {wifiSsid, wifiKey, ip, netmask, gateway, routeMetric, network, ...configJSON} = config;
            const networks = [ {
                wifiSsid,
                wifiKey,
                ip,
                netmask,
                gateway,
                routeMetric
            }, ...network !== null && network !== void 0 ? network : [] ];
            const networkConfigFiles = createNetworkConfigFiles(networks);
            await (0, balena_image_fs_1.interact)(disk, partition, (async fs => {
                const writeFileAsync = (0, util_1.promisify)(fs.writeFile);
                const mkdirAsync = (0, util_1.promisify)(fs.mkdir);
                await writeFileAsync("/config.json", JSON.stringify(configJSON));
                try {
                    await mkdirAsync("/system-connections");
                } catch (_a) {}
                for (const [index, configuration] of networkConfigFiles.ethernet.entries()) {
                    await writeFileAsync(`/system-connections/connection-${pad(index + 1)}`, configuration);
                }
                for (const [index, configuration] of networkConfigFiles.wifi.entries()) {
                    await writeFileAsync(`/system-connections/balena-wifi-${pad(index + 1)}`, configuration);
                }
            }));
        }
        exports.configure = configure;
    }, (module, __webpack_exports__, __webpack_require__) => {
        "use strict";
        __webpack_require__.r(__webpack_exports__);
        __webpack_require__.d(__webpack_exports__, {
            default: () => __WEBPACK_DEFAULT_EXPORT__,
            outdent: () => defaultOutdent
        });
        module = __webpack_require__.hmd(module);
        function noop() {
            var args = [];
            for (var _i = 0; _i < arguments.length; _i++) {
                args[_i] = arguments[_i];
            }
        }
        function createWeakMap() {
            if (typeof WeakMap !== "undefined") {
                return new WeakMap;
            } else {
                return fakeSetOrMap();
            }
        }
        function fakeSetOrMap() {
            return {
                add: noop,
                delete: noop,
                get: noop,
                set: noop,
                has: function(k) {
                    return false;
                }
            };
        }
        var hop = Object.prototype.hasOwnProperty;
        var has = function(obj, prop) {
            return hop.call(obj, prop);
        };
        function extend(target, source) {
            for (var prop in source) {
                if (has(source, prop)) {
                    target[prop] = source[prop];
                }
            }
            return target;
        }
        var reLeadingNewline = /^[ \t]*(?:\r\n|\r|\n)/;
        var reTrailingNewline = /(?:\r\n|\r|\n)[ \t]*$/;
        var reStartsWithNewlineOrIsEmpty = /^(?:[\r\n]|$)/;
        var reDetectIndentation = /(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/;
        var reOnlyWhitespaceWithAtLeastOneNewline = /^[ \t]*[\r\n][ \t\r\n]*$/;
        function _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options) {
            var indentationLevel = 0;
            var match = strings[0].match(reDetectIndentation);
            if (match) {
                indentationLevel = match[1].length;
            }
            var reSource = "(\\r\\n|\\r|\\n).{0," + indentationLevel + "}";
            var reMatchIndent = new RegExp(reSource, "g");
            if (firstInterpolatedValueSetsIndentationLevel) {
                strings = strings.slice(1);
            }
            var newline = options.newline, trimLeadingNewline = options.trimLeadingNewline, trimTrailingNewline = options.trimTrailingNewline;
            var normalizeNewlines = typeof newline === "string";
            var l = strings.length;
            var outdentedStrings = strings.map((function(v, i) {
                v = v.replace(reMatchIndent, "$1");
                if (i === 0 && trimLeadingNewline) {
                    v = v.replace(reLeadingNewline, "");
                }
                if (i === l - 1 && trimTrailingNewline) {
                    v = v.replace(reTrailingNewline, "");
                }
                if (normalizeNewlines) {
                    v = v.replace(/\r\n|\n|\r/g, (function(_) {
                        return newline;
                    }));
                }
                return v;
            }));
            return outdentedStrings;
        }
        function concatStringsAndValues(strings, values) {
            var ret = "";
            for (var i = 0, l = strings.length; i < l; i++) {
                ret += strings[i];
                if (i < l - 1) {
                    ret += values[i];
                }
            }
            return ret;
        }
        function isTemplateStringsArray(v) {
            return has(v, "raw") && has(v, "length");
        }
        function createInstance(options) {
            var arrayAutoIndentCache = createWeakMap();
            var arrayFirstInterpSetsIndentCache = createWeakMap();
            function outdent(stringsOrOptions) {
                var values = [];
                for (var _i = 1; _i < arguments.length; _i++) {
                    values[_i - 1] = arguments[_i];
                }
                if (isTemplateStringsArray(stringsOrOptions)) {
                    var strings = stringsOrOptions;
                    var firstInterpolatedValueSetsIndentationLevel = (values[0] === outdent || values[0] === defaultOutdent) && reOnlyWhitespaceWithAtLeastOneNewline.test(strings[0]) && reStartsWithNewlineOrIsEmpty.test(strings[1]);
                    var cache = firstInterpolatedValueSetsIndentationLevel ? arrayFirstInterpSetsIndentCache : arrayAutoIndentCache;
                    var renderedArray = cache.get(strings);
                    if (!renderedArray) {
                        renderedArray = _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options);
                        cache.set(strings, renderedArray);
                    }
                    if (values.length === 0) {
                        return renderedArray[0];
                    }
                    var rendered = concatStringsAndValues(renderedArray, firstInterpolatedValueSetsIndentationLevel ? values.slice(1) : values);
                    return rendered;
                } else {
                    return createInstance(extend(extend({}, options), stringsOrOptions || {}));
                }
            }
            var fullOutdent = extend(outdent, {
                string: function(str) {
                    return _outdentArray([ str ], false, options)[0];
                }
            });
            return fullOutdent;
        }
        var defaultOutdent = createInstance({
            trimLeadingNewline: true,
            trimTrailingNewline: true
        });
        const __WEBPACK_DEFAULT_EXPORT__ = defaultOutdent;
        if (true) {
            try {
                module.exports = defaultOutdent;
                Object.defineProperty(defaultOutdent, "__esModule", {
                    value: true
                });
                defaultOutdent.default = defaultOutdent;
                defaultOutdent.outdent = defaultOutdent;
            } catch (e) {}
        }
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.copy = void 0;
        const balena_image_fs_1 = __webpack_require__(69);
        async function copyFile(sourceFs, sourcePath, destinationFs, destinationPath) {
            const readStream = sourceFs.createReadStream(`/${sourcePath}`);
            const writeStream = destinationFs.createWriteStream(`/${destinationPath}`);
            await new Promise(((resolve, reject) => {
                readStream.on("error", reject).pipe(writeStream).on("error", reject).on("close", resolve);
            }));
        }
        async function copy(diskFrom, partitionFrom, pathFrom, diskTo, partitionTo, pathTo) {
            await (0, balena_image_fs_1.interact)(diskFrom, partitionFrom, (async fsFrom => {
                if (diskFrom === diskTo && partitionFrom === partitionTo) {
                    await copyFile(fsFrom, pathFrom, fsFrom, pathTo);
                } else {
                    await (0, balena_image_fs_1.interact)(diskTo, partitionTo, (async fsTo => {
                        await copyFile(fsFrom, pathFrom, fsTo, pathTo);
                    }));
                }
            }));
        }
        exports.copy = copy;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.MultiDestination = exports.MultiDestinationVerifier = exports.MultiDestinationError = void 0;
        const events_1 = __webpack_require__(26);
        const stream_1 = __webpack_require__(17);
        const constants_1 = __webpack_require__(3);
        const errors_1 = __webpack_require__(4);
        const utils_1 = __webpack_require__(6);
        const block_device_1 = __webpack_require__(92);
        const source_destination_1 = __webpack_require__(25);
        function isntNull(x) {
            return x !== null;
        }
        class MultiDestinationError extends Error {
            constructor(error, destination) {
                super();
                this.error = error;
                this.destination = destination;
            }
        }
        exports.MultiDestinationError = MultiDestinationError;
        class MultiDestinationVerifier extends source_destination_1.Verifier {
            constructor(source, checksumOrBlocks, size) {
                super();
                this.verifiers = new Set;
                for (const dest of source.activeDestinations) {
                    const verifier = dest.createVerifier(checksumOrBlocks, size);
                    verifier.on("error", (error => {
                        this.oneVerifierFinished(verifier);
                        source.destinationError(dest, error, this);
                    }));
                    verifier.on("finish", (() => {
                        this.oneVerifierFinished(verifier);
                    }));
                    this.verifiers.add(verifier);
                }
            }
            oneVerifierFinished(verifier) {
                if (!this.verifiers.has(verifier)) {
                    return;
                }
                if (this.verifiers.size === 1) {
                    clearInterval(this.timer);
                    this.emitProgress();
                    this.emit("finish");
                }
                this.verifiers.delete(verifier);
            }
            emitProgress() {
                const verifier = (0, utils_1.minBy)(this.verifiers, (v => v.progress.bytes));
                if (verifier !== undefined) {
                    this.emit("progress", verifier.progress);
                }
            }
            async run() {
                if (this.verifiers.size === 0) {
                    this.emit("finish");
                    return;
                }
                this.timer = setInterval(this.emitProgress.bind(this), constants_1.PROGRESS_EMISSION_INTERVAL);
                for (const verifier of this.verifiers) {
                    verifier.run();
                }
            }
        }
        exports.MultiDestinationVerifier = MultiDestinationVerifier;
        class MultiDestination extends source_destination_1.SourceDestination {
            constructor(destinations) {
                super();
                this.destinations = new Set;
                this.erroredDestinations = new Set;
                if (destinations.length === 0) {
                    throw new Error("At least one destination is required");
                }
                for (const destination of destinations) {
                    this.destinations.add(destination);
                }
            }
            getAlignment() {
                let max;
                for (const destination of this.destinations.values()) {
                    if (destination instanceof block_device_1.BlockDevice && (max === undefined || destination.alignment > max)) {
                        max = destination.alignment;
                    }
                }
                return max;
            }
            destinationError(destination, error, stream) {
                if (!(error instanceof errors_1.VerificationError)) {
                    this.erroredDestinations.add(destination);
                }
                error = new MultiDestinationError(error, destination);
                if (stream !== undefined) {
                    stream.emit("fail", error);
                } else {
                    this.emit("fail", error);
                }
            }
            get activeDestinations() {
                return (0, utils_1.difference)(this.destinations, this.erroredDestinations);
            }
            async can(methodName) {
                return (0, utils_1.every)(await Promise.all(Array.from(this.activeDestinations).map((destination => destination[methodName]()))));
            }
            canRead() {
                return this.can("canRead");
            }
            canWrite() {
                return this.can("canWrite");
            }
            canCreateReadStream() {
                return this.can("canCreateReadStream");
            }
            canCreateSparseReadStream() {
                return this.can("canCreateSparseReadStream");
            }
            canCreateWriteStream() {
                return this.can("canCreateWriteStream");
            }
            canCreateSparseWriteStream() {
                return this.can("canCreateSparseWriteStream");
            }
            read(buffer, bufferOffset, length, sourceOffset) {
                return Array.from(this.activeDestinations)[0].read(buffer, bufferOffset, length, sourceOffset);
            }
            async write(buffer, bufferOffset, length, fileOffset) {
                const results = await Promise.all(Array.from(this.activeDestinations).map((destination => destination.write(buffer, bufferOffset, length, fileOffset))));
                return results[0];
            }
            createReadStream(options) {
                return Array.from(this.activeDestinations)[0].createReadStream(options);
            }
            createSparseReadStream(options) {
                return Array.from(this.activeDestinations)[0].createSparseReadStream(options);
            }
            async createStream(methodName, ...args) {
                const passthrough = new stream_1.PassThrough({
                    objectMode: methodName === "createSparseWriteStream"
                });
                const listeners = this.activeDestinations.size + 1;
                if (listeners > events_1.EventEmitter.defaultMaxListeners) {
                    passthrough.setMaxListeners(listeners);
                }
                const progresses = new Map;
                let interval;
                function oneStreamFinished(stream) {
                    if (!progresses.has(stream)) {
                        return;
                    }
                    if (progresses.size === 1) {
                        clearInterval(interval);
                        emitProgress();
                        passthrough.emit("done");
                    }
                    progresses.delete(stream);
                }
                function emitProgress() {
                    const leastAdvancedProgress = (0, utils_1.minBy)(Array.from(progresses.values()).filter(isntNull), (p => p.position));
                    if (leastAdvancedProgress !== undefined) {
                        passthrough.emit("progress", leastAdvancedProgress);
                    }
                }
                await Promise.all(Array.from(this.activeDestinations).map((async destination => {
                    const stream = await destination[methodName](...args);
                    progresses.set(stream, null);
                    stream.on("progress", (progressEvent => {
                        progresses.set(stream, progressEvent);
                        if (interval === undefined) {
                            interval = setInterval(emitProgress, constants_1.PROGRESS_EMISSION_INTERVAL);
                        }
                    }));
                    stream.on("error", (error => {
                        this.destinationError(destination, error, passthrough);
                        oneStreamFinished(stream);
                    }));
                    stream.on("finish", oneStreamFinished.bind(null, stream));
                    passthrough.pipe(stream);
                })));
                passthrough.on("pipe", (() => {
                    if (this.activeDestinations.size === 0) {
                        passthrough.emit("done");
                    }
                }));
                return passthrough;
            }
            createWriteStream(...args) {
                return this.createStream("createWriteStream", ...args);
            }
            createSparseWriteStream(...args) {
                return this.createStream("createSparseWriteStream", ...args);
            }
            createVerifier(checksumOrBlocks, size) {
                return new MultiDestinationVerifier(this, checksumOrBlocks, size);
            }
            async _open() {
                await Promise.all(Array.from(this.destinations).map((async destination => {
                    try {
                        await destination.open();
                    } catch (error) {
                        this.destinationError(destination, error);
                    }
                })));
            }
            async _close() {
                await Promise.all(Array.from(this.destinations).map((async destination => {
                    try {
                        await destination.close();
                    } catch (error) {
                        this.destinationError(destination, error);
                    }
                })));
            }
        }
        exports.MultiDestination = MultiDestination;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.Scanner = exports.adapters = void 0;
        const adapters = __webpack_require__(107);
        exports.adapters = adapters;
        const scanner_1 = __webpack_require__(142);
        Object.defineProperty(exports, "Scanner", {
            enumerable: true,
            get: function() {
                return scanner_1.Scanner;
            }
        });
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        const tslib_1 = __webpack_require__(108);
        (0, tslib_1.__exportStar)(__webpack_require__(109), exports);
        (0, tslib_1.__exportStar)(__webpack_require__(110), exports);
        (0, tslib_1.__exportStar)(__webpack_require__(116), exports);
        (0, tslib_1.__exportStar)(__webpack_require__(136), exports);
        (0, tslib_1.__exportStar)(__webpack_require__(138), exports);
    }, (__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
        "use strict";
        __webpack_require__.r(__webpack_exports__);
        __webpack_require__.d(__webpack_exports__, {
            __extends: () => __extends,
            __assign: () => __assign,
            __rest: () => __rest,
            __decorate: () => __decorate,
            __param: () => __param,
            __metadata: () => __metadata,
            __awaiter: () => __awaiter,
            __generator: () => __generator,
            __createBinding: () => __createBinding,
            __exportStar: () => __exportStar,
            __values: () => __values,
            __read: () => __read,
            __spread: () => __spread,
            __spreadArrays: () => __spreadArrays,
            __spreadArray: () => __spreadArray,
            __await: () => __await,
            __asyncGenerator: () => __asyncGenerator,
            __asyncDelegator: () => __asyncDelegator,
            __asyncValues: () => __asyncValues,
            __makeTemplateObject: () => __makeTemplateObject,
            __importStar: () => __importStar,
            __importDefault: () => __importDefault,
            __classPrivateFieldGet: () => __classPrivateFieldGet,
            __classPrivateFieldSet: () => __classPrivateFieldSet
        });
        var extendStatics = function(d, b) {
            extendStatics = Object.setPrototypeOf || {
                __proto__: []
            } instanceof Array && function(d, b) {
                d.__proto__ = b;
            } || function(d, b) {
                for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
            };
            return extendStatics(d, b);
        };
        function __extends(d, b) {
            if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
            extendStatics(d, b);
            function __() {
                this.constructor = d;
            }
            d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __);
        }
        var __assign = function() {
            __assign = Object.assign || function __assign(t) {
                for (var s, i = 1, n = arguments.length; i < n; i++) {
                    s = arguments[i];
                    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
                }
                return t;
            };
            return __assign.apply(this, arguments);
        };
        function __rest(s, e) {
            var t = {};
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
            if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
                if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
            }
            return t;
        }
        function __decorate(decorators, target, key, desc) {
            var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
            if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
            return c > 3 && r && Object.defineProperty(target, key, r), r;
        }
        function __param(paramIndex, decorator) {
            return function(target, key) {
                decorator(target, key, paramIndex);
            };
        }
        function __metadata(metadataKey, metadataValue) {
            if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
        }
        function __awaiter(thisArg, _arguments, P, generator) {
            function adopt(value) {
                return value instanceof P ? value : new P((function(resolve) {
                    resolve(value);
                }));
            }
            return new (P || (P = Promise))((function(resolve, reject) {
                function fulfilled(value) {
                    try {
                        step(generator.next(value));
                    } catch (e) {
                        reject(e);
                    }
                }
                function rejected(value) {
                    try {
                        step(generator["throw"](value));
                    } catch (e) {
                        reject(e);
                    }
                }
                function step(result) {
                    result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
                }
                step((generator = generator.apply(thisArg, _arguments || [])).next());
            }));
        }
        function __generator(thisArg, body) {
            var _ = {
                label: 0,
                sent: function() {
                    if (t[0] & 1) throw t[1];
                    return t[1];
                },
                trys: [],
                ops: []
            }, f, y, t, g;
            return g = {
                next: verb(0),
                throw: verb(1),
                return: verb(2)
            }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
                return this;
            }), g;
            function verb(n) {
                return function(v) {
                    return step([ n, v ]);
                };
            }
            function step(op) {
                if (f) throw new TypeError("Generator is already executing.");
                while (_) try {
                    if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 
                    0) : y.next) && !(t = t.call(y, op[1])).done) return t;
                    if (y = 0, t) op = [ op[0] & 2, t.value ];
                    switch (op[0]) {
                      case 0:
                      case 1:
                        t = op;
                        break;

                      case 4:
                        _.label++;
                        return {
                            value: op[1],
                            done: false
                        };

                      case 5:
                        _.label++;
                        y = op[1];
                        op = [ 0 ];
                        continue;

                      case 7:
                        op = _.ops.pop();
                        _.trys.pop();
                        continue;

                      default:
                        if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
                            _ = 0;
                            continue;
                        }
                        if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
                            _.label = op[1];
                            break;
                        }
                        if (op[0] === 6 && _.label < t[1]) {
                            _.label = t[1];
                            t = op;
                            break;
                        }
                        if (t && _.label < t[2]) {
                            _.label = t[2];
                            _.ops.push(op);
                            break;
                        }
                        if (t[2]) _.ops.pop();
                        _.trys.pop();
                        continue;
                    }
                    op = body.call(thisArg, _);
                } catch (e) {
                    op = [ 6, e ];
                    y = 0;
                } finally {
                    f = t = 0;
                }
                if (op[0] & 5) throw op[1];
                return {
                    value: op[0] ? op[1] : void 0,
                    done: true
                };
            }
        }
        var __createBinding = Object.create ? function(o, m, k, k2) {
            if (k2 === undefined) k2 = k;
            Object.defineProperty(o, k2, {
                enumerable: true,
                get: function() {
                    return m[k];
                }
            });
        } : function(o, m, k, k2) {
            if (k2 === undefined) k2 = k;
            o[k2] = m[k];
        };
        function __exportStar(m, o) {
            for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
        }
        function __values(o) {
            var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
            if (m) return m.call(o);
            if (o && typeof o.length === "number") return {
                next: function() {
                    if (o && i >= o.length) o = void 0;
                    return {
                        value: o && o[i++],
                        done: !o
                    };
                }
            };
            throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
        }
        function __read(o, n) {
            var m = typeof Symbol === "function" && o[Symbol.iterator];
            if (!m) return o;
            var i = m.call(o), r, ar = [], e;
            try {
                while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
            } catch (error) {
                e = {
                    error
                };
            } finally {
                try {
                    if (r && !r.done && (m = i["return"])) m.call(i);
                } finally {
                    if (e) throw e.error;
                }
            }
            return ar;
        }
        function __spread() {
            for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
            return ar;
        }
        function __spreadArrays() {
            for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
            for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, 
            k++) r[k] = a[j];
            return r;
        }
        function __spreadArray(to, from) {
            for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) to[j] = from[i];
            return to;
        }
        function __await(v) {
            return this instanceof __await ? (this.v = v, this) : new __await(v);
        }
        function __asyncGenerator(thisArg, _arguments, generator) {
            if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
            var g = generator.apply(thisArg, _arguments || []), i, q = [];
            return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
                return this;
            }, i;
            function verb(n) {
                if (g[n]) i[n] = function(v) {
                    return new Promise((function(a, b) {
                        q.push([ n, v, a, b ]) > 1 || resume(n, v);
                    }));
                };
            }
            function resume(n, v) {
                try {
                    step(g[n](v));
                } catch (e) {
                    settle(q[0][3], e);
                }
            }
            function step(r) {
                r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
            }
            function fulfill(value) {
                resume("next", value);
            }
            function reject(value) {
                resume("throw", value);
            }
            function settle(f, v) {
                if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
            }
        }
        function __asyncDelegator(o) {
            var i, p;
            return i = {}, verb("next"), verb("throw", (function(e) {
                throw e;
            })), verb("return"), i[Symbol.iterator] = function() {
                return this;
            }, i;
            function verb(n, f) {
                i[n] = o[n] ? function(v) {
                    return (p = !p) ? {
                        value: __await(o[n](v)),
                        done: n === "return"
                    } : f ? f(v) : v;
                } : f;
            }
        }
        function __asyncValues(o) {
            if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
            var m = o[Symbol.asyncIterator], i;
            return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), 
            i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
                return this;
            }, i);
            function verb(n) {
                i[n] = o[n] && function(v) {
                    return new Promise((function(resolve, reject) {
                        v = o[n](v), settle(resolve, reject, v.done, v.value);
                    }));
                };
            }
            function settle(resolve, reject, d, v) {
                Promise.resolve(v).then((function(v) {
                    resolve({
                        value: v,
                        done: d
                    });
                }), reject);
            }
        }
        function __makeTemplateObject(cooked, raw) {
            if (Object.defineProperty) {
                Object.defineProperty(cooked, "raw", {
                    value: raw
                });
            } else {
                cooked.raw = raw;
            }
            return cooked;
        }
        var __setModuleDefault = Object.create ? function(o, v) {
            Object.defineProperty(o, "default", {
                enumerable: true,
                value: v
            });
        } : function(o, v) {
            o["default"] = v;
        };
        function __importStar(mod) {
            if (mod && mod.__esModule) return mod;
            var result = {};
            if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
            __setModuleDefault(result, mod);
            return result;
        }
        function __importDefault(mod) {
            return mod && mod.__esModule ? mod : {
                default: mod
            };
        }
        function __classPrivateFieldGet(receiver, privateMap) {
            if (!privateMap.has(receiver)) {
                throw new TypeError("attempted to get private field on non-instance");
            }
            return privateMap.get(receiver);
        }
        function __classPrivateFieldSet(receiver, privateMap, value) {
            if (!privateMap.has(receiver)) {
                throw new TypeError("attempted to set private field on non-instance");
            }
            privateMap.set(receiver, value);
            return value;
        }
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.Adapter = void 0;
        const events_1 = __webpack_require__(26);
        class Adapter extends events_1.EventEmitter {}
        exports.Adapter = Adapter;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.BlockDeviceAdapter = void 0;
        const _debug = __webpack_require__(90);
        const drivelist_1 = __webpack_require__(111);
        const block_device_1 = __webpack_require__(92);
        const utils_1 = __webpack_require__(6);
        const adapter_1 = __webpack_require__(109);
        const debug = _debug("etcher-sdk:block-device-adapter");
        const SCAN_INTERVAL = 1e3;
        const USBBOOT_RPI_COMPUTE_MODULE_NAMES = [ "0001", "RPi-MSD- 0001", "File-Stor Gadget", "Linux File-Stor_Gadget", "Linux File-Stor Gadget", "Linux File-Stor Gadget USB Device", "Linux File-Stor Gadget Media" ];
        function looksLikeComputeModule(description) {
            for (const name of USBBOOT_RPI_COMPUTE_MODULE_NAMES) {
                if (description.startsWith(name)) {
                    return true;
                }
            }
            return false;
        }
        function driveKey(drive) {
            return [ drive.device, drive.size, drive.description, drive.mountpoints.map((m => m.path)).sort().join(",") ].join("|");
        }
        class BlockDeviceAdapter extends adapter_1.Adapter {
            constructor({includeSystemDrives = () => false, unmountOnSuccess = false, write = false, direct = true}) {
                super();
                this.drives = new Map;
                this.running = false;
                this.ready = false;
                this.includeSystemDrives = includeSystemDrives;
                this.unmountOnSuccess = unmountOnSuccess;
                this.oWrite = write;
                this.oDirect = direct;
            }
            start() {
                this.running = true;
                this.scanLoop();
            }
            stop() {
                this.running = false;
                this.ready = false;
                this.drives.clear();
            }
            async scanLoop() {
                while (this.running) {
                    await this.scan();
                    if (!this.ready) {
                        this.ready = true;
                        this.emit("ready");
                    }
                    await (0, utils_1.delay)(SCAN_INTERVAL);
                }
            }
            async scan() {
                const drives = await this.listDrives();
                if (this.running) {
                    const oldDevices = new Set(this.drives.keys());
                    const newDevices = new Set(drives.keys());
                    for (const removed of (0, utils_1.difference)(oldDevices, newDevices)) {
                        this.emit("detach", this.drives.get(removed));
                        this.drives.delete(removed);
                    }
                    for (const added of (0, utils_1.difference)(newDevices, oldDevices)) {
                        const drive = drives.get(added);
                        const blockDevice = new block_device_1.BlockDevice({
                            drive,
                            unmountOnSuccess: this.unmountOnSuccess,
                            write: this.oWrite,
                            direct: this.oDirect
                        });
                        this.emit("attach", blockDevice);
                        this.drives.set(added, blockDevice);
                    }
                }
            }
            async listDrives() {
                let drives;
                const result = new Map;
                try {
                    drives = await (0, drivelist_1.list)();
                } catch (error) {
                    debug(error);
                    this.emit("error", error);
                    return result;
                }
                for (const drive of drives) {
                    if (!(drive.busType !== "RAID" && !drive.error && (this.includeSystemDrives() || !drive.isSystem) && typeof drive.size === "number" && !drive.isVirtual)) {
                        continue;
                    }
                    const displayName = /PhysicalDrive/i.test(drive.device) && drive.mountpoints.length ? drive.mountpoints.map((m => m.path)).join(", ") : drive.device;
                    const resultDrive = {
                        ...drive,
                        displayName
                    };
                    if (looksLikeComputeModule(resultDrive.description)) {
                        resultDrive.description = "Compute Module";
                        resultDrive.icon = "raspberrypi";
                        resultDrive.isSystem = false;
                    }
                    result.set(driveKey(drive), resultDrive);
                }
                return result;
            }
        }
        exports.BlockDeviceAdapter = BlockDeviceAdapter;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.list = void 0;
        const bindings = __webpack_require__(112);
        const os_1 = __webpack_require__(93);
        const lsblk_1 = __webpack_require__(113);
        const drivelistBindings = bindings;
        function bindingsList() {
            return new Promise(((resolve, reject) => {
                drivelistBindings.list(((error, drives) => {
                    if (error != null) {
                        reject(error);
                    } else {
                        resolve(drives);
                    }
                }));
            }));
        }
        function handleApfs(disks) {
            const apfs = [];
            const other = [];
            for (const disk of disks) {
                if (disk.description === "AppleAPFSMedia") {
                    apfs.push(disk);
                } else {
                    other.push(disk);
                }
            }
            for (const disk of apfs) {
                const source = other.find((d => d.devicePath === disk.devicePath && !d.isVirtual));
                if (source !== undefined) {
                    source.mountpoints.push(...disk.mountpoints);
                    disk.isVirtual = true;
                }
            }
        }
        async function list() {
            const plat = os_1.platform();
            if (plat === "win32") {
                return await bindingsList();
            } else if (plat === "darwin") {
                const disks = await bindingsList();
                handleApfs(disks);
                return disks;
            } else if (plat === "linux") {
                return await lsblk_1.lsblk();
            }
            throw new Error(`Your OS is not supported by this module: ${os_1.platform()}`);
        }
        exports.list = list;
    }, module => {
        module.exports = require("./modules/drivelist/build/Release/drivelist.node");
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.lsblk = exports.getPartitionTableType = void 0;
        const child_process_1 = __webpack_require__(96);
        const fs_1 = __webpack_require__(14);
        const path_1 = __webpack_require__(15);
        const util_1 = __webpack_require__(58);
        const json_1 = __webpack_require__(114);
        const pairs_1 = __webpack_require__(115);
        const execFileAsync = util_1.promisify(child_process_1.execFile);
        const DISK_PATH_DIR = "/dev/disk/by-path/";
        let SUPPORTS_JSON = true;
        let SUPPORTS_PTTYPE = true;
        function getPartitionTableType(pttype) {
            if (pttype === "gpt") {
                return "gpt";
            } else if (pttype === "dos") {
                return "mbr";
            }
            return null;
        }
        exports.getPartitionTableType = getPartitionTableType;
        async function getDevicePaths() {
            const mapping = new Map;
            for (const filename of await fs_1.promises.readdir(DISK_PATH_DIR)) {
                const linkPath = path_1.join(DISK_PATH_DIR, filename);
                let link;
                try {
                    link = await fs_1.promises.readlink(linkPath);
                } catch (error) {
                    continue;
                }
                const devicePath = path_1.resolve(DISK_PATH_DIR, link);
                mapping.set(devicePath, linkPath);
            }
            return mapping;
        }
        async function addDevicePaths(devices) {
            const devicePaths = await getDevicePaths();
            for (const device of devices) {
                device.devicePath = devicePaths.get(device.device) || null;
            }
        }
        async function getOutput(command, ...args) {
            const {stdout} = await execFileAsync(command, args);
            return stdout;
        }
        async function lsblkJSON() {
            return json_1.parse(await getOutput("lsblk", "--bytes", "--all", "--json", "--paths", "--output-all"));
        }
        async function getLsblkPairsOutput() {
            if (SUPPORTS_PTTYPE) {
                try {
                    return await getOutput("lsblk", "--bytes", "--all", "--pairs", "-o", "+pttype");
                } catch (error) {
                    SUPPORTS_PTTYPE = false;
                }
            }
            return await getOutput("lsblk", "--bytes", "--all", "--pairs");
        }
        async function lsblkPairs() {
            return pairs_1.parse(await getLsblkPairsOutput());
        }
        async function $lsblk() {
            if (SUPPORTS_JSON) {
                try {
                    return await lsblkJSON();
                } catch (error) {
                    SUPPORTS_JSON = false;
                }
            }
            return await lsblkPairs();
        }
        async function lsblk() {
            const drives = await $lsblk();
            try {
                await addDevicePaths(drives);
            } catch (error) {}
            return drives;
        }
        exports.lsblk = lsblk;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.parse = exports.transform = void 0;
        const path_1 = __webpack_require__(15);
        const _1 = __webpack_require__(113);
        function getMountpoints(children) {
            return children.filter((child => child.mountpoint)).map((child => ({
                path: child.mountpoint,
                label: child.label || child.partlabel
            })));
        }
        function getDescription(device) {
            const description = [ device.label || "", device.vendor || "", device.model || "" ];
            if (device.children) {
                let subLabels = device.children.filter((c => c.label && c.label !== device.label || c.mountpoint)).map((c => c.label || c.mountpoint));
                subLabels = Array.from(new Set(subLabels));
                if (subLabels.length) {
                    description.push(`(${subLabels.join(", ")})`);
                }
            }
            return description.join(" ").replace(/\s+/g, " ").trim();
        }
        function resolveDeviceName(name) {
            if (!name) {
                return null;
            }
            if (!path_1.posix.isAbsolute(name)) {
                return path_1.posix.resolve("/dev", name);
            }
            return name;
        }
        function transform(data) {
            return data.blockdevices.map((device => Object.assign({}, device, {
                name: resolveDeviceName(device.name),
                kname: resolveDeviceName(device.kname)
            }))).filter((device => !device.name.startsWith("/dev/loop") && !device.name.startsWith("/dev/sr") && !device.name.startsWith("/dev/ram"))).map((device => {
                const isVirtual = device.subsystems ? /^(block)$/i.test(device.subsystems) : null;
                const isSCSI = device.tran ? /^(sata|scsi|ata|ide|pci)$/i.test(device.tran) : null;
                const isUSB = device.tran ? /^(usb)$/i.test(device.tran) : null;
                const isReadOnly = Number(device.ro) === 1;
                const isRemovable = Number(device.rm) === 1 || Number(device.hotplug) === 1 || Boolean(isVirtual);
                return {
                    enumerator: "lsblk:json",
                    busType: (device.tran || "UNKNOWN").toUpperCase(),
                    busVersion: null,
                    device: device.name,
                    devicePath: null,
                    raw: device.kname || device.name,
                    description: getDescription(device),
                    error: null,
                    size: Number(device.size) || null,
                    blockSize: Number(device["phy-sec"]) || 512,
                    logicalBlockSize: Number(device["log-sec"]) || 512,
                    mountpoints: device.children ? getMountpoints(device.children) : getMountpoints([ device ]),
                    isReadOnly,
                    isSystem: !isRemovable && !isVirtual,
                    isVirtual,
                    isRemovable,
                    isCard: null,
                    isSCSI,
                    isUSB,
                    isUAS: null,
                    partitionTableType: _1.getPartitionTableType(device.pttype)
                };
            }));
        }
        exports.transform = transform;
        function parse(stdout) {
            return transform(JSON.parse(stdout));
        }
        exports.parse = parse;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.parse = void 0;
        const _1 = __webpack_require__(113);
        function parseLsblkLine(line) {
            const data = {};
            let offset = 0;
            let key = "";
            let value = "";
            const keyChar = /[^"=]/;
            const whitespace = /\s+/;
            const escape = "\\";
            let state = "key";
            while (offset < line.length) {
                if (state === "key") {
                    while (keyChar.test(line[offset])) {
                        key += line[offset];
                        offset += 1;
                    }
                    if (line[offset] === "=") {
                        state = "value";
                        offset += 1;
                    }
                } else if (state === "value") {
                    if (line[offset] !== '"') {
                        throw new Error(`Expected '"', saw "${line[offset]}"`);
                    }
                    offset += 1;
                    while (line[offset - 1] === escape || line[offset - 1] !== escape && line[offset] !== '"') {
                        value += line[offset];
                        offset += 1;
                    }
                    if (line[offset] !== '"') {
                        throw new Error(`Expected '"', saw "${line[offset]}"`);
                    }
                    offset += 1;
                    data[key.toLowerCase()] = value.trim();
                    key = "";
                    value = "";
                    state = "space";
                } else if (state === "space") {
                    while (whitespace.test(line[offset])) {
                        offset += 1;
                    }
                    state = "key";
                } else {
                    throw new Error(`Undefined state "${state}"`);
                }
            }
            return data;
        }
        function parseLsblk(output) {
            return output.trim().split(/\r?\n/g).map(parseLsblkLine);
        }
        function consolidate(devices) {
            const primaries = devices.filter((device => device.type === "disk" && !device.name.startsWith("ram") && !device.name.startsWith("sr")));
            return primaries.map((device => {
                const children = devices.filter((child => [ "disk", "part" ].includes(child.type) && child.name.startsWith(device.name)));
                return Object.assign({}, device, {
                    mountpoints: children.filter((child => child.mountpoint)).map((child => ({
                        path: child.mountpoint,
                        label: child.label
                    })))
                });
            }));
        }
        function getDescription(device) {
            const description = [ device.label || "", device.vendor || "", device.model || "" ];
            if (device.mountpoints.length) {
                let subLabels = device.mountpoints.filter((c => c.label && c.label !== device.label || c.path)).map((c => c.label || c.path));
                subLabels = Array.from(new Set(subLabels));
                if (subLabels.length) {
                    description.push(`(${subLabels.join(", ")})`);
                }
            }
            return description.join(" ").replace(/\s+/g, " ").trim();
        }
        function parse(stdout) {
            const devices = consolidate(parseLsblk(stdout));
            return devices.map((device => {
                const isVirtual = device.subsystems ? /^block$/i.test(device.subsystems) : null;
                const isSCSI = device.tran ? /^(?:sata|scsi|ata|ide|pci)$/i.test(device.tran) : null;
                const isUSB = device.tran ? /^usb$/i.test(device.tran) : null;
                const isReadOnly = Number(device.ro) === 1;
                const isRemovable = Number(device.rm) === 1 || Number(device.hotplug) === 1 || Boolean(isVirtual);
                return {
                    enumerator: "lsblk:pairs",
                    busType: (device.tran || "UNKNOWN").toUpperCase(),
                    busVersion: null,
                    device: "/dev/" + device.name,
                    devicePath: null,
                    raw: "/dev/" + device.name,
                    description: getDescription(device) || device.name,
                    error: null,
                    size: Number(device.size) || null,
                    blockSize: Number(device["phy-sec"]) || 512,
                    logicalBlockSize: Number(device["log-sec"]) || 512,
                    mountpoints: device.mountpoints,
                    isReadOnly,
                    isSystem: !isRemovable && !isVirtual,
                    isVirtual,
                    isRemovable,
                    isCard: null,
                    isSCSI,
                    isUSB,
                    isUAS: null,
                    partitionTableType: _1.getPartitionTableType(device.pttype)
                };
            }));
        }
        exports.parse = parse;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.UsbBBbootDeviceAdapter = void 0;
        const node_beaglebone_usbboot_1 = __webpack_require__(117);
        const usb_bb_boot_1 = __webpack_require__(135);
        const adapter_1 = __webpack_require__(109);
        class UsbBBbootDeviceAdapter extends adapter_1.Adapter {
            constructor() {
                super();
                this.drives = new Map;
                this.scanner = new node_beaglebone_usbboot_1.UsbBBbootScanner;
                this.scanner.on("attach", this.onAttach.bind(this));
                this.scanner.on("detach", this.onDetach.bind(this));
                this.scanner.on("ready", this.emit.bind(this, "ready"));
                this.scanner.on("error", this.emit.bind(this, "error"));
            }
            start() {
                this.scanner.start();
            }
            stop() {
                this.scanner.stop();
            }
            onAttach(device) {
                let drive = this.drives.get(device);
                if (drive === undefined) {
                    drive = new usb_bb_boot_1.UsbBBbootDrive(device);
                    this.drives.set(device, drive);
                }
                this.emit("attach", drive);
            }
            onDetach(device) {
                const drive = this.drives.get(device);
                this.drives.delete(device);
                this.emit("detach", drive);
            }
        }
        exports.UsbBBbootDeviceAdapter = UsbBBbootDeviceAdapter;
    }, function(__unused_webpack_module, exports, __webpack_require__) {
        "use strict";
        var __awaiter = this && this.__awaiter || function(thisArg, _arguments, P, generator) {
            function adopt(value) {
                return value instanceof P ? value : new P((function(resolve) {
                    resolve(value);
                }));
            }
            return new (P || (P = Promise))((function(resolve, reject) {
                function fulfilled(value) {
                    try {
                        step(generator.next(value));
                    } catch (e) {
                        reject(e);
                    }
                }
                function rejected(value) {
                    try {
                        step(generator["throw"](value));
                    } catch (e) {
                        reject(e);
                    }
                }
                function step(result) {
                    result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
                }
                step((generator = generator.apply(thisArg, _arguments || [])).next());
            }));
        };
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.UsbBBbootDevice = exports.UsbBBbootScanner = exports.isSPLUSBDevice = exports.isROMUSBDevice = exports.isUsbBootCapableUSBDevice = void 0;
        const usb = __webpack_require__(60);
        const _debug = __webpack_require__(63);
        const events_1 = __webpack_require__(26);
        const _os = __webpack_require__(93);
        const timers_1 = __webpack_require__(118);
        const messages_1 = __webpack_require__(119);
        const platform = _os.platform();
        const debug = _debug("node-beaglebone-usbboot");
        const POLLING_INTERVAL_MS = 2e3;
        const DEVICE_UNPLUG_TIMEOUT = 5e3;
        const USB_VENDOR_ID_TEXAS_INSTRUMENTS = 1105;
        const USB_PRODUCT_ID_ROM = 24897;
        const USB_PRODUCT_ID_SPL = 53282;
        const getDeviceId = device => `${device.busNumber}:${device.deviceAddress}`;
        const isUsbBootCapableUSBDevice = (idVendor, idProduct) => idVendor === USB_VENDOR_ID_TEXAS_INSTRUMENTS && (idProduct === USB_PRODUCT_ID_ROM || idProduct === USB_PRODUCT_ID_SPL);
        exports.isUsbBootCapableUSBDevice = isUsbBootCapableUSBDevice;
        const isROMUSBDevice = (idVendor, idProduct) => idVendor === USB_VENDOR_ID_TEXAS_INSTRUMENTS && idProduct === USB_PRODUCT_ID_ROM;
        exports.isROMUSBDevice = isROMUSBDevice;
        const isSPLUSBDevice = (idVendor, idProduct) => idVendor === USB_VENDOR_ID_TEXAS_INSTRUMENTS && idProduct === USB_PRODUCT_ID_SPL;
        exports.isSPLUSBDevice = isSPLUSBDevice;
        const isUsbBootCapableUSBDevice$ = device => exports.isUsbBootCapableUSBDevice(device.deviceDescriptor.idVendor, device.deviceDescriptor.idProduct);
        const isBeagleBoneInMassStorageMode = device => device.deviceDescriptor.idVendor === USB_VENDOR_ID_TEXAS_INSTRUMENTS && device.deviceDescriptor.idProduct === USB_PRODUCT_ID_SPL && device.deviceDescriptor.bNumConfigurations === 1;
        const initializeDevice = device => {
            debug("bInterface", device.configDescriptor.bNumInterfaces);
            const interfaceNumber = 1;
            const iface = device.interface(interfaceNumber);
            if (platform !== "win32") {
                if (iface.isKernelDriverActive()) {
                    iface.detachKernelDriver();
                }
            }
            iface.claim();
            const inEndpoint = iface.endpoints[0];
            const outEndpoint = iface.endpoints[1];
            if (!(inEndpoint instanceof usb.InEndpoint)) {
                throw new Error("endpoint is not an usb.OutEndpoint");
            }
            if (!(outEndpoint instanceof usb.OutEndpoint)) {
                throw new Error("endpoint is not an usb.OutEndpoint");
            }
            debug("Initialized device correctly", devicePortId(device));
            return {
                inEndpoint,
                outEndpoint
            };
        };
        const initializeRNDIS = device => {
            const interfaceNumber = 0;
            const iface0 = device.interface(interfaceNumber);
            iface0.claim();
            const iEndpoint = iface0.endpoints[0];
            if (!(iEndpoint instanceof usb.InEndpoint)) {
                throw new Error("endpoint is not an usb.OutEndpoint");
            } else {
                iEndpoint.startPoll(1, 256);
            }
            const CONTROL_BUFFER_SIZE = 1025;
            const message = new messages_1.Message;
            const initMsg = message.getRNDISInit();
            const bmRequestTypeSend = 33;
            const bmRequestTypeReceive = 161;
            device.controlTransfer(bmRequestTypeSend, 0, 0, 0, initMsg, (error => {
                if (error) {
                    throw new Error(`Control transfer error on SEND_ENCAPSULATED ${error}`);
                }
            }));
            device.controlTransfer(bmRequestTypeReceive, 1, 0, 0, CONTROL_BUFFER_SIZE, (error => {
                if (error) {
                    throw new Error(`Control transfer error on GET_ENCAPSULATED ${error}`);
                }
            }));
            const setMsg = message.getRNDISSet();
            device.controlTransfer(bmRequestTypeSend, 0, 0, 0, setMsg, (error => {
                if (error) {
                    throw new Error(`Control transfer error on SEND_ENCAPSULATED ${error}`);
                }
            }));
            device.controlTransfer(bmRequestTypeReceive, 1, 0, 0, CONTROL_BUFFER_SIZE, (error => {
                if (error) {
                    throw new Error(`Control transfer error on GET_ENCAPSULATED ${error}`);
                }
            }));
            return iEndpoint;
        };
        class UsbBBbootScanner extends events_1.EventEmitter {
            constructor() {
                super();
                this.usbBBbootDevices = new Map;
                this.attachedDeviceIds = new Set;
                this.boundAttachDevice = this.attachDevice.bind(this);
                this.boundDetachDevice = this.detachDevice.bind(this);
            }
            start() {
                debug("Waiting for BeagleBone");
                usb.getDeviceList().map(this.boundAttachDevice);
                this.emit("ready");
                usb.on("attach", this.boundAttachDevice);
                usb.on("detach", this.boundDetachDevice);
                this.interval = timers_1.setInterval((() => {
                    usb.getDeviceList().forEach(this.boundAttachDevice);
                }), POLLING_INTERVAL_MS);
            }
            stop() {
                usb.removeListener("attach", this.boundAttachDevice);
                usb.removeListener("detach", this.boundDetachDevice);
                if (this.interval !== undefined) {
                    timers_1.clearInterval(this.interval);
                }
                this.usbBBbootDevices.clear();
            }
            step(device, step) {
                const usbBBbootDevice = this.getOrCreate(device);
                usbBBbootDevice.step = step;
                if (step === UsbBBbootDevice.LAST_STEP) {
                    this.remove(device);
                }
            }
            incrementStep(device) {
                const usbBBbootDevice = this.getOrCreate(device);
                this.step(device, usbBBbootDevice.step + 1);
            }
            get(device) {
                const key = devicePortId(device);
                return this.usbBBbootDevices.get(key);
            }
            getOrCreate(device) {
                const key = devicePortId(device);
                let usbBBbootDevice = this.usbBBbootDevices.get(key);
                if (usbBBbootDevice === undefined) {
                    usbBBbootDevice = new UsbBBbootDevice(key);
                    this.usbBBbootDevices.set(key, usbBBbootDevice);
                    this.emit("attach", usbBBbootDevice);
                }
                return usbBBbootDevice;
            }
            remove(device) {
                const key = devicePortId(device);
                const usbBBbootDevice = this.usbBBbootDevices.get(key);
                if (usbBBbootDevice !== undefined) {
                    this.usbBBbootDevices.delete(key);
                    this.emit("detach", usbBBbootDevice);
                }
            }
            attachDevice(device) {
                return __awaiter(this, void 0, void 0, (function*() {
                    if (this.attachedDeviceIds.has(getDeviceId(device))) {
                        return;
                    }
                    this.attachedDeviceIds.add(getDeviceId(device));
                    if (isBeagleBoneInMassStorageMode(device) && this.usbBBbootDevices.has(devicePortId(device))) {
                        this.step(device, UsbBBbootDevice.LAST_STEP);
                        return;
                    }
                    if (!isUsbBootCapableUSBDevice$(device)) {
                        return;
                    }
                    if (device.deviceDescriptor.iSerialNumber !== 0) {
                        return;
                    }
                    if (exports.isROMUSBDevice(device.deviceDescriptor.idVendor, device.deviceDescriptor.idProduct)) {
                        this.process(device, "u-boot-spl.bin");
                    }
                    if (exports.isSPLUSBDevice(device.deviceDescriptor.idVendor, device.deviceDescriptor.idProduct)) {
                        setTimeout((() => {
                            this.process(device, "u-boot.img");
                        }), 500);
                    }
                }));
            }
            process(device, fileName) {
                try {
                    device.open();
                    let rndisInEndpoint;
                    if (platform === "win32" || platform === "darwin") {
                        rndisInEndpoint = initializeRNDIS(device);
                        rndisInEndpoint.on("error", (error => {
                            debug("RNDIS InEndpoint Error", error);
                        }));
                    }
                    const {inEndpoint, outEndpoint} = initializeDevice(device);
                    const serverConfig = {};
                    serverConfig.bootpFile = fileName;
                    inEndpoint.startPoll(1, 500);
                    inEndpoint.on("error", (error => {
                        debug("InEndpoint Error", error);
                    }));
                    const message = new messages_1.Message;
                    inEndpoint.on("data", (data => __awaiter(this, void 0, void 0, (function*() {
                        const request = message.identify(data);
                        if (request === "BOOTP") {
                            const bootPBuff = message.getBOOTPResponse(data, serverConfig);
                            yield this.transfer(device, outEndpoint, bootPBuff);
                        } else if (request === "ARP") {
                            const arpBuff = message.getARResponse(data, serverConfig);
                            yield this.transfer(device, outEndpoint, arpBuff);
                        } else if (request === "TFTP") {
                            message.getBootFile(data, serverConfig);
                            if (!serverConfig.tftp.fileError) {
                                const tftpBuff = message.getTFTPData(serverConfig);
                                if (tftpBuff !== undefined) {
                                    yield this.transfer(device, outEndpoint, tftpBuff);
                                }
                            } else {
                                yield this.transfer(device, outEndpoint, message.getTFTPError(serverConfig));
                            }
                        } else if (request === "TFTP_Data") {
                            const tftpBuff = message.getTFTPData(serverConfig);
                            if (serverConfig.tftp) {
                                if (tftpBuff !== undefined) {
                                    yield this.transfer(device, outEndpoint, tftpBuff);
                                } else {
                                    if (platform === "win32" || platform === "darwin") {
                                        rndisInEndpoint.stopPoll();
                                    }
                                    inEndpoint.stopPoll();
                                    device.close();
                                }
                            }
                        } else {
                            debug("Request", request);
                        }
                    }))));
                } catch (error) {
                    debug("error", error, devicePortId(device));
                    this.remove(device);
                }
            }
            transfer(device, outEndpoint, response) {
                return __awaiter(this, void 0, void 0, (function*() {
                    yield new Promise(((resolve, reject) => {
                        outEndpoint.transfer(response, (error => {
                            if (!error) {
                                resolve();
                            } else {
                                debug("Out transfer Error", error);
                                reject(error);
                            }
                        }));
                    }));
                    this.incrementStep(device);
                }));
            }
            detachDevice(device) {
                this.attachedDeviceIds.delete(getDeviceId(device));
                if (!isUsbBootCapableUSBDevice$(device)) {
                    return;
                }
                setTimeout((() => {
                    const usbBBbootDevice = this.get(device);
                    if (usbBBbootDevice !== undefined && usbBBbootDevice.step === UsbBBbootDevice.LAST_STEP) {
                        debug("device", devicePortId(device), "did not reattached after", DEVICE_UNPLUG_TIMEOUT, "ms.");
                        this.remove(device);
                    }
                }), DEVICE_UNPLUG_TIMEOUT);
            }
        }
        exports.UsbBBbootScanner = UsbBBbootScanner;
        class UsbBBbootDevice extends events_1.EventEmitter {
            constructor(portId) {
                super();
                this.portId = portId;
                this._step = 0;
            }
            get progress() {
                return Math.floor(this._step / UsbBBbootDevice.LAST_STEP * 100);
            }
            get step() {
                return this._step;
            }
            set step(step) {
                this._step = step;
                this.emit("progress", this.progress);
            }
        }
        exports.UsbBBbootDevice = UsbBBbootDevice;
        UsbBBbootDevice.LAST_STEP = 1124;
        const devicePortId = device => {
            let result = `${device.busNumber}`;
            if (device.portNumbers !== undefined) {
                result += `-${device.portNumbers.join(".")}`;
            }
            return result;
        };
    }, module => {
        "use strict";
        module.exports = require("timers");
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.Message = void 0;
        const protocols_1 = __webpack_require__(120);
        const util_1 = __webpack_require__(122);
        const BOOTPS = 67;
        const BOOTPC = 68;
        const IP_UDP = 17;
        const IPV6_HOP_BY_HOP_OPTION = 0;
        const IPV6_ICMP = 58;
        const TFTP_PORT = 69;
        const NETCONSOLE_UDP_PORT = 6666;
        const MDNS_UDP_PORT = 5353;
        const ETH_TYPE_ARP = 2054;
        const ETH_TYPE_IPV4 = 2048;
        const ETH_TYPE_IPV6 = 34525;
        const RNDIS_SIZE = 44;
        const ETHER_SIZE = 14;
        const IPV4_SIZE = 20;
        const IPV6_SIZE = 40;
        const UDP_SIZE = 8;
        const MAXBUF = 500;
        const BOOTP_SIZE = 300;
        const SERVER_IP = [ 192, 168, 1, 9 ];
        const BB_IP = [ 192, 168, 1, 3 ];
        const FULL_SIZE = 386;
        const SERVER_NAME = [ 66, 69, 65, 71, 76, 69, 66, 79, 79, 84 ];
        const ARP_SIZE = 28;
        const TFTP_SIZE = 4;
        class Message {
            constructor() {
                this.parser = new protocols_1.Parser;
                this.encoder = new protocols_1.Encoder;
            }
            identify(buff) {
                const parser = new protocols_1.Parser;
                const ether = parser.parseEthHdr(buff.slice(RNDIS_SIZE));
                if (ether.h_proto === ETH_TYPE_ARP) {
                    return "ARP";
                }
                if (ether.h_proto === ETH_TYPE_IPV4) {
                    const ipv4 = parser.parseIpv4(buff.slice(RNDIS_SIZE + ETHER_SIZE));
                    if (ipv4.Protocol === 2) {
                        return "IGMP";
                    }
                    if (ipv4.Protocol === IP_UDP) {
                        const udp = parser.parseUdp(buff.slice(RNDIS_SIZE + ETHER_SIZE + IPV4_SIZE));
                        const sPort = udp.udpSrc;
                        const dPort = udp.udpDest;
                        if (sPort === BOOTPC && dPort === BOOTPS) {
                            return "BOOTP";
                        }
                        if (dPort === TFTP_PORT) {
                            const opcode = buff[RNDIS_SIZE + ETHER_SIZE + IPV4_SIZE + UDP_SIZE + 1];
                            if (opcode === 1) {
                                return "TFTP";
                            }
                            if (opcode === 4) {
                                return "TFTP_Data";
                            }
                        }
                        if (dPort === NETCONSOLE_UDP_PORT) {
                            return "NC";
                        }
                        if (dPort === MDNS_UDP_PORT && sPort === MDNS_UDP_PORT) {
                            return "mDNS";
                        }
                    }
                }
                if (ether.h_proto === ETH_TYPE_IPV6) {
                    const ipv6 = parser.parseIpv6(buff.slice(RNDIS_SIZE + ETHER_SIZE));
                    if (ipv6.NextHeader === IPV6_HOP_BY_HOP_OPTION) {
                        const ipv6Option = parser.parseIpv6Option(buff.slice(RNDIS_SIZE + ETHER_SIZE + IPV6_SIZE));
                        if (ipv6Option.NextHeader === IPV6_ICMP) {
                            return "ICMPv6";
                        }
                    }
                    if (ipv6.NextHeader === IP_UDP) {
                        const udp = parser.parseUdp(buff.slice(RNDIS_SIZE + ETHER_SIZE + IPV6_SIZE));
                        if (udp.udpSrc === MDNS_UDP_PORT && udp.udpDest === MDNS_UDP_PORT) {
                            return "mDNS";
                        }
                    }
                }
                return "unidentified";
            }
            getBOOTPResponse(data, serverConfig) {
                const etherBuf = Buffer.alloc(MAXBUF - RNDIS_SIZE);
                const udpBuf = Buffer.alloc(UDP_SIZE);
                const bootpBuf = Buffer.alloc(BOOTP_SIZE);
                data.copy(udpBuf, 0, RNDIS_SIZE + ETHER_SIZE + IPV4_SIZE, MAXBUF);
                data.copy(bootpBuf, 0, RNDIS_SIZE + ETHER_SIZE + IPV4_SIZE + UDP_SIZE, MAXBUF);
                data.copy(etherBuf, 0, RNDIS_SIZE, MAXBUF);
                serverConfig.ether = this.parser.parseEthHdr(etherBuf);
                const udpUboot = this.parser.parseUdp(udpBuf);
                const bootp = this.parser.parseBOOTP(bootpBuf);
                const rndis = this.encoder.makeRNDIS(FULL_SIZE - RNDIS_SIZE);
                const eth2 = this.encoder.makeEther2(serverConfig.ether.h_source, serverConfig.ether.h_dest, ETH_TYPE_IPV4);
                const ip = this.encoder.makeIPV4(SERVER_IP, BB_IP, IP_UDP, 0, IPV4_SIZE + UDP_SIZE + BOOTP_SIZE, 0);
                const udp = this.encoder.makeUDP(BOOTP_SIZE, udpUboot.udpDest, udpUboot.udpSrc);
                const bootreply = this.encoder.makeBOOTP(SERVER_NAME, serverConfig.bootpFile, bootp.xid, serverConfig.ether.h_source, BB_IP, SERVER_IP);
                return Buffer.concat([ rndis, eth2, ip, udp, bootreply ], FULL_SIZE);
            }
            getARResponse(data, serverConfig) {
                const arpBuf = Buffer.alloc(ARP_SIZE);
                data.copy(arpBuf, 0, RNDIS_SIZE + ETHER_SIZE, RNDIS_SIZE + ETHER_SIZE + ARP_SIZE);
                serverConfig.receivedARP = this.parser.parseARP(arpBuf);
                const arpResponse = this.encoder.makeARP(2, serverConfig.ether.h_dest, serverConfig.receivedARP.ip_dest, serverConfig.receivedARP.hw_source, serverConfig.receivedARP.ip_source);
                const rndis = this.encoder.makeRNDIS(ETHER_SIZE + ARP_SIZE);
                const eth2 = this.encoder.makeEther2(serverConfig.ether.h_source, serverConfig.ether.h_dest, ETH_TYPE_ARP);
                return Buffer.concat([ rndis, eth2, arpResponse ], RNDIS_SIZE + ETHER_SIZE + ARP_SIZE);
            }
            getBootFile(data, serverConfig) {
                const udpTFTPBuf = Buffer.alloc(UDP_SIZE);
                data.copy(udpTFTPBuf, 0, RNDIS_SIZE + ETHER_SIZE + IPV4_SIZE, RNDIS_SIZE + ETHER_SIZE + IPV4_SIZE + UDP_SIZE);
                serverConfig.tftp = {};
                serverConfig.tftp.i = 1;
                serverConfig.tftp.receivedUdp = this.parser.parseUdp(udpTFTPBuf);
                serverConfig.tftp.eth2 = this.encoder.makeEther2(serverConfig.ether.h_source, serverConfig.ether.h_dest, ETH_TYPE_IPV4);
                const fileName = this.extractName(data);
                const buff = util_1.safeReadFile(fileName);
                if (buff !== undefined) {
                    serverConfig.tftp.start = 0;
                    serverConfig.tftp.fileData = buff;
                    serverConfig.tftp.fileError = false;
                } else {
                    serverConfig.tftp.fileError = true;
                }
            }
            getTFTPData(serverConfig) {
                if (serverConfig.tftp.lastChunkSent) {
                    return;
                }
                let blockSize = serverConfig.tftp.fileData.length - serverConfig.tftp.start;
                if (blockSize > 512) {
                    blockSize = 512;
                }
                if (blockSize < 512) {
                    serverConfig.tftp.lastChunkSent = true;
                }
                const blockData = Buffer.alloc(blockSize);
                serverConfig.tftp.fileData.copy(blockData, 0, serverConfig.tftp.start, serverConfig.tftp.start + blockSize);
                serverConfig.tftp.start += blockSize;
                const rndis = this.encoder.makeRNDIS(ETHER_SIZE + IPV4_SIZE + UDP_SIZE + TFTP_SIZE + blockSize);
                const ip = this.encoder.makeIPV4(serverConfig.receivedARP.ip_dest, serverConfig.receivedARP.ip_source, IP_UDP, 0, IPV4_SIZE + UDP_SIZE + TFTP_SIZE + blockSize, 0);
                const udp = this.encoder.makeUDP(TFTP_SIZE + blockSize, serverConfig.tftp.receivedUdp.udpDest, serverConfig.tftp.receivedUdp.udpSrc);
                const tftp = this.encoder.makeTFTP(3, serverConfig.tftp.i);
                serverConfig.tftp.i++;
                return Buffer.concat([ rndis, serverConfig.tftp.eth2, ip, udp, tftp, blockData ], RNDIS_SIZE + ETHER_SIZE + IPV4_SIZE + UDP_SIZE + TFTP_SIZE + blockSize);
            }
            getTFTPError(serverConfig) {
                const errorMsg = "File not found";
                const rndis = this.encoder.makeRNDIS(ETHER_SIZE + IPV4_SIZE + UDP_SIZE + TFTP_SIZE + errorMsg.length + 1);
                const ip = this.encoder.makeIPV4(serverConfig.receivedARP.ip_dest, serverConfig.receivedARP.ip_source, IP_UDP, 0, IPV4_SIZE + UDP_SIZE + TFTP_SIZE + errorMsg.length + 1, 0);
                const udp = this.encoder.makeUDP(TFTP_SIZE + errorMsg.length + 1, serverConfig.tftp.receivedUdp.udpDest, serverConfig.tftp.receivedUdp.udpSrc);
                const tftp = this.encoder.makeTFTPError(5, 1, errorMsg);
                return Buffer.concat([ rndis, serverConfig.tftp.eth2, ip, udp, tftp ], RNDIS_SIZE + ETHER_SIZE + IPV4_SIZE + UDP_SIZE + TFTP_SIZE + errorMsg.length + 1);
            }
            getRNDISInit() {
                return this.encoder.makeRNDISInit();
            }
            getRNDISSet() {
                return this.encoder.makeRNDISSet();
            }
            extractName(data) {
                const fv = RNDIS_SIZE + ETHER_SIZE + IPV4_SIZE + UDP_SIZE + 2;
                let nameCount = 0;
                let name = "";
                while (data[fv + nameCount] !== 0) {
                    name += String.fromCharCode(data[fv + nameCount]);
                    nameCount++;
                }
                return name;
            }
        }
        exports.Message = Message;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.Encoder = exports.Parser = void 0;
        const arp_1 = __webpack_require__(121);
        const bootp_1 = __webpack_require__(128);
        const eth_1 = __webpack_require__(129);
        const ip_1 = __webpack_require__(130);
        const rndis_1 = __webpack_require__(131);
        const tftp_1 = __webpack_require__(133);
        const udp_1 = __webpack_require__(134);
        class Parser {
            parseEthHdr(buff) {
                return (new eth_1.Eth).parseEthHdr(buff);
            }
            parseIpv4(buff) {
                return (new ip_1.IP).parseIpv4(buff);
            }
            parseIpv6(buff) {
                return (new ip_1.IP).parseIpv6(buff);
            }
            parseIpv6Option(buff) {
                return (new ip_1.IP).parseIpv6Option(buff);
            }
            parseUdp(buff) {
                return (new udp_1.UDP).parseUdp(buff);
            }
            parseBOOTP(buff) {
                return (new bootp_1.BOOTP).parseBOOTP(buff);
            }
            parseARP(buff) {
                return (new arp_1.ARP).parseARP(buff);
            }
        }
        exports.Parser = Parser;
        class Encoder {
            makeRNDIS(dataLength) {
                return (new rndis_1.RNDIS).makeRNDIS(dataLength);
            }
            makeRNDISInit() {
                return (new rndis_1.RNDIS).makeRNDISInit();
            }
            makeRNDISSet() {
                return (new rndis_1.RNDIS).makeRNDISSet();
            }
            makeEther2(dest, source, proto) {
                return (new eth_1.Eth).makeEther2(dest, source, proto);
            }
            makeIPV4(srcAddr, dstAddr, proto, id, totalLen, chksum) {
                return (new ip_1.IP).makeIPV4(srcAddr, dstAddr, proto, id, totalLen, chksum);
            }
            makeUDP(udpDataLen, srcPort, dstPort) {
                return (new udp_1.UDP).makeUDP(udpDataLen, srcPort, dstPort);
            }
            makeBOOTP(serverName, fileName, xid, hwDest, bbIP, serverIP) {
                return (new bootp_1.BOOTP).makeBOOTP(serverName, fileName, xid, hwDest, bbIP, serverIP);
            }
            makeARP(opCode, hwSource, ipSource, hwDest, ipDest) {
                return (new arp_1.ARP).makeARP(opCode, hwSource, ipSource, hwDest, ipDest);
            }
            makeTFTP(opcode, blkNumber) {
                return (new tftp_1.TFTP).makeTFTP(opcode, blkNumber);
            }
            makeTFTPError(opcode, errCode, desc) {
                return (new tftp_1.TFTP).makeTFTPError(opcode, errCode, desc);
            }
        }
        exports.Encoder = Encoder;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.ARP = void 0;
        const util_1 = __webpack_require__(122);
        const bp = __webpack_require__(123);
        const Parser = bp.Parser;
        const sp = __webpack_require__(127);
        const arphdr_e = sp.build([ {
            htype: "uint16"
        }, {
            ptype: "uint16"
        }, {
            hlen: "uint8"
        }, {
            plen: "uint8"
        }, {
            opcode: "uint16"
        }, {
            hw_source: {
                0: "uint8",
                1: "uint8",
                2: "uint8",
                3: "uint8",
                4: "uint8",
                5: "uint8"
            }
        }, {
            ip_source: {
                0: "uint8",
                1: "uint8",
                2: "uint8",
                3: "uint8"
            }
        }, {
            hw_dest: {
                0: "uint8",
                1: "uint8",
                2: "uint8",
                3: "uint8",
                4: "uint8",
                5: "uint8"
            }
        }, {
            ip_dest: {
                0: "uint8",
                1: "uint8",
                2: "uint8",
                3: "uint8"
            }
        }, {
            pad: "string"
        } ]);
        class ARP {
            parseARP(buff) {
                const arphdr = (new Parser).uint16be("htype").uint16be("ptype").uint8("hlen").uint8("plen").uint16be("opcode").array("hw_source", {
                    length: 6,
                    type: "uint8"
                }).array("ip_source", {
                    length: 4,
                    type: "uint8"
                }).array("hw_dest", {
                    length: 6,
                    type: "uint8"
                }).array("ip_dest", {
                    length: 4,
                    type: "uint8"
                });
                return arphdr.parse(buff);
            }
            makeARP(opcode, hw_source, ip_source, hw_dest, ip_dest) {
                const arp = [ {
                    htype: 1
                }, {
                    ptype: 2048
                }, {
                    hlen: 6
                }, {
                    plen: 4
                }, {
                    opcode
                }, {
                    hw_source
                }, {
                    ip_source
                }, {
                    hw_dest
                }, {
                    ip_dest
                } ];
                return util_1.fixBuff(arphdr_e.encode(arp));
            }
        }
        exports.ARP = ARP;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        var __dirname = "node_modules\\@balena\\node-beaglebone-usbboot\\lib\\messages\\protocols";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.safeReadFile = exports.stringToAscii = exports.fixBuff = void 0;
        const fs_1 = __webpack_require__(14);
        const Path = __webpack_require__(15);
        const fixBuff = buff => {
            const bufFix = Buffer.alloc(buff.length - 1, 0, "hex");
            buff.copy(bufFix, 0, 0, buff.length - 1);
            return bufFix;
        };
        exports.fixBuff = fixBuff;
        const stringToAscii = filename => {
            let x = 0;
            const fileName = [];
            while (x <= 72) {
                x = fileName.push(x < filename.length ? filename.charCodeAt(x) : 0);
            }
            return fileName;
        };
        exports.stringToAscii = stringToAscii;
        const safeReadFile = filename => {
            try {
                const filePath = Path.join(__dirname, "..", "..", "..", "blobs", "am335x", filename);
                return fs_1.readFileSync(filePath);
            } catch (e) {
                return undefined;
            }
        };
        exports.safeReadFile = safeReadFile;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.Parser = void 0;
        var context_1 = __webpack_require__(124);
        var smart_buffer_1 = __webpack_require__(125);
        var aliasRegistry = {};
        var FUNCTION_PREFIX = "___parser_";
        var FUNCTION_ENCODE_PREFIX = "___encoder_";
        var PRIMITIVE_SIZES = {
            uint8: 1,
            uint16le: 2,
            uint16be: 2,
            uint32le: 4,
            uint32be: 4,
            int8: 1,
            int16le: 2,
            int16be: 2,
            int32le: 4,
            int32be: 4,
            int64be: 8,
            int64le: 8,
            uint64be: 8,
            uint64le: 8,
            floatle: 4,
            floatbe: 4,
            doublele: 8,
            doublebe: 8
        };
        var PRIMITIVE_NAMES = {
            uint8: "Uint8",
            uint16le: "Uint16",
            uint16be: "Uint16",
            uint32le: "Uint32",
            uint32be: "Uint32",
            int8: "Int8",
            int16le: "Int16",
            int16be: "Int16",
            int32le: "Int32",
            int32be: "Int32",
            int64be: "BigInt64",
            int64le: "BigInt64",
            uint64be: "BigUint64",
            uint64le: "BigUint64",
            floatle: "Float32",
            floatbe: "Float32",
            doublele: "Float64",
            doublebe: "Float64"
        };
        var PRIMITIVE_LITTLE_ENDIANS = {
            uint8: false,
            uint16le: true,
            uint16be: false,
            uint32le: true,
            uint32be: false,
            int8: false,
            int16le: true,
            int16be: false,
            int32le: true,
            int32be: false,
            int64be: false,
            int64le: true,
            uint64be: false,
            uint64le: true,
            floatle: true,
            floatbe: false,
            doublele: true,
            doublebe: false
        };
        var CAPITILIZED_TYPE_NAMES = {
            uint8: "UInt8",
            uint16le: "UInt16LE",
            uint16be: "UInt16BE",
            uint32le: "UInt32LE",
            uint32be: "UInt32BE",
            int8: "Int8",
            int16le: "Int16LE",
            int16be: "Int16BE",
            int32le: "Int32LE",
            int32be: "Int32BE",
            int64be: "BigInt64BE",
            int64le: "BigInt64LE",
            uint64be: "BigUInt64BE",
            uint64le: "BigUInt64LE",
            floatle: "FloatLE",
            floatbe: "FloatBE",
            doublele: "DoubleLE",
            doublebe: "DoubleBE",
            bit: "Bit",
            string: "String",
            buffer: "Buffer",
            array: "Array",
            choice: "Choice",
            nest: "Nest",
            seek: "Seek",
            pointer: "Pointer",
            saveOffset: "SaveOffset",
            "": ""
        };
        var Parser = function() {
            function Parser(opts) {
                this.varName = "";
                this.type = "";
                this.options = {};
                this.next = null;
                this.head = null;
                this.compiled = null;
                this.compiledEncode = null;
                this.endian = "be";
                this.constructorFn = null;
                this.alias = null;
                this.smartBufferSize = opts && typeof opts === "object" && opts.smartBufferSize ? opts.smartBufferSize : 256;
                this.encoderOpts = {
                    bitEndianess: false
                };
            }
            Parser.start = function(opts) {
                return new Parser(opts);
            };
            Parser.prototype.primitiveGenerateN = function(type, ctx) {
                var typeName = PRIMITIVE_NAMES[type];
                var littleEndian = PRIMITIVE_LITTLE_ENDIANS[type];
                ctx.pushCode(ctx.generateVariable(this.varName) + " = dataView.get" + typeName + "(offset, " + littleEndian + ");");
                ctx.pushCode("offset += " + PRIMITIVE_SIZES[type] + ";");
            };
            Parser.prototype.primitiveGenerate_encodeN = function(type, ctx) {
                var typeName = CAPITILIZED_TYPE_NAMES[type];
                ctx.pushCode("smartBuffer.write" + typeName + "(" + ctx.generateVariable(this.varName) + ");");
            };
            Parser.prototype.primitiveN = function(type, varName, options) {
                return this.setNextParser(type, varName, options);
            };
            Parser.prototype.useThisEndian = function(type) {
                return type + this.endian.toLowerCase();
            };
            Parser.prototype.uint8 = function(varName, options) {
                return this.primitiveN("uint8", varName, options);
            };
            Parser.prototype.uint16 = function(varName, options) {
                return this.primitiveN(this.useThisEndian("uint16"), varName, options);
            };
            Parser.prototype.uint16le = function(varName, options) {
                return this.primitiveN("uint16le", varName, options);
            };
            Parser.prototype.uint16be = function(varName, options) {
                return this.primitiveN("uint16be", varName, options);
            };
            Parser.prototype.uint32 = function(varName, options) {
                return this.primitiveN(this.useThisEndian("uint32"), varName, options);
            };
            Parser.prototype.uint32le = function(varName, options) {
                return this.primitiveN("uint32le", varName, options);
            };
            Parser.prototype.uint32be = function(varName, options) {
                return this.primitiveN("uint32be", varName, options);
            };
            Parser.prototype.int8 = function(varName, options) {
                return this.primitiveN("int8", varName, options);
            };
            Parser.prototype.int16 = function(varName, options) {
                return this.primitiveN(this.useThisEndian("int16"), varName, options);
            };
            Parser.prototype.int16le = function(varName, options) {
                return this.primitiveN("int16le", varName, options);
            };
            Parser.prototype.int16be = function(varName, options) {
                return this.primitiveN("int16be", varName, options);
            };
            Parser.prototype.int32 = function(varName, options) {
                return this.primitiveN(this.useThisEndian("int32"), varName, options);
            };
            Parser.prototype.int32le = function(varName, options) {
                return this.primitiveN("int32le", varName, options);
            };
            Parser.prototype.int32be = function(varName, options) {
                return this.primitiveN("int32be", varName, options);
            };
            Parser.prototype.bigIntVersionCheck = function() {
                if (!DataView.prototype.getBigInt64) throw new Error("BigInt64 is unsupported in this runtime");
            };
            Parser.prototype.int64 = function(varName, options) {
                this.bigIntVersionCheck();
                return this.primitiveN(this.useThisEndian("int64"), varName, options);
            };
            Parser.prototype.int64be = function(varName, options) {
                this.bigIntVersionCheck();
                return this.primitiveN("int64be", varName, options);
            };
            Parser.prototype.int64le = function(varName, options) {
                this.bigIntVersionCheck();
                return this.primitiveN("int64le", varName, options);
            };
            Parser.prototype.uint64 = function(varName, options) {
                this.bigIntVersionCheck();
                return this.primitiveN(this.useThisEndian("uint64"), varName, options);
            };
            Parser.prototype.uint64be = function(varName, options) {
                this.bigIntVersionCheck();
                return this.primitiveN("uint64be", varName, options);
            };
            Parser.prototype.uint64le = function(varName, options) {
                this.bigIntVersionCheck();
                return this.primitiveN("uint64le", varName, options);
            };
            Parser.prototype.floatle = function(varName, options) {
                return this.primitiveN("floatle", varName, options);
            };
            Parser.prototype.floatbe = function(varName, options) {
                return this.primitiveN("floatbe", varName, options);
            };
            Parser.prototype.doublele = function(varName, options) {
                return this.primitiveN("doublele", varName, options);
            };
            Parser.prototype.doublebe = function(varName, options) {
                return this.primitiveN("doublebe", varName, options);
            };
            Parser.prototype.bitN = function(size, varName, options) {
                if (!options) {
                    options = {};
                }
                options.length = size;
                return this.setNextParser("bit", varName, options);
            };
            Parser.prototype.bit1 = function(varName, options) {
                return this.bitN(1, varName, options);
            };
            Parser.prototype.bit2 = function(varName, options) {
                return this.bitN(2, varName, options);
            };
            Parser.prototype.bit3 = function(varName, options) {
                return this.bitN(3, varName, options);
            };
            Parser.prototype.bit4 = function(varName, options) {
                return this.bitN(4, varName, options);
            };
            Parser.prototype.bit5 = function(varName, options) {
                return this.bitN(5, varName, options);
            };
            Parser.prototype.bit6 = function(varName, options) {
                return this.bitN(6, varName, options);
            };
            Parser.prototype.bit7 = function(varName, options) {
                return this.bitN(7, varName, options);
            };
            Parser.prototype.bit8 = function(varName, options) {
                return this.bitN(8, varName, options);
            };
            Parser.prototype.bit9 = function(varName, options) {
                return this.bitN(9, varName, options);
            };
            Parser.prototype.bit10 = function(varName, options) {
                return this.bitN(10, varName, options);
            };
            Parser.prototype.bit11 = function(varName, options) {
                return this.bitN(11, varName, options);
            };
            Parser.prototype.bit12 = function(varName, options) {
                return this.bitN(12, varName, options);
            };
            Parser.prototype.bit13 = function(varName, options) {
                return this.bitN(13, varName, options);
            };
            Parser.prototype.bit14 = function(varName, options) {
                return this.bitN(14, varName, options);
            };
            Parser.prototype.bit15 = function(varName, options) {
                return this.bitN(15, varName, options);
            };
            Parser.prototype.bit16 = function(varName, options) {
                return this.bitN(16, varName, options);
            };
            Parser.prototype.bit17 = function(varName, options) {
                return this.bitN(17, varName, options);
            };
            Parser.prototype.bit18 = function(varName, options) {
                return this.bitN(18, varName, options);
            };
            Parser.prototype.bit19 = function(varName, options) {
                return this.bitN(19, varName, options);
            };
            Parser.prototype.bit20 = function(varName, options) {
                return this.bitN(20, varName, options);
            };
            Parser.prototype.bit21 = function(varName, options) {
                return this.bitN(21, varName, options);
            };
            Parser.prototype.bit22 = function(varName, options) {
                return this.bitN(22, varName, options);
            };
            Parser.prototype.bit23 = function(varName, options) {
                return this.bitN(23, varName, options);
            };
            Parser.prototype.bit24 = function(varName, options) {
                return this.bitN(24, varName, options);
            };
            Parser.prototype.bit25 = function(varName, options) {
                return this.bitN(25, varName, options);
            };
            Parser.prototype.bit26 = function(varName, options) {
                return this.bitN(26, varName, options);
            };
            Parser.prototype.bit27 = function(varName, options) {
                return this.bitN(27, varName, options);
            };
            Parser.prototype.bit28 = function(varName, options) {
                return this.bitN(28, varName, options);
            };
            Parser.prototype.bit29 = function(varName, options) {
                return this.bitN(29, varName, options);
            };
            Parser.prototype.bit30 = function(varName, options) {
                return this.bitN(30, varName, options);
            };
            Parser.prototype.bit31 = function(varName, options) {
                return this.bitN(31, varName, options);
            };
            Parser.prototype.bit32 = function(varName, options) {
                return this.bitN(32, varName, options);
            };
            Parser.prototype.namely = function(alias) {
                aliasRegistry[alias] = this;
                this.alias = alias;
                return this;
            };
            Parser.prototype.skip = function(length, options) {
                return this.seek(length, options);
            };
            Parser.prototype.seek = function(relOffset, options) {
                if (options && options.assert) {
                    throw new Error("assert option on seek is not allowed.");
                }
                return this.setNextParser("seek", "", {
                    length: relOffset
                });
            };
            Parser.prototype.string = function(varName, options) {
                if (!options.zeroTerminated && !options.length && !options.greedy) {
                    throw new Error("Neither length, zeroTerminated, nor greedy is defined for string.");
                }
                if ((options.zeroTerminated || options.length) && options.greedy) {
                    throw new Error("greedy is mutually exclusive with length and zeroTerminated for string.");
                }
                if (options.stripNull && !(options.length || options.greedy)) {
                    throw new Error("Length or greedy must be defined if stripNull is defined.");
                }
                options.encoding = options.encoding || "utf8";
                return this.setNextParser("string", varName, options);
            };
            Parser.prototype.buffer = function(varName, options) {
                if (!options.length && !options.readUntil) {
                    throw new Error("Length nor readUntil is defined in buffer parser");
                }
                return this.setNextParser("buffer", varName, options);
            };
            Parser.prototype.array = function(varName, options) {
                if (!options.readUntil && !options.length && !options.lengthInBytes) {
                    throw new Error("Length option of array is not defined.");
                }
                if (!options.type) {
                    throw new Error("Type option of array is not defined.");
                }
                if (typeof options.type === "string" && !aliasRegistry[options.type] && Object.keys(PRIMITIVE_SIZES).indexOf(options.type) < 0) {
                    throw new Error('Specified primitive type "' + options.type + '" is not supported.');
                }
                return this.setNextParser("array", varName, options);
            };
            Parser.prototype.choice = function(varName, options) {
                if (typeof options !== "object" && typeof varName === "object") {
                    options = varName;
                    varName = null;
                }
                if (!options.tag) {
                    throw new Error("Tag option of array is not defined.");
                }
                if (!options.choices) {
                    throw new Error("Choices option of array is not defined.");
                }
                Object.keys(options.choices).forEach((function(keyString) {
                    var key = parseInt(keyString, 10);
                    var value = options.choices[key];
                    if (isNaN(key)) {
                        throw new Error("Key of choices must be a number.");
                    }
                    if (!value) {
                        throw new Error("Choice Case " + keyString + " of " + varName + " is not valid.");
                    }
                    if (typeof value === "string" && !aliasRegistry[value] && Object.keys(PRIMITIVE_SIZES).indexOf(value) < 0) {
                        throw new Error('Specified primitive type "' + value + '" is not supported.');
                    }
                }));
                return this.setNextParser("choice", varName, options);
            };
            Parser.prototype.nest = function(varName, options) {
                if (typeof options !== "object" && typeof varName === "object") {
                    options = varName;
                    varName = null;
                }
                if (!options.type) {
                    throw new Error("Type option of nest is not defined.");
                }
                if (!(options.type instanceof Parser) && !aliasRegistry[options.type]) {
                    throw new Error("Type option of nest must be a Parser object.");
                }
                if (!(options.type instanceof Parser) && !varName) {
                    throw new Error("options.type must be a object if variable name is omitted.");
                }
                return this.setNextParser("nest", varName, options);
            };
            Parser.prototype.pointer = function(varName, options) {
                if (!options.offset) {
                    throw new Error("Offset option of pointer is not defined.");
                }
                if (!options.type) {
                    throw new Error("Type option of pointer is not defined.");
                } else if (typeof options.type === "string") {
                    if (Object.keys(PRIMITIVE_SIZES).indexOf(options.type) < 0 && !aliasRegistry[options.type]) {
                        throw new Error('Specified type "' + options.type + '" is not supported.');
                    }
                } else if (options.type instanceof Parser) {} else {
                    throw new Error("Type option of pointer must be a string or a Parser object.");
                }
                return this.setNextParser("pointer", varName, options);
            };
            Parser.prototype.saveOffset = function(varName, options) {
                return this.setNextParser("saveOffset", varName, options);
            };
            Parser.prototype.endianess = function(endianess) {
                switch (endianess.toLowerCase()) {
                  case "little":
                    this.endian = "le";
                    break;

                  case "big":
                    this.endian = "be";
                    break;

                  default:
                    throw new Error("Invalid endianess: " + endianess);
                }
                return this;
            };
            Parser.prototype.encoderSetOptions = function(opts) {
                Object.assign(this.encoderOpts, opts);
                return this;
            };
            Parser.prototype.create = function(constructorFn) {
                if (!(constructorFn instanceof Function)) {
                    throw new Error("Constructor must be a Function object.");
                }
                this.constructorFn = constructorFn;
                return this;
            };
            Parser.prototype.getContext = function(importPath) {
                var ctx = new context_1.Context(importPath);
                ctx.pushCode("var dataView = new DataView(buffer.buffer, buffer.byteOffset, buffer.length);");
                if (!this.alias) {
                    this.addRawCode(ctx);
                } else {
                    this.addAliasedCode(ctx);
                    ctx.pushCode("return " + (FUNCTION_PREFIX + this.alias) + "(0).result;");
                }
                return ctx;
            };
            Parser.prototype.getCode = function() {
                return this.getContext().code;
            };
            Parser.prototype.getContextEncode = function(importPath) {
                var ctx = new context_1.Context(importPath);
                ctx.pushCode('if (!obj || typeof obj !== "object") {');
                ctx.generateError('"argument obj is not an object"');
                ctx.pushCode("}");
                if (!this.alias) {
                    this.addRawCodeEncode(ctx);
                } else {
                    this.addAliasedCodeEncode(ctx);
                    ctx.pushCode("return " + (FUNCTION_ENCODE_PREFIX + this.alias) + "(obj);");
                }
                return ctx;
            };
            Parser.prototype.getCodeEncode = function() {
                return this.getContextEncode().code;
            };
            Parser.prototype.addRawCode = function(ctx) {
                ctx.pushCode("var offset = 0;");
                if (this.constructorFn) {
                    ctx.pushCode("var vars = new constructorFn();");
                } else {
                    ctx.pushCode("var vars = {};");
                }
                this.generate(ctx);
                this.resolveReferences(ctx);
                ctx.pushCode("return vars;");
            };
            Parser.prototype.addRawCodeEncode = function(ctx) {
                ctx.pushCode("var vars = obj;");
                ctx.pushCode("var smartBuffer = SmartBuffer.fromOptions({size: " + this.smartBufferSize + ', encoding: "utf8"});');
                this.generateEncode(ctx);
                this.resolveReferences(ctx, "encode");
                ctx.pushCode("return smartBuffer.toBuffer();");
            };
            Parser.prototype.addAliasedCode = function(ctx) {
                ctx.pushCode("function " + (FUNCTION_PREFIX + this.alias) + "(offset) {");
                if (this.constructorFn) {
                    ctx.pushCode("var vars = new constructorFn();");
                } else {
                    ctx.pushCode("var vars = {};");
                }
                this.generate(ctx);
                ctx.markResolved(this.alias);
                this.resolveReferences(ctx);
                ctx.pushCode("return { offset: offset, result: vars };");
                ctx.pushCode("}");
                return ctx;
            };
            Parser.prototype.addAliasedCodeEncode = function(ctx) {
                ctx.pushCode("function " + (FUNCTION_ENCODE_PREFIX + this.alias) + "(obj) {");
                ctx.pushCode("var vars = obj;");
                ctx.pushCode("var smartBuffer = SmartBuffer.fromOptions({size: " + this.smartBufferSize + ', encoding: "utf8"});');
                this.generateEncode(ctx);
                ctx.markResolved(this.alias);
                this.resolveReferences(ctx, "encode");
                ctx.pushCode("return smartBuffer.toBuffer();");
                ctx.pushCode("}");
                return ctx;
            };
            Parser.prototype.resolveReferences = function(ctx, encode) {
                var references = ctx.getUnresolvedReferences();
                ctx.markRequested(references);
                references.forEach((function(alias) {
                    var parser = aliasRegistry[alias];
                    if (encode) {
                        parser.addAliasedCodeEncode(ctx);
                    } else {
                        parser.addAliasedCode(ctx);
                    }
                }));
            };
            Parser.prototype.compile = function() {
                var importPath = "imports";
                var ctx = this.getContext(importPath);
                this.compiled = new Function(importPath, "TextDecoder", "return function (buffer, constructorFn) { " + ctx.code + " };")(ctx.imports, typeof TextDecoder === "undefined" ? __webpack_require__(58).TextDecoder : TextDecoder);
            };
            Parser.prototype.compileEncode = function() {
                var importPath = "imports";
                var ctx = this.getContextEncode(importPath);
                this.compiledEncode = new Function(importPath, "TextDecoder", "SmartBuffer", "return function (obj) { " + ctx.code + " };")(ctx.imports, typeof TextDecoder === "undefined" ? __webpack_require__(58).TextDecoder : TextDecoder, typeof smart_buffer_1.SmartBuffer === "undefined" ? __webpack_require__(125).SmartBuffer : smart_buffer_1.SmartBuffer);
            };
            Parser.prototype.sizeOf = function() {
                var size = NaN;
                if (Object.keys(PRIMITIVE_SIZES).indexOf(this.type) >= 0) {
                    size = PRIMITIVE_SIZES[this.type];
                } else if (this.type === "string" && typeof this.options.length === "number") {
                    size = this.options.length;
                } else if (this.type === "buffer" && typeof this.options.length === "number") {
                    size = this.options.length;
                } else if (this.type === "array" && typeof this.options.length === "number") {
                    var elementSize = NaN;
                    if (typeof this.options.type === "string") {
                        elementSize = PRIMITIVE_SIZES[this.options.type];
                    } else if (this.options.type instanceof Parser) {
                        elementSize = this.options.type.sizeOf();
                    }
                    size = this.options.length * elementSize;
                } else if (this.type === "seek") {
                    size = this.options.length;
                } else if (this.type === "nest") {
                    size = this.options.type.sizeOf();
                } else if (!this.type) {
                    size = 0;
                }
                if (this.next) {
                    size += this.next.sizeOf();
                }
                return size;
            };
            Parser.prototype.parse = function(buffer) {
                if (!this.compiled) {
                    this.compile();
                }
                return this.compiled(buffer, this.constructorFn);
            };
            Parser.prototype.encode = function(obj) {
                if (!this.compiledEncode) {
                    this.compileEncode();
                }
                return this.compiledEncode(obj);
            };
            Parser.prototype.setNextParser = function(type, varName, options) {
                var parser = new Parser;
                parser.type = type;
                parser.varName = varName;
                parser.options = options || parser.options;
                parser.endian = this.endian;
                parser.encoderOpts = this.encoderOpts;
                if (this.head) {
                    this.head.next = parser;
                } else {
                    this.next = parser;
                }
                this.head = parser;
                return this;
            };
            Parser.prototype.generate = function(ctx) {
                if (this.type) {
                    switch (this.type) {
                      case "uint8":
                      case "uint16le":
                      case "uint16be":
                      case "uint32le":
                      case "uint32be":
                      case "int8":
                      case "int16le":
                      case "int16be":
                      case "int32le":
                      case "int32be":
                      case "int64be":
                      case "int64le":
                      case "uint64be":
                      case "uint64le":
                      case "floatle":
                      case "floatbe":
                      case "doublele":
                      case "doublebe":
                        this.primitiveGenerateN(this.type, ctx);
                        break;

                      case "bit":
                        this.generateBit(ctx);
                        break;

                      case "string":
                        this.generateString(ctx);
                        break;

                      case "buffer":
                        this.generateBuffer(ctx);
                        break;

                      case "seek":
                        this.generateSeek(ctx);
                        break;

                      case "nest":
                        this.generateNest(ctx);
                        break;

                      case "array":
                        this.generateArray(ctx);
                        break;

                      case "choice":
                        this.generateChoice(ctx);
                        break;

                      case "pointer":
                        this.generatePointer(ctx);
                        break;

                      case "saveOffset":
                        this.generateSaveOffset(ctx);
                        break;
                    }
                    this.generateAssert(ctx);
                }
                var varName = ctx.generateVariable(this.varName);
                if (this.options.formatter) {
                    this.generateFormatter(ctx, varName, this.options.formatter);
                }
                return this.generateNext(ctx);
            };
            Parser.prototype.generateEncode = function(ctx) {
                var savVarName = ctx.generateTmpVariable();
                var varName = ctx.generateVariable(this.varName);
                if (this.options.encoder) {
                    ctx.pushCode("var " + savVarName + " = " + varName);
                    this.generateEncoder(ctx, varName, this.options.encoder);
                }
                if (this.type) {
                    switch (this.type) {
                      case "uint8":
                      case "uint16le":
                      case "uint16be":
                      case "uint32le":
                      case "uint32be":
                      case "int8":
                      case "int16le":
                      case "int16be":
                      case "int32le":
                      case "int32be":
                      case "int64be":
                      case "int64le":
                      case "uint64be":
                      case "uint64le":
                      case "floatle":
                      case "floatbe":
                      case "doublele":
                      case "doublebe":
                        this.primitiveGenerate_encodeN(this.type, ctx);
                        break;

                      case "bit":
                        this.generate_encodeBit(ctx);
                        break;

                      case "string":
                        this.generate_encodeString(ctx);
                        break;

                      case "buffer":
                        this.generate_encodeBuffer(ctx);
                        break;

                      case "seek":
                        this.generate_encodeSeek(ctx);
                        break;

                      case "nest":
                        this.generate_encodeNest(ctx);
                        break;

                      case "array":
                        this.generate_encodeArray(ctx);
                        break;

                      case "choice":
                        this.generate_encodeChoice(ctx);
                        break;

                      case "pointer":
                        this.generate_encodePointer(ctx);
                        break;

                      case "saveOffset":
                        this.generate_encodeSaveOffset(ctx);
                        break;
                    }
                    this.generateAssert(ctx);
                }
                if (this.options.encoder) {
                    ctx.pushCode(varName + " = " + savVarName + ";");
                }
                return this.generateEncodeNext(ctx);
            };
            Parser.prototype.generateAssert = function(ctx) {
                if (!this.options.assert) {
                    return;
                }
                var varName = ctx.generateVariable(this.varName);
                switch (typeof this.options.assert) {
                  case "function":
                    var func = ctx.addImport(this.options.assert);
                    ctx.pushCode("if (!" + func + ".call(vars, " + varName + ")) {");
                    break;

                  case "number":
                    ctx.pushCode("if (" + this.options.assert + " !== " + varName + ") {");
                    break;

                  case "string":
                    ctx.pushCode('if ("' + this.options.assert + '" !== ' + varName + ") {");
                    break;

                  default:
                    throw new Error("Assert option supports only strings, numbers and assert functions.");
                }
                ctx.generateError('"Assert error: ' + varName + ' is " + ' + this.options.assert);
                ctx.pushCode("}");
            };
            Parser.prototype.generateNext = function(ctx) {
                if (this.next) {
                    ctx = this.next.generate(ctx);
                }
                return ctx;
            };
            Parser.prototype.generateEncodeNext = function(ctx) {
                if (this.next) {
                    ctx = this.next.generateEncode(ctx);
                }
                return ctx;
            };
            Parser.prototype.generateBit = function(ctx) {
                var parser = JSON.parse(JSON.stringify(this));
                parser.varName = ctx.generateVariable(parser.varName);
                ctx.bitFields.push(parser);
                if (!this.next || this.next && [ "bit", "nest" ].indexOf(this.next.type) < 0) {
                    var sum_1 = 0;
                    ctx.bitFields.forEach((function(parser) {
                        return sum_1 += parser.options.length;
                    }));
                    var val_1 = ctx.generateTmpVariable();
                    if (sum_1 <= 8) {
                        ctx.pushCode("var " + val_1 + " = dataView.getUint8(offset);");
                        sum_1 = 8;
                    } else if (sum_1 <= 16) {
                        ctx.pushCode("var " + val_1 + " = dataView.getUint16(offset);");
                        sum_1 = 16;
                    } else if (sum_1 <= 24) {
                        var val1 = ctx.generateTmpVariable();
                        var val2 = ctx.generateTmpVariable();
                        ctx.pushCode("var " + val1 + " = dataView.getUint16(offset);");
                        ctx.pushCode("var " + val2 + " = dataView.getUint8(offset + 2);");
                        ctx.pushCode("var " + val_1 + " = (" + val1 + " << 8) | " + val2 + ";");
                        sum_1 = 24;
                    } else if (sum_1 <= 32) {
                        ctx.pushCode("var " + val_1 + " = dataView.getUint32(offset);");
                        sum_1 = 32;
                    } else {
                        throw new Error("Currently, bit field sequence longer than 4-bytes is not supported.");
                    }
                    ctx.pushCode("offset += " + sum_1 / 8 + ";");
                    var bitOffset_1 = 0;
                    var isBigEndian_1 = this.endian === "be";
                    ctx.bitFields.forEach((function(parser) {
                        var length = parser.options.length;
                        var offset = isBigEndian_1 ? sum_1 - bitOffset_1 - length : bitOffset_1;
                        var mask = (1 << length) - 1;
                        ctx.pushCode(parser.varName + " = " + val_1 + " >> " + offset + " & " + mask + ";");
                        bitOffset_1 += length;
                    }));
                    ctx.bitFields = [];
                }
            };
            Parser.prototype.generate_encodeBit = function(ctx) {
                var parser = JSON.parse(JSON.stringify(this));
                parser.varName = ctx.generateVariable(parser.varName);
                ctx.bitFields.push(parser);
                if (!this.next || this.next && [ "bit", "nest" ].indexOf(this.next.type) < 0) {
                    var sum_2 = 0;
                    ctx.bitFields.forEach((function(parser) {
                        sum_2 += parser.options.length;
                    }));
                    if (sum_2 <= 8) {
                        sum_2 = 8;
                    } else if (sum_2 <= 16) {
                        sum_2 = 16;
                    } else if (sum_2 <= 24) {
                        sum_2 = 24;
                    } else if (sum_2 <= 32) {
                        sum_2 = 32;
                    } else {
                        throw new Error("Currently, bit field sequences longer than 4-bytes is not supported.");
                    }
                    var isBitLittleEndian_1 = this.endian === "le" && this.encoderOpts.bitEndianess;
                    var tmpVal_1 = ctx.generateTmpVariable();
                    var boundVal_1 = ctx.generateTmpVariable();
                    ctx.pushCode("var " + tmpVal_1 + " = 0;");
                    ctx.pushCode("var " + boundVal_1 + " = 0;");
                    var bitOffset_2 = 0;
                    ctx.bitFields.forEach((function(parser) {
                        ctx.pushCode(boundVal_1 + " = (" + parser.varName + " & " + ((1 << parser.options.length) - 1) + ");");
                        ctx.pushCode(tmpVal_1 + " |= (" + boundVal_1 + " << " + (isBitLittleEndian_1 ? bitOffset_2 : sum_2 - parser.options.length - bitOffset_2) + ");");
                        ctx.pushCode(tmpVal_1 + " = " + tmpVal_1 + " >>> 0;");
                        bitOffset_2 += parser.options.length;
                    }));
                    if (sum_2 == 8) {
                        ctx.pushCode("smartBuffer.writeUInt8(" + tmpVal_1 + ");");
                    } else if (sum_2 == 16) {
                        ctx.pushCode("smartBuffer.writeUInt16BE(" + tmpVal_1 + ");");
                    } else if (sum_2 == 24) {
                        var val1 = ctx.generateTmpVariable();
                        var val2 = ctx.generateTmpVariable();
                        ctx.pushCode("var " + val1 + " = (" + tmpVal_1 + " >>> 8);");
                        ctx.pushCode("var " + val2 + " = (" + tmpVal_1 + " & 0x0ff);");
                        ctx.pushCode("smartBuffer.writeUInt16BE(" + val1 + ");");
                        ctx.pushCode("smartBuffer.writeUInt8(" + val2 + ");");
                    } else if (sum_2 == 32) {
                        ctx.pushCode("smartBuffer.writeUInt32BE(" + tmpVal_1 + ");");
                    }
                    ctx.bitFields = [];
                }
            };
            Parser.prototype.generateSeek = function(ctx) {
                var length = ctx.generateOption(this.options.length);
                ctx.pushCode("offset += " + length + ";");
            };
            Parser.prototype.generate_encodeSeek = function(ctx) {
                var length = ctx.generateOption(this.options.length);
                ctx.pushCode("smartBuffer.writeBuffer(Buffer.alloc(" + length + "));");
            };
            Parser.prototype.generateString = function(ctx) {
                var name = ctx.generateVariable(this.varName);
                var start = ctx.generateTmpVariable();
                var encoding = this.options.encoding;
                var isHex = encoding.toLowerCase() === "hex";
                var toHex = 'b => b.toString(16).padStart(2, "0")';
                if (this.options.length && this.options.zeroTerminated) {
                    var len = this.options.length;
                    ctx.pushCode("var " + start + " = offset;");
                    ctx.pushCode("while(dataView.getUint8(offset++) !== 0 && offset - " + start + "  < " + len + ");");
                    var end = "dataView.getUint8(offset -1) == 0 ? offset - 1 : offset";
                    ctx.pushCode(isHex ? name + " = Array.from(buffer.subarray(" + start + ", " + end + "), " + toHex + ").join('');" : name + " = new TextDecoder('" + encoding + "').decode(buffer.subarray(" + start + ", " + end + "));");
                } else if (this.options.length) {
                    var len = ctx.generateOption(this.options.length);
                    ctx.pushCode(isHex ? name + " = Array.from(buffer.subarray(offset, offset + " + len + "), " + toHex + ").join('');" : name + " = new TextDecoder('" + encoding + "').decode(buffer.subarray(offset, offset + " + len + "));");
                    ctx.pushCode("offset += " + len + ";");
                } else if (this.options.zeroTerminated) {
                    ctx.pushCode("var " + start + " = offset;");
                    ctx.pushCode("while(dataView.getUint8(offset++) !== 0);");
                    ctx.pushCode(isHex ? name + " = Array.from(buffer.subarray(" + start + ", offset - 1)), " + toHex + ").join('');" : name + " = new TextDecoder('" + encoding + "').decode(buffer.subarray(" + start + ", offset - 1));");
                } else if (this.options.greedy) {
                    ctx.pushCode("var " + start + " = offset;");
                    ctx.pushCode("while(buffer.length > offset++);");
                    ctx.pushCode(isHex ? name + " = Array.from(buffer.subarray(" + start + ", offset)), " + toHex + ").join('');" : name + " = new TextDecoder('" + encoding + "').decode(buffer.subarray(" + start + ", offset));");
                }
                if (this.options.stripNull) {
                    ctx.pushCode(name + " = " + name + ".replace(/\\x00+$/g, '')");
                }
                if (this.options.trim) {
                    ctx.pushCode(name + " = " + name + ".trim()");
                }
            };
            Parser.prototype.generate_encodeString = function(ctx) {
                var name = ctx.generateVariable(this.varName);
                if (this.options.length) {
                    var optLength = ctx.generateOption(this.options.length);
                    var tmpBuf = ctx.generateTmpVariable();
                    ctx.pushCode("var " + tmpBuf + " = Buffer.from(" + name + ', "' + this.options.encoding + '");');
                    ctx.pushCode(tmpBuf + " = " + tmpBuf + ".slice(0, " + optLength + ");");
                    var padLen = ctx.generateTmpVariable();
                    ctx.pushCode(padLen + " = " + optLength + " - " + tmpBuf + ".length;");
                    if (this.options.zeroTerminated) {
                        ctx.pushCode("smartBuffer.writeBuffer(" + tmpBuf + ");");
                        ctx.pushCode("if (" + padLen + " > 0) { smartBuffer.writeUInt8(0x00); }");
                    } else {
                        var padCharVar = ctx.generateTmpVariable();
                        var padChar = this.options.stripNull ? "\0" : " ";
                        if (this.options.padd && typeof this.options.padd === "string") {
                            var code = this.options.padd.charCodeAt(0);
                            if (code < 128) {
                                padChar = String.fromCharCode(code);
                            }
                        }
                        ctx.pushCode(padCharVar + ' = "' + padChar + '";');
                        if (this.options.padding === "left") {
                            ctx.pushCode("if (" + padLen + " > 0) {smartBuffer.writeString(" + padCharVar + ".repeat(" + padLen + "));}");
                        }
                        ctx.pushCode("smartBuffer.writeBuffer(" + tmpBuf + ");");
                        if (this.options.padding !== "left") {
                            ctx.pushCode("if (" + padLen + " > 0) {smartBuffer.writeString(" + padCharVar + ".repeat(" + padLen + "));}");
                        }
                    }
                } else {
                    ctx.pushCode("smartBuffer.writeString(" + name + ', "' + this.options.encoding + '");');
                    if (this.options.zeroTerminated) {
                        ctx.pushCode("smartBuffer.writeUInt8(0x00);");
                    }
                }
            };
            Parser.prototype.generateBuffer = function(ctx) {
                var varName = ctx.generateVariable(this.varName);
                if (typeof this.options.readUntil === "function") {
                    var pred = this.options.readUntil;
                    var start = ctx.generateTmpVariable();
                    var cur = ctx.generateTmpVariable();
                    ctx.pushCode("var " + start + " = offset;");
                    ctx.pushCode("var " + cur + " = 0;");
                    ctx.pushCode("while (offset < buffer.length) {");
                    ctx.pushCode(cur + " = dataView.getUint8(offset);");
                    var func = ctx.addImport(pred);
                    ctx.pushCode("if (" + func + ".call(this, " + cur + ", buffer.subarray(offset))) break;");
                    ctx.pushCode("offset += 1;");
                    ctx.pushCode("}");
                    ctx.pushCode(varName + " = buffer.subarray(" + start + ", offset);");
                } else if (this.options.readUntil === "eof") {
                    ctx.pushCode(varName + " = buffer.subarray(offset);");
                } else {
                    var len = ctx.generateOption(this.options.length);
                    ctx.pushCode(varName + " = buffer.subarray(offset, offset + " + len + ");");
                    ctx.pushCode("offset += " + len + ";");
                }
                if (this.options.clone) {
                    ctx.pushCode(varName + " = buffer.constructor.from(" + varName + ");");
                }
            };
            Parser.prototype.generate_encodeBuffer = function(ctx) {
                ctx.pushCode("smartBuffer.writeBuffer(" + ctx.generateVariable(this.varName) + ");");
            };
            Parser.prototype.generateArray = function(ctx) {
                var length = ctx.generateOption(this.options.length);
                var lengthInBytes = ctx.generateOption(this.options.lengthInBytes);
                var type = this.options.type;
                var counter = ctx.generateTmpVariable();
                var lhs = ctx.generateVariable(this.varName);
                var item = ctx.generateTmpVariable();
                var key = this.options.key;
                var isHash = typeof key === "string";
                if (isHash) {
                    ctx.pushCode(lhs + " = {};");
                } else {
                    ctx.pushCode(lhs + " = [];");
                }
                if (typeof this.options.readUntil === "function") {
                    ctx.pushCode("do {");
                } else if (this.options.readUntil === "eof") {
                    ctx.pushCode("for (var " + counter + " = 0; offset < buffer.length; " + counter + "++) {");
                } else if (lengthInBytes !== undefined) {
                    ctx.pushCode("for (var " + counter + " = offset + " + lengthInBytes + "; offset < " + counter + "; ) {");
                } else {
                    ctx.pushCode("for (var " + counter + " = " + length + "; " + counter + " > 0; " + counter + "--) {");
                }
                if (typeof type === "string") {
                    if (!aliasRegistry[type]) {
                        var typeName = PRIMITIVE_NAMES[type];
                        var littleEndian = PRIMITIVE_LITTLE_ENDIANS[type];
                        ctx.pushCode("var " + item + " = dataView.get" + typeName + "(offset, " + littleEndian + ");");
                        ctx.pushCode("offset += " + PRIMITIVE_SIZES[type] + ";");
                    } else {
                        var tempVar = ctx.generateTmpVariable();
                        ctx.pushCode("var " + tempVar + " = " + (FUNCTION_PREFIX + type) + "(offset);");
                        ctx.pushCode("var " + item + " = " + tempVar + ".result; offset = " + tempVar + ".offset;");
                        if (type !== this.alias) ctx.addReference(type);
                    }
                } else if (type instanceof Parser) {
                    ctx.pushCode("var " + item + " = {};");
                    ctx.pushScope(item);
                    type.generate(ctx);
                    ctx.popScope();
                }
                if (isHash) {
                    ctx.pushCode(lhs + "[" + item + "." + key + "] = " + item + ";");
                } else {
                    ctx.pushCode(lhs + ".push(" + item + ");");
                }
                ctx.pushCode("}");
                if (typeof this.options.readUntil === "function") {
                    var pred = this.options.readUntil;
                    var func = ctx.addImport(pred);
                    ctx.pushCode("while (!" + func + ".call(this, " + item + ", buffer.subarray(offset)));");
                }
            };
            Parser.prototype.generate_encodeArray = function(ctx) {
                var length = ctx.generateOption(this.options.length);
                var lengthInBytes = ctx.generateOption(this.options.lengthInBytes);
                var type = this.options.type;
                var name = ctx.generateVariable(this.varName);
                var item = ctx.generateTmpVariable();
                var itemCounter = ctx.generateTmpVariable();
                var maxItems = ctx.generateTmpVariable();
                var isHash = typeof this.options.key === "string";
                if (isHash) {
                    ctx.generateError('"Encoding associative array not supported"');
                }
                ctx.pushCode("var " + maxItems + " = 0;");
                ctx.pushCode("if(" + name + ") {" + maxItems + " = " + name + ".length;}");
                if (length !== undefined) {
                    ctx.pushCode(maxItems + " = " + maxItems + " > " + length + " ? " + length + " : " + maxItems);
                }
                var savSmartBuffer = ctx.generateTmpVariable();
                ctx.pushCode("var " + savSmartBuffer + " = smartBuffer; " + ("smartBuffer = SmartBuffer.fromOptions({size: " + this.smartBufferSize + ', encoding: "utf8"});'));
                ctx.pushCode("if(" + maxItems + " > 0) {");
                ctx.pushCode("var " + itemCounter + " = 0;");
                if (typeof this.options.encodeUntil === "function" || typeof this.options.readUntil === "function") {
                    ctx.pushCode("do {");
                } else {
                    ctx.pushCode("for ( ; " + itemCounter + " < " + maxItems + "; ) {");
                }
                ctx.pushCode("var " + item + " = " + name + "[" + itemCounter + "];");
                ctx.pushCode(itemCounter + "++;");
                if (typeof type === "string") {
                    if (!aliasRegistry[type]) {
                        ctx.pushCode("smartBuffer.write" + CAPITILIZED_TYPE_NAMES[type] + "(" + item + ");");
                    } else {
                        ctx.pushCode("smartBuffer.writeBuffer(" + (FUNCTION_ENCODE_PREFIX + type) + "(" + item + "));");
                        if (type !== this.alias) {
                            ctx.addReference(type);
                        }
                    }
                } else if (type instanceof Parser) {
                    ctx.pushScope(item);
                    type.generateEncode(ctx);
                    ctx.popScope();
                }
                ctx.pushCode("}");
                if (typeof this.options.encodeUntil === "function") {
                    ctx.pushCode(" while (" + itemCounter + " < " + maxItems + " && !(" + this.options.encodeUntil + ").call(this, " + item + ", vars));");
                } else if (typeof this.options.readUntil === "function") {
                    ctx.pushCode(" while (" + itemCounter + " < " + maxItems + " && !(" + this.options.readUntil + ").call(this, " + item + ", " + savSmartBuffer + ".toBuffer()));");
                }
                ctx.pushCode("}");
                var tmpBuffer = ctx.generateTmpVariable();
                ctx.pushCode("var " + tmpBuffer + " = smartBuffer.toBuffer()");
                if (lengthInBytes !== undefined) {
                    ctx.pushCode(tmpBuffer + " = " + tmpBuffer + ".slice(0, " + lengthInBytes + ");");
                }
                ctx.pushCode(savSmartBuffer + ".writeBuffer(" + tmpBuffer + ");");
                ctx.pushCode("smartBuffer = " + savSmartBuffer + ";");
            };
            Parser.prototype.generateChoiceCase = function(ctx, varName, type) {
                if (typeof type === "string") {
                    var varName_1 = ctx.generateVariable(this.varName);
                    if (!aliasRegistry[type]) {
                        var typeName = PRIMITIVE_NAMES[type];
                        var littleEndian = PRIMITIVE_LITTLE_ENDIANS[type];
                        ctx.pushCode(varName_1 + " = dataView.get" + typeName + "(offset, " + littleEndian + ");");
                        ctx.pushCode("offset += " + PRIMITIVE_SIZES[type]);
                    } else {
                        var tempVar = ctx.generateTmpVariable();
                        ctx.pushCode("var " + tempVar + " = " + (FUNCTION_PREFIX + type) + "(offset);");
                        ctx.pushCode(varName_1 + " = " + tempVar + ".result; offset = " + tempVar + ".offset;");
                        if (type !== this.alias) ctx.addReference(type);
                    }
                } else if (type instanceof Parser) {
                    ctx.pushPath(varName);
                    type.generate(ctx);
                    ctx.popPath(varName);
                }
            };
            Parser.prototype.generate_encodeChoiceCase = function(ctx, varName, type) {
                if (typeof type === "string") {
                    if (!aliasRegistry[type]) {
                        ctx.pushCode("smartBuffer.write" + CAPITILIZED_TYPE_NAMES[type] + "(" + ctx.generateVariable(this.varName) + ");");
                    } else {
                        var tempVar = ctx.generateTmpVariable();
                        ctx.pushCode("var " + tempVar + " = " + (FUNCTION_ENCODE_PREFIX + type) + "(" + ctx.generateVariable(this.varName) + ");");
                        ctx.pushCode("smartBuffer.writeBuffer(" + tempVar + ");");
                        if (type !== this.alias) ctx.addReference(type);
                    }
                } else if (type instanceof Parser) {
                    ctx.pushPath(varName);
                    type.generateEncode(ctx);
                    ctx.popPath(varName);
                }
            };
            Parser.prototype.generateChoice = function(ctx) {
                var _this = this;
                var tag = ctx.generateOption(this.options.tag);
                if (this.varName) {
                    ctx.pushCode(ctx.generateVariable(this.varName) + " = {};");
                }
                ctx.pushCode("switch(" + tag + ") {");
                Object.keys(this.options.choices).forEach((function(tag) {
                    var type = _this.options.choices[parseInt(tag, 10)];
                    ctx.pushCode("case " + tag + ":");
                    _this.generateChoiceCase(ctx, _this.varName, type);
                    ctx.pushCode("break;");
                }));
                ctx.pushCode("default:");
                if (this.options.defaultChoice) {
                    this.generateChoiceCase(ctx, this.varName, this.options.defaultChoice);
                } else {
                    ctx.generateError('"Met undefined tag value " + ' + tag + ' + " at choice"');
                }
                ctx.pushCode("}");
            };
            Parser.prototype.generate_encodeChoice = function(ctx) {
                var _this = this;
                var tag = ctx.generateOption(this.options.tag);
                ctx.pushCode("switch(" + tag + ") {");
                Object.keys(this.options.choices).forEach((function(tag) {
                    var type = _this.options.choices[parseInt(tag, 10)];
                    ctx.pushCode("case " + tag + ":");
                    _this.generate_encodeChoiceCase(ctx, _this.varName, type);
                    ctx.pushCode("break;");
                }), this);
                ctx.pushCode("default:");
                if (this.options.defaultChoice) {
                    this.generate_encodeChoiceCase(ctx, this.varName, this.options.defaultChoice);
                } else {
                    ctx.generateError('"Met undefined tag value " + ' + tag + ' + " at choice"');
                }
                ctx.pushCode("}");
            };
            Parser.prototype.generateNest = function(ctx) {
                var nestVar = ctx.generateVariable(this.varName);
                if (this.options.type instanceof Parser) {
                    if (this.varName) {
                        ctx.pushCode(nestVar + " = {};");
                    }
                    ctx.pushPath(this.varName);
                    this.options.type.generate(ctx);
                    ctx.popPath(this.varName);
                } else if (aliasRegistry[this.options.type]) {
                    var tempVar = ctx.generateTmpVariable();
                    ctx.pushCode("var " + tempVar + " = " + (FUNCTION_PREFIX + this.options.type) + "(offset);");
                    ctx.pushCode(nestVar + " = " + tempVar + ".result; offset = " + tempVar + ".offset;");
                    if (this.options.type !== this.alias) ctx.addReference(this.options.type);
                }
            };
            Parser.prototype.generate_encodeNest = function(ctx) {
                var nestVar = ctx.generateVariable(this.varName);
                if (this.options.type instanceof Parser) {
                    ctx.pushPath(this.varName);
                    this.options.type.generateEncode(ctx);
                    ctx.popPath(this.varName);
                } else if (aliasRegistry[this.options.type]) {
                    var tempVar = ctx.generateTmpVariable();
                    ctx.pushCode("var " + tempVar + " = " + (FUNCTION_ENCODE_PREFIX + this.options.type) + "(" + nestVar + ");");
                    ctx.pushCode("smartBuffer.writeBuffer(" + tempVar + ");");
                    if (this.options.type !== this.alias) {
                        ctx.addReference(this.options.type);
                    }
                }
            };
            Parser.prototype.generateFormatter = function(ctx, varName, formatter) {
                if (typeof formatter === "function") {
                    var func = ctx.addImport(formatter);
                    ctx.pushCode(varName + " = " + func + ".call(this, " + varName + ");");
                }
            };
            Parser.prototype.generateEncoder = function(ctx, varName, encoder) {
                if (typeof encoder === "function") {
                    ctx.pushCode(varName + " = (" + encoder + ").call(this, " + varName + ", vars);");
                }
            };
            Parser.prototype.generatePointer = function(ctx) {
                var type = this.options.type;
                var offset = ctx.generateOption(this.options.offset);
                var tempVar = ctx.generateTmpVariable();
                var nestVar = ctx.generateVariable(this.varName);
                ctx.pushCode("var " + tempVar + " = offset;");
                ctx.pushCode("offset = " + offset + ";");
                if (this.options.type instanceof Parser) {
                    ctx.pushCode(nestVar + " = {};");
                    ctx.pushPath(this.varName);
                    this.options.type.generate(ctx);
                    ctx.popPath(this.varName);
                } else if (aliasRegistry[this.options.type]) {
                    var tempVar_1 = ctx.generateTmpVariable();
                    ctx.pushCode("var " + tempVar_1 + " = " + (FUNCTION_PREFIX + this.options.type) + "(offset);");
                    ctx.pushCode(nestVar + " = " + tempVar_1 + ".result; offset = " + tempVar_1 + ".offset;");
                    if (this.options.type !== this.alias) ctx.addReference(this.options.type);
                } else if (Object.keys(PRIMITIVE_SIZES).indexOf(this.options.type) >= 0) {
                    var typeName = PRIMITIVE_NAMES[type];
                    var littleEndian = PRIMITIVE_LITTLE_ENDIANS[type];
                    ctx.pushCode(nestVar + " = dataView.get" + typeName + "(offset, " + littleEndian + ");");
                    ctx.pushCode("offset += " + PRIMITIVE_SIZES[type] + ";");
                }
                ctx.pushCode("offset = " + tempVar + ";");
            };
            Parser.prototype.generate_encodePointer = function(ctx) {};
            Parser.prototype.generateSaveOffset = function(ctx) {
                var varName = ctx.generateVariable(this.varName);
                ctx.pushCode(varName + " = offset");
            };
            Parser.prototype.generate_encodeSaveOffset = function(ctx) {};
            return Parser;
        }();
        exports.Parser = Parser;
    }, (__unused_webpack_module, exports) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.Context = void 0;
        var Context = function() {
            function Context(importPath) {
                this.code = "";
                this.scopes = [ [ "vars" ] ];
                this.bitFields = [];
                this.tmpVariableCount = 0;
                this.references = {};
                this.imports = [];
                this.reverseImports = new Map;
                this.importPath = importPath;
            }
            Context.prototype.generateVariable = function(name) {
                var arr = [];
                var scopes = this.scopes[this.scopes.length - 1];
                arr.push.apply(arr, scopes);
                if (name) {
                    arr.push(name);
                }
                return arr.join(".");
            };
            Context.prototype.generateOption = function(val) {
                switch (typeof val) {
                  case "number":
                    return val.toString();

                  case "string":
                    return this.generateVariable(val);

                  case "function":
                    return this.addImport(val) + ".call(" + this.generateVariable() + ", vars)";
                }
            };
            Context.prototype.generateError = function(err) {
                this.pushCode("throw new Error(" + err + ");");
            };
            Context.prototype.generateTmpVariable = function() {
                return "$tmp" + this.tmpVariableCount++;
            };
            Context.prototype.pushCode = function(code) {
                this.code += code + "\n";
            };
            Context.prototype.pushPath = function(name) {
                if (name) {
                    this.scopes[this.scopes.length - 1].push(name);
                }
            };
            Context.prototype.popPath = function(name) {
                if (name) {
                    this.scopes[this.scopes.length - 1].pop();
                }
            };
            Context.prototype.pushScope = function(name) {
                this.scopes.push([ name ]);
            };
            Context.prototype.popScope = function() {
                this.scopes.pop();
            };
            Context.prototype.addImport = function(im) {
                if (!this.importPath) return "(" + im + ")";
                var id = this.reverseImports.get(im);
                if (!id) {
                    id = this.imports.push(im) - 1;
                    this.reverseImports.set(im, id);
                }
                return this.importPath + "[" + id + "]";
            };
            Context.prototype.addReference = function(alias) {
                if (this.references[alias]) return;
                this.references[alias] = {
                    resolved: false,
                    requested: false
                };
            };
            Context.prototype.markResolved = function(alias) {
                this.references[alias].resolved = true;
            };
            Context.prototype.markRequested = function(aliasList) {
                var _this = this;
                aliasList.forEach((function(alias) {
                    _this.references[alias].requested = true;
                }));
            };
            Context.prototype.getUnresolvedReferences = function() {
                var references = this.references;
                return Object.keys(this.references).filter((function(alias) {
                    return !references[alias].resolved && !references[alias].requested;
                }));
            };
            return Context;
        }();
        exports.Context = Context;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        const utils_1 = __webpack_require__(126);
        const DEFAULT_SMARTBUFFER_SIZE = 4096;
        const DEFAULT_SMARTBUFFER_ENCODING = "utf8";
        class SmartBuffer {
            constructor(options) {
                this.length = 0;
                this._encoding = DEFAULT_SMARTBUFFER_ENCODING;
                this._writeOffset = 0;
                this._readOffset = 0;
                if (SmartBuffer.isSmartBufferOptions(options)) {
                    if (options.encoding) {
                        utils_1.checkEncoding(options.encoding);
                        this._encoding = options.encoding;
                    }
                    if (options.size) {
                        if (utils_1.isFiniteInteger(options.size) && options.size > 0) {
                            this._buff = Buffer.allocUnsafe(options.size);
                        } else {
                            throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_SIZE);
                        }
                    } else if (options.buff) {
                        if (Buffer.isBuffer(options.buff)) {
                            this._buff = options.buff;
                            this.length = options.buff.length;
                        } else {
                            throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_BUFFER);
                        }
                    } else {
                        this._buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE);
                    }
                } else {
                    if (typeof options !== "undefined") {
                        throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_OBJECT);
                    }
                    this._buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE);
                }
            }
            static fromSize(size, encoding) {
                return new this({
                    size,
                    encoding
                });
            }
            static fromBuffer(buff, encoding) {
                return new this({
                    buff,
                    encoding
                });
            }
            static fromOptions(options) {
                return new this(options);
            }
            static isSmartBufferOptions(options) {
                const castOptions = options;
                return castOptions && (castOptions.encoding !== undefined || castOptions.size !== undefined || castOptions.buff !== undefined);
            }
            readInt8(offset) {
                return this._readNumberValue(Buffer.prototype.readInt8, 1, offset);
            }
            readInt16BE(offset) {
                return this._readNumberValue(Buffer.prototype.readInt16BE, 2, offset);
            }
            readInt16LE(offset) {
                return this._readNumberValue(Buffer.prototype.readInt16LE, 2, offset);
            }
            readInt32BE(offset) {
                return this._readNumberValue(Buffer.prototype.readInt32BE, 4, offset);
            }
            readInt32LE(offset) {
                return this._readNumberValue(Buffer.prototype.readInt32LE, 4, offset);
            }
            readBigInt64BE(offset) {
                utils_1.bigIntAndBufferInt64Check("readBigInt64BE");
                return this._readNumberValue(Buffer.prototype.readBigInt64BE, 8, offset);
            }
            readBigInt64LE(offset) {
                utils_1.bigIntAndBufferInt64Check("readBigInt64LE");
                return this._readNumberValue(Buffer.prototype.readBigInt64LE, 8, offset);
            }
            writeInt8(value, offset) {
                this._writeNumberValue(Buffer.prototype.writeInt8, 1, value, offset);
                return this;
            }
            insertInt8(value, offset) {
                return this._insertNumberValue(Buffer.prototype.writeInt8, 1, value, offset);
            }
            writeInt16BE(value, offset) {
                return this._writeNumberValue(Buffer.prototype.writeInt16BE, 2, value, offset);
            }
            insertInt16BE(value, offset) {
                return this._insertNumberValue(Buffer.prototype.writeInt16BE, 2, value, offset);
            }
            writeInt16LE(value, offset) {
                return this._writeNumberValue(Buffer.prototype.writeInt16LE, 2, value, offset);
            }
            insertInt16LE(value, offset) {
                return this._insertNumberValue(Buffer.prototype.writeInt16LE, 2, value, offset);
            }
            writeInt32BE(value, offset) {
                return this._writeNumberValue(Buffer.prototype.writeInt32BE, 4, value, offset);
            }
            insertInt32BE(value, offset) {
                return this._insertNumberValue(Buffer.prototype.writeInt32BE, 4, value, offset);
            }
            writeInt32LE(value, offset) {
                return this._writeNumberValue(Buffer.prototype.writeInt32LE, 4, value, offset);
            }
            insertInt32LE(value, offset) {
                return this._insertNumberValue(Buffer.prototype.writeInt32LE, 4, value, offset);
            }
            writeBigInt64BE(value, offset) {
                utils_1.bigIntAndBufferInt64Check("writeBigInt64BE");
                return this._writeNumberValue(Buffer.prototype.writeBigInt64BE, 8, value, offset);
            }
            insertBigInt64BE(value, offset) {
                utils_1.bigIntAndBufferInt64Check("writeBigInt64BE");
                return this._insertNumberValue(Buffer.prototype.writeBigInt64BE, 8, value, offset);
            }
            writeBigInt64LE(value, offset) {
                utils_1.bigIntAndBufferInt64Check("writeBigInt64LE");
                return this._writeNumberValue(Buffer.prototype.writeBigInt64LE, 8, value, offset);
            }
            insertBigInt64LE(value, offset) {
                utils_1.bigIntAndBufferInt64Check("writeBigInt64LE");
                return this._insertNumberValue(Buffer.prototype.writeBigInt64LE, 8, value, offset);
            }
            readUInt8(offset) {
                return this._readNumberValue(Buffer.prototype.readUInt8, 1, offset);
            }
            readUInt16BE(offset) {
                return this._readNumberValue(Buffer.prototype.readUInt16BE, 2, offset);
            }
            readUInt16LE(offset) {
                return this._readNumberValue(Buffer.prototype.readUInt16LE, 2, offset);
            }
            readUInt32BE(offset) {
                return this._readNumberValue(Buffer.prototype.readUInt32BE, 4, offset);
            }
            readUInt32LE(offset) {
                return this._readNumberValue(Buffer.prototype.readUInt32LE, 4, offset);
            }
            readBigUInt64BE(offset) {
                utils_1.bigIntAndBufferInt64Check("readBigUInt64BE");
                return this._readNumberValue(Buffer.prototype.readBigUInt64BE, 8, offset);
            }
            readBigUInt64LE(offset) {
                utils_1.bigIntAndBufferInt64Check("readBigUInt64LE");
                return this._readNumberValue(Buffer.prototype.readBigUInt64LE, 8, offset);
            }
            writeUInt8(value, offset) {
                return this._writeNumberValue(Buffer.prototype.writeUInt8, 1, value, offset);
            }
            insertUInt8(value, offset) {
                return this._insertNumberValue(Buffer.prototype.writeUInt8, 1, value, offset);
            }
            writeUInt16BE(value, offset) {
                return this._writeNumberValue(Buffer.prototype.writeUInt16BE, 2, value, offset);
            }
            insertUInt16BE(value, offset) {
                return this._insertNumberValue(Buffer.prototype.writeUInt16BE, 2, value, offset);
            }
            writeUInt16LE(value, offset) {
                return this._writeNumberValue(Buffer.prototype.writeUInt16LE, 2, value, offset);
            }
            insertUInt16LE(value, offset) {
                return this._insertNumberValue(Buffer.prototype.writeUInt16LE, 2, value, offset);
            }
            writeUInt32BE(value, offset) {
                return this._writeNumberValue(Buffer.prototype.writeUInt32BE, 4, value, offset);
            }
            insertUInt32BE(value, offset) {
                return this._insertNumberValue(Buffer.prototype.writeUInt32BE, 4, value, offset);
            }
            writeUInt32LE(value, offset) {
                return this._writeNumberValue(Buffer.prototype.writeUInt32LE, 4, value, offset);
            }
            insertUInt32LE(value, offset) {
                return this._insertNumberValue(Buffer.prototype.writeUInt32LE, 4, value, offset);
            }
            writeBigUInt64BE(value, offset) {
                utils_1.bigIntAndBufferInt64Check("writeBigUInt64BE");
                return this._writeNumberValue(Buffer.prototype.writeBigUInt64BE, 8, value, offset);
            }
            insertBigUInt64BE(value, offset) {
                utils_1.bigIntAndBufferInt64Check("writeBigUInt64BE");
                return this._insertNumberValue(Buffer.prototype.writeBigUInt64BE, 8, value, offset);
            }
            writeBigUInt64LE(value, offset) {
                utils_1.bigIntAndBufferInt64Check("writeBigUInt64LE");
                return this._writeNumberValue(Buffer.prototype.writeBigUInt64LE, 8, value, offset);
            }
            insertBigUInt64LE(value, offset) {
                utils_1.bigIntAndBufferInt64Check("writeBigUInt64LE");
                return this._insertNumberValue(Buffer.prototype.writeBigUInt64LE, 8, value, offset);
            }
            readFloatBE(offset) {
                return this._readNumberValue(Buffer.prototype.readFloatBE, 4, offset);
            }
            readFloatLE(offset) {
                return this._readNumberValue(Buffer.prototype.readFloatLE, 4, offset);
            }
            writeFloatBE(value, offset) {
                return this._writeNumberValue(Buffer.prototype.writeFloatBE, 4, value, offset);
            }
            insertFloatBE(value, offset) {
                return this._insertNumberValue(Buffer.prototype.writeFloatBE, 4, value, offset);
            }
            writeFloatLE(value, offset) {
                return this._writeNumberValue(Buffer.prototype.writeFloatLE, 4, value, offset);
            }
            insertFloatLE(value, offset) {
                return this._insertNumberValue(Buffer.prototype.writeFloatLE, 4, value, offset);
            }
            readDoubleBE(offset) {
                return this._readNumberValue(Buffer.prototype.readDoubleBE, 8, offset);
            }
            readDoubleLE(offset) {
                return this._readNumberValue(Buffer.prototype.readDoubleLE, 8, offset);
            }
            writeDoubleBE(value, offset) {
                return this._writeNumberValue(Buffer.prototype.writeDoubleBE, 8, value, offset);
            }
            insertDoubleBE(value, offset) {
                return this._insertNumberValue(Buffer.prototype.writeDoubleBE, 8, value, offset);
            }
            writeDoubleLE(value, offset) {
                return this._writeNumberValue(Buffer.prototype.writeDoubleLE, 8, value, offset);
            }
            insertDoubleLE(value, offset) {
                return this._insertNumberValue(Buffer.prototype.writeDoubleLE, 8, value, offset);
            }
            readString(arg1, encoding) {
                let lengthVal;
                if (typeof arg1 === "number") {
                    utils_1.checkLengthValue(arg1);
                    lengthVal = Math.min(arg1, this.length - this._readOffset);
                } else {
                    encoding = arg1;
                    lengthVal = this.length - this._readOffset;
                }
                if (typeof encoding !== "undefined") {
                    utils_1.checkEncoding(encoding);
                }
                const value = this._buff.slice(this._readOffset, this._readOffset + lengthVal).toString(encoding || this._encoding);
                this._readOffset += lengthVal;
                return value;
            }
            insertString(value, offset, encoding) {
                utils_1.checkOffsetValue(offset);
                return this._handleString(value, true, offset, encoding);
            }
            writeString(value, arg2, encoding) {
                return this._handleString(value, false, arg2, encoding);
            }
            readStringNT(encoding) {
                if (typeof encoding !== "undefined") {
                    utils_1.checkEncoding(encoding);
                }
                let nullPos = this.length;
                for (let i = this._readOffset; i < this.length; i++) {
                    if (this._buff[i] === 0) {
                        nullPos = i;
                        break;
                    }
                }
                const value = this._buff.slice(this._readOffset, nullPos);
                this._readOffset = nullPos + 1;
                return value.toString(encoding || this._encoding);
            }
            insertStringNT(value, offset, encoding) {
                utils_1.checkOffsetValue(offset);
                this.insertString(value, offset, encoding);
                this.insertUInt8(0, offset + value.length);
                return this;
            }
            writeStringNT(value, arg2, encoding) {
                this.writeString(value, arg2, encoding);
                this.writeUInt8(0, typeof arg2 === "number" ? arg2 + value.length : this.writeOffset);
                return this;
            }
            readBuffer(length) {
                if (typeof length !== "undefined") {
                    utils_1.checkLengthValue(length);
                }
                const lengthVal = typeof length === "number" ? length : this.length;
                const endPoint = Math.min(this.length, this._readOffset + lengthVal);
                const value = this._buff.slice(this._readOffset, endPoint);
                this._readOffset = endPoint;
                return value;
            }
            insertBuffer(value, offset) {
                utils_1.checkOffsetValue(offset);
                return this._handleBuffer(value, true, offset);
            }
            writeBuffer(value, offset) {
                return this._handleBuffer(value, false, offset);
            }
            readBufferNT() {
                let nullPos = this.length;
                for (let i = this._readOffset; i < this.length; i++) {
                    if (this._buff[i] === 0) {
                        nullPos = i;
                        break;
                    }
                }
                const value = this._buff.slice(this._readOffset, nullPos);
                this._readOffset = nullPos + 1;
                return value;
            }
            insertBufferNT(value, offset) {
                utils_1.checkOffsetValue(offset);
                this.insertBuffer(value, offset);
                this.insertUInt8(0, offset + value.length);
                return this;
            }
            writeBufferNT(value, offset) {
                if (typeof offset !== "undefined") {
                    utils_1.checkOffsetValue(offset);
                }
                this.writeBuffer(value, offset);
                this.writeUInt8(0, typeof offset === "number" ? offset + value.length : this._writeOffset);
                return this;
            }
            clear() {
                this._writeOffset = 0;
                this._readOffset = 0;
                this.length = 0;
                return this;
            }
            remaining() {
                return this.length - this._readOffset;
            }
            get readOffset() {
                return this._readOffset;
            }
            set readOffset(offset) {
                utils_1.checkOffsetValue(offset);
                utils_1.checkTargetOffset(offset, this);
                this._readOffset = offset;
            }
            get writeOffset() {
                return this._writeOffset;
            }
            set writeOffset(offset) {
                utils_1.checkOffsetValue(offset);
                utils_1.checkTargetOffset(offset, this);
                this._writeOffset = offset;
            }
            get encoding() {
                return this._encoding;
            }
            set encoding(encoding) {
                utils_1.checkEncoding(encoding);
                this._encoding = encoding;
            }
            get internalBuffer() {
                return this._buff;
            }
            toBuffer() {
                return this._buff.slice(0, this.length);
            }
            toString(encoding) {
                const encodingVal = typeof encoding === "string" ? encoding : this._encoding;
                utils_1.checkEncoding(encodingVal);
                return this._buff.toString(encodingVal, 0, this.length);
            }
            destroy() {
                this.clear();
                return this;
            }
            _handleString(value, isInsert, arg3, encoding) {
                let offsetVal = this._writeOffset;
                let encodingVal = this._encoding;
                if (typeof arg3 === "number") {
                    offsetVal = arg3;
                } else if (typeof arg3 === "string") {
                    utils_1.checkEncoding(arg3);
                    encodingVal = arg3;
                }
                if (typeof encoding === "string") {
                    utils_1.checkEncoding(encoding);
                    encodingVal = encoding;
                }
                const byteLength = Buffer.byteLength(value, encodingVal);
                if (isInsert) {
                    this.ensureInsertable(byteLength, offsetVal);
                } else {
                    this._ensureWriteable(byteLength, offsetVal);
                }
                this._buff.write(value, offsetVal, byteLength, encodingVal);
                if (isInsert) {
                    this._writeOffset += byteLength;
                } else {
                    if (typeof arg3 === "number") {
                        this._writeOffset = Math.max(this._writeOffset, offsetVal + byteLength);
                    } else {
                        this._writeOffset += byteLength;
                    }
                }
                return this;
            }
            _handleBuffer(value, isInsert, offset) {
                const offsetVal = typeof offset === "number" ? offset : this._writeOffset;
                if (isInsert) {
                    this.ensureInsertable(value.length, offsetVal);
                } else {
                    this._ensureWriteable(value.length, offsetVal);
                }
                value.copy(this._buff, offsetVal);
                if (isInsert) {
                    this._writeOffset += value.length;
                } else {
                    if (typeof offset === "number") {
                        this._writeOffset = Math.max(this._writeOffset, offsetVal + value.length);
                    } else {
                        this._writeOffset += value.length;
                    }
                }
                return this;
            }
            ensureReadable(length, offset) {
                let offsetVal = this._readOffset;
                if (typeof offset !== "undefined") {
                    utils_1.checkOffsetValue(offset);
                    offsetVal = offset;
                }
                if (offsetVal < 0 || offsetVal + length > this.length) {
                    throw new Error(utils_1.ERRORS.INVALID_READ_BEYOND_BOUNDS);
                }
            }
            ensureInsertable(dataLength, offset) {
                utils_1.checkOffsetValue(offset);
                this._ensureCapacity(this.length + dataLength);
                if (offset < this.length) {
                    this._buff.copy(this._buff, offset + dataLength, offset, this._buff.length);
                }
                if (offset + dataLength > this.length) {
                    this.length = offset + dataLength;
                } else {
                    this.length += dataLength;
                }
            }
            _ensureWriteable(dataLength, offset) {
                const offsetVal = typeof offset === "number" ? offset : this._writeOffset;
                this._ensureCapacity(offsetVal + dataLength);
                if (offsetVal + dataLength > this.length) {
                    this.length = offsetVal + dataLength;
                }
            }
            _ensureCapacity(minLength) {
                const oldLength = this._buff.length;
                if (minLength > oldLength) {
                    let data = this._buff;
                    let newLength = oldLength * 3 / 2 + 1;
                    if (newLength < minLength) {
                        newLength = minLength;
                    }
                    this._buff = Buffer.allocUnsafe(newLength);
                    data.copy(this._buff, 0, 0, oldLength);
                }
            }
            _readNumberValue(func, byteSize, offset) {
                this.ensureReadable(byteSize, offset);
                const value = func.call(this._buff, typeof offset === "number" ? offset : this._readOffset);
                if (typeof offset === "undefined") {
                    this._readOffset += byteSize;
                }
                return value;
            }
            _insertNumberValue(func, byteSize, value, offset) {
                utils_1.checkOffsetValue(offset);
                this.ensureInsertable(byteSize, offset);
                func.call(this._buff, value, offset);
                this._writeOffset += byteSize;
                return this;
            }
            _writeNumberValue(func, byteSize, value, offset) {
                if (typeof offset === "number") {
                    if (offset < 0) {
                        throw new Error(utils_1.ERRORS.INVALID_WRITE_BEYOND_BOUNDS);
                    }
                    utils_1.checkOffsetValue(offset);
                }
                const offsetVal = typeof offset === "number" ? offset : this._writeOffset;
                this._ensureWriteable(byteSize, offsetVal);
                func.call(this._buff, value, offsetVal);
                if (typeof offset === "number") {
                    this._writeOffset = Math.max(this._writeOffset, offsetVal + byteSize);
                } else {
                    this._writeOffset += byteSize;
                }
                return this;
            }
        }
        exports.SmartBuffer = SmartBuffer;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        const buffer_1 = __webpack_require__(79);
        const ERRORS = {
            INVALID_ENCODING: "Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.",
            INVALID_SMARTBUFFER_SIZE: "Invalid size provided. Size must be a valid integer greater than zero.",
            INVALID_SMARTBUFFER_BUFFER: "Invalid Buffer provided in SmartBufferOptions.",
            INVALID_SMARTBUFFER_OBJECT: "Invalid SmartBufferOptions object supplied to SmartBuffer constructor or factory methods.",
            INVALID_OFFSET: "An invalid offset value was provided.",
            INVALID_OFFSET_NON_NUMBER: "An invalid offset value was provided. A numeric value is required.",
            INVALID_LENGTH: "An invalid length value was provided.",
            INVALID_LENGTH_NON_NUMBER: "An invalid length value was provived. A numeric value is required.",
            INVALID_TARGET_OFFSET: "Target offset is beyond the bounds of the internal SmartBuffer data.",
            INVALID_TARGET_LENGTH: "Specified length value moves cursor beyong the bounds of the internal SmartBuffer data.",
            INVALID_READ_BEYOND_BOUNDS: "Attempted to read beyond the bounds of the managed data.",
            INVALID_WRITE_BEYOND_BOUNDS: "Attempted to write beyond the bounds of the managed data."
        };
        exports.ERRORS = ERRORS;
        function checkEncoding(encoding) {
            if (!buffer_1.Buffer.isEncoding(encoding)) {
                throw new Error(ERRORS.INVALID_ENCODING);
            }
        }
        exports.checkEncoding = checkEncoding;
        function isFiniteInteger(value) {
            return typeof value === "number" && isFinite(value) && isInteger(value);
        }
        exports.isFiniteInteger = isFiniteInteger;
        function checkOffsetOrLengthValue(value, offset) {
            if (typeof value === "number") {
                if (!isFiniteInteger(value) || value < 0) {
                    throw new Error(offset ? ERRORS.INVALID_OFFSET : ERRORS.INVALID_LENGTH);
                }
            } else {
                throw new Error(offset ? ERRORS.INVALID_OFFSET_NON_NUMBER : ERRORS.INVALID_LENGTH_NON_NUMBER);
            }
        }
        function checkLengthValue(length) {
            checkOffsetOrLengthValue(length, false);
        }
        exports.checkLengthValue = checkLengthValue;
        function checkOffsetValue(offset) {
            checkOffsetOrLengthValue(offset, true);
        }
        exports.checkOffsetValue = checkOffsetValue;
        function checkTargetOffset(offset, buff) {
            if (offset < 0 || offset > buff.length) {
                throw new Error(ERRORS.INVALID_TARGET_OFFSET);
            }
        }
        exports.checkTargetOffset = checkTargetOffset;
        function isInteger(value) {
            return typeof value === "number" && isFinite(value) && Math.floor(value) === value;
        }
        function bigIntAndBufferInt64Check(bufferMethod) {
            if (typeof BigInt === "undefined") {
                throw new Error("Platform does not support JS BigInt type.");
            }
            if (typeof buffer_1.Buffer.prototype[bufferMethod] === "undefined") {
                throw new Error(`Platform does not support Buffer.prototype.${bufferMethod}.`);
            }
        }
        exports.bigIntAndBufferInt64Check = bigIntAndBufferInt64Check;
    }, (module, exports, __webpack_require__) => {
        "use strict";
        var Buffer = __webpack_require__(79).Buffer;
        var strEnc = "utf8";
        var validateByDefault = true;
        var aliasTypes = {};
        function addTypeAlias(newTypeName, underlyingType) {
            var everyType = Object.keys(readTypeDictStr);
            if (everyType.indexOf(underlyingType) < 0) {
                throw new TypeError("Underlying type does not exist. Typo?");
            } else {
                aliasTypes[newTypeName] = underlyingType;
            }
        }
        function getDataType(val) {
            var everyType = Object.keys(readTypeDictStr);
            var dataType = val.trim().toLowerCase();
            if (aliasTypes.hasOwnProperty(dataType)) {
                dataType = aliasTypes[dataType];
            }
            if (everyType.indexOf(dataType) === -1) {
                throw new TypeError("Invalid data type for schema: " + val + " -> " + dataType);
            }
            return dataType;
        }
        function setValidateByDefault(flag) {
            validateByDefault = flag;
        }
        function setStringEncoding(stringEncoding) {
            var requested = stringEncoding.trim().toLowerCase();
            var available = [ "ascii", "utf8", "utf16le", "ucs2", "base64", "binary", "hex" ];
            if (available.indexOf(requested) > -1) {
                strEnc = requested;
            } else {
                throw new TypeError("String encoding not available");
            }
        }
        function writeVarUInt(value, wBuffer) {
            while (value > 127) {
                wBuffer[bag.byteOffset++] = value & 127 | 128;
                value >>= 7;
            }
            wBuffer[bag.byteOffset++] = value & 127;
        }
        function writeVarInt(value, wBuffer) {
            writeVarUInt(value << 1 ^ value >> 31, wBuffer);
        }
        function readVarUInt(buffer) {
            var val = 0, i = 0, b;
            do {
                b = buffer[bag.byteOffset++];
                val |= (b & 127) << 7 * i;
                i++;
            } while (b & 128);
            return val;
        }
        function readVarInt(buffer) {
            var val = readVarUInt(buffer);
            return val >>> 1 ^ -(val & 1);
        }
        function writeString(val, wBuffer) {
            var len = Buffer.byteLength(val || "", strEnc);
            writeVarUInt(len, wBuffer);
            bag.byteOffset += wBuffer.write(val || "", bag.byteOffset, len, strEnc);
        }
        function readString(buffer) {
            var len = readVarUInt(buffer);
            var str = buffer.toString(strEnc, bag.byteOffset, bag.byteOffset + len);
            bag.byteOffset += len;
            return str;
        }
        function writeBuffer(val, wBuffer) {
            var len = val.length;
            writeVarUInt(len, wBuffer);
            val.copy(wBuffer, bag.byteOffset);
            bag.byteOffset += len;
        }
        function readBuffer(buffer) {
            var len = readVarUInt(buffer);
            var buff = allocUnsafe(len);
            buffer.copy(buff, 0, bag.byteOffset, bag.byteOffset + len);
            bag.byteOffset += len;
            return buff;
        }
        var readTypeDictStr = {
            boolean: "!!buffer.readUInt8(bag.byteOffset, true); bag.byteOffset += 1;",
            int8: "buffer.readInt8(bag.byteOffset, true); bag.byteOffset += 1;",
            uint8: "buffer.readUInt8(bag.byteOffset, true); bag.byteOffset += 1;",
            int16: "buffer.readInt16BE(bag.byteOffset, true); bag.byteOffset += 2;",
            uint16: "buffer.readUInt16BE(bag.byteOffset, true); bag.byteOffset += 2;",
            int32: "buffer.readInt32BE(bag.byteOffset, true); bag.byteOffset += 4;",
            uint32: "buffer.readUInt32BE(bag.byteOffset, true); bag.byteOffset += 4;",
            float32: "buffer.readFloatBE(bag.byteOffset, true); bag.byteOffset += 4;",
            float64: "buffer.readDoubleBE(bag.byteOffset, true); bag.byteOffset += 8;",
            string: "bag.readString(buffer);",
            varuint: "bag.readVarUInt(buffer);",
            varint: "bag.readVarInt(buffer);",
            buffer: "bag.readBuffer(buffer);"
        };
        function getWriteTypeDictStr(dataType, valStr) {
            switch (dataType) {
              case "boolean":
                return "bag.byteOffset = wBuffer.writeUInt8(" + valStr + " ? 1 : 0, bag.byteOffset, true);";

              case "int8":
                return "bag.byteOffset = wBuffer.writeInt8(" + valStr + ", bag.byteOffset, true);";

              case "uint8":
                return "bag.byteOffset = wBuffer.writeUInt8(" + valStr + ", bag.byteOffset, true);";

              case "int16":
                return "bag.byteOffset = wBuffer.writeInt16BE(" + valStr + ", bag.byteOffset, true);";

              case "uint16":
                return "bag.byteOffset = wBuffer.writeUInt16BE(" + valStr + ", bag.byteOffset, true);";

              case "int32":
                return "bag.byteOffset = wBuffer.writeInt32BE(" + valStr + ", bag.byteOffset, true);";

              case "uint32":
                return "bag.byteOffset = wBuffer.writeUInt32BE(" + valStr + ", bag.byteOffset, true);";

              case "float32":
                return "bag.byteOffset = wBuffer.writeFloatBE(" + valStr + ", bag.byteOffset, true);";

              case "float64":
                return "bag.byteOffset = wBuffer.writeDoubleBE(" + valStr + ", bag.byteOffset, true);";

              case "string":
                return "bag.writeString(" + valStr + ", wBuffer);";

              case "varuint":
                return "bag.writeVarUInt(" + valStr + ", wBuffer);";

              case "varint":
                return "bag.writeVarInt(" + valStr + ", wBuffer);";

              case "buffer":
                return "bag.writeBuffer(" + valStr + ", wBuffer);";
            }
        }
        var constantByteCounts = {
            boolean: 1,
            int8: 1,
            uint8: 1,
            int16: 2,
            uint16: 2,
            int32: 4,
            uint32: 4,
            float32: 4,
            float64: 8
        };
        var dynamicByteCounts = {
            string: function(val) {
                var len = Buffer.byteLength(val, strEnc);
                return getVarUIntByteLength(len) + len;
            },
            varuint: function(val) {
                return getVarUIntByteLength(val);
            },
            varint: function(val) {
                return getVarIntByteLength(val);
            },
            buffer: function(val) {
                var len = val.length;
                return getVarUIntByteLength(len) + len;
            }
        };
        function getVarUIntByteLength(val) {
            if (val <= 0) {
                return 1;
            }
            return Math.floor(Math.log(val) / Math.log(128)) + 1;
        }
        function getVarIntByteLength(value) {
            return getVarUIntByteLength(value << 1 ^ value >> 31);
        }
        var allocUnsafe = Buffer.allocUnsafe ? function(n) {
            return Buffer.allocUnsafe(n);
        } : function(n) {
            return new Buffer(n);
        };
        var bufferFrom = Buffer.from ? function(buf) {
            return Buffer.from(buf);
        } : function(buf) {
            return new Buffer(buf);
        };
        var bag = {};
        bag.allocUnsafe = allocUnsafe;
        bag.getVarUIntByteLength = getVarUIntByteLength;
        bag.dynamicByteCounts = dynamicByteCounts;
        bag.readVarUInt = readVarUInt;
        bag.readVarInt = readVarInt;
        bag.writeVarUInt = writeVarUInt;
        bag.writeVarInt = writeVarInt;
        bag.readString = readString;
        bag.writeString = writeString;
        bag.readBuffer = readBuffer;
        bag.writeBuffer = writeBuffer;
        bag.throwTypeError = throwTypeError;
        bag.byteOffset = 0;
        function processArrayEnd(val, id, commands, stackLen, arrLenStr) {
            var repID = stackLen <= 1 ? id : id + "xn";
            var outerBound = arrLenStr === undefined ? "ref" + repID + ".length" : arrLenStr;
            var jStr = "j" + id;
            return "for (var " + jStr + "=" + (val.length - 1) + ";" + jStr + "<" + outerBound + ";" + jStr + "++) { " + commands + "}";
        }
        function getArrayLengthByteCount(id) {
            return "byteC+=bag.getVarUIntByteLength(ref" + id + ".length);";
        }
        function encodeArrayLength(id) {
            return "bag.writeVarUInt(ref" + id + ".length,wBuffer);";
        }
        function decodeArrayLength(arrLenStr) {
            return "var " + arrLenStr + "=bag.readVarUInt(buffer);";
        }
        function declareDecodeRef(id, parentID, prop, container) {
            return "var ref" + id + "=" + container + "; ref" + parentID + "[" + prop + "]=ref" + id + ";";
        }
        function declareEncodeRef(id, parentID, prop) {
            return "var ref" + id + "=ref" + parentID + "[" + prop + "];";
        }
        function declareRepeatRefs(repItem, id, parentID, prop, container, repEncArrStack, repDecArrStack, repByteCountStack) {
            var repID = getXN(repEncArrStack, id);
            var parentIDXN = getXN(repEncArrStack, parentID);
            var index = repItem ? "j" + parentID : prop;
            repEncArrStack[repEncArrStack.length - 1] += declareEncodeRef(id + "xn", parentIDXN, index);
            repDecArrStack[repDecArrStack.length - 1] += declareDecodeRef(id + "xn", parentIDXN, index, container);
            repByteCountStack[repByteCountStack.length - 1] += declareEncodeRef(id + "xn", parentIDXN, index);
        }
        function throwTypeError(valStr, typeStr, min, max, schemaType) {
            if (typeof valStr !== typeStr) {
                throw new TypeError(valStr + " does not match the type of " + typeStr);
            } else if (min !== undefined && valStr < min) {
                throw new TypeError(valStr + " is less than minimum allowed value of " + min + " for schema type " + schemaType);
            } else if (max !== undefined && valStr > max) {
                throw new TypeError(valStr + " is greater than maximum allowed value of " + max + " for schema type " + schemaType);
            }
        }
        function getCheckBufferStr(valStr) {
            var throwMessage = "bag.throwTypeError(" + valStr + ",'Buffer or Uint8Array');";
            return "if (" + valStr + " instanceof Uint8Array === false && " + valStr + " instanceof Buffer === false){" + throwMessage + "}";
        }
        function getCheckDataTypeStr(valStr, typeStr) {
            var throwMessage = "bag.throwTypeError(" + valStr + ",'" + typeStr + "');";
            return "if (typeof(" + valStr + ") !== '" + typeStr + "'){" + throwMessage + "}";
        }
        function getBoundsCheckStr(valStr, min, max, schemaType) {
            var throwMessage = "bag.throwTypeError(" + valStr + ",'number'," + min + "," + max + ",'" + schemaType + "');";
            return "if (typeof(" + valStr + ") !== 'number'||" + valStr + "<" + min + "||" + valStr + ">" + max + "){" + throwMessage + "}";
        }
        function validateDataType(dataType, valStr) {
            var maxFloat = 34028234663852886e22;
            switch (dataType) {
              case "boolean":
                return getCheckDataTypeStr(valStr, "boolean");

              case "int8":
                return getBoundsCheckStr(valStr, -128, 127, "int8");

              case "uint8":
                return getBoundsCheckStr(valStr, 0, 255, "uint8");

              case "int16":
                return getBoundsCheckStr(valStr, -32768, 32767, "int16");

              case "uint16":
                return getBoundsCheckStr(valStr, 0, 65535, "uint16");

              case "int32":
                return getBoundsCheckStr(valStr, -2147483648, 2147483647, "int32");

              case "uint32":
                return getBoundsCheckStr(valStr, 0, 4294967295, "uint32");

              case "float32":
                return getBoundsCheckStr(valStr, -maxFloat, maxFloat, "float32");

              case "float64":
                return getBoundsCheckStr(valStr, -Number.MAX_VALUE, Number.MAX_VALUE, "float64");

              case "string":
                return getCheckDataTypeStr(valStr, "string");

              case "varuint":
                return getBoundsCheckStr(valStr, 0, 2147483647, "varuint");

              case "varint":
                return getBoundsCheckStr(valStr, -1073741824, 1073741823, "varint");

              case "buffer":
                return getCheckBufferStr(valStr);
            }
        }
        function encodeValue(dataType, id, prop, validate) {
            var varName = "ref" + id + prop;
            return (validate ? validateDataType(dataType, varName) : "") + getWriteTypeDictStr(dataType, varName);
        }
        function decodeValue(dataType, id, prop) {
            return "ref" + id + prop + "=" + readTypeDictStr[dataType];
        }
        function encodeByteCount(dataType, id, prop) {
            var isConstant = constantByteCounts.hasOwnProperty(dataType);
            if (isConstant) {
                return "byteC+=" + constantByteCounts[dataType] + ";";
            } else {
                return "byteC+=bag.dynamicByteCounts['" + dataType + "'](ref" + id + prop + ");";
            }
        }
        function getXN(aStack, id) {
            return aStack.length <= 2 && aStack[aStack.length - 1].length <= 0 ? id : id + "xn";
        }
        function getCompiledSchema(schema, validate) {
            var strEncodeFunction = "bag.byteOffset=0;";
            var strDecodeFunction = "var ref1={}; bag.byteOffset=0;";
            var strByteCount = "";
            var strEncodeRefDecs = "var ref1=json;";
            var incID = 0;
            var repEncArrStack = [ "" ];
            var repDecArrStack = [ "" ];
            var repByteCountStack = [ "" ];
            var tmpRepEncArr = "";
            var tmpRepDecArr = "";
            var tmpRepByteCount = "";
            schema = {
                a: schema
            };
            function compileSchema(json, inArray) {
                incID++;
                var keys = Object.keys(json);
                keys.sort((function(a, b) {
                    return a < b ? -1 : a > b ? 1 : 0;
                }));
                var saveID = incID;
                for (var i = 0; i < keys.length; i++) {
                    var key = keys[i];
                    var val = json[key];
                    if (inArray) {
                        key = +key;
                    }
                    var prop = typeof key === "number" ? key : "'" + key + "'";
                    var container = val.constructor === Array ? "[]" : "{}";
                    var isRepArrItem = inArray && i >= keys.length - 1;
                    if (isRepArrItem) {
                        repEncArrStack.push("");
                        repDecArrStack.push("");
                        repByteCountStack.push("");
                    }
                    if (val.constructor === Array) {
                        var newID = incID + 1;
                        var repID = repEncArrStack.length <= 1 ? newID : newID + "xn";
                        var arrLenStr = "arrLen" + incID;
                        if (repEncArrStack.length === 1) {
                            strEncodeRefDecs += declareEncodeRef(newID, saveID, prop);
                            strDecodeFunction += declareDecodeRef(newID, saveID, prop, "[]");
                        }
                        var encArrayLength = encodeArrayLength(repID);
                        var decArrayLength = decodeArrayLength(arrLenStr);
                        var byteArrayLength = getArrayLengthByteCount(repID);
                        declareRepeatRefs(isRepArrItem, newID, saveID, prop, container, repEncArrStack, repDecArrStack, repByteCountStack);
                        compileSchema(val, true);
                        tmpRepEncArr = encArrayLength + processArrayEnd(val, newID, repEncArrStack.pop() + tmpRepEncArr, repEncArrStack.length);
                        tmpRepDecArr = decArrayLength + processArrayEnd(val, newID, repDecArrStack.pop() + tmpRepDecArr, repEncArrStack.length, arrLenStr);
                        tmpRepByteCount = byteArrayLength + processArrayEnd(val, newID, repByteCountStack.pop() + tmpRepByteCount, repEncArrStack.length);
                        if (repEncArrStack.length === 1) {
                            strEncodeFunction += tmpRepEncArr;
                            tmpRepEncArr = "";
                            strDecodeFunction += tmpRepDecArr;
                            tmpRepDecArr = "";
                            strByteCount += tmpRepByteCount;
                            tmpRepByteCount = "";
                        }
                    } else if (typeof val === "object") {
                        var newID = incID + 1;
                        if (repEncArrStack.length === 1) {
                            strEncodeRefDecs += declareEncodeRef(newID, saveID, prop);
                            strDecodeFunction += declareDecodeRef(newID, saveID, prop, "{}");
                        }
                        declareRepeatRefs(isRepArrItem, newID, saveID, prop, container, repEncArrStack, repDecArrStack, repByteCountStack);
                        compileSchema(val, false);
                    } else {
                        var index = inArray ? "" : "[" + prop + "]";
                        var dataType = getDataType(val);
                        json[key] = dataType;
                        var repID = getXN(repEncArrStack, saveID);
                        if (inArray) {
                            repID += isRepArrItem ? "[j" + saveID + "]" : "[" + i + "]";
                        }
                        repEncArrStack[repEncArrStack.length - 1] += encodeValue(dataType, repID, index, validate);
                        repDecArrStack[repDecArrStack.length - 1] += decodeValue(dataType, repID, index);
                        repByteCountStack[repByteCountStack.length - 1] += encodeByteCount(dataType, repID, index);
                        if (repEncArrStack.length > 1) {
                            continue;
                        }
                        var uniqID = inArray ? saveID + "[" + i + "]" : saveID;
                        strEncodeFunction += encodeValue(dataType, uniqID, index, validate);
                        strDecodeFunction += decodeValue(dataType, uniqID, index);
                        strByteCount += encodeByteCount(dataType, uniqID, index);
                    }
                }
            }
            compileSchema(schema, false);
            strByteCount = "var byteC=0;".concat(strByteCount, "var wBuffer=bag.allocUnsafe(byteC);");
            strEncodeFunction = strEncodeRefDecs.concat(strByteCount, strEncodeFunction, "return wBuffer;");
            strDecodeFunction = strDecodeFunction.concat("return ref1['a'];");
            var compiledEncode = new Function("json", "bag", strEncodeFunction);
            var compiledDecode = new Function("buffer", "bag", strDecodeFunction);
            return [ compiledEncode, compiledDecode ];
        }
        function build(schema, validate) {
            var builtSchema = getCompiledSchema(schema, validate === undefined ? validateByDefault : validate);
            var compiledEncode = builtSchema[0];
            var compiledDecode = builtSchema[1];
            return {
                encode: function(json) {
                    var itemWrapper = {
                        a: json
                    };
                    return compiledEncode(itemWrapper, bag);
                },
                decode: function(buffer) {
                    var bufferWrapper = Buffer.isBuffer(buffer) ? buffer : bufferFrom(buffer);
                    return compiledDecode(bufferWrapper, bag);
                }
            };
        }
        addTypeAlias("bool", "boolean");
        module.exports = exports = {
            build,
            addTypeAlias,
            setStringEncoding,
            setValidateByDefault
        };
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.BOOTP = void 0;
        const util_1 = __webpack_require__(122);
        const bp = __webpack_require__(123);
        const Parser = bp.Parser;
        const sp = __webpack_require__(127);
        const bootp1 = sp.build([ {
            opcode: "uint8"
        }, {
            hw: "uint8"
        }, {
            hw_length: "uint8"
        }, {
            hopcount: "uint8"
        }, {
            xid: "uint32"
        }, {
            secs: "uint16"
        }, {
            flags: "uint16"
        }, {
            ciaddr: {
                0: "uint8",
                1: "uint8",
                2: "uint8",
                3: "uint8"
            }
        }, {
            pad: "string"
        } ]);
        const bootp2 = sp.build([ {
            yiaddr: {
                0: "uint8",
                1: "uint8",
                2: "uint8",
                3: "uint8"
            }
        }, {
            server_ip: {
                0: "uint8",
                1: "uint8",
                2: "uint8",
                3: "uint8"
            }
        }, {
            bootp_gw_ip: {
                0: "uint8",
                1: "uint8",
                2: "uint8",
                3: "uint8"
            }
        }, {
            hwaddr: {
                0: "uint8",
                1: "uint8",
                2: "uint8",
                3: "uint8",
                4: "uint8",
                5: "uint8"
            }
        }, {
            pad: "string"
        } ]);
        const bootpServername = sp.build([ {
            servername: {
                0: "uint8",
                1: "uint8",
                2: "uint8",
                3: "uint8",
                4: "uint8",
                5: "uint8",
                6: "uint8",
                7: "uint8",
                8: "uint8",
                9: "uint8"
            }
        }, {
            pad: "string"
        } ]);
        const bootpBootfile = sp.build([ {
            bootfile1: {
                0: "uint8",
                1: "uint8",
                2: "uint8",
                3: "uint8",
                4: "uint8",
                5: "uint8",
                6: "uint8",
                7: "uint8",
                8: "uint8"
            }
        }, {
            bootfile2: {
                0: "uint8",
                1: "uint8",
                2: "uint8",
                3: "uint8",
                4: "uint8",
                5: "uint8",
                6: "uint8",
                7: "uint8",
                8: "uint8"
            }
        }, {
            bootfile3: {
                0: "uint8",
                1: "uint8",
                2: "uint8",
                3: "uint8",
                4: "uint8",
                5: "uint8",
                6: "uint8",
                7: "uint8",
                8: "uint8"
            }
        }, {
            bootfile4: {
                0: "uint8",
                1: "uint8",
                2: "uint8",
                3: "uint8",
                4: "uint8",
                5: "uint8",
                6: "uint8",
                7: "uint8",
                8: "uint8"
            }
        }, {
            bootfile5: {
                0: "uint8",
                1: "uint8",
                2: "uint8",
                3: "uint8",
                4: "uint8",
                5: "uint8",
                6: "uint8",
                7: "uint8",
                8: "uint8"
            }
        }, {
            bootfile6: {
                0: "uint8",
                1: "uint8",
                2: "uint8",
                3: "uint8",
                4: "uint8",
                5: "uint8",
                6: "uint8",
                7: "uint8",
                8: "uint8"
            }
        }, {
            bootfile7: {
                0: "uint8",
                1: "uint8",
                2: "uint8",
                3: "uint8",
                4: "uint8",
                5: "uint8",
                6: "uint8",
                7: "uint8",
                8: "uint8"
            }
        }, {
            bootfile8: {
                0: "uint8",
                1: "uint8",
                2: "uint8",
                3: "uint8",
                4: "uint8",
                5: "uint8",
                6: "uint8",
                7: "uint8",
                8: "uint8"
            }
        }, {
            pad: "string"
        } ]);
        const bootpVendor1 = sp.build([ {
            vendor1: {
                0: "uint8",
                1: "uint8",
                2: "uint8",
                3: "uint8",
                4: "uint8",
                5: "uint8",
                6: "uint8",
                7: "uint8",
                8: "uint8"
            }
        }, {
            pad: "string"
        } ]);
        const bootpVendor2 = sp.build([ {
            vendor2: {
                0: "uint8",
                1: "uint8",
                2: "uint8",
                3: "uint8",
                4: "uint8",
                5: "uint8",
                6: "uint8",
                7: "uint8",
                8: "uint8"
            }
        }, {
            pad: "string"
        } ]);
        const bootpVendor3 = sp.build([ {
            vendor3: {
                0: "uint8",
                1: "uint8",
                2: "uint8",
                3: "uint8",
                4: "uint8",
                5: "uint8",
                6: "uint8",
                7: "uint8",
                8: "uint8"
            }
        }, {
            pad: "string"
        } ]);
        const bootpVendor4 = sp.build([ {
            vendor4: {
                0: "uint8",
                1: "uint8",
                2: "uint8",
                3: "uint8",
                4: "uint8"
            }
        }, {
            pad: "string"
        } ]);
        class BOOTP {
            parseBOOTP(buff) {
                const bootp = (new Parser).uint8("opcode").uint8("hw").uint8("hwlength").uint8("hopcount").uint32be("xid").uint16be("secs").uint16be("flags").array("ciaddr", {
                    length: 4,
                    type: "uint8"
                }).array("yiaddr", {
                    length: 4,
                    type: "uint8"
                }).array("server_ip", {
                    length: 4,
                    type: "uint8"
                }).array("bootp_gw_ip", {
                    length: 4,
                    type: "uint8"
                }).array("hwaddr", {
                    length: 16,
                    type: "uint8"
                }).array("servername", {
                    length: 64,
                    type: "uint8"
                }).array("bootfile", {
                    length: 128,
                    type: "uint8"
                }).array("vendor", {
                    length: 64,
                    type: "uint8"
                });
                return bootp.parse(buff);
            }
            makeBOOTP(server_name, file_name, xid_, hw_dest, BB_ip, serverIP) {
                const bootp_1 = [ {
                    opcode: 2
                }, {
                    hw: 1
                }, {
                    hw_length: 6
                }, {
                    hopcount: 0
                }, {
                    xid: xid_
                }, {
                    secs: 0
                }, {
                    flags: 0
                }, {
                    ciaddr: [ 0, 0, 0, 0 ]
                } ];
                const bootp_2 = [ {
                    yiaddr: BB_ip
                }, {
                    server_ip: serverIP
                }, {
                    bootp_gw_ip: serverIP
                }, {
                    hwaddr: hw_dest
                } ];
                const servername = [ {
                    servername: server_name
                } ];
                const filename = util_1.stringToAscii(file_name);
                const bootfile = [ {
                    bootfile1: filename.slice(0, 9)
                }, {
                    bootfile2: filename.slice(9, 18)
                }, {
                    bootfile3: filename.slice(18, 27)
                }, {
                    bootfile4: filename.slice(27, 36)
                }, {
                    bootfile5: filename.slice(36, 45)
                }, {
                    bootfile6: filename.slice(45, 54)
                }, {
                    bootfile7: filename.slice(54, 63)
                }, {
                    bootfile8: filename.slice(63, 72)
                } ];
                const vendor1 = [ {
                    vendor1: [ 99, 130, 83, 99, 53, 1, 5, 1, 4 ]
                } ];
                const vendor2 = [ {
                    vendor2: [ 225, 255, 255, 0, 3, 4, 192, 168, 1 ]
                } ];
                const vendor3 = [ {
                    vendor3: [ 9, 51, 4, 255, 255, 255, 255, 54, 4 ]
                } ];
                const vendor4 = [ {
                    vendor4: [ 192, 168, 1, 9, 255 ]
                } ];
                const buf1 = util_1.fixBuff(bootp1.encode(bootp_1));
                const buf2 = util_1.fixBuff(bootp2.encode(bootp_2));
                const buf2_ = Buffer.alloc(10);
                const buf3 = util_1.fixBuff(bootpServername.encode(servername));
                const buf3_ = Buffer.alloc(54);
                const buf4 = util_1.fixBuff(bootpBootfile.encode(bootfile));
                const buf4_ = Buffer.alloc(56);
                const buf5 = util_1.fixBuff(bootpVendor1.encode(vendor1));
                const buf5a = util_1.fixBuff(bootpVendor2.encode(vendor2));
                const buf5b = util_1.fixBuff(bootpVendor3.encode(vendor3));
                const buf5c = util_1.fixBuff(bootpVendor4.encode(vendor4));
                const buf5d = Buffer.alloc(32);
                return Buffer.concat([ buf1, buf2, buf2_, buf3, buf3_, buf4, buf4_, buf5, buf5a, buf5b, buf5c, buf5d ], 300);
            }
        }
        exports.BOOTP = BOOTP;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.Eth = void 0;
        const util_1 = __webpack_require__(122);
        const bp = __webpack_require__(123);
        const sp = __webpack_require__(127);
        const Parser = bp.Parser;
        const ethhdr_e = sp.build([ {
            h_dest: {
                0: "uint8",
                1: "uint8",
                2: "uint8",
                3: "uint8",
                4: "uint8",
                5: "uint8"
            }
        }, {
            h_source: {
                0: "uint8",
                1: "uint8",
                2: "uint8",
                3: "uint8",
                4: "uint8",
                5: "uint8"
            }
        }, {
            h_proto: "uint16"
        }, {
            pad: "string"
        } ]);
        class Eth {
            parseEthHdr(buff) {
                const ethhdr = (new Parser).array("h_dest", {
                    type: "uint8",
                    length: 6
                }).array("h_source", {
                    type: "uint8",
                    length: 6
                }).uint16be("h_proto");
                return ethhdr.parse(buff);
            }
            makeEther2(dest, source, proto) {
                const eth = [ {
                    h_dest: dest
                }, {
                    h_source: source
                }, {
                    h_proto: proto
                } ];
                const data = util_1.fixBuff(ethhdr_e.encode(eth));
                return data;
            }
        }
        exports.Eth = Eth;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.IP = void 0;
        const util_1 = __webpack_require__(122);
        const sp = __webpack_require__(127);
        const bp = __webpack_require__(123);
        const Parser = bp.Parser;
        const iphdr1 = sp.build([ {
            ver_hl: "uint8"
        }, {
            tos: "uint8"
        }, {
            tot_len: "uint16"
        }, {
            id: "uint16"
        }, {
            frag_off: "uint16"
        }, {
            ttl: "uint8"
        }, {
            protocol: "uint8"
        }, {
            check: "uint16"
        }, {
            pad: "string"
        } ]);
        const iphdr2 = sp.build([ {
            saddr: {
                0: "uint8",
                1: "uint8",
                2: "uint8",
                3: "uint8"
            }
        }, {
            daddr: {
                0: "uint8",
                1: "uint8",
                2: "uint8",
                3: "uint8"
            }
        }, {
            pad: "string"
        } ]);
        class IP {
            parseIpv4(buff) {
                const ipv4Hdr = (new Parser).endianess("big").bit4("Version").bit4("IHL").uint8("TypeOfService").uint16("TotalLength").uint16("Identification").bit3("Flags").bit13("FragmentOffset").uint8("TimeToLIve").uint8("Protocol").uint16("HeaderChecksum").array("SourceAddress", {
                    length: 4,
                    type: "uint8"
                }).array("DestinationAddress", {
                    length: 4,
                    type: "uint8"
                });
                return ipv4Hdr.parse(buff);
            }
            parseIpv6(buff) {
                const ipv6Hdr = (new Parser).endianess("big").array("VTF", {
                    length: 4,
                    type: "uint8"
                }).uint16("PayloadLength").uint8("NextHeader").uint8("HopLimit").array("SourceAddress", {
                    length: 16,
                    type: "uint8"
                }).array("DestinationAddress", {
                    length: 16,
                    type: "uint8"
                });
                return ipv6Hdr.parse(buff);
            }
            parseIpv6Option(buff) {
                const ipv6Option = (new Parser).endianess("big").uint8("NextHeader").uint8("Length").string("Data", {
                    encoding: "hex",
                    length: "Length"
                });
                return ipv6Option.parse(buff);
            }
            makeIPV4(src_addr, dst_addr, proto, id_, total_len, chksum) {
                const ip1 = [ {
                    ver_hl: 69
                }, {
                    tos: 0
                }, {
                    tot_len: total_len
                }, {
                    id: id_
                }, {
                    frag_off: 0
                }, {
                    ttl: 64
                }, {
                    protocol: proto
                }, {
                    check: chksum
                } ];
                const ip2 = [ {
                    saddr: src_addr
                }, {
                    daddr: dst_addr
                } ];
                const buf1 = util_1.fixBuff(iphdr1.encode(ip1));
                const buf2 = util_1.fixBuff(iphdr2.encode(ip2));
                let data = Buffer.concat([ buf1, buf2 ], 20);
                if (!chksum) {
                    const ip = (new Parser).array("data", {
                        length: 10,
                        type: "uint16be"
                    });
                    const ip_packet = ip.parse(data);
                    let i = 0;
                    let sum = 0;
                    while (i < 10) {
                        sum += ip_packet.data[i++];
                        var a = sum.toString(16);
                        if (a.length > 4) {
                            sum = parseInt(a[1] + a[2] + a[3] + a[4], 16) + 1;
                        }
                    }
                    a = (~sum >>> 0).toString(16);
                    sum = parseInt(a[4] + a[5] + a[6] + a[7], 16);
                    data = this.makeIPV4(src_addr, dst_addr, proto, id_, total_len, sum);
                }
                return data;
            }
        }
        exports.IP = IP;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.RNDIS = void 0;
        const util_1 = __webpack_require__(122);
        const sp = __webpack_require__(127);
        const toggle = __webpack_require__(132);
        const rndis_1 = sp.build([ {
            msg_type: "uint32"
        }, {
            msg_len: "uint32"
        }, {
            data_offset: "uint32"
        }, {
            data_len: "uint32"
        }, {
            band_offset: "uint32"
        }, {
            pad: "string"
        } ]);
        const rndis_2 = sp.build([ {
            band_len: "uint32"
        }, {
            out_band_elements: "uint32"
        }, {
            packet_offset: "uint32"
        }, {
            packet_info_len: "uint32"
        }, {
            reserved_first: "uint32"
        }, {
            reserved_second: "uint32"
        }, {
            pad: "string"
        } ]);
        const rndis_init_hdr = sp.build([ {
            msg_type: "uint32"
        }, {
            msg_len: "uint32"
        }, {
            request_id: "uint32"
        }, {
            major_version: "uint32"
        }, {
            minor_version: "uint32"
        }, {
            max_transfer_size: "uint32"
        }, {
            pad: "string"
        } ]);
        const rndis_set_hdr = sp.build([ {
            msg_type: "uint32"
        }, {
            msg_len: "uint32"
        }, {
            request_id: "uint32"
        }, {
            oid: "uint32"
        }, {
            len: "uint32"
        }, {
            offset: "uint32"
        }, {
            reserved: "uint32"
        }, {
            pad: "string"
        } ]);
        const oid = sp.build([ {
            oid_param: "uint32"
        }, {
            pad: "string"
        } ]);
        class RNDIS {
            makeRNDIS(dataLength) {
                const rndis1 = [ {
                    msg_type: 1
                }, {
                    msg_len: dataLength + 44
                }, {
                    data_offset: 36
                }, {
                    data_len: dataLength
                }, {
                    band_offset: 0
                } ];
                const rndis2 = [ {
                    band_len: 0
                }, {
                    out_band_elements: 0
                }, {
                    packet_offset: 0
                }, {
                    packet_info_len: 0
                }, {
                    reserved_first: 0
                }, {
                    reserved_second: 0
                } ];
                const buf1 = util_1.fixBuff(rndis_1.encode(rndis1));
                const buf2 = util_1.fixBuff(rndis_2.encode(rndis2));
                const data = Buffer.concat([ buf1, buf2 ], 44);
                return toggle(data, 32);
            }
            makeRNDISInit() {
                const rndis_init = [ {
                    msg_type: 2
                }, {
                    msg_len: 24
                }, {
                    request_id: 1
                }, {
                    major_version: 1
                }, {
                    minor_version: 1
                }, {
                    max_transfer_size: 64
                } ];
                const data = util_1.fixBuff(rndis_init_hdr.encode(rndis_init));
                return toggle(data, 32);
            }
            makeRNDISSet() {
                const rndis_set = [ {
                    msg_type: 5
                }, {
                    msg_len: 28
                }, {
                    request_id: 23
                }, {
                    oid: 65806
                }, {
                    len: 4
                }, {
                    offset: 20
                }, {
                    reserved: 0
                } ];
                const oid_ = [ {
                    oid_param: 1 | 8 | 4 | 32
                } ];
                const set_buf = util_1.fixBuff(rndis_set_hdr.encode(rndis_set));
                const oid_p = util_1.fixBuff(oid.encode(oid_));
                const data = Buffer.concat([ set_buf, oid_p ], 32);
                return toggle(data, 32);
            }
        }
        exports.RNDIS = RNDIS;
    }, module => {
        module.exports = function(buf, bits) {
            var output = new Buffer(buf.length);
            if (bits % 8 !== 0) {
                throw new Error("bits must be a multiple of 8");
            }
            var bytes = bits / 8;
            if (buf.length % bytes !== 0) {
                throw new Error(buf.length % bytes + " non-aligned trailing bytes");
            }
            for (var i = 0; i < buf.length; i += bytes) {
                for (var j = 0; j < bytes; j++) {
                    output[i + bytes - j - 1] = buf[i + j];
                }
            }
            return output;
        };
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.TFTP = void 0;
        const util_1 = __webpack_require__(122);
        const sp = __webpack_require__(127);
        const tftp = sp.build([ {
            opcode: "uint16"
        }, {
            blk_number: "uint16"
        }, {
            pad: "string"
        } ]);
        const tftp_error = sp.build([ {
            opcode: "uint16"
        }, {
            err_code: "uint16"
        }, {
            err_mesg: "string"
        }, {
            pad: "string"
        } ]);
        class TFTP {
            makeTFTP(opcode, blk_number) {
                const tftp_data = [ {
                    opcode
                }, {
                    blk_number
                } ];
                return util_1.fixBuff(tftp.encode(tftp_data));
            }
            makeTFTPError(opcode, err_code, desc) {
                const my_tftp_error = [ {
                    opcode
                }, {
                    err_code
                }, {
                    err_msg: desc
                } ];
                return util_1.fixBuff(tftp_error.encode(my_tftp_error));
            }
        }
        exports.TFTP = TFTP;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.UDP = void 0;
        const util_1 = __webpack_require__(122);
        const bp = __webpack_require__(123);
        const sp = __webpack_require__(127);
        const Parser = bp.Parser;
        const udp_e = sp.build([ {
            udpSrc: "uint16"
        }, {
            udpDst: "uint16"
        }, {
            udpLen: "uint16"
        }, {
            chkSum: "uint16"
        }, {
            pad: "string"
        } ]);
        class UDP {
            parseUdp(buff) {
                const udp = (new Parser).uint16be("udpSrc").uint16be("udpDest").uint16be("udpLen").uint16be("chkSum");
                return udp.parse(buff);
            }
            makeUDP(udpDataLen, srcPort, dstPort) {
                const udp = [ {
                    udpSrc: srcPort
                }, {
                    udpDst: dstPort
                }, {
                    udpLen: udpDataLen + 8
                }, {
                    chkSum: 0
                } ];
                return util_1.fixBuff(udp_e.encode(udp));
            }
        }
        exports.UDP = UDP;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.UsbBBbootDrive = void 0;
        const source_destination_1 = __webpack_require__(25);
        class UsbBBbootDrive extends source_destination_1.SourceDestination {
            constructor(usbDevice) {
                super();
                this.usbDevice = usbDevice;
                this.raw = null;
                this.displayName = "Initializing device";
                this.device = null;
                this.devicePath = null;
                this.icon = "loading";
                this.isSystem = false;
                this.description = "BeagleBone";
                this.mountpoints = [];
                this.isReadOnly = false;
                this.disabled = true;
                this.size = null;
                this.emitsProgress = true;
                this.progress = 0;
                usbDevice.on("progress", (value => {
                    this.progress = value;
                    this.emit("progress", value);
                }));
            }
        }
        exports.UsbBBbootDrive = UsbBBbootDrive;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.UsbbootDeviceAdapter = void 0;
        const lazy_1 = __webpack_require__(57);
        const usbboot_1 = __webpack_require__(137);
        const adapter_1 = __webpack_require__(109);
        class UsbbootDeviceAdapter extends adapter_1.Adapter {
            constructor() {
                super();
                this.drives = new Map;
                const rpiUsbboot = (0, lazy_1.getRaspberrypiUsbboot)();
                if (rpiUsbboot !== undefined) {
                    this.scanner = new rpiUsbboot.UsbbootScanner;
                    this.scanner.on("attach", this.onAttach.bind(this));
                    this.scanner.on("detach", this.onDetach.bind(this));
                    this.scanner.on("ready", this.emit.bind(this, "ready"));
                    this.scanner.on("error", this.emit.bind(this, "error"));
                } else {
                    console.warn("node-raspberrypi-usbboot not available");
                    setImmediate(this.emit.bind(this, "ready"));
                }
            }
            start() {
                var _a, _b;
                (_b = (_a = this.scanner) === null || _a === void 0 ? void 0 : _a.start) === null || _b === void 0 ? void 0 : _b.call(_a);
            }
            stop() {
                var _a, _b;
                (_b = (_a = this.scanner) === null || _a === void 0 ? void 0 : _a.stop) === null || _b === void 0 ? void 0 : _b.call(_a);
            }
            onAttach(device) {
                let drive = this.drives.get(device);
                if (drive === undefined) {
                    drive = new usbboot_1.UsbbootDrive(device);
                    this.drives.set(device, drive);
                }
                this.emit("attach", drive);
            }
            onDetach(device) {
                const drive = this.drives.get(device);
                this.drives.delete(device);
                this.emit("detach", drive);
            }
        }
        exports.UsbbootDeviceAdapter = UsbbootDeviceAdapter;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.UsbbootDrive = void 0;
        const source_destination_1 = __webpack_require__(25);
        class UsbbootDrive extends source_destination_1.SourceDestination {
            constructor(usbDevice) {
                super();
                this.usbDevice = usbDevice;
                this.raw = null;
                this.displayName = "Initializing device";
                this.device = null;
                this.devicePath = null;
                this.icon = "loading";
                this.isSystem = false;
                this.description = "Compute Module";
                this.mountpoints = [];
                this.isReadOnly = false;
                this.disabled = true;
                this.size = null;
                this.emitsProgress = true;
                this.progress = 0;
                usbDevice.on("progress", (value => {
                    this.progress = value;
                    this.emit("progress", value);
                }));
            }
        }
        exports.UsbbootDrive = UsbbootDrive;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.DriverlessDeviceAdapter = void 0;
        const process_1 = __webpack_require__(5);
        const lazy_1 = __webpack_require__(57);
        const driverless_1 = __webpack_require__(139);
        const utils_1 = __webpack_require__(6);
        const adapter_1 = __webpack_require__(109);
        const SCAN_INTERVAL = 1e3;
        class DriverlessDeviceAdapter$ extends adapter_1.Adapter {
            constructor() {
                super(...arguments);
                this.drives = new Map;
                this.running = false;
                this.ready = false;
            }
            start() {
                this.running = true;
                this.scanLoop();
            }
            stop() {
                this.running = false;
                this.ready = false;
                this.drives.clear();
            }
            async scanLoop() {
                if (this.listDriverlessDevices === undefined) {
                    this.listDriverlessDevices = (await Promise.resolve().then((() => __webpack_require__(140)))).listDriverlessDevices;
                }
                while (this.running) {
                    this.scan();
                    if (!this.ready) {
                        this.ready = true;
                        this.emit("ready");
                    }
                    await (0, utils_1.delay)(SCAN_INTERVAL);
                }
            }
            scan() {
                let drives;
                try {
                    drives = this.listDrives();
                } catch (error) {
                    return;
                }
                if (this.running) {
                    const oldDevices = new Set(this.drives.keys());
                    const newDevices = new Set(drives.keys());
                    for (const removed of (0, utils_1.difference)(oldDevices, newDevices)) {
                        this.emit("detach", this.drives.get(removed));
                        this.drives.delete(removed);
                    }
                    for (const added of (0, utils_1.difference)(newDevices, oldDevices)) {
                        const drive = drives.get(added);
                        const driverlessDevice = new driverless_1.DriverlessDevice(drive);
                        this.emit("attach", driverlessDevice);
                        this.drives.set(added, driverlessDevice);
                    }
                }
            }
            listDrives() {
                var _a;
                const isUsbBootCapableUSBDevice = (_a = (0, lazy_1.getRaspberrypiUsbboot)()) === null || _a === void 0 ? void 0 : _a.isUsbBootCapableUSBDevice;
                const result = new Map;
                if (isUsbBootCapableUSBDevice == null) {
                    return result;
                }
                const devices = this.listDriverlessDevices();
                for (const device of devices) {
                    if (isUsbBootCapableUSBDevice(device.vid, device.pid)) {
                        result.set(device.did, device);
                    }
                }
                return result;
            }
        }
        exports.DriverlessDeviceAdapter = process_1.platform === "win32" ? DriverlessDeviceAdapter$ : undefined;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.DriverlessDevice = void 0;
        const source_destination_1 = __webpack_require__(25);
        class DriverlessDevice extends source_destination_1.SourceDestination {
            constructor(driverlessDevice) {
                super();
                this.accessible = false;
                this.raw = null;
                this.device = null;
                this.devicePath = null;
                this.isSystem = false;
                this.mountpoints = [];
                this.size = null;
                this.emitsProgress = false;
                this.description = "";
                this.deviceDescriptor = {
                    idVendor: driverlessDevice.vid,
                    idProduct: driverlessDevice.pid
                };
            }
        }
        exports.DriverlessDevice = DriverlessDevice;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        module.exports = __webpack_require__(141);
        module.exports.hasDriver = (vendorId, productId) => {
            for (const device of module.exports.listDriverlessDevices()) {
                if (device.vid === vendorId && device.pid === productId) {
                    return false;
                }
            }
            return true;
        };
    }, module => {
        module.exports = require("./modules/winusb-driver-generator/build/Release/Generator.node");
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.Scanner = void 0;
        const debug_ = __webpack_require__(90);
        const events_1 = __webpack_require__(26);
        const debug = debug_("etcher-sdk:scanner");
        class Scanner extends events_1.EventEmitter {
            constructor(adapters) {
                super();
                this.adapters = adapters;
                this.drives = new Set;
                this.adapters.forEach((adapter => {
                    adapter.on("attach", this.onAttach.bind(this));
                    adapter.on("detach", this.onDetach.bind(this));
                    adapter.on("error", this.emit.bind(this, "error"));
                }));
            }
            onAttach(drive) {
                this.drives.add(drive);
                this.emit("attach", drive);
            }
            onDetach(drive) {
                this.drives.delete(drive);
                this.emit("detach", drive);
            }
            getBy(field, value) {
                for (const drive of this.drives) {
                    if (drive[field] === value) {
                        return drive;
                    }
                }
            }
            start() {
                debug("start");
                let notReady = this.adapters.length;
                return new Promise((resolve => {
                    this.adapters.forEach((adapter => {
                        adapter.on("ready", (() => {
                            notReady -= 1;
                            if (notReady === 0) {
                                this.emit("ready");
                                resolve();
                            }
                        }));
                        adapter.start();
                    }));
                }));
            }
            stop() {
                debug("stop");
                this.drives.clear();
                this.adapters.forEach((adapter => {
                    adapter.stop();
                }));
            }
        }
        exports.Scanner = Scanner;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        const tslib_1 = __webpack_require__(108);
        (0, tslib_1.__exportStar)(__webpack_require__(92), exports);
        (0, tslib_1.__exportStar)(__webpack_require__(144), exports);
        (0, tslib_1.__exportStar)(__webpack_require__(68), exports);
        (0, tslib_1.__exportStar)(__webpack_require__(21), exports);
        (0, tslib_1.__exportStar)(__webpack_require__(148), exports);
        (0, tslib_1.__exportStar)(__webpack_require__(139), exports);
        (0, tslib_1.__exportStar)(__webpack_require__(173), exports);
        (0, tslib_1.__exportStar)(__webpack_require__(100), exports);
        (0, tslib_1.__exportStar)(__webpack_require__(174), exports);
        (0, tslib_1.__exportStar)(__webpack_require__(208), exports);
        (0, tslib_1.__exportStar)(__webpack_require__(105), exports);
        (0, tslib_1.__exportStar)(__webpack_require__(18), exports);
        (0, tslib_1.__exportStar)(__webpack_require__(209), exports);
        (0, tslib_1.__exportStar)(__webpack_require__(249), exports);
        (0, tslib_1.__exportStar)(__webpack_require__(25), exports);
        (0, tslib_1.__exportStar)(__webpack_require__(24), exports);
        (0, tslib_1.__exportStar)(__webpack_require__(279), exports);
        (0, tslib_1.__exportStar)(__webpack_require__(135), exports);
        (0, tslib_1.__exportStar)(__webpack_require__(137), exports);
        (0, tslib_1.__exportStar)(__webpack_require__(280), exports);
        (0, tslib_1.__exportStar)(__webpack_require__(215), exports);
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.BZip2Source = void 0;
        const unbzip2Stream = __webpack_require__(145);
        const compressed_source_1 = __webpack_require__(21);
        const source_destination_1 = __webpack_require__(25);
        class BZip2Source extends compressed_source_1.CompressedSource {
            createTransform() {
                return unbzip2Stream();
            }
            async getSize() {
                const size = await this.getSizeFromPartitionTable();
                if (size !== undefined) {
                    return {
                        size,
                        isEstimated: true
                    };
                }
            }
        }
        exports.BZip2Source = BZip2Source;
        BZip2Source.mimetype = "application/x-bzip2";
        source_destination_1.SourceDestination.register(BZip2Source);
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var stream = __webpack_require__(17);
        var bz2 = __webpack_require__(146);
        var bitIterator = __webpack_require__(147);
        class Unbzip2Stream extends stream.Transform {
            constructor(options) {
                super(options);
                this.queue = [];
                this.hasBytes = 0;
                this.blockSize = 0;
                this.done = false;
                this.bitReader = null;
                this.streamCRC = null;
            }
            _decompressAndQueue() {
                if (this.destroyed) return false;
                try {
                    return this._decompressBlock();
                } catch (error) {
                    this.destroy(error);
                    return false;
                }
            }
            _decompressBlock() {
                if (!this.blockSize) {
                    this.blockSize = bz2.header(this.bitReader);
                    return true;
                } else {
                    var length = 1e5 * this.blockSize;
                    var buffer = new Int32Array(length);
                    var bytes = [];
                    var push = value => {
                        bytes.push(value);
                    };
                    this.streamCRC = bz2.decompress(this.bitReader, push, buffer, length, this.streamCRC);
                    if (this.streamCRC === null) {
                        this.blockSize = 0;
                        return false;
                    } else {
                        this.push(Buffer.from(bytes));
                        return true;
                    }
                }
            }
            _transform(chunk, encoding, next) {
                this.queue.push(chunk);
                this.hasBytes += chunk.length;
                if (this.bitReader == null) {
                    this.bitReader = bitIterator((() => this.queue.shift()));
                }
                while (!this.destroyed && this.hasBytes - this.bitReader.bytesRead + 1 >= (25e3 + 1e5 * this.blockSize || 4)) {
                    this._decompressAndQueue();
                }
                process.nextTick(next);
            }
            _flush(next) {
                while (!this.destroyed && this.hasBytes > this.bitReader.bytesRead) {
                    this._decompressAndQueue();
                }
                if (this.destroyed) {
                    return;
                }
                if (this.streamCRC !== null) {
                    this.destroy(new Error("input stream ended prematurely"));
                }
                this.push(null);
            }
        }
        module.exports = function unbzip2Stream(options) {
            return new Unbzip2Stream(options);
        };
        module.exports.Stream = Unbzip2Stream;
    }, module => {
        function Bzip2Error(message) {
            this.name = "Bzip2Error";
            this.message = message;
            this.stack = (new Error).stack;
        }
        Bzip2Error.prototype = new Error;
        var message = {
            Error: function(message) {
                throw new Error(message);
            }
        };
        var bzip2 = {};
        bzip2.Bzip2Error = Bzip2Error;
        bzip2.crcTable = [ 0, 79764919, 159529838, 222504665, 319059676, 398814059, 445009330, 507990021, 638119352, 583659535, 797628118, 726387553, 890018660, 835552979, 1015980042, 944750013, 1276238704, 1221641927, 1167319070, 1095957929, 1595256236, 1540665371, 1452775106, 1381403509, 1780037320, 1859660671, 1671105958, 1733955601, 2031960084, 2111593891, 1889500026, 1952343757, 2552477408, 2632100695, 2443283854, 2506133561, 2334638140, 2414271883, 2191915858, 2254759653, 3190512472, 3135915759, 3081330742, 3009969537, 2905550212, 2850959411, 2762807018, 2691435357, 3560074640, 3505614887, 3719321342, 3648080713, 3342211916, 3287746299, 3467911202, 3396681109, 4063920168, 4143685023, 4223187782, 4286162673, 3779000052, 3858754371, 3904687514, 3967668269, 881225847, 809987520, 1023691545, 969234094, 662832811, 591600412, 771767749, 717299826, 311336399, 374308984, 453813921, 533576470, 25881363, 88864420, 134795389, 214552010, 2023205639, 2086057648, 1897238633, 1976864222, 1804852699, 1867694188, 1645340341, 1724971778, 1587496639, 1516133128, 1461550545, 1406951526, 1302016099, 1230646740, 1142491917, 1087903418, 2896545431, 2825181984, 2770861561, 2716262478, 3215044683, 3143675388, 3055782693, 3001194130, 2326604591, 2389456536, 2200899649, 2280525302, 2578013683, 2640855108, 2418763421, 2498394922, 3769900519, 3832873040, 3912640137, 3992402750, 4088425275, 4151408268, 4197601365, 4277358050, 3334271071, 3263032808, 3476998961, 3422541446, 3585640067, 3514407732, 3694837229, 3640369242, 1762451694, 1842216281, 1619975040, 1682949687, 2047383090, 2127137669, 1938468188, 2001449195, 1325665622, 1271206113, 1183200824, 1111960463, 1543535498, 1489069629, 1434599652, 1363369299, 622672798, 568075817, 748617968, 677256519, 907627842, 853037301, 1067152940, 995781531, 51762726, 131386257, 177728840, 240578815, 269590778, 349224269, 429104020, 491947555, 4046411278, 4126034873, 4172115296, 4234965207, 3794477266, 3874110821, 3953728444, 4016571915, 3609705398, 3555108353, 3735388376, 3664026991, 3290680682, 3236090077, 3449943556, 3378572211, 3174993278, 3120533705, 3032266256, 2961025959, 2923101090, 2868635157, 2813903052, 2742672763, 2604032198, 2683796849, 2461293480, 2524268063, 2284983834, 2364738477, 2175806836, 2238787779, 1569362073, 1498123566, 1409854455, 1355396672, 1317987909, 1246755826, 1192025387, 1137557660, 2072149281, 2135122070, 1912620623, 1992383480, 1753615357, 1816598090, 1627664531, 1707420964, 295390185, 358241886, 404320391, 483945776, 43990325, 106832002, 186451547, 266083308, 932423249, 861060070, 1041341759, 986742920, 613929101, 542559546, 756411363, 701822548, 3316196985, 3244833742, 3425377559, 3370778784, 3601682597, 3530312978, 3744426955, 3689838204, 3819031489, 3881883254, 3928223919, 4007849240, 4037393693, 4100235434, 4180117107, 4259748804, 2310601993, 2373574846, 2151335527, 2231098320, 2596047829, 2659030626, 2470359227, 2550115596, 2947551409, 2876312838, 2788305887, 2733848168, 3165939309, 3094707162, 3040238851, 2985771188 ];
        bzip2.array = function(bytes) {
            var bit = 0, byte = 0;
            var BITMASK = [ 0, 1, 3, 7, 15, 31, 63, 127, 255 ];
            return function(n) {
                var result = 0;
                while (n > 0) {
                    var left = 8 - bit;
                    if (n >= left) {
                        result <<= left;
                        result |= BITMASK[left] & bytes[byte++];
                        bit = 0;
                        n -= left;
                    } else {
                        result <<= n;
                        result |= (bytes[byte] & BITMASK[n] << 8 - n - bit) >> 8 - n - bit;
                        bit += n;
                        n = 0;
                    }
                }
                return result;
            };
        };
        bzip2.simple = function(srcbuffer, stream) {
            var bits = bzip2.array(srcbuffer);
            var size = bzip2.header(bits);
            var ret = false;
            var bufsize = 1e5 * size;
            var buf = new Int32Array(bufsize);
            do {
                ret = bzip2.decompress(bits, stream, buf, bufsize);
            } while (!ret);
        };
        bzip2.header = function(bits) {
            this.byteCount = new Int32Array(256);
            this.symToByte = new Uint8Array(256);
            this.mtfSymbol = new Int32Array(256);
            this.selectors = new Uint8Array(32768);
            if (bits(8 * 3) != 4348520) message.Error("No magic number found");
            var i = bits(8) - 48;
            if (i < 1 || i > 9) message.Error("Not a BZIP archive");
            return i;
        };
        bzip2.decompress = function(bits, stream, buf, bufsize, streamCRC) {
            var MAX_HUFCODE_BITS = 20;
            var MAX_SYMBOLS = 258;
            var SYMBOL_RUNA = 0;
            var SYMBOL_RUNB = 1;
            var GROUP_SIZE = 50;
            var crc = 0 ^ -1;
            for (var h = "", i = 0; i < 6; i++) h += bits(8).toString(16);
            if (h == "177245385090") {
                var finalCRC = bits(32) | 0;
                if (finalCRC !== streamCRC) message.Error("Error in bzip2: crc32 do not match");
                bits(null);
                return null;
            }
            if (h != "314159265359") message.Error("eek not valid bzip data");
            var crcblock = bits(32) | 0;
            if (bits(1)) message.Error("unsupported obsolete version");
            var origPtr = bits(24);
            if (origPtr > bufsize) message.Error("Initial position larger than buffer size");
            var t = bits(16);
            var symTotal = 0;
            for (i = 0; i < 16; i++) {
                if (t & 1 << 15 - i) {
                    var k = bits(16);
                    for (j = 0; j < 16; j++) {
                        if (k & 1 << 15 - j) {
                            this.symToByte[symTotal++] = 16 * i + j;
                        }
                    }
                }
            }
            var groupCount = bits(3);
            if (groupCount < 2 || groupCount > 6) message.Error("another error");
            var nSelectors = bits(15);
            if (nSelectors == 0) message.Error("meh");
            for (var i = 0; i < groupCount; i++) this.mtfSymbol[i] = i;
            for (var i = 0; i < nSelectors; i++) {
                for (var j = 0; bits(1); j++) if (j >= groupCount) message.Error("whoops another error");
                var uc = this.mtfSymbol[j];
                for (var k = j - 1; k >= 0; k--) {
                    this.mtfSymbol[k + 1] = this.mtfSymbol[k];
                }
                this.mtfSymbol[0] = uc;
                this.selectors[i] = uc;
            }
            var symCount = symTotal + 2;
            var groups = [];
            var length = new Uint8Array(MAX_SYMBOLS), temp = new Uint16Array(MAX_HUFCODE_BITS + 1);
            var hufGroup;
            for (var j = 0; j < groupCount; j++) {
                t = bits(5);
                for (var i = 0; i < symCount; i++) {
                    while (true) {
                        if (t < 1 || t > MAX_HUFCODE_BITS) message.Error("I gave up a while ago on writing error messages");
                        if (!bits(1)) break;
                        if (!bits(1)) t++; else t--;
                    }
                    length[i] = t;
                }
                var minLen, maxLen;
                minLen = maxLen = length[0];
                for (var i = 1; i < symCount; i++) {
                    if (length[i] > maxLen) maxLen = length[i]; else if (length[i] < minLen) minLen = length[i];
                }
                hufGroup = groups[j] = {};
                hufGroup.permute = new Int32Array(MAX_SYMBOLS);
                hufGroup.limit = new Int32Array(MAX_HUFCODE_BITS + 1);
                hufGroup.base = new Int32Array(MAX_HUFCODE_BITS + 1);
                hufGroup.minLen = minLen;
                hufGroup.maxLen = maxLen;
                var base = hufGroup.base;
                var limit = hufGroup.limit;
                var pp = 0;
                for (var i = minLen; i <= maxLen; i++) for (var t = 0; t < symCount; t++) if (length[t] == i) hufGroup.permute[pp++] = t;
                for (i = minLen; i <= maxLen; i++) temp[i] = limit[i] = 0;
                for (i = 0; i < symCount; i++) temp[length[i]]++;
                pp = t = 0;
                for (i = minLen; i < maxLen; i++) {
                    pp += temp[i];
                    limit[i] = pp - 1;
                    pp <<= 1;
                    base[i + 1] = pp - (t += temp[i]);
                }
                limit[maxLen] = pp + temp[maxLen] - 1;
                base[minLen] = 0;
            }
            for (var i = 0; i < 256; i++) {
                this.mtfSymbol[i] = i;
                this.byteCount[i] = 0;
            }
            var runPos, count, symCount, selector;
            runPos = count = symCount = selector = 0;
            while (true) {
                if (!symCount--) {
                    symCount = GROUP_SIZE - 1;
                    if (selector >= nSelectors) message.Error("meow i'm a kitty, that's an error");
                    hufGroup = groups[this.selectors[selector++]];
                    base = hufGroup.base;
                    limit = hufGroup.limit;
                }
                i = hufGroup.minLen;
                j = bits(i);
                while (true) {
                    if (i > hufGroup.maxLen) message.Error("rawr i'm a dinosaur");
                    if (j <= limit[i]) break;
                    i++;
                    j = j << 1 | bits(1);
                }
                j -= base[i];
                if (j < 0 || j >= MAX_SYMBOLS) message.Error("moo i'm a cow");
                var nextSym = hufGroup.permute[j];
                if (nextSym == SYMBOL_RUNA || nextSym == SYMBOL_RUNB) {
                    if (!runPos) {
                        runPos = 1;
                        t = 0;
                    }
                    if (nextSym == SYMBOL_RUNA) t += runPos; else t += 2 * runPos;
                    runPos <<= 1;
                    continue;
                }
                if (runPos) {
                    runPos = 0;
                    if (count + t > bufsize) message.Error("Boom.");
                    uc = this.symToByte[this.mtfSymbol[0]];
                    this.byteCount[uc] += t;
                    while (t--) buf[count++] = uc;
                }
                if (nextSym > symTotal) break;
                if (count >= bufsize) message.Error("I can't think of anything. Error");
                i = nextSym - 1;
                uc = this.mtfSymbol[i];
                for (var k = i - 1; k >= 0; k--) {
                    this.mtfSymbol[k + 1] = this.mtfSymbol[k];
                }
                this.mtfSymbol[0] = uc;
                uc = this.symToByte[uc];
                this.byteCount[uc]++;
                buf[count++] = uc;
            }
            if (origPtr < 0 || origPtr >= count) message.Error("I'm a monkey and I'm throwing something at someone, namely you");
            var j = 0;
            for (var i = 0; i < 256; i++) {
                k = j + this.byteCount[i];
                this.byteCount[i] = j;
                j = k;
            }
            for (var i = 0; i < count; i++) {
                uc = buf[i] & 255;
                buf[this.byteCount[uc]] |= i << 8;
                this.byteCount[uc]++;
            }
            var pos = 0, current = 0, run = 0;
            if (count) {
                pos = buf[origPtr];
                current = pos & 255;
                pos >>= 8;
                run = -1;
            }
            count = count;
            var copies, previous, outbyte;
            while (count) {
                count--;
                previous = current;
                pos = buf[pos];
                current = pos & 255;
                pos >>= 8;
                if (run++ == 3) {
                    copies = current;
                    outbyte = previous;
                    current = -1;
                } else {
                    copies = 1;
                    outbyte = current;
                }
                while (copies--) {
                    crc = (crc << 8 ^ this.crcTable[(crc >> 24 ^ outbyte) & 255]) & 4294967295;
                    stream(outbyte);
                }
                if (current != previous) run = 0;
            }
            crc = (crc ^ -1) >>> 0;
            if ((crc | 0) != (crcblock | 0)) message.Error("Error in bzip2: crc32 do not match");
            if (streamCRC === null) streamCRC = 0;
            streamCRC = (crc ^ (streamCRC << 1 | streamCRC >>> 31)) & 4294967295;
            return streamCRC;
        };
        module.exports = bzip2;
    }, module => {
        var BITMASK = [ 0, 1, 3, 7, 15, 31, 63, 127, 255 ];
        module.exports = function bitIterator(nextBuffer) {
            var bit = 0, byte = 0;
            var bytes = nextBuffer();
            var f = function(n) {
                if (n === null && bit != 0) {
                    bit = 0;
                    byte++;
                    return;
                }
                var result = 0;
                while (n > 0) {
                    if (byte >= bytes.length) {
                        byte = 0;
                        bytes = nextBuffer();
                    }
                    var left = 8 - bit;
                    if (bit === 0 && n > 0) f.bytesRead++;
                    if (n >= left) {
                        result <<= left;
                        result |= BITMASK[left] & bytes[byte++];
                        bit = 0;
                        n -= left;
                    } else {
                        result <<= n;
                        result |= (bytes[byte] & BITMASK[n] << 8 - n - bit) >> 8 - n - bit;
                        bit += n;
                        n = 0;
                    }
                }
                return result;
            };
            f.bytesRead = 0;
            return f;
        };
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.DmgSource = void 0;
        const udif_1 = __webpack_require__(149);
        const source_destination_1 = __webpack_require__(25);
        const source_source_1 = __webpack_require__(24);
        const block_transform_stream_1 = __webpack_require__(20);
        const constants_1 = __webpack_require__(3);
        const errors_1 = __webpack_require__(4);
        const shared_1 = __webpack_require__(55);
        const sparse_transform_stream_1 = __webpack_require__(172);
        class DmgSource extends source_source_1.SourceSource {
            constructor(source) {
                super(source);
            }
            async canCreateReadStream() {
                return true;
            }
            async canCreateSparseReadStream() {
                return true;
            }
            async createReadStream({start = 0, end, alignment, numBuffers} = {}) {
                if (start !== 0) {
                    throw new errors_1.NotCapable;
                }
                const stream = await this.image.createReadStream(end);
                return block_transform_stream_1.BlockTransformStream.alignIfNeeded(stream, alignment, numBuffers);
            }
            async createSparseReadStream({alignment, numBuffers} = {}) {
                const blocks = await this.getBlocks();
                const stream = Object.assign(await this.image.createSparseReadStream(), {
                    blocks
                });
                if (alignment !== undefined) {
                    const transform = new sparse_transform_stream_1.ProgressSparseTransformStream({
                        blocks,
                        chunkSize: constants_1.CHUNK_SIZE,
                        alignment,
                        numBuffers
                    });
                    stream.on("error", transform.emit.bind(transform, "error"));
                    stream.pipe(transform);
                    return transform;
                } else {
                    return stream;
                }
            }
            async getBlocks() {
                const result = [];
                for (const blk of this.image.resourceFork.blkx) {
                    const childBlocks = blk.map.blocks.filter((b => DmgSource.mappedBlockTypes.includes(b.type)));
                    if (childBlocks.length === 0) {
                        continue;
                    }
                    let checksumType;
                    let checksum;
                    if (blk.map.checksum.type === udif_1.CHECKSUM_TYPE.CRC32) {
                        checksumType = "crc32";
                        checksum = blk.map.checksum.value;
                    }
                    const blocks = [];
                    result.push({
                        checksumType,
                        checksum,
                        blocks
                    });
                    let lastBlock;
                    for (const childBlk of childBlocks) {
                        const offset = (blk.map.sectorNumber + childBlk.sectorNumber) * udif_1.SECTOR_SIZE;
                        const length = childBlk.sectorCount * udif_1.SECTOR_SIZE;
                        if (lastBlock === undefined) {
                            lastBlock = {
                                offset,
                                length
                            };
                        } else if (lastBlock.offset + lastBlock.length === offset) {
                            lastBlock.length += length;
                        } else {
                            blocks.push(lastBlock);
                            lastBlock = {
                                offset,
                                length
                            };
                        }
                    }
                    blocks.push(lastBlock);
                }
                return result;
            }
            async _getMetadata() {
                const blocks = await this.getBlocks();
                const blockmappedSize = (0, shared_1.blocksLength)(blocks);
                const compressedSize = (await this.source.getMetadata()).size;
                const size = await this.image.getUncompressedSize();
                return {
                    blocks,
                    blockmappedSize,
                    compressedSize,
                    size
                };
            }
            async _open() {
                await super._open();
                this.image = new udif_1.Image({
                    size: (await this.source.getMetadata()).size,
                    createReadStream: async (start, end) => await this.source.createReadStream({
                        start,
                        end
                    })
                });
                await this.image.ready;
            }
        }
        exports.DmgSource = DmgSource;
        DmgSource.mappedBlockTypes = [ udif_1.BLOCK.ZEROFILL, udif_1.BLOCK.RAW, udif_1.BLOCK.UDCO, udif_1.BLOCK.UDZO, udif_1.BLOCK.UDBZ, udif_1.BLOCK.LZFSE ];
        DmgSource.requiresRandomReadableSource = true;
        DmgSource.mimetype = "application/x-apple-diskimage";
        source_destination_1.SourceDestination.register(DmgSource);
    }, function(__unused_webpack_module, exports, __webpack_require__) {
        "use strict";
        var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
            if (k2 === undefined) k2 = k;
            Object.defineProperty(o, k2, {
                enumerable: true,
                get: function() {
                    return m[k];
                }
            });
        } : function(o, m, k, k2) {
            if (k2 === undefined) k2 = k;
            o[k2] = m[k];
        });
        var __exportStar = this && this.__exportStar || function(m, exports) {
            for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
        };
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        __exportStar(__webpack_require__(150), exports);
        __exportStar(__webpack_require__(153), exports);
        __exportStar(__webpack_require__(154), exports);
        __exportStar(__webpack_require__(151), exports);
        __exportStar(__webpack_require__(155), exports);
        __exportStar(__webpack_require__(156), exports);
        __exportStar(__webpack_require__(166), exports);
        __exportStar(__webpack_require__(171), exports);
        __exportStar(__webpack_require__(152), exports);
        __exportStar(__webpack_require__(167), exports);
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.Block = void 0;
        const constants_1 = __webpack_require__(151);
        const uint64_1 = __webpack_require__(152);
        class Block {
            constructor() {
                this.type = 0;
                this.description = "UNKNOWN";
                this.comment = "";
                this.sectorNumber = 0;
                this.sectorCount = 0;
                this.compressedOffset = 0;
                this.compressedLength = 0;
            }
            static getDescription(type) {
                switch (type) {
                  case constants_1.BLOCK.ZEROFILL:
                    return "ZEROFILL";
                    break;

                  case constants_1.BLOCK.RAW:
                    return "UDRW (raw)";
                    break;

                  case constants_1.BLOCK.FREE:
                    return "FREE (unallocated)";
                    break;

                  case constants_1.BLOCK.UDCO:
                    return "UDCO (adc-compressed)";
                    break;

                  case constants_1.BLOCK.UDZO:
                    return "UDZO (zlib-compressed)";
                    break;

                  case constants_1.BLOCK.UDBZ:
                    return "UDBZ (bzip2-compressed)";
                    break;

                  case constants_1.BLOCK.COMMENT:
                    return "COMMENT";
                    break;

                  case constants_1.BLOCK.TERMINATOR:
                    return "TERMINATOR";
                    break;

                  default:
                    return "UNKNOWN";
                    break;
                }
            }
            static parse(buffer, offset = 0) {
                return (new Block).parse(buffer, offset);
            }
            parse(buffer, offset = 0) {
                this.type = buffer.readUInt32BE(offset + 0);
                this.description = Block.getDescription(this.type);
                this.comment = buffer.toString("ascii", offset + 4, offset + 8).replace(/\u0000/g, "");
                this.sectorNumber = uint64_1.readBE(buffer, offset + 8);
                this.sectorCount = uint64_1.readBE(buffer, offset + 16);
                this.compressedOffset = uint64_1.readBE(buffer, offset + 24);
                this.compressedLength = uint64_1.readBE(buffer, offset + 32);
                return this;
            }
            write(buffer, offset = 0) {
                buffer.writeUInt32BE(this.type, offset + 0);
                buffer.write(this.comment, offset + 4, 4, "ascii");
                uint64_1.writeBE(buffer, this.sectorNumber, offset + 8);
                uint64_1.writeBE(buffer, this.sectorCount, offset + 16);
                uint64_1.writeBE(buffer, this.compressedOffset, offset + 24);
                uint64_1.writeBE(buffer, this.compressedLength, offset + 32);
                return buffer;
            }
        }
        exports.Block = Block;
        Block.SIZE = 40;
    }, (__unused_webpack_module, exports) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.BLOCK = exports.CHECKSUM_TYPE = exports.SECTOR_SIZE = void 0;
        exports.SECTOR_SIZE = 512;
        var CHECKSUM_TYPE;
        (function(CHECKSUM_TYPE) {
            CHECKSUM_TYPE[CHECKSUM_TYPE["NONE"] = 0] = "NONE";
            CHECKSUM_TYPE[CHECKSUM_TYPE["CRC32"] = 2] = "CRC32";
        })(CHECKSUM_TYPE = exports.CHECKSUM_TYPE || (exports.CHECKSUM_TYPE = {}));
        var BLOCK;
        (function(BLOCK) {
            BLOCK[BLOCK["ZEROFILL"] = 0] = "ZEROFILL";
            BLOCK[BLOCK["RAW"] = 1] = "RAW";
            BLOCK[BLOCK["FREE"] = 2] = "FREE";
            BLOCK[BLOCK["UDCO"] = 2147483652] = "UDCO";
            BLOCK[BLOCK["UDZO"] = 2147483653] = "UDZO";
            BLOCK[BLOCK["UDBZ"] = 2147483654] = "UDBZ";
            BLOCK[BLOCK["LZFSE"] = 2147483655] = "LZFSE";
            BLOCK[BLOCK["COMMENT"] = 2147483646] = "COMMENT";
            BLOCK[BLOCK["TERMINATOR"] = 4294967295] = "TERMINATOR";
        })(BLOCK = exports.BLOCK || (exports.BLOCK = {}));
    }, (__unused_webpack_module, exports) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.writeBE = exports.readBE = void 0;
        const MAX_UINT32 = Math.pow(2, 32);
        function readBE(buffer, offset) {
            offset = offset || 0;
            const hi = buffer.readUInt32BE(offset);
            const lo = buffer.readUInt32BE(offset + 4);
            return hi * MAX_UINT32 + lo;
        }
        exports.readBE = readBE;
        function writeBE(buffer, value, offset) {
            offset = offset || 0;
            const hi = value / MAX_UINT32;
            const lo = value - hi * MAX_UINT32;
            buffer.writeUInt32BE(hi, offset);
            buffer.writeUInt32BE(lo, offset + 4);
            return offset + 8;
        }
        exports.writeBE = writeBE;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.BlockMap = void 0;
        const checksum_1 = __webpack_require__(154);
        const uint64_1 = __webpack_require__(152);
        const block_1 = __webpack_require__(150);
        class BlockMap {
            constructor() {
                this.signature = 0;
                this.version = 0;
                this.sectorNumber = 0;
                this.sectorCount = 0;
                this.dataOffset = 0;
                this.buffersNeeded = 0;
                this.blockDescriptorCount = 0;
                this.reserved1 = 0;
                this.reserved2 = 0;
                this.reserved3 = 0;
                this.reserved4 = 0;
                this.reserved5 = 0;
                this.reserved6 = 0;
                this.checksum = new checksum_1.Checksum;
                this.blockCount = 0;
                this.blocks = [];
            }
            static parse(buffer, offset = 0) {
                return (new BlockMap).parse(buffer, offset);
            }
            parse(buffer, offset = 0) {
                this.signature = buffer.readUInt32BE(offset + 0);
                if (this.signature !== BlockMap.SIGNATURE) {
                    const expected = BlockMap.SIGNATURE.toString(16);
                    const actual = this.signature.toString(16);
                    throw new Error(`Invalid block map signature: Expected 0x${expected}, saw 0x${actual}`);
                }
                this.version = buffer.readUInt32BE(offset + 4);
                this.sectorNumber = uint64_1.readBE(buffer, offset + 8);
                this.sectorCount = uint64_1.readBE(buffer, offset + 16);
                this.dataOffset = uint64_1.readBE(buffer, offset + 24);
                this.buffersNeeded = buffer.readUInt32BE(offset + 32);
                this.blockDescriptorCount = buffer.readUInt32BE(offset + 36);
                this.reserved1 = buffer.readUInt32BE(offset + 40);
                this.reserved2 = buffer.readUInt32BE(offset + 44);
                this.reserved3 = buffer.readUInt32BE(offset + 48);
                this.reserved4 = buffer.readUInt32BE(offset + 52);
                this.reserved5 = buffer.readUInt32BE(offset + 56);
                this.reserved6 = buffer.readUInt32BE(offset + 60);
                this.checksum.parse(buffer, offset + 64);
                this.blockCount = buffer.readUInt32BE(offset + 200);
                this.blocks = [];
                for (let i = 0; i < this.blockCount; i++) {
                    this.blocks.push(block_1.Block.parse(buffer, BlockMap.SIZE + i * block_1.Block.SIZE + offset));
                }
                return this;
            }
            write(buffer, offset = 0) {
                const length = BlockMap.SIZE + this.blocks.length * block_1.Block.SIZE;
                offset = offset || 0;
                buffer = buffer || Buffer.alloc(length + offset);
                this.blockCount = this.blocks.length;
                buffer.writeUInt32BE(this.signature, offset + 0);
                buffer.writeUInt32BE(this.version, offset + 4);
                uint64_1.writeBE(buffer, this.sectorNumber, offset + 8);
                uint64_1.writeBE(buffer, this.sectorCount, offset + 16);
                uint64_1.writeBE(buffer, this.dataOffset, offset + 24);
                buffer.writeUInt32BE(this.buffersNeeded, offset + 32);
                buffer.writeUInt32BE(this.blockDescriptorCount, offset + 36);
                buffer.writeUInt32BE(this.reserved1, offset + 40);
                buffer.writeUInt32BE(this.reserved2, offset + 44);
                buffer.writeUInt32BE(this.reserved3, offset + 48);
                buffer.writeUInt32BE(this.reserved4, offset + 52);
                buffer.writeUInt32BE(this.reserved5, offset + 56);
                buffer.writeUInt32BE(this.reserved6, offset + 60);
                this.checksum.write(buffer, offset + 64);
                buffer.writeUInt32BE(this.blockCount, offset + 200);
                for (let i = 0; i < this.blockCount; i++) {
                    this.blocks[i].write(buffer, BlockMap.SIZE + i * block_1.Block.SIZE + offset);
                }
                return buffer;
            }
        }
        exports.BlockMap = BlockMap;
        BlockMap.SIZE = 204;
        BlockMap.SIGNATURE = 1835627368;
        BlockMap.VERSION = 1;
        BlockMap.Block = block_1.Block;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.Checksum = void 0;
        const constants_1 = __webpack_require__(151);
        class Checksum {
            constructor() {
                this.type = constants_1.CHECKSUM_TYPE.NONE;
                this.bits = 0;
                this.value = "";
            }
            static parse(buffer, offset) {
                return (new Checksum).parse(buffer, offset);
            }
            parse(buffer, offset = 0) {
                this.type = buffer.readUInt32BE(offset + 0);
                this.bits = buffer.readUInt32BE(offset + 4);
                this.value = buffer.toString("hex", offset + 8, offset + 8 + this.bits / 8);
                return this;
            }
            write(buffer, offset = 0) {
                buffer = buffer || Buffer.alloc(Checksum.SIZE + offset);
                buffer.writeUInt32BE(this.type, offset + 0);
                buffer.writeUInt32BE(this.bits, offset + 4);
                buffer.write(this.value, offset + 8, this.bits / 8, "hex");
                return buffer;
            }
        }
        exports.Checksum = Checksum;
        Checksum.SIZE = 128;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.Footer = void 0;
        const checksum_1 = __webpack_require__(154);
        const uint64_1 = __webpack_require__(152);
        class Footer {
            constructor() {
                this.signature = Footer.SIGNATURE;
                this.version = 0;
                this.headerSize = 0;
                this.flags = 0;
                this.runningDataForkOffset = 0;
                this.dataForkOffset = 0;
                this.dataForkLength = 0;
                this.resourceForkOffset = 0;
                this.resourceForkLength = 0;
                this.segmentNumber = 0;
                this.segmentCount = 0;
                this.segmentId = Buffer.alloc(16);
                this.dataChecksum = new checksum_1.Checksum;
                this.xmlOffset = 0;
                this.xmlLength = 0;
                this.reserved1 = Buffer.alloc(120);
                this.checksum = new checksum_1.Checksum;
                this.imageVariant = 0;
                this.sectorCount = 0;
                this.reserved2 = 0;
                this.reserved3 = 0;
                this.reserved4 = 0;
            }
            static parse(buffer, offset = 0) {
                return (new Footer).parse(buffer, offset);
            }
            parse(buffer, offset = 0) {
                this.signature = buffer.readUInt32BE(offset + 0);
                if (this.signature !== Footer.SIGNATURE) {
                    const expected = Footer.SIGNATURE.toString(16);
                    const actual = this.signature.toString(16);
                    throw new Error(`Invalid footer signature: Expected 0x${expected}, saw 0x${actual}`);
                }
                this.version = buffer.readUInt32BE(offset + 4);
                this.headerSize = buffer.readUInt32BE(offset + 8);
                this.flags = buffer.readUInt32BE(offset + 12);
                this.runningDataForkOffset = uint64_1.readBE(buffer, offset + 16);
                this.dataForkOffset = uint64_1.readBE(buffer, offset + 24);
                this.dataForkLength = uint64_1.readBE(buffer, offset + 32);
                this.resourceForkOffset = uint64_1.readBE(buffer, offset + 40);
                this.resourceForkLength = uint64_1.readBE(buffer, offset + 48);
                this.segmentNumber = buffer.readUInt32BE(offset + 56);
                this.segmentCount = buffer.readUInt32BE(offset + 60);
                buffer.copy(this.segmentId, 0, offset + 64, offset + 64 + 16);
                this.dataChecksum.parse(buffer, offset + 80);
                this.xmlOffset = uint64_1.readBE(buffer, offset + 216);
                this.xmlLength = uint64_1.readBE(buffer, offset + 224);
                buffer.copy(this.reserved1, 0, offset + 232, offset + 232 + 120);
                this.checksum.parse(buffer, offset + 352);
                this.imageVariant = buffer.readUInt32BE(offset + 488);
                this.sectorCount = uint64_1.readBE(buffer, offset + 492);
                this.reserved2 = buffer.readUInt32BE(offset + 500);
                this.reserved3 = buffer.readUInt32BE(offset + 504);
                this.reserved4 = buffer.readUInt32BE(offset + 508);
                return this;
            }
            write(buffer, offset = 0) {
                buffer = buffer || Buffer.alloc(Footer.SIZE + offset);
                buffer.writeUInt32BE(this.signature, offset + 0);
                buffer.writeUInt32BE(this.version, offset + 4);
                buffer.writeUInt32BE(this.headerSize, offset + 8);
                buffer.writeUInt32BE(this.flags, offset + 12);
                uint64_1.writeBE(buffer, this.runningDataForkOffset, offset + 16);
                uint64_1.writeBE(buffer, this.dataForkOffset, offset + 24);
                uint64_1.writeBE(buffer, this.dataForkLength, offset + 32);
                uint64_1.writeBE(buffer, this.resourceForkOffset, offset + 40);
                uint64_1.writeBE(buffer, this.resourceForkLength, offset + 48);
                buffer.writeUInt32BE(this.segmentNumber, offset + 56);
                buffer.writeUInt32BE(this.segmentCount, offset + 60);
                this.segmentId.copy(buffer, offset + 64);
                this.dataChecksum.write(buffer, offset + 80);
                uint64_1.writeBE(buffer, this.xmlOffset, offset + 216);
                uint64_1.writeBE(buffer, this.xmlLength, offset + 224);
                this.reserved1.copy(buffer, offset + 232);
                this.checksum.write(buffer, offset + 352);
                buffer.writeUInt32BE(this.imageVariant, offset + 488);
                uint64_1.writeBE(buffer, this.sectorCount, offset + 492);
                buffer.writeUInt32BE(this.reserved2, offset + 500);
                buffer.writeUInt32BE(this.reserved3, offset + 504);
                buffer.writeUInt32BE(this.reserved4, offset + 508);
                return buffer;
            }
        }
        exports.Footer = Footer;
        Footer.SIZE = 512;
        Footer.SIGNATURE = 1802464377;
        Footer.VERSION = 4;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.Image = void 0;
        const plist = __webpack_require__(157);
        const crc32 = __webpack_require__(34);
        const stream_1 = __webpack_require__(17);
        const blockmap_1 = __webpack_require__(153);
        const constants_1 = __webpack_require__(151);
        const footer_1 = __webpack_require__(155);
        const readstream_1 = __webpack_require__(166);
        const sparse_readstream_1 = __webpack_require__(171);
        const utils_1 = __webpack_require__(167);
        class Image {
            constructor(fs) {
                this.fs = fs;
                this.resourceFork = {
                    blkx: [],
                    nsiz: [],
                    cSum: [],
                    plst: [],
                    size: []
                };
                this.ready = this.open();
            }
            async open() {
                await this.readFooter();
                await this.readPropertyList();
            }
            static parseBlkx(blkx) {
                return blkx.map((block => ({
                    id: +block["ID"],
                    attributes: +block["Attributes"],
                    name: block["Name"],
                    coreFoundationName: block["CFName"],
                    map: blockmap_1.BlockMap.parse(block["Data"])
                })));
            }
            static parseNsiz(nsiz) {
                return nsiz.map((block => ({
                    id: +block["ID"],
                    attributes: +block["Attributes"],
                    name: block["Name"],
                    data: plist.parse(block["Data"].toString()).data
                })));
            }
            static parsePlst(plst) {
                return plst.map((block => ({
                    id: +block["ID"],
                    attributes: +block["Attributes"],
                    name: block["Name"],
                    data: block["Data"]
                })));
            }
            static parseCsum(plst) {
                return plst.map((block => ({
                    id: +block["ID"],
                    attributes: +block["Attributes"],
                    name: block["Name"],
                    data: {
                        unknown: block["Data"].readUInt16LE(0),
                        type: block["Data"].readUInt32LE(2),
                        value: block["Data"].toString("hex", 6)
                    }
                })));
            }
            static parseSize(size) {
                return size.map((block => ({
                    id: +block["ID"],
                    attributes: +block["Attributes"],
                    name: block["Name"],
                    data: block["Data"]
                })));
            }
            async createReadStream(end = Infinity) {
                await this.ready;
                return stream_1.Readable.from(readstream_1.readStream(this, end));
            }
            async createSparseReadStream() {
                await this.ready;
                return stream_1.Readable.from(sparse_readstream_1.sparseReadStream(this));
            }
            async getUncompressedSize() {
                await this.ready;
                return this.resourceFork.blkx.reduce(((size, resource) => resource.map.blocks.reduce(((s, block) => s + block.sectorCount * constants_1.SECTOR_SIZE), size)), 0);
            }
            async getMappedSize() {
                await this.ready;
                return this.resourceFork.blkx.reduce(((size, resource) => resource.map.blocks.reduce(((s, block) => {
                    if (block.type !== constants_1.BLOCK.ZEROFILL && block.type !== constants_1.BLOCK.FREE) {
                        return s + block.sectorCount * constants_1.SECTOR_SIZE;
                    } else {
                        return s;
                    }
                }), size)), 0);
            }
            async verifyData() {
                await this.ready;
                if (this.footer === undefined) {
                    throw new Error("Must read footer before calling verifyData");
                }
                if (!this.footer.dataChecksum || this.footer.dataChecksum.type === constants_1.CHECKSUM_TYPE.NONE) {
                    return null;
                }
                let hash;
                let checksum = "";
                if (this.footer.dataChecksum.type === constants_1.CHECKSUM_TYPE.CRC32) {
                    hash = new crc32.Hash({
                        encoding: "hex"
                    });
                } else {
                    throw new Error(`Unknown or unsupported checksum type "${this.footer.dataChecksum.type}"`);
                }
                const readable = await this.fs.createReadStream(this.footer.dataForkOffset, this.footer.dataForkOffset + this.footer.dataForkLength - 1);
                return await new Promise(((resolve, reject) => {
                    readable.on("error", reject).pipe(hash).on("error", reject).on("readable", (function() {
                        let chunk = this.read();
                        while (chunk) {
                            checksum += chunk;
                            chunk = this.read();
                        }
                    })).on("end", (() => {
                        var _a, _b;
                        resolve(checksum === ((_b = (_a = this.footer) === null || _a === void 0 ? void 0 : _a.dataChecksum) === null || _b === void 0 ? void 0 : _b.value));
                    }));
                }));
            }
            async readFooter() {
                const length = footer_1.Footer.SIZE;
                const position = this.fs.size - footer_1.Footer.SIZE;
                const buffer = await utils_1.streamToBuffer(await this.fs.createReadStream(position, position + length - 1));
                this.footer = footer_1.Footer.parse(buffer);
                return this.footer;
            }
            async readPropertyList() {
                if (this.footer === undefined) {
                    throw new Error("Must read footer before property list");
                }
                const length = this.footer.xmlLength;
                const position = this.footer.xmlOffset;
                const buffer = await utils_1.streamToBuffer(await this.fs.createReadStream(position, position + length - 1));
                const data = plist.parse(buffer.toString()).data;
                const resourceFork = data["resource-fork"];
                if (resourceFork.blkx) {
                    this.resourceFork.blkx = Image.parseBlkx(resourceFork.blkx);
                }
                if (resourceFork.nsiz) {
                    this.resourceFork.nsiz = Image.parseNsiz(resourceFork.nsiz);
                }
                if (resourceFork.cSum) {
                    this.resourceFork.cSum = Image.parseCsum(resourceFork.cSum);
                }
                if (resourceFork.plst) {
                    this.resourceFork.plst = Image.parsePlst(resourceFork.plst);
                }
                if (resourceFork.size) {
                    this.resourceFork.size = Image.parseSize(resourceFork.size);
                }
                return this.resourceFork;
            }
        }
        exports.Image = Image;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const JSON_DATE_PATTERN = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,3})?Z$/;
        class Plist {
            constructor() {
                this.data = {};
            }
            get(keyPath) {
                var path = keyPath.split(".");
                var key = path.pop();
                var objRef = this.data;
                var pathComp = null;
                while (pathComp = path.shift()) {
                    if (objRef[pathComp] == null) return undefined;
                    objRef = objRef[pathComp];
                }
                return objRef[key];
            }
            set(keyPath, value) {
                var path = keyPath.split(".");
                var key = path.pop();
                var objRef = this.data;
                var pathComp = null;
                while (pathComp = path.shift()) {
                    if (objRef[pathComp] == null) return undefined;
                    objRef = objRef[pathComp];
                }
                return objRef[key] = value;
            }
            replace(keyPath, value) {
                if (this.get(keyPath) !== undefined) {
                    this.set(keyPath, value);
                    return true;
                }
                return false;
            }
            delete(keyPath) {
                this.data[keyPath] = undefined;
                delete this.data[keyPath];
            }
            parse(buffer, offset, length) {
                offset = offset || 0;
                length = length || buffer.length - offset;
                if (buffer.indexOf(Plist.SIGNATURE_BINARY, offset) === offset) {
                    return this.parseBinary(buffer, offset, length);
                } else if (buffer.indexOf(Plist.SIGNATURE_XML, offset) === offset) {
                    return this.parseXML(buffer, offset, length);
                } else if (buffer.indexOf(Plist.SIGNATURE_JSON, offset) === offset) {
                    return this.fromJSON(buffer.slice(offset, offset + length));
                }
                throw new Error(`Invalid property list signature at offset 0x${offset.toString(16)}`);
                return this;
            }
            parseBinary(buffer, offset, length) {
                this.data = Plist.binary.parse(buffer, offset, length);
                return this;
            }
            parseXML(buffer, offset, length) {
                this.data = Plist.xml.parse(buffer, offset, length);
                return this;
            }
            fromJSON(value) {
                this.data = null;
                if (typeof value === "string") {
                    this.data = JSON.parse(value, Plist.reviver);
                } else if (Buffer.isBuffer(value)) {
                    this.data = JSON.parse(value.toString("utf8"), Plist.reviver);
                } else {
                    this.data = JSON.parse(JSON.stringify(value), Plist.reviver);
                }
                return this;
            }
            toJSON() {
                return this.data;
            }
            toString() {
                return Plist.xml.write(this.data);
            }
            write(buffer, offset, encoding) {
                encoding = encoding || "binary";
                switch (encoding) {
                  case "binary":
                    return Plist.binary.write(this.data, buffer, offset);

                  case "xml":
                    return Buffer.from(this.toString());

                  case "json":
                    return Buffer.from(JSON.stringify(this.data));

                  default:
                    throw new Error(`Unknown encoding ${encoding}`);
                }
            }
        }
        module.exports = Plist;
        Plist.SIGNATURE_BINARY = "bplist";
        Plist.SIGNATURE_XML = "<?xml ";
        Plist.SIGNATURE_JSON = "{";
        Plist.EPOCH = 9783072e5;
        Plist.DOCTYPE = {
            "1.0": '<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">'
        };
        Plist.xml = {
            parse: __webpack_require__(158),
            write: __webpack_require__(161)
        };
        Plist.binary = {
            parse: __webpack_require__(163),
            write: __webpack_require__(165)
        };
        Plist.reviver = function(key, value) {
            var isBuffer = typeof value === "object" && !Array.isArray(value) && value.type === "Buffer" && Array.isArray(value.data);
            if (isBuffer) {
                return Buffer.from(value.data);
            }
            if (typeof value == "string" && JSON_DATE_PATTERN.test(value)) {
                return new Date(value);
            }
            return value;
        };
        Plist.fromJSON = function(value) {
            return (new Plist).fromJSON(value);
        };
        Plist.parse = function(buffer, offset) {
            return (new Plist).parse(buffer, offset);
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var Plist = __webpack_require__(157);
        var sax = __webpack_require__(159);
        var depth = 0;
        var state = [];
        var values = [];
        var keys = [];
        var textContent = "";
        function isStruct(name) {
            return name === "dict" || name === "array" || name === "set";
        }
        function isValue(name) {
            return name === "string" || name === "integer" || name === "real" || name === "true" || name === "false" || name === "null" || name === "data" || name === "date";
        }
        function reset() {
            depth = 0;
            state = [];
            values = [];
            key = "";
            textContent = "";
        }
        function pushValue() {
            switch (state[0]) {
              case "true":
                values.unshift(true);
                break;

              case "false":
                values.unshift(false);
                break;

              case "null":
                values.unshift(null);
                break;

              case "string":
                values.unshift(textContent.trim());
                break;

              case "integer":
                values.unshift(+textContent.trim());
                break;

              case "real":
                values.unshift(+textContent.trim());
                break;

              case "data":
                values.unshift(Buffer.from(textContent.trim(), "base64"));
                break;

              case "date":
                values.unshift(new Date(textContent.trim()));
                break;
            }
        }
        function popValue() {
            switch (state[0]) {
              case "dict":
                values[1][keys.shift()] = values.shift();
                break;

              case "array":
                values[1].push(values.shift());
                break;

              case "set":
                values[1].add(values.shift());
                break;
            }
        }
        var parser = sax.parser(true);
        parser.onopentag = tag => {
            if (tag.name === "plist") {
                if (tag.attributes.version !== "1.0") {
                    reset();
                    parser.reset();
                    throw new Error(`Unsupported version "${tag.attributes.version}"`);
                }
                return;
            }
            state.unshift(tag.name);
            if (tag.name === "dict" || tag.name === "array" || tag.name === "set") {
                depth++;
                switch (tag.name) {
                  case "dict":
                    values.unshift({});
                    break;

                  case "array":
                    values.unshift([]);
                    break;

                  case "set":
                    values.unshift(new Set);
                    break;
                }
            }
        };
        parser.ontext = text => {
            if (state[0] === "key" || isValue(state[0])) textContent += text;
        };
        parser.onclosetag = name => {
            if (name === "plist") return;
            if (state[0] === "key") {
                keys.unshift(textContent.trim());
                textContent = "";
                state.shift();
                return;
            }
            if (isValue(name)) {
                pushValue();
                textContent = "";
                state.shift();
                if (isStruct(state[0])) {
                    popValue();
                }
            } else if (isStruct(name)) {
                state.shift();
                depth--;
                if (isStruct(state[0])) {
                    popValue();
                }
            } else {
                throw new Error(`Unexpected closing state for "${name}"`);
            }
        };
        parser.onend = () => {
            if (depth) {
                var msg = `Unbalanced structure, remaining depth of ${depth}`;
                reset();
                parser.reset();
                throw new Error(msg);
            }
        };
        function parse(buffer, offset, length) {
            offset = offset || 0;
            length = length || buffer.length - offset;
            if (buffer.indexOf(Plist.SIGNATURE_XML, offset) !== offset) {
                throw new Error(`Invalid property list signature at offset 0x${offset.toString(16)}`);
            }
            var xml = Buffer.isBuffer(buffer) ? buffer.toString("utf8", offset, offset + length) : offset === 0 ? buffer : buffer.slice(offset, offset + length);
            parser.write(xml).close();
            var data = values[0];
            reset();
            return data;
        }
        module.exports = parse;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        (function(sax) {
            sax.parser = function(strict, opt) {
                return new SAXParser(strict, opt);
            };
            sax.SAXParser = SAXParser;
            sax.SAXStream = SAXStream;
            sax.createStream = createStream;
            sax.MAX_BUFFER_LENGTH = 64 * 1024;
            var buffers = [ "comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script" ];
            sax.EVENTS = [ "text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "opentagstart", "attribute", "opentag", "closetag", "opencdata", "cdata", "closecdata", "error", "end", "ready", "script", "opennamespace", "closenamespace" ];
            function SAXParser(strict, opt) {
                if (!(this instanceof SAXParser)) {
                    return new SAXParser(strict, opt);
                }
                var parser = this;
                clearBuffers(parser);
                parser.q = parser.c = "";
                parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH;
                parser.opt = opt || {};
                parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags;
                parser.looseCase = parser.opt.lowercase ? "toLowerCase" : "toUpperCase";
                parser.tags = [];
                parser.closed = parser.closedRoot = parser.sawRoot = false;
                parser.tag = parser.error = null;
                parser.strict = !!strict;
                parser.noscript = !!(strict || parser.opt.noscript);
                parser.state = S.BEGIN;
                parser.strictEntities = parser.opt.strictEntities;
                parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES);
                parser.attribList = [];
                if (parser.opt.xmlns) {
                    parser.ns = Object.create(rootNS);
                }
                parser.trackPosition = parser.opt.position !== false;
                if (parser.trackPosition) {
                    parser.position = parser.line = parser.column = 0;
                }
                emit(parser, "onready");
            }
            if (!Object.create) {
                Object.create = function(o) {
                    function F() {}
                    F.prototype = o;
                    var newf = new F;
                    return newf;
                };
            }
            if (!Object.keys) {
                Object.keys = function(o) {
                    var a = [];
                    for (var i in o) if (o.hasOwnProperty(i)) a.push(i);
                    return a;
                };
            }
            function checkBufferLength(parser) {
                var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10);
                var maxActual = 0;
                for (var i = 0, l = buffers.length; i < l; i++) {
                    var len = parser[buffers[i]].length;
                    if (len > maxAllowed) {
                        switch (buffers[i]) {
                          case "textNode":
                            closeText(parser);
                            break;

                          case "cdata":
                            emitNode(parser, "oncdata", parser.cdata);
                            parser.cdata = "";
                            break;

                          case "script":
                            emitNode(parser, "onscript", parser.script);
                            parser.script = "";
                            break;

                          default:
                            error(parser, "Max buffer length exceeded: " + buffers[i]);
                        }
                    }
                    maxActual = Math.max(maxActual, len);
                }
                var m = sax.MAX_BUFFER_LENGTH - maxActual;
                parser.bufferCheckPosition = m + parser.position;
            }
            function clearBuffers(parser) {
                for (var i = 0, l = buffers.length; i < l; i++) {
                    parser[buffers[i]] = "";
                }
            }
            function flushBuffers(parser) {
                closeText(parser);
                if (parser.cdata !== "") {
                    emitNode(parser, "oncdata", parser.cdata);
                    parser.cdata = "";
                }
                if (parser.script !== "") {
                    emitNode(parser, "onscript", parser.script);
                    parser.script = "";
                }
            }
            SAXParser.prototype = {
                end: function() {
                    end(this);
                },
                write,
                resume: function() {
                    this.error = null;
                    return this;
                },
                close: function() {
                    return this.write(null);
                },
                flush: function() {
                    flushBuffers(this);
                }
            };
            var Stream;
            try {
                Stream = __webpack_require__(17).Stream;
            } catch (ex) {
                Stream = function() {};
            }
            var streamWraps = sax.EVENTS.filter((function(ev) {
                return ev !== "error" && ev !== "end";
            }));
            function createStream(strict, opt) {
                return new SAXStream(strict, opt);
            }
            function SAXStream(strict, opt) {
                if (!(this instanceof SAXStream)) {
                    return new SAXStream(strict, opt);
                }
                Stream.apply(this);
                this._parser = new SAXParser(strict, opt);
                this.writable = true;
                this.readable = true;
                var me = this;
                this._parser.onend = function() {
                    me.emit("end");
                };
                this._parser.onerror = function(er) {
                    me.emit("error", er);
                    me._parser.error = null;
                };
                this._decoder = null;
                streamWraps.forEach((function(ev) {
                    Object.defineProperty(me, "on" + ev, {
                        get: function() {
                            return me._parser["on" + ev];
                        },
                        set: function(h) {
                            if (!h) {
                                me.removeAllListeners(ev);
                                me._parser["on" + ev] = h;
                                return h;
                            }
                            me.on(ev, h);
                        },
                        enumerable: true,
                        configurable: false
                    });
                }));
            }
            SAXStream.prototype = Object.create(Stream.prototype, {
                constructor: {
                    value: SAXStream
                }
            });
            SAXStream.prototype.write = function(data) {
                if (typeof Buffer === "function" && typeof Buffer.isBuffer === "function" && Buffer.isBuffer(data)) {
                    if (!this._decoder) {
                        var SD = __webpack_require__(160).StringDecoder;
                        this._decoder = new SD("utf8");
                    }
                    data = this._decoder.write(data);
                }
                this._parser.write(data.toString());
                this.emit("data", data);
                return true;
            };
            SAXStream.prototype.end = function(chunk) {
                if (chunk && chunk.length) {
                    this.write(chunk);
                }
                this._parser.end();
                return true;
            };
            SAXStream.prototype.on = function(ev, handler) {
                var me = this;
                if (!me._parser["on" + ev] && streamWraps.indexOf(ev) !== -1) {
                    me._parser["on" + ev] = function() {
                        var args = arguments.length === 1 ? [ arguments[0] ] : Array.apply(null, arguments);
                        args.splice(0, 0, ev);
                        me.emit.apply(me, args);
                    };
                }
                return Stream.prototype.on.call(me, ev, handler);
            };
            var CDATA = "[CDATA[";
            var DOCTYPE = "DOCTYPE";
            var XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
            var XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/";
            var rootNS = {
                xml: XML_NAMESPACE,
                xmlns: XMLNS_NAMESPACE
            };
            var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
            var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;
            var entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
            var entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;
            function isWhitespace(c) {
                return c === " " || c === "\n" || c === "\r" || c === "\t";
            }
            function isQuote(c) {
                return c === '"' || c === "'";
            }
            function isAttribEnd(c) {
                return c === ">" || isWhitespace(c);
            }
            function isMatch(regex, c) {
                return regex.test(c);
            }
            function notMatch(regex, c) {
                return !isMatch(regex, c);
            }
            var S = 0;
            sax.STATE = {
                BEGIN: S++,
                BEGIN_WHITESPACE: S++,
                TEXT: S++,
                TEXT_ENTITY: S++,
                OPEN_WAKA: S++,
                SGML_DECL: S++,
                SGML_DECL_QUOTED: S++,
                DOCTYPE: S++,
                DOCTYPE_QUOTED: S++,
                DOCTYPE_DTD: S++,
                DOCTYPE_DTD_QUOTED: S++,
                COMMENT_STARTING: S++,
                COMMENT: S++,
                COMMENT_ENDING: S++,
                COMMENT_ENDED: S++,
                CDATA: S++,
                CDATA_ENDING: S++,
                CDATA_ENDING_2: S++,
                PROC_INST: S++,
                PROC_INST_BODY: S++,
                PROC_INST_ENDING: S++,
                OPEN_TAG: S++,
                OPEN_TAG_SLASH: S++,
                ATTRIB: S++,
                ATTRIB_NAME: S++,
                ATTRIB_NAME_SAW_WHITE: S++,
                ATTRIB_VALUE: S++,
                ATTRIB_VALUE_QUOTED: S++,
                ATTRIB_VALUE_CLOSED: S++,
                ATTRIB_VALUE_UNQUOTED: S++,
                ATTRIB_VALUE_ENTITY_Q: S++,
                ATTRIB_VALUE_ENTITY_U: S++,
                CLOSE_TAG: S++,
                CLOSE_TAG_SAW_WHITE: S++,
                SCRIPT: S++,
                SCRIPT_ENDING: S++
            };
            sax.XML_ENTITIES = {
                amp: "&",
                gt: ">",
                lt: "<",
                quot: '"',
                apos: "'"
            };
            sax.ENTITIES = {
                amp: "&",
                gt: ">",
                lt: "<",
                quot: '"',
                apos: "'",
                AElig: 198,
                Aacute: 193,
                Acirc: 194,
                Agrave: 192,
                Aring: 197,
                Atilde: 195,
                Auml: 196,
                Ccedil: 199,
                ETH: 208,
                Eacute: 201,
                Ecirc: 202,
                Egrave: 200,
                Euml: 203,
                Iacute: 205,
                Icirc: 206,
                Igrave: 204,
                Iuml: 207,
                Ntilde: 209,
                Oacute: 211,
                Ocirc: 212,
                Ograve: 210,
                Oslash: 216,
                Otilde: 213,
                Ouml: 214,
                THORN: 222,
                Uacute: 218,
                Ucirc: 219,
                Ugrave: 217,
                Uuml: 220,
                Yacute: 221,
                aacute: 225,
                acirc: 226,
                aelig: 230,
                agrave: 224,
                aring: 229,
                atilde: 227,
                auml: 228,
                ccedil: 231,
                eacute: 233,
                ecirc: 234,
                egrave: 232,
                eth: 240,
                euml: 235,
                iacute: 237,
                icirc: 238,
                igrave: 236,
                iuml: 239,
                ntilde: 241,
                oacute: 243,
                ocirc: 244,
                ograve: 242,
                oslash: 248,
                otilde: 245,
                ouml: 246,
                szlig: 223,
                thorn: 254,
                uacute: 250,
                ucirc: 251,
                ugrave: 249,
                uuml: 252,
                yacute: 253,
                yuml: 255,
                copy: 169,
                reg: 174,
                nbsp: 160,
                iexcl: 161,
                cent: 162,
                pound: 163,
                curren: 164,
                yen: 165,
                brvbar: 166,
                sect: 167,
                uml: 168,
                ordf: 170,
                laquo: 171,
                not: 172,
                shy: 173,
                macr: 175,
                deg: 176,
                plusmn: 177,
                sup1: 185,
                sup2: 178,
                sup3: 179,
                acute: 180,
                micro: 181,
                para: 182,
                middot: 183,
                cedil: 184,
                ordm: 186,
                raquo: 187,
                frac14: 188,
                frac12: 189,
                frac34: 190,
                iquest: 191,
                times: 215,
                divide: 247,
                OElig: 338,
                oelig: 339,
                Scaron: 352,
                scaron: 353,
                Yuml: 376,
                fnof: 402,
                circ: 710,
                tilde: 732,
                Alpha: 913,
                Beta: 914,
                Gamma: 915,
                Delta: 916,
                Epsilon: 917,
                Zeta: 918,
                Eta: 919,
                Theta: 920,
                Iota: 921,
                Kappa: 922,
                Lambda: 923,
                Mu: 924,
                Nu: 925,
                Xi: 926,
                Omicron: 927,
                Pi: 928,
                Rho: 929,
                Sigma: 931,
                Tau: 932,
                Upsilon: 933,
                Phi: 934,
                Chi: 935,
                Psi: 936,
                Omega: 937,
                alpha: 945,
                beta: 946,
                gamma: 947,
                delta: 948,
                epsilon: 949,
                zeta: 950,
                eta: 951,
                theta: 952,
                iota: 953,
                kappa: 954,
                lambda: 955,
                mu: 956,
                nu: 957,
                xi: 958,
                omicron: 959,
                pi: 960,
                rho: 961,
                sigmaf: 962,
                sigma: 963,
                tau: 964,
                upsilon: 965,
                phi: 966,
                chi: 967,
                psi: 968,
                omega: 969,
                thetasym: 977,
                upsih: 978,
                piv: 982,
                ensp: 8194,
                emsp: 8195,
                thinsp: 8201,
                zwnj: 8204,
                zwj: 8205,
                lrm: 8206,
                rlm: 8207,
                ndash: 8211,
                mdash: 8212,
                lsquo: 8216,
                rsquo: 8217,
                sbquo: 8218,
                ldquo: 8220,
                rdquo: 8221,
                bdquo: 8222,
                dagger: 8224,
                Dagger: 8225,
                bull: 8226,
                hellip: 8230,
                permil: 8240,
                prime: 8242,
                Prime: 8243,
                lsaquo: 8249,
                rsaquo: 8250,
                oline: 8254,
                frasl: 8260,
                euro: 8364,
                image: 8465,
                weierp: 8472,
                real: 8476,
                trade: 8482,
                alefsym: 8501,
                larr: 8592,
                uarr: 8593,
                rarr: 8594,
                darr: 8595,
                harr: 8596,
                crarr: 8629,
                lArr: 8656,
                uArr: 8657,
                rArr: 8658,
                dArr: 8659,
                hArr: 8660,
                forall: 8704,
                part: 8706,
                exist: 8707,
                empty: 8709,
                nabla: 8711,
                isin: 8712,
                notin: 8713,
                ni: 8715,
                prod: 8719,
                sum: 8721,
                minus: 8722,
                lowast: 8727,
                radic: 8730,
                prop: 8733,
                infin: 8734,
                ang: 8736,
                and: 8743,
                or: 8744,
                cap: 8745,
                cup: 8746,
                int: 8747,
                there4: 8756,
                sim: 8764,
                cong: 8773,
                asymp: 8776,
                ne: 8800,
                equiv: 8801,
                le: 8804,
                ge: 8805,
                sub: 8834,
                sup: 8835,
                nsub: 8836,
                sube: 8838,
                supe: 8839,
                oplus: 8853,
                otimes: 8855,
                perp: 8869,
                sdot: 8901,
                lceil: 8968,
                rceil: 8969,
                lfloor: 8970,
                rfloor: 8971,
                lang: 9001,
                rang: 9002,
                loz: 9674,
                spades: 9824,
                clubs: 9827,
                hearts: 9829,
                diams: 9830
            };
            Object.keys(sax.ENTITIES).forEach((function(key) {
                var e = sax.ENTITIES[key];
                var s = typeof e === "number" ? String.fromCharCode(e) : e;
                sax.ENTITIES[key] = s;
            }));
            for (var s in sax.STATE) {
                sax.STATE[sax.STATE[s]] = s;
            }
            S = sax.STATE;
            function emit(parser, event, data) {
                parser[event] && parser[event](data);
            }
            function emitNode(parser, nodeType, data) {
                if (parser.textNode) closeText(parser);
                emit(parser, nodeType, data);
            }
            function closeText(parser) {
                parser.textNode = textopts(parser.opt, parser.textNode);
                if (parser.textNode) emit(parser, "ontext", parser.textNode);
                parser.textNode = "";
            }
            function textopts(opt, text) {
                if (opt.trim) text = text.trim();
                if (opt.normalize) text = text.replace(/\s+/g, " ");
                return text;
            }
            function error(parser, er) {
                closeText(parser);
                if (parser.trackPosition) {
                    er += "\nLine: " + parser.line + "\nColumn: " + parser.column + "\nChar: " + parser.c;
                }
                er = new Error(er);
                parser.error = er;
                emit(parser, "onerror", er);
                return parser;
            }
            function end(parser) {
                if (parser.sawRoot && !parser.closedRoot) strictFail(parser, "Unclosed root tag");
                if (parser.state !== S.BEGIN && parser.state !== S.BEGIN_WHITESPACE && parser.state !== S.TEXT) {
                    error(parser, "Unexpected end");
                }
                closeText(parser);
                parser.c = "";
                parser.closed = true;
                emit(parser, "onend");
                SAXParser.call(parser, parser.strict, parser.opt);
                return parser;
            }
            function strictFail(parser, message) {
                if (typeof parser !== "object" || !(parser instanceof SAXParser)) {
                    throw new Error("bad call to strictFail");
                }
                if (parser.strict) {
                    error(parser, message);
                }
            }
            function newTag(parser) {
                if (!parser.strict) parser.tagName = parser.tagName[parser.looseCase]();
                var parent = parser.tags[parser.tags.length - 1] || parser;
                var tag = parser.tag = {
                    name: parser.tagName,
                    attributes: {}
                };
                if (parser.opt.xmlns) {
                    tag.ns = parent.ns;
                }
                parser.attribList.length = 0;
                emitNode(parser, "onopentagstart", tag);
            }
            function qname(name, attribute) {
                var i = name.indexOf(":");
                var qualName = i < 0 ? [ "", name ] : name.split(":");
                var prefix = qualName[0];
                var local = qualName[1];
                if (attribute && name === "xmlns") {
                    prefix = "xmlns";
                    local = "";
                }
                return {
                    prefix,
                    local
                };
            }
            function attrib(parser) {
                if (!parser.strict) {
                    parser.attribName = parser.attribName[parser.looseCase]();
                }
                if (parser.attribList.indexOf(parser.attribName) !== -1 || parser.tag.attributes.hasOwnProperty(parser.attribName)) {
                    parser.attribName = parser.attribValue = "";
                    return;
                }
                if (parser.opt.xmlns) {
                    var qn = qname(parser.attribName, true);
                    var prefix = qn.prefix;
                    var local = qn.local;
                    if (prefix === "xmlns") {
                        if (local === "xml" && parser.attribValue !== XML_NAMESPACE) {
                            strictFail(parser, "xml: prefix must be bound to " + XML_NAMESPACE + "\n" + "Actual: " + parser.attribValue);
                        } else if (local === "xmlns" && parser.attribValue !== XMLNS_NAMESPACE) {
                            strictFail(parser, "xmlns: prefix must be bound to " + XMLNS_NAMESPACE + "\n" + "Actual: " + parser.attribValue);
                        } else {
                            var tag = parser.tag;
                            var parent = parser.tags[parser.tags.length - 1] || parser;
                            if (tag.ns === parent.ns) {
                                tag.ns = Object.create(parent.ns);
                            }
                            tag.ns[local] = parser.attribValue;
                        }
                    }
                    parser.attribList.push([ parser.attribName, parser.attribValue ]);
                } else {
                    parser.tag.attributes[parser.attribName] = parser.attribValue;
                    emitNode(parser, "onattribute", {
                        name: parser.attribName,
                        value: parser.attribValue
                    });
                }
                parser.attribName = parser.attribValue = "";
            }
            function openTag(parser, selfClosing) {
                if (parser.opt.xmlns) {
                    var tag = parser.tag;
                    var qn = qname(parser.tagName);
                    tag.prefix = qn.prefix;
                    tag.local = qn.local;
                    tag.uri = tag.ns[qn.prefix] || "";
                    if (tag.prefix && !tag.uri) {
                        strictFail(parser, "Unbound namespace prefix: " + JSON.stringify(parser.tagName));
                        tag.uri = qn.prefix;
                    }
                    var parent = parser.tags[parser.tags.length - 1] || parser;
                    if (tag.ns && parent.ns !== tag.ns) {
                        Object.keys(tag.ns).forEach((function(p) {
                            emitNode(parser, "onopennamespace", {
                                prefix: p,
                                uri: tag.ns[p]
                            });
                        }));
                    }
                    for (var i = 0, l = parser.attribList.length; i < l; i++) {
                        var nv = parser.attribList[i];
                        var name = nv[0];
                        var value = nv[1];
                        var qualName = qname(name, true);
                        var prefix = qualName.prefix;
                        var local = qualName.local;
                        var uri = prefix === "" ? "" : tag.ns[prefix] || "";
                        var a = {
                            name,
                            value,
                            prefix,
                            local,
                            uri
                        };
                        if (prefix && prefix !== "xmlns" && !uri) {
                            strictFail(parser, "Unbound namespace prefix: " + JSON.stringify(prefix));
                            a.uri = prefix;
                        }
                        parser.tag.attributes[name] = a;
                        emitNode(parser, "onattribute", a);
                    }
                    parser.attribList.length = 0;
                }
                parser.tag.isSelfClosing = !!selfClosing;
                parser.sawRoot = true;
                parser.tags.push(parser.tag);
                emitNode(parser, "onopentag", parser.tag);
                if (!selfClosing) {
                    if (!parser.noscript && parser.tagName.toLowerCase() === "script") {
                        parser.state = S.SCRIPT;
                    } else {
                        parser.state = S.TEXT;
                    }
                    parser.tag = null;
                    parser.tagName = "";
                }
                parser.attribName = parser.attribValue = "";
                parser.attribList.length = 0;
            }
            function closeTag(parser) {
                if (!parser.tagName) {
                    strictFail(parser, "Weird empty close tag.");
                    parser.textNode += "</>";
                    parser.state = S.TEXT;
                    return;
                }
                if (parser.script) {
                    if (parser.tagName !== "script") {
                        parser.script += "</" + parser.tagName + ">";
                        parser.tagName = "";
                        parser.state = S.SCRIPT;
                        return;
                    }
                    emitNode(parser, "onscript", parser.script);
                    parser.script = "";
                }
                var t = parser.tags.length;
                var tagName = parser.tagName;
                if (!parser.strict) {
                    tagName = tagName[parser.looseCase]();
                }
                var closeTo = tagName;
                while (t--) {
                    var close = parser.tags[t];
                    if (close.name !== closeTo) {
                        strictFail(parser, "Unexpected close tag");
                    } else {
                        break;
                    }
                }
                if (t < 0) {
                    strictFail(parser, "Unmatched closing tag: " + parser.tagName);
                    parser.textNode += "</" + parser.tagName + ">";
                    parser.state = S.TEXT;
                    return;
                }
                parser.tagName = tagName;
                var s = parser.tags.length;
                while (s-- > t) {
                    var tag = parser.tag = parser.tags.pop();
                    parser.tagName = parser.tag.name;
                    emitNode(parser, "onclosetag", parser.tagName);
                    var x = {};
                    for (var i in tag.ns) {
                        x[i] = tag.ns[i];
                    }
                    var parent = parser.tags[parser.tags.length - 1] || parser;
                    if (parser.opt.xmlns && tag.ns !== parent.ns) {
                        Object.keys(tag.ns).forEach((function(p) {
                            var n = tag.ns[p];
                            emitNode(parser, "onclosenamespace", {
                                prefix: p,
                                uri: n
                            });
                        }));
                    }
                }
                if (t === 0) parser.closedRoot = true;
                parser.tagName = parser.attribValue = parser.attribName = "";
                parser.attribList.length = 0;
                parser.state = S.TEXT;
            }
            function parseEntity(parser) {
                var entity = parser.entity;
                var entityLC = entity.toLowerCase();
                var num;
                var numStr = "";
                if (parser.ENTITIES[entity]) {
                    return parser.ENTITIES[entity];
                }
                if (parser.ENTITIES[entityLC]) {
                    return parser.ENTITIES[entityLC];
                }
                entity = entityLC;
                if (entity.charAt(0) === "#") {
                    if (entity.charAt(1) === "x") {
                        entity = entity.slice(2);
                        num = parseInt(entity, 16);
                        numStr = num.toString(16);
                    } else {
                        entity = entity.slice(1);
                        num = parseInt(entity, 10);
                        numStr = num.toString(10);
                    }
                }
                entity = entity.replace(/^0+/, "");
                if (isNaN(num) || numStr.toLowerCase() !== entity) {
                    strictFail(parser, "Invalid character entity");
                    return "&" + parser.entity + ";";
                }
                return String.fromCodePoint(num);
            }
            function beginWhiteSpace(parser, c) {
                if (c === "<") {
                    parser.state = S.OPEN_WAKA;
                    parser.startTagPosition = parser.position;
                } else if (!isWhitespace(c)) {
                    strictFail(parser, "Non-whitespace before first tag.");
                    parser.textNode = c;
                    parser.state = S.TEXT;
                }
            }
            function charAt(chunk, i) {
                var result = "";
                if (i < chunk.length) {
                    result = chunk.charAt(i);
                }
                return result;
            }
            function write(chunk) {
                var parser = this;
                if (this.error) {
                    throw this.error;
                }
                if (parser.closed) {
                    return error(parser, "Cannot write after close. Assign an onready handler.");
                }
                if (chunk === null) {
                    return end(parser);
                }
                if (typeof chunk === "object") {
                    chunk = chunk.toString();
                }
                var i = 0;
                var c = "";
                while (true) {
                    c = charAt(chunk, i++);
                    parser.c = c;
                    if (!c) {
                        break;
                    }
                    if (parser.trackPosition) {
                        parser.position++;
                        if (c === "\n") {
                            parser.line++;
                            parser.column = 0;
                        } else {
                            parser.column++;
                        }
                    }
                    switch (parser.state) {
                      case S.BEGIN:
                        parser.state = S.BEGIN_WHITESPACE;
                        if (c === "\ufeff") {
                            continue;
                        }
                        beginWhiteSpace(parser, c);
                        continue;

                      case S.BEGIN_WHITESPACE:
                        beginWhiteSpace(parser, c);
                        continue;

                      case S.TEXT:
                        if (parser.sawRoot && !parser.closedRoot) {
                            var starti = i - 1;
                            while (c && c !== "<" && c !== "&") {
                                c = charAt(chunk, i++);
                                if (c && parser.trackPosition) {
                                    parser.position++;
                                    if (c === "\n") {
                                        parser.line++;
                                        parser.column = 0;
                                    } else {
                                        parser.column++;
                                    }
                                }
                            }
                            parser.textNode += chunk.substring(starti, i - 1);
                        }
                        if (c === "<" && !(parser.sawRoot && parser.closedRoot && !parser.strict)) {
                            parser.state = S.OPEN_WAKA;
                            parser.startTagPosition = parser.position;
                        } else {
                            if (!isWhitespace(c) && (!parser.sawRoot || parser.closedRoot)) {
                                strictFail(parser, "Text data outside of root node.");
                            }
                            if (c === "&") {
                                parser.state = S.TEXT_ENTITY;
                            } else {
                                parser.textNode += c;
                            }
                        }
                        continue;

                      case S.SCRIPT:
                        if (c === "<") {
                            parser.state = S.SCRIPT_ENDING;
                        } else {
                            parser.script += c;
                        }
                        continue;

                      case S.SCRIPT_ENDING:
                        if (c === "/") {
                            parser.state = S.CLOSE_TAG;
                        } else {
                            parser.script += "<" + c;
                            parser.state = S.SCRIPT;
                        }
                        continue;

                      case S.OPEN_WAKA:
                        if (c === "!") {
                            parser.state = S.SGML_DECL;
                            parser.sgmlDecl = "";
                        } else if (isWhitespace(c)) {} else if (isMatch(nameStart, c)) {
                            parser.state = S.OPEN_TAG;
                            parser.tagName = c;
                        } else if (c === "/") {
                            parser.state = S.CLOSE_TAG;
                            parser.tagName = "";
                        } else if (c === "?") {
                            parser.state = S.PROC_INST;
                            parser.procInstName = parser.procInstBody = "";
                        } else {
                            strictFail(parser, "Unencoded <");
                            if (parser.startTagPosition + 1 < parser.position) {
                                var pad = parser.position - parser.startTagPosition;
                                c = new Array(pad).join(" ") + c;
                            }
                            parser.textNode += "<" + c;
                            parser.state = S.TEXT;
                        }
                        continue;

                      case S.SGML_DECL:
                        if ((parser.sgmlDecl + c).toUpperCase() === CDATA) {
                            emitNode(parser, "onopencdata");
                            parser.state = S.CDATA;
                            parser.sgmlDecl = "";
                            parser.cdata = "";
                        } else if (parser.sgmlDecl + c === "--") {
                            parser.state = S.COMMENT;
                            parser.comment = "";
                            parser.sgmlDecl = "";
                        } else if ((parser.sgmlDecl + c).toUpperCase() === DOCTYPE) {
                            parser.state = S.DOCTYPE;
                            if (parser.doctype || parser.sawRoot) {
                                strictFail(parser, "Inappropriately located doctype declaration");
                            }
                            parser.doctype = "";
                            parser.sgmlDecl = "";
                        } else if (c === ">") {
                            emitNode(parser, "onsgmldeclaration", parser.sgmlDecl);
                            parser.sgmlDecl = "";
                            parser.state = S.TEXT;
                        } else if (isQuote(c)) {
                            parser.state = S.SGML_DECL_QUOTED;
                            parser.sgmlDecl += c;
                        } else {
                            parser.sgmlDecl += c;
                        }
                        continue;

                      case S.SGML_DECL_QUOTED:
                        if (c === parser.q) {
                            parser.state = S.SGML_DECL;
                            parser.q = "";
                        }
                        parser.sgmlDecl += c;
                        continue;

                      case S.DOCTYPE:
                        if (c === ">") {
                            parser.state = S.TEXT;
                            emitNode(parser, "ondoctype", parser.doctype);
                            parser.doctype = true;
                        } else {
                            parser.doctype += c;
                            if (c === "[") {
                                parser.state = S.DOCTYPE_DTD;
                            } else if (isQuote(c)) {
                                parser.state = S.DOCTYPE_QUOTED;
                                parser.q = c;
                            }
                        }
                        continue;

                      case S.DOCTYPE_QUOTED:
                        parser.doctype += c;
                        if (c === parser.q) {
                            parser.q = "";
                            parser.state = S.DOCTYPE;
                        }
                        continue;

                      case S.DOCTYPE_DTD:
                        parser.doctype += c;
                        if (c === "]") {
                            parser.state = S.DOCTYPE;
                        } else if (isQuote(c)) {
                            parser.state = S.DOCTYPE_DTD_QUOTED;
                            parser.q = c;
                        }
                        continue;

                      case S.DOCTYPE_DTD_QUOTED:
                        parser.doctype += c;
                        if (c === parser.q) {
                            parser.state = S.DOCTYPE_DTD;
                            parser.q = "";
                        }
                        continue;

                      case S.COMMENT:
                        if (c === "-") {
                            parser.state = S.COMMENT_ENDING;
                        } else {
                            parser.comment += c;
                        }
                        continue;

                      case S.COMMENT_ENDING:
                        if (c === "-") {
                            parser.state = S.COMMENT_ENDED;
                            parser.comment = textopts(parser.opt, parser.comment);
                            if (parser.comment) {
                                emitNode(parser, "oncomment", parser.comment);
                            }
                            parser.comment = "";
                        } else {
                            parser.comment += "-" + c;
                            parser.state = S.COMMENT;
                        }
                        continue;

                      case S.COMMENT_ENDED:
                        if (c !== ">") {
                            strictFail(parser, "Malformed comment");
                            parser.comment += "--" + c;
                            parser.state = S.COMMENT;
                        } else {
                            parser.state = S.TEXT;
                        }
                        continue;

                      case S.CDATA:
                        if (c === "]") {
                            parser.state = S.CDATA_ENDING;
                        } else {
                            parser.cdata += c;
                        }
                        continue;

                      case S.CDATA_ENDING:
                        if (c === "]") {
                            parser.state = S.CDATA_ENDING_2;
                        } else {
                            parser.cdata += "]" + c;
                            parser.state = S.CDATA;
                        }
                        continue;

                      case S.CDATA_ENDING_2:
                        if (c === ">") {
                            if (parser.cdata) {
                                emitNode(parser, "oncdata", parser.cdata);
                            }
                            emitNode(parser, "onclosecdata");
                            parser.cdata = "";
                            parser.state = S.TEXT;
                        } else if (c === "]") {
                            parser.cdata += "]";
                        } else {
                            parser.cdata += "]]" + c;
                            parser.state = S.CDATA;
                        }
                        continue;

                      case S.PROC_INST:
                        if (c === "?") {
                            parser.state = S.PROC_INST_ENDING;
                        } else if (isWhitespace(c)) {
                            parser.state = S.PROC_INST_BODY;
                        } else {
                            parser.procInstName += c;
                        }
                        continue;

                      case S.PROC_INST_BODY:
                        if (!parser.procInstBody && isWhitespace(c)) {
                            continue;
                        } else if (c === "?") {
                            parser.state = S.PROC_INST_ENDING;
                        } else {
                            parser.procInstBody += c;
                        }
                        continue;

                      case S.PROC_INST_ENDING:
                        if (c === ">") {
                            emitNode(parser, "onprocessinginstruction", {
                                name: parser.procInstName,
                                body: parser.procInstBody
                            });
                            parser.procInstName = parser.procInstBody = "";
                            parser.state = S.TEXT;
                        } else {
                            parser.procInstBody += "?" + c;
                            parser.state = S.PROC_INST_BODY;
                        }
                        continue;

                      case S.OPEN_TAG:
                        if (isMatch(nameBody, c)) {
                            parser.tagName += c;
                        } else {
                            newTag(parser);
                            if (c === ">") {
                                openTag(parser);
                            } else if (c === "/") {
                                parser.state = S.OPEN_TAG_SLASH;
                            } else {
                                if (!isWhitespace(c)) {
                                    strictFail(parser, "Invalid character in tag name");
                                }
                                parser.state = S.ATTRIB;
                            }
                        }
                        continue;

                      case S.OPEN_TAG_SLASH:
                        if (c === ">") {
                            openTag(parser, true);
                            closeTag(parser);
                        } else {
                            strictFail(parser, "Forward-slash in opening tag not followed by >");
                            parser.state = S.ATTRIB;
                        }
                        continue;

                      case S.ATTRIB:
                        if (isWhitespace(c)) {
                            continue;
                        } else if (c === ">") {
                            openTag(parser);
                        } else if (c === "/") {
                            parser.state = S.OPEN_TAG_SLASH;
                        } else if (isMatch(nameStart, c)) {
                            parser.attribName = c;
                            parser.attribValue = "";
                            parser.state = S.ATTRIB_NAME;
                        } else {
                            strictFail(parser, "Invalid attribute name");
                        }
                        continue;

                      case S.ATTRIB_NAME:
                        if (c === "=") {
                            parser.state = S.ATTRIB_VALUE;
                        } else if (c === ">") {
                            strictFail(parser, "Attribute without value");
                            parser.attribValue = parser.attribName;
                            attrib(parser);
                            openTag(parser);
                        } else if (isWhitespace(c)) {
                            parser.state = S.ATTRIB_NAME_SAW_WHITE;
                        } else if (isMatch(nameBody, c)) {
                            parser.attribName += c;
                        } else {
                            strictFail(parser, "Invalid attribute name");
                        }
                        continue;

                      case S.ATTRIB_NAME_SAW_WHITE:
                        if (c === "=") {
                            parser.state = S.ATTRIB_VALUE;
                        } else if (isWhitespace(c)) {
                            continue;
                        } else {
                            strictFail(parser, "Attribute without value");
                            parser.tag.attributes[parser.attribName] = "";
                            parser.attribValue = "";
                            emitNode(parser, "onattribute", {
                                name: parser.attribName,
                                value: ""
                            });
                            parser.attribName = "";
                            if (c === ">") {
                                openTag(parser);
                            } else if (isMatch(nameStart, c)) {
                                parser.attribName = c;
                                parser.state = S.ATTRIB_NAME;
                            } else {
                                strictFail(parser, "Invalid attribute name");
                                parser.state = S.ATTRIB;
                            }
                        }
                        continue;

                      case S.ATTRIB_VALUE:
                        if (isWhitespace(c)) {
                            continue;
                        } else if (isQuote(c)) {
                            parser.q = c;
                            parser.state = S.ATTRIB_VALUE_QUOTED;
                        } else {
                            strictFail(parser, "Unquoted attribute value");
                            parser.state = S.ATTRIB_VALUE_UNQUOTED;
                            parser.attribValue = c;
                        }
                        continue;

                      case S.ATTRIB_VALUE_QUOTED:
                        if (c !== parser.q) {
                            if (c === "&") {
                                parser.state = S.ATTRIB_VALUE_ENTITY_Q;
                            } else {
                                parser.attribValue += c;
                            }
                            continue;
                        }
                        attrib(parser);
                        parser.q = "";
                        parser.state = S.ATTRIB_VALUE_CLOSED;
                        continue;

                      case S.ATTRIB_VALUE_CLOSED:
                        if (isWhitespace(c)) {
                            parser.state = S.ATTRIB;
                        } else if (c === ">") {
                            openTag(parser);
                        } else if (c === "/") {
                            parser.state = S.OPEN_TAG_SLASH;
                        } else if (isMatch(nameStart, c)) {
                            strictFail(parser, "No whitespace between attributes");
                            parser.attribName = c;
                            parser.attribValue = "";
                            parser.state = S.ATTRIB_NAME;
                        } else {
                            strictFail(parser, "Invalid attribute name");
                        }
                        continue;

                      case S.ATTRIB_VALUE_UNQUOTED:
                        if (!isAttribEnd(c)) {
                            if (c === "&") {
                                parser.state = S.ATTRIB_VALUE_ENTITY_U;
                            } else {
                                parser.attribValue += c;
                            }
                            continue;
                        }
                        attrib(parser);
                        if (c === ">") {
                            openTag(parser);
                        } else {
                            parser.state = S.ATTRIB;
                        }
                        continue;

                      case S.CLOSE_TAG:
                        if (!parser.tagName) {
                            if (isWhitespace(c)) {
                                continue;
                            } else if (notMatch(nameStart, c)) {
                                if (parser.script) {
                                    parser.script += "</" + c;
                                    parser.state = S.SCRIPT;
                                } else {
                                    strictFail(parser, "Invalid tagname in closing tag.");
                                }
                            } else {
                                parser.tagName = c;
                            }
                        } else if (c === ">") {
                            closeTag(parser);
                        } else if (isMatch(nameBody, c)) {
                            parser.tagName += c;
                        } else if (parser.script) {
                            parser.script += "</" + parser.tagName;
                            parser.tagName = "";
                            parser.state = S.SCRIPT;
                        } else {
                            if (!isWhitespace(c)) {
                                strictFail(parser, "Invalid tagname in closing tag");
                            }
                            parser.state = S.CLOSE_TAG_SAW_WHITE;
                        }
                        continue;

                      case S.CLOSE_TAG_SAW_WHITE:
                        if (isWhitespace(c)) {
                            continue;
                        }
                        if (c === ">") {
                            closeTag(parser);
                        } else {
                            strictFail(parser, "Invalid characters in closing tag");
                        }
                        continue;

                      case S.TEXT_ENTITY:
                      case S.ATTRIB_VALUE_ENTITY_Q:
                      case S.ATTRIB_VALUE_ENTITY_U:
                        var returnState;
                        var buffer;
                        switch (parser.state) {
                          case S.TEXT_ENTITY:
                            returnState = S.TEXT;
                            buffer = "textNode";
                            break;

                          case S.ATTRIB_VALUE_ENTITY_Q:
                            returnState = S.ATTRIB_VALUE_QUOTED;
                            buffer = "attribValue";
                            break;

                          case S.ATTRIB_VALUE_ENTITY_U:
                            returnState = S.ATTRIB_VALUE_UNQUOTED;
                            buffer = "attribValue";
                            break;
                        }
                        if (c === ";") {
                            parser[buffer] += parseEntity(parser);
                            parser.entity = "";
                            parser.state = returnState;
                        } else if (isMatch(parser.entity.length ? entityBody : entityStart, c)) {
                            parser.entity += c;
                        } else {
                            strictFail(parser, "Invalid character in entity name");
                            parser[buffer] += "&" + parser.entity + c;
                            parser.entity = "";
                            parser.state = returnState;
                        }
                        continue;

                      default:
                        throw new Error(parser, "Unknown state: " + parser.state);
                    }
                }
                if (parser.position >= parser.bufferCheckPosition) {
                    checkBufferLength(parser);
                }
                return parser;
            }
            if (!String.fromCodePoint) {
                (function() {
                    var stringFromCharCode = String.fromCharCode;
                    var floor = Math.floor;
                    var fromCodePoint = function() {
                        var MAX_SIZE = 16384;
                        var codeUnits = [];
                        var highSurrogate;
                        var lowSurrogate;
                        var index = -1;
                        var length = arguments.length;
                        if (!length) {
                            return "";
                        }
                        var result = "";
                        while (++index < length) {
                            var codePoint = Number(arguments[index]);
                            if (!isFinite(codePoint) || codePoint < 0 || codePoint > 1114111 || floor(codePoint) !== codePoint) {
                                throw RangeError("Invalid code point: " + codePoint);
                            }
                            if (codePoint <= 65535) {
                                codeUnits.push(codePoint);
                            } else {
                                codePoint -= 65536;
                                highSurrogate = (codePoint >> 10) + 55296;
                                lowSurrogate = codePoint % 1024 + 56320;
                                codeUnits.push(highSurrogate, lowSurrogate);
                            }
                            if (index + 1 === length || codeUnits.length > MAX_SIZE) {
                                result += stringFromCharCode.apply(null, codeUnits);
                                codeUnits.length = 0;
                            }
                        }
                        return result;
                    };
                    if (Object.defineProperty) {
                        Object.defineProperty(String, "fromCodePoint", {
                            value: fromCodePoint,
                            configurable: true,
                            writable: true
                        });
                    } else {
                        String.fromCodePoint = fromCodePoint;
                    }
                })();
            }
        })(false ? 0 : exports);
    }, module => {
        "use strict";
        module.exports = require("string_decoder");
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var Plist = __webpack_require__(157);
        var getType = __webpack_require__(162);
        const INDENT = "  ";
        const EOL = "\n";
        const BASE64_WIDTH = 48 * 2;
        const ENTITY_PATTERN = /<|>|"|'|&/g;
        const ENTITIES = {
            "<": "&lt;",
            ">": "&gt;",
            '"': "&quot;",
            "'": "&apos;",
            "&": "&amp;"
        };
        function encodeEntities(str) {
            return str ? str.replace(ENTITY_PATTERN, (char => ENTITIES[char])) : "";
        }
        function encodeData(value, depth) {
            var indent = INDENT.repeat(depth);
            var block = indent + "<data>" + EOL;
            var data = value.toString("base64");
            var offset = 0;
            while (offset < data.length) {
                block += indent + data.slice(offset, offset += BASE64_WIDTH) + EOL;
            }
            return block + indent + "</data>" + EOL;
        }
        function encodeString(value, depth) {
            return INDENT.repeat(depth) + `<string>${encodeEntities(value)}</string>` + EOL;
        }
        function encodeBoolean(value, depth) {
            return INDENT.repeat(depth) + (value ? `<true/>` : "<false/>") + EOL;
        }
        function encodeNumber(value, depth) {
            return INDENT.repeat(depth) + (Math.round(value) === value ? `<integer>${encodeEntities(value.toString())}</integer>` : `<real>${encodeEntities(value.toString())}</real>`) + EOL;
        }
        function encodeDate(value, depth) {
            return INDENT.repeat(depth) + `<date>${value.toJSON()}</date>` + EOL;
        }
        function encodeKey(value, depth) {
            return INDENT.repeat(depth) + `<key>${encodeEntities(value)}</key>` + EOL;
        }
        function encodeDict(value, depth) {
            var indent = INDENT.repeat(depth);
            var output = indent + "<dict>" + EOL;
            var keys = Object.keys(value);
            for (var i = 0; i < keys.length; i++) {
                output += encodeKey(keys[i], depth + 1);
                output += encodeObject(value[keys[i]], depth + 1);
            }
            return output + indent + "</dict>" + EOL;
        }
        function encodeMap(value, depth) {
            var indent = INDENT.repeat(depth);
            var output = indent + "<dict>" + EOL;
            value.forEach(((value, key) => {
                output += encodeKey(keys, depth + 1);
                output += encodeObject(value, depth + 1);
            }));
            return output + indent + "</dict>" + EOL;
        }
        function encodeSet(value, depth) {
            var indent = INDENT.repeat(depth);
            var output = indent + "<array>" + EOL;
            value.forEach((value => {
                output += encodeObject(value, depth + 1);
            }));
            return output + indent + "</array>" + EOL;
        }
        function encodeArray(value, depth) {
            var indent = INDENT.repeat(depth);
            var output = indent + "<array>" + EOL;
            for (var i = 0; i < value.length; i++) {
                output += encodeObject(value[i], depth + 1);
            }
            return output + indent + "</array>" + EOL;
        }
        function encodeObject(value, depth) {
            var type = getType(value);
            depth = depth || 0;
            switch (type) {
              case "arraybufferview":
                return encodeData(Buffer.from(value.buffer, value.byteOffset, value.byteLength), depth);

              case "arraybuffer":
                return encodeData(Buffer.from(value), depth);

              case "buffer":
                return encodeData(value, depth);

              case "array":
                return encodeArray(value, depth);

              case "set":
                return encodeSet(value, depth);

              case "object":
                return encodeDict(value, depth);

              case "map":
                return encodeMap(value, depth);

              case "number":
                return encodeNumber(value, depth);

              case "bigint":
                return encodeNumber(value, depth);

              case "string":
                return encodeString(value, depth);

              case "symbol":
                return encodeString(value.description, depth);

              case "boolean":
                return encodeBoolean(value, depth);

              case "date":
                return encodeDate(value, depth);
            }
            throw new Error(`Unknown data type "${type}"`);
        }
        function encode(data, buffer, offset) {
            return `<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n<plist version="1.0">\n${encodeObject(data)}\n</plist>\n`;
        }
        module.exports = encode;
    }, module => {
        module.exports = function getTypeOf(value) {
            if (value === null) return "null";
            var type = typeof value;
            var isPrimitive = type == "undefined" || type == "number" || type == "bigint" || type == "string" || type == "boolean" || type == "symbol";
            if (isPrimitive) return type;
            if (Buffer.isBuffer(value)) return "buffer";
            if (Array.isArray(value)) return "array";
            if (ArrayBuffer.isView(value)) return "arraybufferview";
            if (value instanceof Number) return "number";
            if (value instanceof Boolean) return "boolean";
            if (value instanceof ArrayBuffer) return "arraybuffer";
            if (value instanceof Date) return "date";
            if (value instanceof Set) return "set";
            if (value instanceof Map) return "map";
            return type;
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var Plist = __webpack_require__(157);
        var {readBigInt64BE, readBigUInt64BE} = __webpack_require__(164);
        function readPrimitive(objInfo) {
            switch (objInfo) {
              case 0:
                return null;

              case 8:
                return false;

              case 9:
                return true;

              case 15:
                return undefined;
            }
        }
        function readInt(context, buffer, offset) {
            var objInfo = buffer[context.offset + offset] & 15;
            var length = 1 << objInfo;
            switch (length) {
              case 1:
                return buffer.readUInt8(context.offset + offset + 1);

              case 2:
                return buffer.readUInt16BE(context.offset + offset + 1);

              case 4:
                return buffer.readUInt32BE(context.offset + offset + 1);

              case 8:
                return Number(readBigInt64BE(buffer, context.offset + offset + 1));

              case 16:
                return Number((readBigInt64BE(buffer, context.offset + offset + 1) << 64n) + readBigUInt64BE(buffer, context.offset + offset + 1 + 8));

              default:
                throw new Error(`${length} byte integers not supported`);
            }
        }
        function readReal(context, buffer, offset) {
            var objInfo = buffer[context.offset + offset] & 15;
            var length = 1 << objInfo;
            switch (length) {
              case 4:
                return buffer.readFloatBE(context.offset + offset + 1);

              case 8:
                return buffer.readDoubleBE(context.offset + offset + 1);

              default:
                throw new Error(`${length} byte reals not supported`);
            }
        }
        function readDate(context, buffer, offset) {
            var objInfo = buffer[context.offset + offset] & 15;
            offset += 1;
            var seconds = buffer.readDoubleBE(context.offset + offset);
            return new Date(Plist.EPOCH + seconds * 1e3);
        }
        function readData(context, buffer, offset) {
            var objInfo = buffer[context.offset + offset] & 15;
            var length = objInfo !== 15 ? objInfo : -1;
            offset += 1;
            if (length === -1) {
                length = readInt(context, buffer, offset);
                offset += 1 + (1 << (buffer[context.offset + offset] & 15));
            }
            var data = Buffer.alloc(length);
            var start = context.offset + offset;
            var end = start + length;
            buffer.copy(data, 0, start, end);
            return data;
        }
        function readAscii(context, buffer, offset) {
            var objInfo = buffer[context.offset + offset] & 15;
            var length = objInfo !== 15 ? objInfo : -1;
            offset += 1;
            if (length === -1) {
                length = readInt(context, buffer, offset);
                offset += 1 + (1 << (buffer[context.offset + offset] & 15));
            }
            var start = context.offset + offset;
            var end = start + length;
            return buffer.toString("ascii", start, end);
        }
        function readUnicode(context, buffer, offset) {
            var objInfo = buffer[context.offset + offset] & 15;
            var length = objInfo !== 15 ? objInfo : -1;
            offset += 1;
            if (length === -1) {
                length = readInt(context, buffer, offset);
                offset += 1 + (1 << (buffer[context.offset + offset] & 15));
            }
            var start = context.offset + offset;
            var end = start + length * 2;
            var chars = Buffer.alloc(length * 2);
            buffer.copy(chars, 0, start, end);
            return chars.swap16().toString("utf16le");
        }
        function readUID(context, buffer, offset) {
            var objInfo = buffer[context.offset + offset] & 15;
            var length = objInfo + 1;
            offset += 1;
            var start = context.offset + offset;
            var end = start + length;
            return buffer.toString("hex", start, end);
        }
        function readArray(context, buffer, offset) {
            var objInfo = buffer[context.offset + offset] & 15;
            var length = objInfo !== 15 ? objInfo : -1;
            offset += 1;
            if (length === -1) {
                length = readInt(context, buffer, offset);
                offset += 1 + (1 << (buffer[context.offset + offset] & 15));
            }
            var array = [];
            var objRef = null;
            for (var i = 0; i < length; i++) {
                objRef = buffer.readUIntBE(context.offset + offset + i * context.objectRefSize, context.objectRefSize);
                array.push(readObject(context, buffer, objRef));
            }
            return array;
        }
        function readSet(context, buffer, offset) {
            var objInfo = buffer[context.offset + offset] & 15;
            var length = objInfo !== 15 ? objInfo : -1;
            offset += 1;
            if (length === -1) {
                length = readInt(context, buffer, offset);
                offset += 1 + (1 << (buffer[context.offset + offset] & 15));
            }
            var set = new Set;
            var objRef = null;
            for (var i = 0; i < length; i++) {
                objRef = buffer.readUIntBE(offset + i * context.objectRefSize, context.objectRefSize);
                set.add(readObject(context, buffer, objRef));
            }
            return set;
        }
        function readDict(context, buffer, offset) {
            var objInfo = buffer[context.offset + offset] & 15;
            var length = objInfo !== 15 ? objInfo : -1;
            offset += 1;
            if (length === -1) {
                length = readInt(context, buffer, offset);
                offset += 1 + (1 << (buffer[context.offset + offset] & 15));
            }
            var dict = {};
            var keys = [];
            var objRef = null;
            for (var i = 0; i < length; i++) {
                objRef = buffer.readUIntBE(context.offset + offset + i * context.objectRefSize, context.objectRefSize);
                keys.push(readObject(context, buffer, objRef));
            }
            var values = [];
            for (var i = 0; i < length; i++) {
                objRef = buffer.readUIntBE(context.offset + offset + (i + length) * context.objectRefSize, context.objectRefSize);
                values.push(readObject(context, buffer, objRef));
            }
            for (var i = 0; i < length; i++) {
                dict[keys[i]] = values[i];
            }
            return dict;
        }
        function readObject(context, buffer, objRef) {
            var offset = context.offsetTable.readUIntBE(objRef * context.offsetIntSize, context.offsetIntSize);
            var marker = buffer[context.offset + offset];
            var objType = (marker & 240) >>> 4;
            var objInfo = marker & 15;
            switch (objType) {
              case 0:
                return readPrimitive(objInfo);

              case 1:
                return readInt(context, buffer, offset);

              case 2:
                return readReal(context, buffer, offset);

              case 3:
                return readDate(context, buffer, offset);

              case 4:
                return readData(context, buffer, offset);

              case 5:
                return readAscii(context, buffer, offset);

              case 6:
                return readUnicode(context, buffer, offset);

              case 8:
                return readUID(context, buffer, offset);

              case 10:
                return readArray(context, buffer, offset);

              case 12:
                return readSet(context, buffer, offset);

              case 13:
                return readDict(context, buffer, offset);
            }
            throw new Error(`Unknown type marker 0b${marker.toString(2)}`);
        }
        function decode(buffer, offset, length) {
            offset = offset || 0;
            length = length || buffer.length - offset;
            if (buffer.indexOf(Plist.SIGNATURE_BINARY, offset) !== offset) {
                throw new Error(`Invalid property list signature at offset 0x${offset.toString(16)}`);
            }
            var trailerOffset = offset + length - 32;
            var context = {
                offset,
                length,
                trailerOffset,
                sortVersion: buffer[trailerOffset + 5],
                offsetIntSize: buffer[trailerOffset + 6],
                objectRefSize: buffer[trailerOffset + 7],
                objectCount: Number(readBigUInt64BE(buffer, trailerOffset + 8)),
                rootObject: Number(readBigUInt64BE(buffer, trailerOffset + 16)),
                offsetTableOffset: Number(readBigUInt64BE(buffer, trailerOffset + 24)),
                offsetTable: null
            };
            context.offsetTable = buffer.slice(offset + context.offsetTableOffset, offset + context.offsetTableOffset + context.objectCount * context.offsetIntSize);
            return readObject(context, buffer, context.rootObject);
        }
        module.exports = decode;
    }, module => {
        var buffer = module.exports;
        var hasBigIntMethods = typeof Buffer.prototype.readBigUInt64BE == "function";
        if (hasBigIntMethods) {
            buffer.readBigUInt64BE = function(buffer, offset) {
                return buffer.readBigUInt64BE(offset);
            };
            buffer.writeBigUInt64BE = function(buffer, value, offset) {
                return buffer.writeBigUInt64BE(value, offset);
            };
            buffer.readBigUInt64LE = function(buffer, offset) {
                return buffer.readBigUInt64LE(offset);
            };
            buffer.writeBigUInt64LE = function(buffer, value, offset) {
                return buffer.writeBigUInt64LE(value, offset);
            };
            buffer.readBigInt64BE = function(buffer, offset) {
                return buffer.readBigInt64BE(offset);
            };
            buffer.writeBigInt64BE = function(buffer, value, offset) {
                return buffer.writeBigInt64BE(value, offset);
            };
            buffer.readBigInt64LE = function(buffer, offset) {
                return buffer.readBigInt64LE(offset);
            };
            buffer.writeBigInt64LE = function(buffer, value, offset) {
                return buffer.writeBigInt64LE(value, offset);
            };
        } else {
            buffer.readBigUInt64BE = function(buffer, offset) {
                offset = offset || 0;
                var hi = buffer.readUInt32BE(offset);
                var lo = buffer.readUInt32BE(offset + 4);
                return (BigInt(hi) << BigInt(32)) + BigInt(lo);
            };
            buffer.writeBigUInt64BE = function(buffer, value, offset) {
                offset = offset || 0;
                var hi = BigInt(value) >> BigInt(32);
                var lo = BigInt(value) - (hi << BigInt(32));
                buffer.writeUInt32BE(Number(hi), offset);
                buffer.writeUInt32BE(Number(lo), offset + 4);
                return offset + 8;
            };
            buffer.readBigUInt64LE = function(buffer, offset) {
                offset = offset || 0;
                var hi = buffer.readUInt32LE(offset + 4);
                var lo = buffer.readUInt32LE(offset);
                return (BigInt(hi) << BigInt(32)) + BigInt(lo);
            };
            buffer.writeBigUInt64LE = function(buffer, value, offset) {
                offset = offset || 0;
                var hi = BigInt(value) >> BigInt(32);
                var lo = BigInt(value) - (hi << BigInt(32));
                buffer.writeUInt32LE(Number(hi), offset + 4);
                buffer.writeUInt32LE(Number(lo), offset);
                return offset + 8;
            };
            buffer.readBigInt64BE = function(buffer, offset) {
                offset = offset || 0;
                var hi = buffer.readInt32BE(offset);
                var lo = buffer.readUInt32BE(offset + 4);
                return (BigInt(hi) << BigInt(32)) + BigInt(lo);
            };
            buffer.writeBigInt64BE = function(buffer, value, offset) {
                offset = offset || 0;
                var hi = BigInt(value) >> BigInt(32);
                var lo = BigInt(value) - (hi << BigInt(32));
                buffer.writeInt32BE(Number(hi), offset);
                buffer.writeUInt32BE(Number(lo), offset + 4);
                return offset + 8;
            };
            buffer.readBigInt64LE = function(buffer, offset) {
                offset = offset || 0;
                var hi = buffer.readInt32LE(offset + 4);
                var lo = buffer.readUInt32LE(offset);
                return (BigInt(hi) << BigInt(32)) + BigInt(lo);
            };
            buffer.writeBigInt64LE = function(buffer, value, offset) {
                offset = offset || 0;
                var hi = BigInt(value) >> BigInt(32);
                var lo = BigInt(value) - (hi << BigInt(32));
                buffer.writeUInt32LE(Number(hi), offset + 4);
                buffer.writeInt32LE(Number(lo), offset);
                return offset + 8;
            };
        }
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var Plist = __webpack_require__(157);
        var {writeBigInt64BE, writeBigUInt64BE} = __webpack_require__(164);
        const PRIMITIVE = 0;
        const INT = 1;
        const REAL = 2;
        const DATE = 3;
        const DATA = 4;
        const ASCII = 5;
        const UNICODE = 6;
        const UUID = 8;
        const ARRAY = 10;
        const SET = 12;
        const DICT = 13;
        function bits(value, clamp = 0) {
            var bits = Math.ceil(Math.log2(Math.abs(value) + 1));
            return Math.max(clamp, 1 << Math.ceil(Math.log2(bits)));
        }
        function signedBits(value, clamp = 0) {
            var bits = Math.ceil(Math.log2(Math.abs(value)));
            return Math.max(clamp, 1 << Math.ceil(Math.log2(bits))) * 2;
        }
        function getTypeof(value) {
            if (value === null) return "null";
            if (Buffer.isBuffer(value)) return "buffer";
            if (Array.isArray(value)) return "array";
            if (ArrayBuffer.isView(value)) return "arraybufferview";
            if (value instanceof Number) return "number";
            if (value instanceof String) return "string";
            if (value instanceof Boolean) return "boolean";
            if (value instanceof Map) return "map";
            if (value instanceof Set) return "set";
            if (value instanceof ArrayBuffer) return "arraybuffer";
            return typeof value;
        }
        function isPrimitiveType(type) {
            return type == "null" || type == "undefined" || type == "boolean" || type == "number" || type == "bigint" || type == "string" || type == "date";
        }
        function getValueSet(value) {
            var values = new Set;
            var objects = new Set;
            var queue = [ value ];
            while (queue.length) {
                let value = queue.shift();
                let type = getTypeof(value);
                if (isPrimitiveType(type)) {
                    values.add(value);
                } else if (type == "object") {
                    objects.add(value);
                    Object.keys(value).forEach((key => {
                        values.add(key);
                        queue.push(value[key]);
                    }));
                } else if (type == "array" || type == "arraybufferview") {
                    objects.add(value);
                    value.forEach((item => {
                        queue.push(item);
                    }));
                } else if (type == "map") {
                    objects.add(value);
                    for (let [key, item] of value) {
                        queue.push(key);
                        queue.push(item);
                    }
                } else if (type == "set") {
                    objects.add(value);
                    for (let item of value) {
                        queue.push(item);
                    }
                } else if (type == "buffer" || type == "arraybuffer") {
                    values.add(value);
                } else {
                    throw new Error(`Unsupported value type "${type}"`);
                }
            }
            return [ ...values ].concat([ ...objects ].reverse());
        }
        function encode(value, buffer, offset) {
            offset = offset || 0;
            var values = getValueSet(value);
            var objectCount = values.length;
            var refSize = bits(objectCount, 8) / 8;
            var offsets = new Array(objectCount);
            var state = {
                offsets,
                objectCount,
                refSize
            };
            offset += buffer.write("bplist00", offset, "bplist00".length, "ascii");
            for (let i = 0; i < objectCount; i++) {
                offsets[i] = offset;
                offset = encodeValue(values, i, state, buffer, offset);
            }
            var tableOffset = offset;
            var offsetSize = bits(tableOffset, 8) / 8;
            var offsetTable = Buffer.alloc(objectCount * offsetSize);
            for (let i = 0; i < objectCount; i++) {
                let dataOffset = offsets[i];
                offset = buffer.writeUIntBE(dataOffset, offset, offsetSize);
            }
            offset = buffer.writeUIntBE(0, offset, 6);
            offset = buffer.writeUInt8(offsetSize, offset);
            offset = buffer.writeUInt8(refSize, offset);
            offset = writeBigUInt64BE(buffer, BigInt(objectCount), offset);
            offset = writeBigUInt64BE(buffer, BigInt(objectCount - 1), offset);
            offset = writeBigUInt64BE(buffer, BigInt(tableOffset), offset);
            return offset;
        }
        function encodeArray(values, index, state, buffer, offset) {
            var list = values[index];
            var length = list.length;
            var objInfo = length > 14 ? 15 : length;
            offset = buffer.writeUInt8(ARRAY << 4 | objInfo, offset);
            offset = objInfo == 15 ? encodeInt(length, buffer, offset) : offset;
            for (var i = 0; i < list.length; i++) {
                let objRef = values.indexOf(list[i]);
                if (objRef == -1) throw new Error(`Attempt to encode unknown object`);
                offset = buffer.writeUIntBE(objRef, offset, state.refSize);
            }
            return offset;
        }
        function encodeSet(values, index, state, buffer, offset) {
            var list = [ ...values[index] ];
            var length = list.length;
            var objInfo = length > 14 ? 15 : length;
            offset = buffer.writeUInt8(SET << 4 | objInfo, offset);
            offset = objInfo == 15 ? encodeInt(length, buffer, offset) : offset;
            for (var i = 0; i < list.length; i++) {
                let objRef = values.indexOf(list[i]);
                if (objRef == -1) throw new Error(`Attempt to encode unknown object`);
                offset = buffer.writeUIntBE(objRef, offset, state.refSize);
            }
            return offset;
        }
        function encodeMap(values, index, state, buffer, offset) {
            var map = values[index];
            var length = map.size;
            var objInfo = length > 14 ? 15 : length;
            offset = buffer.writeUInt8(DICT << 4 | objInfo, offset);
            offset = objInfo == 15 ? encodeInt(length, buffer, offset) : offset;
            for (let [key, value] of map) {
                let keyRef = values.indexOf(key);
                if (keyRef == -1) throw new Error(`Attempt to encode object with unknown key`);
                offset = buffer.writeUIntBE(keyRef, offset, state.refSize);
            }
            for (let [key, value] of map) {
                let objRef = values.indexOf(value);
                if (objRef == -1) throw new Error(`Attempt to encode unknown object`);
                offset = buffer.writeUIntBE(objRef, offset, state.refSize);
            }
            return offset;
        }
        function encodeDict(values, index, state, buffer, offset) {
            var dict = values[index];
            var keys = Object.keys(dict);
            var length = keys.length;
            var objInfo = length > 14 ? 15 : length;
            offset = buffer.writeUInt8(DICT << 4 | objInfo, offset);
            offset = objInfo == 15 ? encodeInt(length, buffer, offset) : offset;
            for (let i = 0; i < length; i++) {
                let keyRef = values.indexOf(keys[i]);
                if (keyRef == -1) throw new Error(`Attempt to encode object with unknown key`);
                offset = buffer.writeUIntBE(keyRef, offset, state.refSize);
            }
            for (let i = 0; i < length; i++) {
                let objRef = values.indexOf(dict[keys[i]]);
                if (objRef == -1) throw new Error(`Attempt to encode unknown object`);
                offset = buffer.writeUIntBE(objRef, offset, state.refSize);
            }
            return offset;
        }
        function encodeValue(values, index, state, buffer, offset) {
            var type = getTypeof(values[index]);
            switch (type) {
              case "null":
              case "undefined":
              case "boolean":
                return encodeBoolean(values[index], buffer, offset);

              case "number":
              case "bigint":
                return encodeNumber(values[index], buffer, offset);

              case "date":
                return encodeDate(values[index], buffer, offset);

              case "string":
                return encodeString(values[index], buffer, offset);

              case "buffer":
                return encodeBlob(values[index], buffer, offset);

              case "arraybuffer":
                return encodeBlob(Buffer.from(values[index]), buffer, offset);

              case "array":
              case "arraybufferview":
                return encodeArray(values, index, state, buffer, offset);

              case "set":
                return encodeSet(values, index, state, buffer, offset);

              case "map":
                return encodeMap(values, index, state, buffer, offset);

              case "object":
                return encodeDict(values, index, state, buffer, offset);

              default:
                throw new Error(`Invalid value type "${type}"`);
            }
        }
        function encodeBoolean(value, buffer, offset) {
            switch (value) {
              case undefined:
              case null:
                return buffer.writeUInt8(PRIMITIVE << 4 | 0, offset);

              case false:
                return buffer.writeUInt8(PRIMITIVE << 4 | 8, offset);

              case true:
                return buffer.writeUInt8(PRIMITIVE << 4 | 9, offset);

              default:
                throw new Error(`Invalid primitive value "${value}"`);
            }
        }
        function encodeNumber(value, buffer, offset) {
            var shouldFloat = Math.abs(Number(value)) > Number.MAX_SAFE_INTEGER || !Number.isFinite(value) || Math.round(value) != value;
            return shouldFloat ? encodeReal(value, buffer, offset) : encodeInt(value, buffer, offset);
        }
        function encodeInt(value, buffer, offset) {
            var size = Math.abs(Number(value)) <= Number.MAX_SAFE_INTEGER ? signedBits(Number(value), 8) : 128;
            offset = buffer.writeUInt8(INT << 4 | Math.log2(size / 8), offset);
            switch (size) {
              case 8:
                offset = buffer.writeInt8(Number(value), offset);
                break;

              case 16:
                offset = buffer.writeInt16BE(Number(value), offset);
                break;

              case 32:
                offset = buffer.writeInt32BE(Number(value), offset);
                break;

              case 64:
                offset = writeBigInt64BE(buffer, BigInt(value), offset);
                break;

              case 128:
                offset = writeBigInt64BE(buffer, BigInt(value) >> 64n, offset);
                offset = writeBigUInt64BE(buffer, BigInt(value) & 0xFFFFFFFFFFFFFFFFn, offset);
                break;

              default:
                throw new Error(`${size} bit integers not supported`);
            }
            return offset;
        }
        function encodeReal(value, buffer, offset) {
            var size = Math.abs(Number(value)) <= Number.MAX_SAFE_INTEGER ? bits(Number(value), 32) : 64;
            if (size > 64) {
                throw new Error(`${size} bit reals not supported`);
            }
            offset = buffer.writeUInt8(REAL << 4 | Math.log2(size / 8), offset);
            switch (size) {
              case 32:
                offset = buffer.writeFloatBE(Number(value), offset);
                break;

              case 64:
                offset = buffer.writeDoubleBE(Number(value), offset);
                break;
            }
            return offset;
        }
        function encodeDate(value, buffer, offset) {
            var time = value.getTime() / 1e3 - Plist.EPOCH;
            offset = buffer.writeUInt8(DATE << 4 | DATE, offset);
            offset = buffer.writeDoubleBE(time, offset);
            return offset;
        }
        function encodeString(value, buffer, offset) {
            var isUUID = /^[A-F0-9]{8}(-[A-F0-9]{4}){3}-[A-F0-9]{12}$/i.test(value);
            if (isUUID) return encodeUID(value, buffer, offset);
            var length = Buffer.byteLength(value);
            var isUnicode = length != value.length || !/^[\x00-\x7F]+$/.test(value);
            var marker = isUnicode ? UNICODE : ASCII;
            var objInfo = length > 14 ? 15 : length;
            offset = buffer.writeUInt8(marker << 4 | objInfo, offset);
            offset = objInfo == 15 ? encodeInt(length, buffer, offset) : offset;
            offset += buffer.write(value, offset, length, isUnicode ? "utf16le" : "ascii");
            return offset;
        }
        function encodeUID(value, buffer, offset) {
            var length = 15;
            offset = buffer.writeUInt8(UUID << 4 | length, offset);
            offset += buffer.write(value.slice(0, 8), offset, 8, "hex");
            offset += buffer.write(value.slice(9, 13), offset, 4, "hex");
            offset += buffer.write(value.slice(14, 18), offset, 4, "hex");
            offset += buffer.write(value.slice(19, 23), offset, 4, "hex");
            offset += buffer.write(value.slice(24, 36), offset, 12, "hex");
            return offset;
        }
        function encodeBlob(value, buffer, offset) {
            var length = value.length || Buffer.byteLength(value);
            var objInfo = length > 14 ? 15 : length;
            offset = buffer.writeUInt8(DATA << 4 | objInfo, offset);
            offset = objInfo == 15 ? encodeInt(length, buffer, offset) : offset;
            offset += value.copy(buffer, offset, 0, length);
            return offset;
        }
        module.exports = encode;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.readStream = void 0;
        const constants_1 = __webpack_require__(151);
        const utils_1 = __webpack_require__(167);
        const EXCLUDE = [ constants_1.BLOCK.COMMENT, constants_1.BLOCK.TERMINATOR ];
        async function* readStream(image, end) {
            let remaining = end + 1;
            for (const {block} of utils_1.blockGenerator(image, EXCLUDE)) {
                if (remaining <= 0) {
                    return;
                }
                if (block.type === constants_1.BLOCK.ZEROFILL || block.type === constants_1.BLOCK.FREE) {
                    const size = Math.min(block.sectorCount * constants_1.SECTOR_SIZE, remaining);
                    yield* new utils_1.ZeroStream(size);
                    remaining -= size;
                } else {
                    const offset = image.footer.dataForkOffset + block.compressedOffset;
                    const length = block.compressedLength;
                    const inputStream = await image.fs.createReadStream(offset, offset + length - 1);
                    for await (let chunk of utils_1.blockDecompressor(block.type, inputStream)) {
                        if (chunk.length > remaining) {
                            chunk = chunk.slice(0, remaining);
                        }
                        yield chunk;
                        remaining -= chunk.length;
                    }
                }
            }
        }
        exports.readStream = readStream;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.streamToBuffer = exports.ZeroStream = exports.blockDecompressor = exports.blockGenerator = exports.withOpenImage = void 0;
        const adc = __webpack_require__(168);
        const fs_1 = __webpack_require__(14);
        const stream_1 = __webpack_require__(17);
        const bz2 = __webpack_require__(145);
        const zlib = __webpack_require__(23);
        const constants_1 = __webpack_require__(151);
        const image_1 = __webpack_require__(156);
        async function withOpenImage(filePath, fn) {
            const handle = await fs_1.promises.open(filePath, "r");
            try {
                const image = new image_1.Image({
                    size: (await handle.stat()).size,
                    createReadStream: async (start = 0, end = Infinity) => fs_1.createReadStream("", {
                        fd: handle.fd,
                        autoClose: false,
                        start,
                        end
                    })
                });
                await image.ready;
                return await fn(image);
            } finally {
                await handle.close();
            }
        }
        exports.withOpenImage = withOpenImage;
        function* blockGenerator(image, exclude = []) {
            for (const entry of image.resourceFork.blkx) {
                for (const block of entry.map.blocks) {
                    if (!exclude.includes(block.type)) {
                        yield {
                            entry,
                            block
                        };
                    }
                }
            }
        }
        exports.blockGenerator = blockGenerator;
        function blockDecompressor(type, inputStream) {
            if (type === constants_1.BLOCK.RAW) {
                return inputStream;
            } else if (type === constants_1.BLOCK.UDZO) {
                return inputStream.pipe(zlib.createInflate());
            } else if (type === constants_1.BLOCK.UDBZ) {
                return inputStream.pipe(bz2());
            } else if (type === constants_1.BLOCK.UDCO) {
                return inputStream.pipe(new adc.Decompressor);
            } else if (type === constants_1.BLOCK.LZFSE) {
                throw new Error("Unsupported compression method: LZFSE");
            }
            throw new Error(`Unknown compression method for type "0x${type.toString(16)}"`);
        }
        exports.blockDecompressor = blockDecompressor;
        class ZeroStream extends stream_1.Readable {
            constructor(length = Infinity, blank) {
                super();
                this.length = length;
                this.blank = blank !== null && blank !== void 0 ? blank : Buffer.alloc(64 * 1024);
            }
            _read() {
                if (this.length >= this.blank.length) {
                    this.push(this.blank);
                    this.length -= this.blank.length;
                } else if (this.length > 0) {
                    this.push(this.blank.slice(0, this.length));
                    this.length = 0;
                } else {
                    this.push(null);
                }
            }
        }
        exports.ZeroStream = ZeroStream;
        function streamToBuffer(stream) {
            const chunks = [];
            return new Promise(((resolve, reject) => {
                stream.on("data", (buf => {
                    chunks.push(buf);
                }));
                stream.on("end", (() => {
                    resolve(Buffer.concat(chunks));
                }));
                stream.on("error", reject);
            }));
        }
        exports.streamToBuffer = streamToBuffer;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var ADC = module.exports;
        ADC.CHUNK_DATA = 128;
        ADC.CHUNK_THREE = 64;
        ADC.CHUNK_TWO = 63;
        ADC.getChunkType = function(byte) {
            if ((byte & 128) === 128) return ADC.CHUNK_DATA;
            if ((byte & 64) === 64) return ADC.CHUNK_THREE;
            return ADC.CHUNK_TWO;
        };
        ADC.getChunkLength = function(byte) {
            var chunkType = ADC.getChunkType(byte);
            switch (chunkType) {
              case ADC.CHUNK_DATA:
                return (byte & 127) + 1;

              case ADC.CHUNK_THREE:
                return (byte & 63) + 4;

              case ADC.CHUNK_TWO:
                return ((byte & 60) >> 2) + 3;

              default:
                return -1;
            }
        };
        ADC.getSequenceLength = function(byte) {
            var chunkType = ADC.getChunkType(byte);
            switch (chunkType) {
              case ADC.CHUNK_DATA:
                return (byte & 127) + 2;

              case ADC.CHUNK_THREE:
                return 3;

              case ADC.CHUNK_TWO:
                return 2;

              default:
                return 0;
            }
        };
        ADC.getOffset = function(buffer, position) {
            var chunkType = ADC.getChunkType(buffer[position]);
            switch (chunkType) {
              case ADC.CHUNK_DATA:
                return 0;

              case ADC.CHUNK_THREE:
                return (buffer[position + 1] << 8) + buffer[position + 2];

              case ADC.CHUNK_TWO:
                return ((buffer[position] & 3) << 8) + buffer[position + 1];

              default:
                return -1;
            }
        };
        ADC.decompress = __webpack_require__(169);
        ADC.Decompressor = __webpack_require__(170);
        ADC.createDecompress = function(options) {
            return new ADC.Decompressor(options);
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const ADC = __webpack_require__(168);
        var windowOffset = 0;
        var windowSize = 65535 + 67;
        const window = new Uint8Array(windowSize);
        function getWindow(position) {
            return window[(position + windowOffset) % windowSize];
        }
        function setWindow(position, value) {
            windowOffset = windowOffset % windowSize === 0 ? 0 : windowOffset;
            return window[(position + windowOffset) % windowSize] = value;
        }
        function decodeData(window, buffer, position) {
            var length = ADC.getChunkLength(buffer[position]);
            var data = Buffer.allocUnsafe(length);
            var offset = windowSize - data.length;
            position += 1;
            windowOffset += length;
            buffer.copy(data, 0, position);
            for (var i = 0; i < length; i++) {
                setWindow(offset + i, buffer[position++]);
            }
            return data;
        }
        function decodeRunlength(window, buffer, position) {
            var length = ADC.getChunkLength(buffer[position]);
            var offset = ADC.getOffset(buffer, position);
            var data = Buffer.allocUnsafe(length);
            var slidePosition = windowSize - data.length;
            windowOffset += length;
            for (var i = 0; i < length; i++) {
                data[i] = setWindow(slidePosition, getWindow(slidePosition - offset - 1));
                slidePosition++;
            }
            return data;
        }
        function decompress(buffer) {
            var chunks = [];
            var chunkType = ADC.CHUNK_UNKNOWN;
            var position = 0;
            var length = 0;
            windowOffset = 0;
            while (position < buffer.length) {
                chunkType = ADC.getChunkType(buffer[position]);
                length = ADC.getSequenceLength(buffer[position]);
                switch (chunkType) {
                  case ADC.CHUNK_DATA:
                    chunks.push(decodeData(window, buffer, position));
                    break;

                  case ADC.CHUNK_THREE:
                    chunks.push(decodeRunlength(window, buffer, position));
                    break;

                  case ADC.CHUNK_TWO:
                    chunks.push(decodeRunlength(window, buffer, position));
                    break;

                  default:
                    throw new Error("Unknown chunk type 0x" + buffer[position].toString(16) + " at " + position);
                }
                position += length;
            }
            return Buffer.concat(chunks);
        }
        decompress.decode = decodeData;
        decompress.runLength = decodeRunlength;
        module.exports = decompress;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var ADC = __webpack_require__(168);
        var Stream = __webpack_require__(17);
        var inherit = __webpack_require__(43);
        function Decompressor(options) {
            if (!(this instanceof Decompressor)) {
                return new Decompressor(options);
            }
            Stream.Transform.call(this, options);
            this._window = new Uint8Array(65535 + 67);
            this._chunks = [];
            this._bytes = 0;
        }
        Decompressor.prototype = {
            constructor: Decompressor,
            _decode(chunk, next) {
                if (this._bytes > 0) {
                    this._chunks.push(chunk);
                    chunk = Buffer.concat(this._chunks);
                    this._chunks.length = 0;
                    this._bytes = 0;
                }
                var chunks = [];
                var chunkType = ADC.CHUNK_UNKNOWN;
                var position = 0;
                var length = 0;
                while (position < chunk.length) {
                    chunkType = ADC.getChunkType(chunk[position]);
                    length = ADC.getSequenceLength(chunk[position]);
                    if (position + length > chunk.length) {
                        break;
                    }
                    switch (chunkType) {
                      case ADC.CHUNK_DATA:
                        chunks.push(ADC.decompress.decode(this._window, chunk, position));
                        break;

                      case ADC.CHUNK_THREE:
                        chunks.push(ADC.decompress.runLength(this._window, chunk, position));
                        break;

                      case ADC.CHUNK_TWO:
                        chunks.push(ADC.decompress.runLength(this._window, chunk, position));
                        break;

                      default:
                        return next(new Error("Unknown chunk type 0x" + chunk[position].toString(16) + " at " + position));
                    }
                    position += length;
                }
                if (chunk.length - position) {
                    chunk = chunk.slice(position);
                    this._chunks.push(chunk);
                    this._bytes += chunk.length;
                }
                next(null, Buffer.concat(chunks));
            },
            _transform(chunk, encoding, next) {
                this._decode(chunk, next);
            },
            _flush(done) {
                this._decode(Buffer.allocUnsafe(0), done);
            }
        };
        inherit(Decompressor, Stream.Transform);
        module.exports = Decompressor;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.sparseReadStream = void 0;
        const constants_1 = __webpack_require__(151);
        const utils_1 = __webpack_require__(167);
        const EXCLUDE = [ constants_1.BLOCK.COMMENT, constants_1.BLOCK.TERMINATOR, constants_1.BLOCK.FREE ];
        async function* sparseReadStream(image) {
            for (const {entry, block} of utils_1.blockGenerator(image, EXCLUDE)) {
                let position = entry.map.sectorNumber * constants_1.SECTOR_SIZE + block.sectorNumber * constants_1.SECTOR_SIZE;
                if (block.type === constants_1.BLOCK.ZEROFILL) {
                    const size = block.sectorCount * constants_1.SECTOR_SIZE;
                    for await (const buffer of new utils_1.ZeroStream(size)) {
                        yield {
                            buffer,
                            position
                        };
                        position += buffer.length;
                    }
                } else {
                    const offset = image.footer.dataForkOffset + block.compressedOffset;
                    const length = block.compressedLength;
                    const inputStream = await image.fs.createReadStream(offset, offset + length - 1);
                    const stream = utils_1.blockDecompressor(block.type, inputStream);
                    for await (const buffer of stream) {
                        yield {
                            buffer,
                            position
                        };
                        position += buffer.length;
                    }
                }
            }
        }
        exports.sparseReadStream = sparseReadStream;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.ProgressSparseTransformStream = exports.SparseTransformStream = void 0;
        const stream_1 = __webpack_require__(17);
        const aligned_lockable_buffer_1 = __webpack_require__(7);
        const progress_1 = __webpack_require__(18);
        const utils_1 = __webpack_require__(6);
        class SparseTransformStream extends stream_1.Transform {
            constructor({blocks, chunkSize, alignment, numBuffers = 2}) {
                super({
                    objectMode: true,
                    highWaterMark: numBuffers - 1
                });
                this.position = 0;
                this.bytesWritten = 0;
                this.blocks = blocks;
                this.alignedReadableState = new aligned_lockable_buffer_1.AlignedReadableState(chunkSize, alignment, numBuffers);
            }
            async __transform(chunk) {
                this.position = chunk.position;
                let buffer = this.alignedReadableState.getCurrentBuffer();
                const unlock = await buffer.lock();
                try {
                    if (chunk.buffer.length < buffer.length) {
                        buffer = buffer.slice(0, chunk.buffer.length);
                    }
                    chunk.buffer.copy(buffer);
                } finally {
                    unlock();
                }
                this.push({
                    position: chunk.position,
                    buffer
                });
                this.bytesWritten += chunk.buffer.length;
                this.position += chunk.buffer.length;
            }
            _transform(chunk, _encoding, callback) {
                (0, utils_1.asCallback)(this.__transform(chunk), callback);
            }
        }
        exports.SparseTransformStream = SparseTransformStream;
        exports.ProgressSparseTransformStream = (0, progress_1.makeClassEmitProgressEvents)(SparseTransformStream, "bytesWritten", "position");
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.GZipSource = void 0;
        const zlib_1 = __webpack_require__(23);
        const compressed_source_1 = __webpack_require__(21);
        const source_destination_1 = __webpack_require__(25);
        const ISIZE_LENGTH = 4;
        class GZipSource extends compressed_source_1.CompressedSource {
            createTransform() {
                return (0, zlib_1.createGunzip)();
            }
            async getSize() {
                const sizeFromPartitionTable = await this.getSizeFromPartitionTable();
                if (await this.source.canRead()) {
                    const sourceMetadata = await this.source.getMetadata();
                    if (sourceMetadata.size !== undefined) {
                        const {buffer} = await this.source.read(Buffer.allocUnsafe(ISIZE_LENGTH), 0, ISIZE_LENGTH, sourceMetadata.size - ISIZE_LENGTH);
                        const sizeFromFooter = buffer.readUInt32LE(0);
                        return {
                            size: Math.max(sizeFromFooter, sizeFromPartitionTable || 0),
                            isEstimated: true
                        };
                    }
                } else if (sizeFromPartitionTable !== undefined) {
                    return {
                        size: sizeFromPartitionTable,
                        isEstimated: true
                    };
                }
            }
        }
        exports.GZipSource = GZipSource;
        GZipSource.mimetype = "application/gzip";
        source_destination_1.SourceDestination.register(GZipSource);
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.Http = void 0;
        const axios_1 = __webpack_require__(175);
        const axiosNodeAdapter = __webpack_require__(187);
        const path_1 = __webpack_require__(15);
        const querystring_1 = __webpack_require__(207);
        const url_1 = __webpack_require__(196);
        const stream_limiter_1 = __webpack_require__(22);
        const source_destination_1 = __webpack_require__(25);
        axios_1.default.defaults.adapter = axiosNodeAdapter;
        class Http extends source_destination_1.SourceDestination {
            constructor({url, avoidRandomAccess = false, axiosInstance = axios_1.default.create(), auth}) {
                super();
                this.url = url;
                this.avoidRandomAccess = avoidRandomAccess;
                this.axiosInstance = axiosInstance;
                if (auth) {
                    this.axiosInstance.defaults.auth = auth;
                }
                this.ready = this.getInfo();
            }
            async getInfo() {
                try {
                    let response;
                    try {
                        response = await this.axiosInstance({
                            method: "head",
                            url: this.url
                        });
                    } catch (error) {
                        response = await this.axiosInstance({
                            method: "get",
                            url: this.url,
                            responseType: "stream"
                        });
                        response.data.destroy();
                    }
                    this.redirectUrl = response.request.res.responseUrl;
                    this.size = parseInt(response.headers["content-length"], 10);
                    if (Number.isNaN(this.size)) {
                        this.size = undefined;
                    }
                    this.acceptsRange = response.headers["accept-ranges"] === "bytes";
                } catch (error) {
                    this.error = error;
                }
            }
            async canRead() {
                await this.ready;
                if (this.error) {
                    throw this.error;
                }
                return !this.avoidRandomAccess && this.acceptsRange;
            }
            async canCreateReadStream() {
                return true;
            }
            async _getMetadata() {
                await this.ready;
                if (this.error) {
                    throw this.error;
                }
                let name;
                const pathname = (0, url_1.parse)(this.redirectUrl).pathname;
                if (pathname !== undefined) {
                    name = (0, path_1.basename)((0, querystring_1.unescape)(pathname));
                }
                return {
                    size: this.size,
                    name
                };
            }
            getRange(start = 0, end) {
                let range = `bytes=${start}-`;
                if (end !== undefined) {
                    range += end;
                }
                return range;
            }
            async read(buffer, bufferOffset, length, sourceOffset) {
                const response = await this.axiosInstance({
                    method: "get",
                    url: this.redirectUrl,
                    responseType: "arraybuffer",
                    headers: {
                        Range: this.getRange(sourceOffset, sourceOffset + length - 1)
                    }
                });
                const bytesRead = response.data.length;
                response.data.copy(buffer, bufferOffset);
                return {
                    bytesRead,
                    buffer
                };
            }
            async createReadStream({emitProgress = false, start = 0, end} = {}) {
                const response = await this.axiosInstance({
                    method: "get",
                    url: this.redirectUrl,
                    headers: {
                        Range: this.getRange(start, end)
                    },
                    responseType: "stream"
                });
                if (emitProgress) {
                    let bytes = 0;
                    let lastTime = Date.now();
                    response.data.on("data", (chunk => {
                        const now = Date.now();
                        const length = chunk.length;
                        bytes += length;
                        const speed = length / ((now - lastTime) / 1e3);
                        lastTime = now;
                        response.data.emit("progress", {
                            position: bytes,
                            bytes,
                            speed
                        });
                    }));
                    response.data.pause();
                }
                if (end !== undefined) {
                    return new stream_limiter_1.StreamLimiter(response.data, end - start + 1);
                }
                return response.data;
            }
        }
        exports.Http = Http;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        module.exports = __webpack_require__(176);
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var utils = __webpack_require__(177);
        var bind = __webpack_require__(178);
        var Axios = __webpack_require__(179);
        var mergeConfig = __webpack_require__(201);
        var defaults = __webpack_require__(184);
        function createInstance(defaultConfig) {
            var context = new Axios(defaultConfig);
            var instance = bind(Axios.prototype.request, context);
            utils.extend(instance, Axios.prototype, context);
            utils.extend(instance, context);
            return instance;
        }
        var axios = createInstance(defaults);
        axios.Axios = Axios;
        axios.create = function create(instanceConfig) {
            return createInstance(mergeConfig(axios.defaults, instanceConfig));
        };
        axios.Cancel = __webpack_require__(203);
        axios.CancelToken = __webpack_require__(204);
        axios.isCancel = __webpack_require__(200);
        axios.all = function all(promises) {
            return Promise.all(promises);
        };
        axios.spread = __webpack_require__(205);
        axios.isAxiosError = __webpack_require__(206);
        module.exports = axios;
        module.exports.default = axios;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var bind = __webpack_require__(178);
        var toString = Object.prototype.toString;
        function isArray(val) {
            return toString.call(val) === "[object Array]";
        }
        function isUndefined(val) {
            return typeof val === "undefined";
        }
        function isBuffer(val) {
            return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && typeof val.constructor.isBuffer === "function" && val.constructor.isBuffer(val);
        }
        function isArrayBuffer(val) {
            return toString.call(val) === "[object ArrayBuffer]";
        }
        function isFormData(val) {
            return typeof FormData !== "undefined" && val instanceof FormData;
        }
        function isArrayBufferView(val) {
            var result;
            if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
                result = ArrayBuffer.isView(val);
            } else {
                result = val && val.buffer && val.buffer instanceof ArrayBuffer;
            }
            return result;
        }
        function isString(val) {
            return typeof val === "string";
        }
        function isNumber(val) {
            return typeof val === "number";
        }
        function isObject(val) {
            return val !== null && typeof val === "object";
        }
        function isPlainObject(val) {
            if (toString.call(val) !== "[object Object]") {
                return false;
            }
            var prototype = Object.getPrototypeOf(val);
            return prototype === null || prototype === Object.prototype;
        }
        function isDate(val) {
            return toString.call(val) === "[object Date]";
        }
        function isFile(val) {
            return toString.call(val) === "[object File]";
        }
        function isBlob(val) {
            return toString.call(val) === "[object Blob]";
        }
        function isFunction(val) {
            return toString.call(val) === "[object Function]";
        }
        function isStream(val) {
            return isObject(val) && isFunction(val.pipe);
        }
        function isURLSearchParams(val) {
            return typeof URLSearchParams !== "undefined" && val instanceof URLSearchParams;
        }
        function trim(str) {
            return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, "");
        }
        function isStandardBrowserEnv() {
            if (typeof navigator !== "undefined" && (navigator.product === "ReactNative" || navigator.product === "NativeScript" || navigator.product === "NS")) {
                return false;
            }
            return typeof window !== "undefined" && typeof document !== "undefined";
        }
        function forEach(obj, fn) {
            if (obj === null || typeof obj === "undefined") {
                return;
            }
            if (typeof obj !== "object") {
                obj = [ obj ];
            }
            if (isArray(obj)) {
                for (var i = 0, l = obj.length; i < l; i++) {
                    fn.call(null, obj[i], i, obj);
                }
            } else {
                for (var key in obj) {
                    if (Object.prototype.hasOwnProperty.call(obj, key)) {
                        fn.call(null, obj[key], key, obj);
                    }
                }
            }
        }
        function merge() {
            var result = {};
            function assignValue(val, key) {
                if (isPlainObject(result[key]) && isPlainObject(val)) {
                    result[key] = merge(result[key], val);
                } else if (isPlainObject(val)) {
                    result[key] = merge({}, val);
                } else if (isArray(val)) {
                    result[key] = val.slice();
                } else {
                    result[key] = val;
                }
            }
            for (var i = 0, l = arguments.length; i < l; i++) {
                forEach(arguments[i], assignValue);
            }
            return result;
        }
        function extend(a, b, thisArg) {
            forEach(b, (function assignValue(val, key) {
                if (thisArg && typeof val === "function") {
                    a[key] = bind(val, thisArg);
                } else {
                    a[key] = val;
                }
            }));
            return a;
        }
        function stripBOM(content) {
            if (content.charCodeAt(0) === 65279) {
                content = content.slice(1);
            }
            return content;
        }
        module.exports = {
            isArray,
            isArrayBuffer,
            isBuffer,
            isFormData,
            isArrayBufferView,
            isString,
            isNumber,
            isObject,
            isPlainObject,
            isUndefined,
            isDate,
            isFile,
            isBlob,
            isFunction,
            isStream,
            isURLSearchParams,
            isStandardBrowserEnv,
            forEach,
            merge,
            extend,
            trim,
            stripBOM
        };
    }, module => {
        "use strict";
        module.exports = function bind(fn, thisArg) {
            return function wrap() {
                var args = new Array(arguments.length);
                for (var i = 0; i < args.length; i++) {
                    args[i] = arguments[i];
                }
                return fn.apply(thisArg, args);
            };
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var utils = __webpack_require__(177);
        var buildURL = __webpack_require__(180);
        var InterceptorManager = __webpack_require__(181);
        var dispatchRequest = __webpack_require__(182);
        var mergeConfig = __webpack_require__(201);
        var validator = __webpack_require__(202);
        var validators = validator.validators;
        function Axios(instanceConfig) {
            this.defaults = instanceConfig;
            this.interceptors = {
                request: new InterceptorManager,
                response: new InterceptorManager
            };
        }
        Axios.prototype.request = function request(config) {
            if (typeof config === "string") {
                config = arguments[1] || {};
                config.url = arguments[0];
            } else {
                config = config || {};
            }
            config = mergeConfig(this.defaults, config);
            if (config.method) {
                config.method = config.method.toLowerCase();
            } else if (this.defaults.method) {
                config.method = this.defaults.method.toLowerCase();
            } else {
                config.method = "get";
            }
            var transitional = config.transitional;
            if (transitional !== undefined) {
                validator.assertOptions(transitional, {
                    silentJSONParsing: validators.transitional(validators.boolean, "1.0.0"),
                    forcedJSONParsing: validators.transitional(validators.boolean, "1.0.0"),
                    clarifyTimeoutError: validators.transitional(validators.boolean, "1.0.0")
                }, false);
            }
            var requestInterceptorChain = [];
            var synchronousRequestInterceptors = true;
            this.interceptors.request.forEach((function unshiftRequestInterceptors(interceptor) {
                if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
                    return;
                }
                synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
                requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
            }));
            var responseInterceptorChain = [];
            this.interceptors.response.forEach((function pushResponseInterceptors(interceptor) {
                responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
            }));
            var promise;
            if (!synchronousRequestInterceptors) {
                var chain = [ dispatchRequest, undefined ];
                Array.prototype.unshift.apply(chain, requestInterceptorChain);
                chain = chain.concat(responseInterceptorChain);
                promise = Promise.resolve(config);
                while (chain.length) {
                    promise = promise.then(chain.shift(), chain.shift());
                }
                return promise;
            }
            var newConfig = config;
            while (requestInterceptorChain.length) {
                var onFulfilled = requestInterceptorChain.shift();
                var onRejected = requestInterceptorChain.shift();
                try {
                    newConfig = onFulfilled(newConfig);
                } catch (error) {
                    onRejected(error);
                    break;
                }
            }
            try {
                promise = dispatchRequest(newConfig);
            } catch (error) {
                return Promise.reject(error);
            }
            while (responseInterceptorChain.length) {
                promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());
            }
            return promise;
        };
        Axios.prototype.getUri = function getUri(config) {
            config = mergeConfig(this.defaults, config);
            return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, "");
        };
        utils.forEach([ "delete", "get", "head", "options" ], (function forEachMethodNoData(method) {
            Axios.prototype[method] = function(url, config) {
                return this.request(mergeConfig(config || {}, {
                    method,
                    url,
                    data: (config || {}).data
                }));
            };
        }));
        utils.forEach([ "post", "put", "patch" ], (function forEachMethodWithData(method) {
            Axios.prototype[method] = function(url, data, config) {
                return this.request(mergeConfig(config || {}, {
                    method,
                    url,
                    data
                }));
            };
        }));
        module.exports = Axios;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var utils = __webpack_require__(177);
        function encode(val) {
            return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
        }
        module.exports = function buildURL(url, params, paramsSerializer) {
            if (!params) {
                return url;
            }
            var serializedParams;
            if (paramsSerializer) {
                serializedParams = paramsSerializer(params);
            } else if (utils.isURLSearchParams(params)) {
                serializedParams = params.toString();
            } else {
                var parts = [];
                utils.forEach(params, (function serialize(val, key) {
                    if (val === null || typeof val === "undefined") {
                        return;
                    }
                    if (utils.isArray(val)) {
                        key = key + "[]";
                    } else {
                        val = [ val ];
                    }
                    utils.forEach(val, (function parseValue(v) {
                        if (utils.isDate(v)) {
                            v = v.toISOString();
                        } else if (utils.isObject(v)) {
                            v = JSON.stringify(v);
                        }
                        parts.push(encode(key) + "=" + encode(v));
                    }));
                }));
                serializedParams = parts.join("&");
            }
            if (serializedParams) {
                var hashmarkIndex = url.indexOf("#");
                if (hashmarkIndex !== -1) {
                    url = url.slice(0, hashmarkIndex);
                }
                url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
            }
            return url;
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var utils = __webpack_require__(177);
        function InterceptorManager() {
            this.handlers = [];
        }
        InterceptorManager.prototype.use = function use(fulfilled, rejected, options) {
            this.handlers.push({
                fulfilled,
                rejected,
                synchronous: options ? options.synchronous : false,
                runWhen: options ? options.runWhen : null
            });
            return this.handlers.length - 1;
        };
        InterceptorManager.prototype.eject = function eject(id) {
            if (this.handlers[id]) {
                this.handlers[id] = null;
            }
        };
        InterceptorManager.prototype.forEach = function forEach(fn) {
            utils.forEach(this.handlers, (function forEachHandler(h) {
                if (h !== null) {
                    fn(h);
                }
            }));
        };
        module.exports = InterceptorManager;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var utils = __webpack_require__(177);
        var transformData = __webpack_require__(183);
        var isCancel = __webpack_require__(200);
        var defaults = __webpack_require__(184);
        function throwIfCancellationRequested(config) {
            if (config.cancelToken) {
                config.cancelToken.throwIfRequested();
            }
        }
        module.exports = function dispatchRequest(config) {
            throwIfCancellationRequested(config);
            config.headers = config.headers || {};
            config.data = transformData.call(config, config.data, config.headers, config.transformRequest);
            config.headers = utils.merge(config.headers.common || {}, config.headers[config.method] || {}, config.headers);
            utils.forEach([ "delete", "get", "head", "post", "put", "patch", "common" ], (function cleanHeaderConfig(method) {
                delete config.headers[method];
            }));
            var adapter = config.adapter || defaults.adapter;
            return adapter(config).then((function onAdapterResolution(response) {
                throwIfCancellationRequested(config);
                response.data = transformData.call(config, response.data, response.headers, config.transformResponse);
                return response;
            }), (function onAdapterRejection(reason) {
                if (!isCancel(reason)) {
                    throwIfCancellationRequested(config);
                    if (reason && reason.response) {
                        reason.response.data = transformData.call(config, reason.response.data, reason.response.headers, config.transformResponse);
                    }
                }
                return Promise.reject(reason);
            }));
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var utils = __webpack_require__(177);
        var defaults = __webpack_require__(184);
        module.exports = function transformData(data, headers, fns) {
            var context = this || defaults;
            utils.forEach(fns, (function transform(fn) {
                data = fn.call(context, data, headers);
            }));
            return data;
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var utils = __webpack_require__(177);
        var normalizeHeaderName = __webpack_require__(185);
        var enhanceError = __webpack_require__(186);
        var DEFAULT_CONTENT_TYPE = {
            "Content-Type": "application/x-www-form-urlencoded"
        };
        function setContentTypeIfUnset(headers, value) {
            if (!utils.isUndefined(headers) && utils.isUndefined(headers["Content-Type"])) {
                headers["Content-Type"] = value;
            }
        }
        function getDefaultAdapter() {
            var adapter;
            if (typeof XMLHttpRequest !== "undefined") {
                adapter = __webpack_require__(187);
            } else if (typeof process !== "undefined" && Object.prototype.toString.call(process) === "[object process]") {
                adapter = __webpack_require__(187);
            }
            return adapter;
        }
        function stringifySafely(rawValue, parser, encoder) {
            if (utils.isString(rawValue)) {
                try {
                    (parser || JSON.parse)(rawValue);
                    return utils.trim(rawValue);
                } catch (e) {
                    if (e.name !== "SyntaxError") {
                        throw e;
                    }
                }
            }
            return (encoder || JSON.stringify)(rawValue);
        }
        var defaults = {
            transitional: {
                silentJSONParsing: true,
                forcedJSONParsing: true,
                clarifyTimeoutError: false
            },
            adapter: getDefaultAdapter(),
            transformRequest: [ function transformRequest(data, headers) {
                normalizeHeaderName(headers, "Accept");
                normalizeHeaderName(headers, "Content-Type");
                if (utils.isFormData(data) || utils.isArrayBuffer(data) || utils.isBuffer(data) || utils.isStream(data) || utils.isFile(data) || utils.isBlob(data)) {
                    return data;
                }
                if (utils.isArrayBufferView(data)) {
                    return data.buffer;
                }
                if (utils.isURLSearchParams(data)) {
                    setContentTypeIfUnset(headers, "application/x-www-form-urlencoded;charset=utf-8");
                    return data.toString();
                }
                if (utils.isObject(data) || headers && headers["Content-Type"] === "application/json") {
                    setContentTypeIfUnset(headers, "application/json");
                    return stringifySafely(data);
                }
                return data;
            } ],
            transformResponse: [ function transformResponse(data) {
                var transitional = this.transitional;
                var silentJSONParsing = transitional && transitional.silentJSONParsing;
                var forcedJSONParsing = transitional && transitional.forcedJSONParsing;
                var strictJSONParsing = !silentJSONParsing && this.responseType === "json";
                if (strictJSONParsing || forcedJSONParsing && utils.isString(data) && data.length) {
                    try {
                        return JSON.parse(data);
                    } catch (e) {
                        if (strictJSONParsing) {
                            if (e.name === "SyntaxError") {
                                throw enhanceError(e, this, "E_JSON_PARSE");
                            }
                            throw e;
                        }
                    }
                }
                return data;
            } ],
            timeout: 0,
            xsrfCookieName: "XSRF-TOKEN",
            xsrfHeaderName: "X-XSRF-TOKEN",
            maxContentLength: -1,
            maxBodyLength: -1,
            validateStatus: function validateStatus(status) {
                return status >= 200 && status < 300;
            }
        };
        defaults.headers = {
            common: {
                Accept: "application/json, text/plain, */*"
            }
        };
        utils.forEach([ "delete", "get", "head" ], (function forEachMethodNoData(method) {
            defaults.headers[method] = {};
        }));
        utils.forEach([ "post", "put", "patch" ], (function forEachMethodWithData(method) {
            defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
        }));
        module.exports = defaults;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var utils = __webpack_require__(177);
        module.exports = function normalizeHeaderName(headers, normalizedName) {
            utils.forEach(headers, (function processHeader(value, name) {
                if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
                    headers[normalizedName] = value;
                    delete headers[name];
                }
            }));
        };
    }, module => {
        "use strict";
        module.exports = function enhanceError(error, config, code, request, response) {
            error.config = config;
            if (code) {
                error.code = code;
            }
            error.request = request;
            error.response = response;
            error.isAxiosError = true;
            error.toJSON = function toJSON() {
                return {
                    message: this.message,
                    name: this.name,
                    description: this.description,
                    number: this.number,
                    fileName: this.fileName,
                    lineNumber: this.lineNumber,
                    columnNumber: this.columnNumber,
                    stack: this.stack,
                    config: this.config,
                    code: this.code
                };
            };
            return error;
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var utils = __webpack_require__(177);
        var settle = __webpack_require__(188);
        var buildFullPath = __webpack_require__(190);
        var buildURL = __webpack_require__(180);
        var http = __webpack_require__(193);
        var https = __webpack_require__(194);
        var httpFollow = __webpack_require__(195).http;
        var httpsFollow = __webpack_require__(195).https;
        var url = __webpack_require__(196);
        var zlib = __webpack_require__(23);
        var pkg = __webpack_require__(199);
        var createError = __webpack_require__(189);
        var enhanceError = __webpack_require__(186);
        var isHttps = /https:?/;
        function setProxy(options, proxy, location) {
            options.hostname = proxy.host;
            options.host = proxy.host;
            options.port = proxy.port;
            options.path = location;
            if (proxy.auth) {
                var base64 = Buffer.from(proxy.auth.username + ":" + proxy.auth.password, "utf8").toString("base64");
                options.headers["Proxy-Authorization"] = "Basic " + base64;
            }
            options.beforeRedirect = function beforeRedirect(redirection) {
                redirection.headers.host = redirection.host;
                setProxy(redirection, proxy, redirection.href);
            };
        }
        module.exports = function httpAdapter(config) {
            return new Promise((function dispatchHttpRequest(resolvePromise, rejectPromise) {
                var resolve = function resolve(value) {
                    resolvePromise(value);
                };
                var reject = function reject(value) {
                    rejectPromise(value);
                };
                var data = config.data;
                var headers = config.headers;
                if ("User-Agent" in headers || "user-agent" in headers) {
                    if (!headers["User-Agent"] && !headers["user-agent"]) {
                        delete headers["User-Agent"];
                        delete headers["user-agent"];
                    }
                } else {
                    headers["User-Agent"] = "axios/" + pkg.version;
                }
                if (data && !utils.isStream(data)) {
                    if (Buffer.isBuffer(data)) {} else if (utils.isArrayBuffer(data)) {
                        data = Buffer.from(new Uint8Array(data));
                    } else if (utils.isString(data)) {
                        data = Buffer.from(data, "utf-8");
                    } else {
                        return reject(createError("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream", config));
                    }
                    headers["Content-Length"] = data.length;
                }
                var auth = undefined;
                if (config.auth) {
                    var username = config.auth.username || "";
                    var password = config.auth.password || "";
                    auth = username + ":" + password;
                }
                var fullPath = buildFullPath(config.baseURL, config.url);
                var parsed = url.parse(fullPath);
                var protocol = parsed.protocol || "http:";
                if (!auth && parsed.auth) {
                    var urlAuth = parsed.auth.split(":");
                    var urlUsername = urlAuth[0] || "";
                    var urlPassword = urlAuth[1] || "";
                    auth = urlUsername + ":" + urlPassword;
                }
                if (auth) {
                    delete headers.Authorization;
                }
                var isHttpsRequest = isHttps.test(protocol);
                var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
                var options = {
                    path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ""),
                    method: config.method.toUpperCase(),
                    headers,
                    agent,
                    agents: {
                        http: config.httpAgent,
                        https: config.httpsAgent
                    },
                    auth
                };
                if (config.socketPath) {
                    options.socketPath = config.socketPath;
                } else {
                    options.hostname = parsed.hostname;
                    options.port = parsed.port;
                }
                var proxy = config.proxy;
                if (!proxy && proxy !== false) {
                    var proxyEnv = protocol.slice(0, -1) + "_proxy";
                    var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()];
                    if (proxyUrl) {
                        var parsedProxyUrl = url.parse(proxyUrl);
                        var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY;
                        var shouldProxy = true;
                        if (noProxyEnv) {
                            var noProxy = noProxyEnv.split(",").map((function trim(s) {
                                return s.trim();
                            }));
                            shouldProxy = !noProxy.some((function proxyMatch(proxyElement) {
                                if (!proxyElement) {
                                    return false;
                                }
                                if (proxyElement === "*") {
                                    return true;
                                }
                                if (proxyElement[0] === "." && parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) {
                                    return true;
                                }
                                return parsed.hostname === proxyElement;
                            }));
                        }
                        if (shouldProxy) {
                            proxy = {
                                host: parsedProxyUrl.hostname,
                                port: parsedProxyUrl.port,
                                protocol: parsedProxyUrl.protocol
                            };
                            if (parsedProxyUrl.auth) {
                                var proxyUrlAuth = parsedProxyUrl.auth.split(":");
                                proxy.auth = {
                                    username: proxyUrlAuth[0],
                                    password: proxyUrlAuth[1]
                                };
                            }
                        }
                    }
                }
                if (proxy) {
                    options.headers.host = parsed.hostname + (parsed.port ? ":" + parsed.port : "");
                    setProxy(options, proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path);
                }
                var transport;
                var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true);
                if (config.transport) {
                    transport = config.transport;
                } else if (config.maxRedirects === 0) {
                    transport = isHttpsProxy ? https : http;
                } else {
                    if (config.maxRedirects) {
                        options.maxRedirects = config.maxRedirects;
                    }
                    transport = isHttpsProxy ? httpsFollow : httpFollow;
                }
                if (config.maxBodyLength > -1) {
                    options.maxBodyLength = config.maxBodyLength;
                }
                var req = transport.request(options, (function handleResponse(res) {
                    if (req.aborted) return;
                    var stream = res;
                    var lastRequest = res.req || req;
                    if (res.statusCode !== 204 && lastRequest.method !== "HEAD" && config.decompress !== false) {
                        switch (res.headers["content-encoding"]) {
                          case "gzip":
                          case "compress":
                          case "deflate":
                            stream = stream.pipe(zlib.createUnzip());
                            delete res.headers["content-encoding"];
                            break;
                        }
                    }
                    var response = {
                        status: res.statusCode,
                        statusText: res.statusMessage,
                        headers: res.headers,
                        config,
                        request: lastRequest
                    };
                    if (config.responseType === "stream") {
                        response.data = stream;
                        settle(resolve, reject, response);
                    } else {
                        var responseBuffer = [];
                        var totalResponseBytes = 0;
                        stream.on("data", (function handleStreamData(chunk) {
                            responseBuffer.push(chunk);
                            totalResponseBytes += chunk.length;
                            if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
                                stream.destroy();
                                reject(createError("maxContentLength size of " + config.maxContentLength + " exceeded", config, null, lastRequest));
                            }
                        }));
                        stream.on("error", (function handleStreamError(err) {
                            if (req.aborted) return;
                            reject(enhanceError(err, config, null, lastRequest));
                        }));
                        stream.on("end", (function handleStreamEnd() {
                            var responseData = Buffer.concat(responseBuffer);
                            if (config.responseType !== "arraybuffer") {
                                responseData = responseData.toString(config.responseEncoding);
                                if (!config.responseEncoding || config.responseEncoding === "utf8") {
                                    responseData = utils.stripBOM(responseData);
                                }
                            }
                            response.data = responseData;
                            settle(resolve, reject, response);
                        }));
                    }
                }));
                req.on("error", (function handleRequestError(err) {
                    if (req.aborted && err.code !== "ERR_FR_TOO_MANY_REDIRECTS") return;
                    reject(enhanceError(err, config, null, req));
                }));
                if (config.timeout) {
                    var timeout = parseInt(config.timeout, 10);
                    if (isNaN(timeout)) {
                        reject(createError("error trying to parse `config.timeout` to int", config, "ERR_PARSE_TIMEOUT", req));
                        return;
                    }
                    req.setTimeout(timeout, (function handleRequestTimeout() {
                        req.abort();
                        reject(createError("timeout of " + timeout + "ms exceeded", config, config.transitional && config.transitional.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED", req));
                    }));
                }
                if (config.cancelToken) {
                    config.cancelToken.promise.then((function onCanceled(cancel) {
                        if (req.aborted) return;
                        req.abort();
                        reject(cancel);
                    }));
                }
                if (utils.isStream(data)) {
                    data.on("error", (function handleStreamError(err) {
                        reject(enhanceError(err, config, null, req));
                    })).pipe(req);
                } else {
                    req.end(data);
                }
            }));
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var createError = __webpack_require__(189);
        module.exports = function settle(resolve, reject, response) {
            var validateStatus = response.config.validateStatus;
            if (!response.status || !validateStatus || validateStatus(response.status)) {
                resolve(response);
            } else {
                reject(createError("Request failed with status code " + response.status, response.config, null, response.request, response));
            }
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var enhanceError = __webpack_require__(186);
        module.exports = function createError(message, config, code, request, response) {
            var error = new Error(message);
            return enhanceError(error, config, code, request, response);
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var isAbsoluteURL = __webpack_require__(191);
        var combineURLs = __webpack_require__(192);
        module.exports = function buildFullPath(baseURL, requestedURL) {
            if (baseURL && !isAbsoluteURL(requestedURL)) {
                return combineURLs(baseURL, requestedURL);
            }
            return requestedURL;
        };
    }, module => {
        "use strict";
        module.exports = function isAbsoluteURL(url) {
            return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
        };
    }, module => {
        "use strict";
        module.exports = function combineURLs(baseURL, relativeURL) {
            return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
        };
    }, module => {
        "use strict";
        module.exports = require("http");
    }, module => {
        "use strict";
        module.exports = require("https");
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var url = __webpack_require__(196);
        var URL = url.URL;
        var http = __webpack_require__(193);
        var https = __webpack_require__(194);
        var Writable = __webpack_require__(17).Writable;
        var assert = __webpack_require__(197);
        var debug = __webpack_require__(198);
        var events = [ "abort", "aborted", "connect", "error", "socket", "timeout" ];
        var eventHandlers = Object.create(null);
        events.forEach((function(event) {
            eventHandlers[event] = function(arg1, arg2, arg3) {
                this._redirectable.emit(event, arg1, arg2, arg3);
            };
        }));
        var RedirectionError = createErrorType("ERR_FR_REDIRECTION_FAILURE", "");
        var TooManyRedirectsError = createErrorType("ERR_FR_TOO_MANY_REDIRECTS", "Maximum number of redirects exceeded");
        var MaxBodyLengthExceededError = createErrorType("ERR_FR_MAX_BODY_LENGTH_EXCEEDED", "Request body larger than maxBodyLength limit");
        var WriteAfterEndError = createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end");
        function RedirectableRequest(options, responseCallback) {
            Writable.call(this);
            this._sanitizeOptions(options);
            this._options = options;
            this._ended = false;
            this._ending = false;
            this._redirectCount = 0;
            this._redirects = [];
            this._requestBodyLength = 0;
            this._requestBodyBuffers = [];
            if (responseCallback) {
                this.on("response", responseCallback);
            }
            var self = this;
            this._onNativeResponse = function(response) {
                self._processResponse(response);
            };
            this._performRequest();
        }
        RedirectableRequest.prototype = Object.create(Writable.prototype);
        RedirectableRequest.prototype.abort = function() {
            abortRequest(this._currentRequest);
            this.emit("abort");
        };
        RedirectableRequest.prototype.write = function(data, encoding, callback) {
            if (this._ending) {
                throw new WriteAfterEndError;
            }
            if (!(typeof data === "string" || typeof data === "object" && "length" in data)) {
                throw new TypeError("data should be a string, Buffer or Uint8Array");
            }
            if (typeof encoding === "function") {
                callback = encoding;
                encoding = null;
            }
            if (data.length === 0) {
                if (callback) {
                    callback();
                }
                return;
            }
            if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {
                this._requestBodyLength += data.length;
                this._requestBodyBuffers.push({
                    data,
                    encoding
                });
                this._currentRequest.write(data, encoding, callback);
            } else {
                this.emit("error", new MaxBodyLengthExceededError);
                this.abort();
            }
        };
        RedirectableRequest.prototype.end = function(data, encoding, callback) {
            if (typeof data === "function") {
                callback = data;
                data = encoding = null;
            } else if (typeof encoding === "function") {
                callback = encoding;
                encoding = null;
            }
            if (!data) {
                this._ended = this._ending = true;
                this._currentRequest.end(null, null, callback);
            } else {
                var self = this;
                var currentRequest = this._currentRequest;
                this.write(data, encoding, (function() {
                    self._ended = true;
                    currentRequest.end(null, null, callback);
                }));
                this._ending = true;
            }
        };
        RedirectableRequest.prototype.setHeader = function(name, value) {
            this._options.headers[name] = value;
            this._currentRequest.setHeader(name, value);
        };
        RedirectableRequest.prototype.removeHeader = function(name) {
            delete this._options.headers[name];
            this._currentRequest.removeHeader(name);
        };
        RedirectableRequest.prototype.setTimeout = function(msecs, callback) {
            var self = this;
            function destroyOnTimeout(socket) {
                socket.setTimeout(msecs);
                socket.removeListener("timeout", socket.destroy);
                socket.addListener("timeout", socket.destroy);
            }
            function startTimer(socket) {
                if (self._timeout) {
                    clearTimeout(self._timeout);
                }
                self._timeout = setTimeout((function() {
                    self.emit("timeout");
                    clearTimer();
                }), msecs);
                destroyOnTimeout(socket);
            }
            function clearTimer() {
                if (self._timeout) {
                    clearTimeout(self._timeout);
                    self._timeout = null;
                }
                if (callback) {
                    self.removeListener("timeout", callback);
                }
                if (!self.socket) {
                    self._currentRequest.removeListener("socket", startTimer);
                }
            }
            if (callback) {
                this.on("timeout", callback);
            }
            if (this.socket) {
                startTimer(this.socket);
            } else {
                this._currentRequest.once("socket", startTimer);
            }
            this.on("socket", destroyOnTimeout);
            this.once("response", clearTimer);
            this.once("error", clearTimer);
            return this;
        };
        [ "flushHeaders", "getHeader", "setNoDelay", "setSocketKeepAlive" ].forEach((function(method) {
            RedirectableRequest.prototype[method] = function(a, b) {
                return this._currentRequest[method](a, b);
            };
        }));
        [ "aborted", "connection", "socket" ].forEach((function(property) {
            Object.defineProperty(RedirectableRequest.prototype, property, {
                get: function() {
                    return this._currentRequest[property];
                }
            });
        }));
        RedirectableRequest.prototype._sanitizeOptions = function(options) {
            if (!options.headers) {
                options.headers = {};
            }
            if (options.host) {
                if (!options.hostname) {
                    options.hostname = options.host;
                }
                delete options.host;
            }
            if (!options.pathname && options.path) {
                var searchPos = options.path.indexOf("?");
                if (searchPos < 0) {
                    options.pathname = options.path;
                } else {
                    options.pathname = options.path.substring(0, searchPos);
                    options.search = options.path.substring(searchPos);
                }
            }
        };
        RedirectableRequest.prototype._performRequest = function() {
            var protocol = this._options.protocol;
            var nativeProtocol = this._options.nativeProtocols[protocol];
            if (!nativeProtocol) {
                this.emit("error", new TypeError("Unsupported protocol " + protocol));
                return;
            }
            if (this._options.agents) {
                var scheme = protocol.substr(0, protocol.length - 1);
                this._options.agent = this._options.agents[scheme];
            }
            var request = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse);
            this._currentUrl = url.format(this._options);
            request._redirectable = this;
            for (var e = 0; e < events.length; e++) {
                request.on(events[e], eventHandlers[events[e]]);
            }
            if (this._isRedirect) {
                var i = 0;
                var self = this;
                var buffers = this._requestBodyBuffers;
                (function writeNext(error) {
                    if (request === self._currentRequest) {
                        if (error) {
                            self.emit("error", error);
                        } else if (i < buffers.length) {
                            var buffer = buffers[i++];
                            if (!request.finished) {
                                request.write(buffer.data, buffer.encoding, writeNext);
                            }
                        } else if (self._ended) {
                            request.end();
                        }
                    }
                })();
            }
        };
        RedirectableRequest.prototype._processResponse = function(response) {
            var statusCode = response.statusCode;
            if (this._options.trackRedirects) {
                this._redirects.push({
                    url: this._currentUrl,
                    headers: response.headers,
                    statusCode
                });
            }
            var location = response.headers.location;
            if (location && this._options.followRedirects !== false && statusCode >= 300 && statusCode < 400) {
                abortRequest(this._currentRequest);
                response.destroy();
                if (++this._redirectCount > this._options.maxRedirects) {
                    this.emit("error", new TooManyRedirectsError);
                    return;
                }
                if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || statusCode === 303 && !/^(?:GET|HEAD)$/.test(this._options.method)) {
                    this._options.method = "GET";
                    this._requestBodyBuffers = [];
                    removeMatchingHeaders(/^content-/i, this._options.headers);
                }
                var previousHostName = removeMatchingHeaders(/^host$/i, this._options.headers) || url.parse(this._currentUrl).hostname;
                var redirectUrl = url.resolve(this._currentUrl, location);
                debug("redirecting to", redirectUrl);
                this._isRedirect = true;
                var redirectUrlParts = url.parse(redirectUrl);
                Object.assign(this._options, redirectUrlParts);
                if (redirectUrlParts.hostname !== previousHostName) {
                    removeMatchingHeaders(/^authorization$/i, this._options.headers);
                }
                if (typeof this._options.beforeRedirect === "function") {
                    var responseDetails = {
                        headers: response.headers
                    };
                    try {
                        this._options.beforeRedirect.call(null, this._options, responseDetails);
                    } catch (err) {
                        this.emit("error", err);
                        return;
                    }
                    this._sanitizeOptions(this._options);
                }
                try {
                    this._performRequest();
                } catch (cause) {
                    var error = new RedirectionError("Redirected request failed: " + cause.message);
                    error.cause = cause;
                    this.emit("error", error);
                }
            } else {
                response.responseUrl = this._currentUrl;
                response.redirects = this._redirects;
                this.emit("response", response);
                this._requestBodyBuffers = [];
            }
        };
        function wrap(protocols) {
            var exports = {
                maxRedirects: 21,
                maxBodyLength: 10 * 1024 * 1024
            };
            var nativeProtocols = {};
            Object.keys(protocols).forEach((function(scheme) {
                var protocol = scheme + ":";
                var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
                var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);
                function request(input, options, callback) {
                    if (typeof input === "string") {
                        var urlStr = input;
                        try {
                            input = urlToOptions(new URL(urlStr));
                        } catch (err) {
                            input = url.parse(urlStr);
                        }
                    } else if (URL && input instanceof URL) {
                        input = urlToOptions(input);
                    } else {
                        callback = options;
                        options = input;
                        input = {
                            protocol
                        };
                    }
                    if (typeof options === "function") {
                        callback = options;
                        options = null;
                    }
                    options = Object.assign({
                        maxRedirects: exports.maxRedirects,
                        maxBodyLength: exports.maxBodyLength
                    }, input, options);
                    options.nativeProtocols = nativeProtocols;
                    assert.equal(options.protocol, protocol, "protocol mismatch");
                    debug("options", options);
                    return new RedirectableRequest(options, callback);
                }
                function get(input, options, callback) {
                    var wrappedRequest = wrappedProtocol.request(input, options, callback);
                    wrappedRequest.end();
                    return wrappedRequest;
                }
                Object.defineProperties(wrappedProtocol, {
                    request: {
                        value: request,
                        configurable: true,
                        enumerable: true,
                        writable: true
                    },
                    get: {
                        value: get,
                        configurable: true,
                        enumerable: true,
                        writable: true
                    }
                });
            }));
            return exports;
        }
        function noop() {}
        function urlToOptions(urlObject) {
            var options = {
                protocol: urlObject.protocol,
                hostname: urlObject.hostname.startsWith("[") ? urlObject.hostname.slice(1, -1) : urlObject.hostname,
                hash: urlObject.hash,
                search: urlObject.search,
                pathname: urlObject.pathname,
                path: urlObject.pathname + urlObject.search,
                href: urlObject.href
            };
            if (urlObject.port !== "") {
                options.port = Number(urlObject.port);
            }
            return options;
        }
        function removeMatchingHeaders(regex, headers) {
            var lastValue;
            for (var header in headers) {
                if (regex.test(header)) {
                    lastValue = headers[header];
                    delete headers[header];
                }
            }
            return lastValue;
        }
        function createErrorType(code, defaultMessage) {
            function CustomError(message) {
                Error.captureStackTrace(this, this.constructor);
                this.message = message || defaultMessage;
            }
            CustomError.prototype = new Error;
            CustomError.prototype.constructor = CustomError;
            CustomError.prototype.name = "Error [" + code + "]";
            CustomError.prototype.code = code;
            return CustomError;
        }
        function abortRequest(request) {
            for (var e = 0; e < events.length; e++) {
                request.removeListener(events[e], eventHandlers[events[e]]);
            }
            request.on("error", noop);
            request.abort();
        }
        module.exports = wrap({
            http,
            https
        });
        module.exports.wrap = wrap;
    }, module => {
        "use strict";
        module.exports = require("url");
    }, module => {
        "use strict";
        module.exports = require("assert");
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var debug;
        module.exports = function() {
            if (!debug) {
                try {
                    debug = __webpack_require__(63)("follow-redirects");
                } catch (error) {}
                if (typeof debug !== "function") {
                    debug = function() {};
                }
            }
            debug.apply(null, arguments);
        };
    }, module => {
        "use strict";
        module.exports = require("../package.json");
    }, module => {
        "use strict";
        module.exports = function isCancel(value) {
            return !!(value && value.__CANCEL__);
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var utils = __webpack_require__(177);
        module.exports = function mergeConfig(config1, config2) {
            config2 = config2 || {};
            var config = {};
            var valueFromConfig2Keys = [ "url", "method", "data" ];
            var mergeDeepPropertiesKeys = [ "headers", "auth", "proxy", "params" ];
            var defaultToConfig2Keys = [ "baseURL", "transformRequest", "transformResponse", "paramsSerializer", "timeout", "timeoutMessage", "withCredentials", "adapter", "responseType", "xsrfCookieName", "xsrfHeaderName", "onUploadProgress", "onDownloadProgress", "decompress", "maxContentLength", "maxBodyLength", "maxRedirects", "transport", "httpAgent", "httpsAgent", "cancelToken", "socketPath", "responseEncoding" ];
            var directMergeKeys = [ "validateStatus" ];
            function getMergedValue(target, source) {
                if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
                    return utils.merge(target, source);
                } else if (utils.isPlainObject(source)) {
                    return utils.merge({}, source);
                } else if (utils.isArray(source)) {
                    return source.slice();
                }
                return source;
            }
            function mergeDeepProperties(prop) {
                if (!utils.isUndefined(config2[prop])) {
                    config[prop] = getMergedValue(config1[prop], config2[prop]);
                } else if (!utils.isUndefined(config1[prop])) {
                    config[prop] = getMergedValue(undefined, config1[prop]);
                }
            }
            utils.forEach(valueFromConfig2Keys, (function valueFromConfig2(prop) {
                if (!utils.isUndefined(config2[prop])) {
                    config[prop] = getMergedValue(undefined, config2[prop]);
                }
            }));
            utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);
            utils.forEach(defaultToConfig2Keys, (function defaultToConfig2(prop) {
                if (!utils.isUndefined(config2[prop])) {
                    config[prop] = getMergedValue(undefined, config2[prop]);
                } else if (!utils.isUndefined(config1[prop])) {
                    config[prop] = getMergedValue(undefined, config1[prop]);
                }
            }));
            utils.forEach(directMergeKeys, (function merge(prop) {
                if (prop in config2) {
                    config[prop] = getMergedValue(config1[prop], config2[prop]);
                } else if (prop in config1) {
                    config[prop] = getMergedValue(undefined, config1[prop]);
                }
            }));
            var axiosKeys = valueFromConfig2Keys.concat(mergeDeepPropertiesKeys).concat(defaultToConfig2Keys).concat(directMergeKeys);
            var otherKeys = Object.keys(config1).concat(Object.keys(config2)).filter((function filterAxiosKeys(key) {
                return axiosKeys.indexOf(key) === -1;
            }));
            utils.forEach(otherKeys, mergeDeepProperties);
            return config;
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var pkg = __webpack_require__(199);
        var validators = {};
        [ "object", "boolean", "number", "function", "string", "symbol" ].forEach((function(type, i) {
            validators[type] = function validator(thing) {
                return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
            };
        }));
        var deprecatedWarnings = {};
        var currentVerArr = pkg.version.split(".");
        function isOlderVersion(version, thanVersion) {
            var pkgVersionArr = thanVersion ? thanVersion.split(".") : currentVerArr;
            var destVer = version.split(".");
            for (var i = 0; i < 3; i++) {
                if (pkgVersionArr[i] > destVer[i]) {
                    return true;
                } else if (pkgVersionArr[i] < destVer[i]) {
                    return false;
                }
            }
            return false;
        }
        validators.transitional = function transitional(validator, version, message) {
            var isDeprecated = version && isOlderVersion(version);
            function formatMessage(opt, desc) {
                return "[Axios v" + pkg.version + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
            }
            return function(value, opt, opts) {
                if (validator === false) {
                    throw new Error(formatMessage(opt, " has been removed in " + version));
                }
                if (isDeprecated && !deprecatedWarnings[opt]) {
                    deprecatedWarnings[opt] = true;
                    console.warn(formatMessage(opt, " has been deprecated since v" + version + " and will be removed in the near future"));
                }
                return validator ? validator(value, opt, opts) : true;
            };
        };
        function assertOptions(options, schema, allowUnknown) {
            if (typeof options !== "object") {
                throw new TypeError("options must be an object");
            }
            var keys = Object.keys(options);
            var i = keys.length;
            while (i-- > 0) {
                var opt = keys[i];
                var validator = schema[opt];
                if (validator) {
                    var value = options[opt];
                    var result = value === undefined || validator(value, opt, options);
                    if (result !== true) {
                        throw new TypeError("option " + opt + " must be " + result);
                    }
                    continue;
                }
                if (allowUnknown !== true) {
                    throw Error("Unknown option " + opt);
                }
            }
        }
        module.exports = {
            isOlderVersion,
            assertOptions,
            validators
        };
    }, module => {
        "use strict";
        function Cancel(message) {
            this.message = message;
        }
        Cancel.prototype.toString = function toString() {
            return "Cancel" + (this.message ? ": " + this.message : "");
        };
        Cancel.prototype.__CANCEL__ = true;
        module.exports = Cancel;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var Cancel = __webpack_require__(203);
        function CancelToken(executor) {
            if (typeof executor !== "function") {
                throw new TypeError("executor must be a function.");
            }
            var resolvePromise;
            this.promise = new Promise((function promiseExecutor(resolve) {
                resolvePromise = resolve;
            }));
            var token = this;
            executor((function cancel(message) {
                if (token.reason) {
                    return;
                }
                token.reason = new Cancel(message);
                resolvePromise(token.reason);
            }));
        }
        CancelToken.prototype.throwIfRequested = function throwIfRequested() {
            if (this.reason) {
                throw this.reason;
            }
        };
        CancelToken.source = function source() {
            var cancel;
            var token = new CancelToken((function executor(c) {
                cancel = c;
            }));
            return {
                token,
                cancel
            };
        };
        module.exports = CancelToken;
    }, module => {
        "use strict";
        module.exports = function spread(callback) {
            return function wrap(arr) {
                return callback.apply(null, arr);
            };
        };
    }, module => {
        "use strict";
        module.exports = function isAxiosError(payload) {
            return typeof payload === "object" && payload.isAxiosError === true;
        };
    }, module => {
        "use strict";
        module.exports = require("querystring");
    }, (__unused_webpack_module, exports) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.BalenaS3Source = exports.BalenaS3SourceBase = void 0;
        const aws4_axios_1 = __webpack_require__(210);
        const axios_1 = __webpack_require__(175);
        const http_1 = __webpack_require__(174);
        const source_destination_1 = __webpack_require__(25);
        const zip_1 = __webpack_require__(215);
        const ESR_IMAGES_PREFIX = "esr-images";
        const IMAGES_PREFIX = "images";
        const PRELOADED_IMAGES_PREFIX = "preloaded-images";
        class BalenaS3SourceBase extends source_destination_1.SourceDestination {
            constructor({host, bucket, prefix, deviceType, buildId, release, awsCredentials}) {
                super();
                this.host = host;
                this.bucket = bucket;
                if (prefix !== undefined) {
                    this.prefix = prefix;
                } else if (release !== undefined) {
                    this.prefix = PRELOADED_IMAGES_PREFIX;
                } else if (BalenaS3SourceBase.isESRVersion(buildId)) {
                    this.prefix = ESR_IMAGES_PREFIX;
                } else {
                    this.prefix = IMAGES_PREFIX;
                }
                this.deviceType = deviceType;
                this.buildId = buildId;
                this.release = release;
                this.axiosInstance = axios_1.default.create();
                if (awsCredentials !== undefined) {
                    this.axiosInstance.interceptors.request.use((0, aws4_axios_1.aws4Interceptor)({
                        service: "s3"
                    }, awsCredentials));
                }
            }
            async canCreateReadStream() {
                return true;
            }
            static isESRVersion(buildId) {
                return /^\d{4}\.\d{2}\.\d+\.(dev|prod)$/.test(buildId);
            }
            isESR() {
                return BalenaS3SourceBase.isESRVersion(this.buildId);
            }
            async download(path, responseType) {
                return await this.axiosInstance.get(this.getUrl(path), {
                    responseType
                });
            }
            getUrl(path) {
                let prefix = this.prefix;
                let release = this.release;
                if (release !== undefined && BalenaS3SourceBase.filesMissingFromPreloadedImages.includes(path)) {
                    release = undefined;
                    prefix = this.isESR() ? ESR_IMAGES_PREFIX : IMAGES_PREFIX;
                }
                return [ this.host, this.bucket, prefix, this.deviceType, encodeURIComponent(this.buildId), release, path ].filter((x => x !== undefined)).join("/");
            }
        }
        exports.BalenaS3SourceBase = BalenaS3SourceBase;
        BalenaS3SourceBase.filesMissingFromPreloadedImages = [ "VERSION", "VERSION_HOSTOS", "device-type.json" ];
        class BalenaS3Source extends BalenaS3SourceBase {
            constructor() {
                super(...arguments);
                this.names = [ "balena", "resin" ];
            }
            async getName() {
                for (const name of this.names) {
                    try {
                        await this.axiosInstance({
                            method: "head",
                            url: this.getUrl(`image/${name}.img`)
                        });
                        return name;
                    } catch (error) {
                        if (error.response.status !== 404) {
                            throw error;
                        }
                    }
                }
                throw new Error("Could not find image");
            }
            async canRead() {
                return true;
            }
            async read(buffer, bufferOffset, length, sourceOffset) {
                return await this.rawSource.read(buffer, bufferOffset, length, sourceOffset);
            }
            async createReadStream(options = {}) {
                return await this.zipSource.createReadStream(options);
            }
            async _getMetadata() {
                return await this.zipSource.getMetadata();
            }
            async _open() {
                this.name = await this.getName();
                this.rawSource = new http_1.Http({
                    url: this.getUrl(`image/${this.name}.img`),
                    axiosInstance: this.axiosInstance
                });
                this.zipSource = new zip_1.ZipSource(new http_1.Http({
                    url: this.getUrl(`image/${this.name}.img.zip`),
                    avoidRandomAccess: true,
                    axiosInstance: this.axiosInstance
                }));
                await Promise.all([ this.rawSource.open(), await this.zipSource.open() ]);
            }
            async _close() {
                await Promise.all([ this.zipSource.close(), await this.rawSource.close() ]);
            }
        }
        exports.BalenaS3Source = BalenaS3Source;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.aws4Interceptor = exports.getAuthErrorMessage = exports.interceptor = void 0;
        var interceptor_1 = __webpack_require__(211);
        Object.defineProperty(exports, "aws4Interceptor", {
            enumerable: true,
            get: function() {
                return interceptor_1.aws4Interceptor;
            }
        });
        var getAuthErrorMessage_1 = __webpack_require__(214);
        Object.defineProperty(exports, "getAuthErrorMessage", {
            enumerable: true,
            get: function() {
                return getAuthErrorMessage_1.getAuthErrorMessage;
            }
        });
        exports.interceptor = interceptor_1.aws4Interceptor;
        exports.default = interceptor_1.aws4Interceptor;
    }, function(__unused_webpack_module, exports, __webpack_require__) {
        "use strict";
        var __assign = this && this.__assign || function() {
            __assign = Object.assign || function(t) {
                for (var s, i = 1, n = arguments.length; i < n; i++) {
                    s = arguments[i];
                    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
                }
                return t;
            };
            return __assign.apply(this, arguments);
        };
        var __rest = this && this.__rest || function(s, e) {
            var t = {};
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
            if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
                if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
            }
            return t;
        };
        var __importDefault = this && this.__importDefault || function(mod) {
            return mod && mod.__esModule ? mod : {
                default: mod
            };
        };
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.aws4Interceptor = void 0;
        var aws4_1 = __webpack_require__(212);
        var buildURL_1 = __importDefault(__webpack_require__(180));
        var combineURLs_1 = __importDefault(__webpack_require__(192));
        var isAbsoluteURL_1 = __importDefault(__webpack_require__(191));
        exports.aws4Interceptor = function(options, credentials) {
            return function(config) {
                if (!config.url) {
                    throw new Error("No URL present in request config, unable to sign request");
                }
                if (config.params) {
                    config.url = buildURL_1.default(config.url, config.params, config.paramsSerializer);
                    delete config.params;
                }
                var url = config.url;
                if (config.baseURL && !isAbsoluteURL_1.default(config.url)) {
                    url = combineURLs_1.default(config.baseURL, config.url);
                }
                var _a = new URL(url), host = _a.host, pathname = _a.pathname, search = _a.search;
                var data = config.data, headers = config.headers, method = config.method;
                var region;
                var service;
                var signQuery;
                if (options) {
                    region = options.region, service = options.service;
                }
                var transformRequest = getTransformer(config);
                var transformedData = transformRequest(data, headers);
                var common = headers.common, _delete = headers.delete, get = headers.get, head = headers.head, post = headers.post, put = headers.put, patch = headers.patch, headersToSign = __rest(headers, [ "common", "delete", "get", "head", "post", "put", "patch" ]);
                var signingOptions = __assign(__assign({
                    method: method && method.toUpperCase(),
                    host,
                    path: pathname + search,
                    region,
                    service
                }, signQuery !== undefined ? {
                    signQuery
                } : {}), {
                    body: transformedData,
                    headers: headersToSign
                });
                aws4_1.sign(signingOptions, credentials);
                config.headers = signingOptions.headers;
                return config;
            };
        };
        var getTransformer = function(config) {
            var transformRequest = config.transformRequest;
            if (transformRequest) {
                if (typeof transformRequest === "function") {
                    return transformRequest;
                } else if (transformRequest.length) {
                    return transformRequest[0];
                }
            }
            throw new Error("Could not get default transformRequest function from Axios defaults");
        };
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        var aws4 = exports, url = __webpack_require__(196), querystring = __webpack_require__(207), crypto = __webpack_require__(56), lru = __webpack_require__(213), credentialsCache = lru(1e3);
        function hmac(key, string, encoding) {
            return crypto.createHmac("sha256", key).update(string, "utf8").digest(encoding);
        }
        function hash(string, encoding) {
            return crypto.createHash("sha256").update(string, "utf8").digest(encoding);
        }
        function encodeRfc3986(urlEncodedString) {
            return urlEncodedString.replace(/[!'()*]/g, (function(c) {
                return "%" + c.charCodeAt(0).toString(16).toUpperCase();
            }));
        }
        function encodeRfc3986Full(str) {
            return encodeRfc3986(encodeURIComponent(str));
        }
        var HEADERS_TO_IGNORE = {
            authorization: true,
            connection: true,
            "x-amzn-trace-id": true,
            "user-agent": true,
            expect: true,
            "presigned-expires": true,
            range: true
        };
        function RequestSigner(request, credentials) {
            if (typeof request === "string") request = url.parse(request);
            var headers = request.headers = request.headers || {}, hostParts = (!this.service || !this.region) && this.matchHost(request.hostname || request.host || headers.Host || headers.host);
            this.request = request;
            this.credentials = credentials || this.defaultCredentials();
            this.service = request.service || hostParts[0] || "";
            this.region = request.region || hostParts[1] || "us-east-1";
            if (this.service === "email") this.service = "ses";
            if (!request.method && request.body) request.method = "POST";
            if (!headers.Host && !headers.host) {
                headers.Host = request.hostname || request.host || this.createHost();
                if (request.port) headers.Host += ":" + request.port;
            }
            if (!request.hostname && !request.host) request.hostname = headers.Host || headers.host;
            this.isCodeCommitGit = this.service === "codecommit" && request.method === "GIT";
        }
        RequestSigner.prototype.matchHost = function(host) {
            var match = (host || "").match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com(\.cn)?$/);
            var hostParts = (match || []).slice(1, 3);
            if (hostParts[1] === "es") hostParts = hostParts.reverse();
            if (hostParts[1] == "s3") {
                hostParts[0] = "s3";
                hostParts[1] = "us-east-1";
            } else {
                for (var i = 0; i < 2; i++) {
                    if (/^s3-/.test(hostParts[i])) {
                        hostParts[1] = hostParts[i].slice(3);
                        hostParts[0] = "s3";
                        break;
                    }
                }
            }
            return hostParts;
        };
        RequestSigner.prototype.isSingleRegion = function() {
            if ([ "s3", "sdb" ].indexOf(this.service) >= 0 && this.region === "us-east-1") return true;
            return [ "cloudfront", "ls", "route53", "iam", "importexport", "sts" ].indexOf(this.service) >= 0;
        };
        RequestSigner.prototype.createHost = function() {
            var region = this.isSingleRegion() ? "" : "." + this.region, subdomain = this.service === "ses" ? "email" : this.service;
            return subdomain + region + ".amazonaws.com";
        };
        RequestSigner.prototype.prepareRequest = function() {
            this.parsePath();
            var request = this.request, headers = request.headers, query;
            if (request.signQuery) {
                this.parsedPath.query = query = this.parsedPath.query || {};
                if (this.credentials.sessionToken) query["X-Amz-Security-Token"] = this.credentials.sessionToken;
                if (this.service === "s3" && !query["X-Amz-Expires"]) query["X-Amz-Expires"] = 86400;
                if (query["X-Amz-Date"]) this.datetime = query["X-Amz-Date"]; else query["X-Amz-Date"] = this.getDateTime();
                query["X-Amz-Algorithm"] = "AWS4-HMAC-SHA256";
                query["X-Amz-Credential"] = this.credentials.accessKeyId + "/" + this.credentialString();
                query["X-Amz-SignedHeaders"] = this.signedHeaders();
            } else {
                if (!request.doNotModifyHeaders && !this.isCodeCommitGit) {
                    if (request.body && !headers["Content-Type"] && !headers["content-type"]) headers["Content-Type"] = "application/x-www-form-urlencoded; charset=utf-8";
                    if (request.body && !headers["Content-Length"] && !headers["content-length"]) headers["Content-Length"] = Buffer.byteLength(request.body);
                    if (this.credentials.sessionToken && !headers["X-Amz-Security-Token"] && !headers["x-amz-security-token"]) headers["X-Amz-Security-Token"] = this.credentials.sessionToken;
                    if (this.service === "s3" && !headers["X-Amz-Content-Sha256"] && !headers["x-amz-content-sha256"]) headers["X-Amz-Content-Sha256"] = hash(this.request.body || "", "hex");
                    if (headers["X-Amz-Date"] || headers["x-amz-date"]) this.datetime = headers["X-Amz-Date"] || headers["x-amz-date"]; else headers["X-Amz-Date"] = this.getDateTime();
                }
                delete headers.Authorization;
                delete headers.authorization;
            }
        };
        RequestSigner.prototype.sign = function() {
            if (!this.parsedPath) this.prepareRequest();
            if (this.request.signQuery) {
                this.parsedPath.query["X-Amz-Signature"] = this.signature();
            } else {
                this.request.headers.Authorization = this.authHeader();
            }
            this.request.path = this.formatPath();
            return this.request;
        };
        RequestSigner.prototype.getDateTime = function() {
            if (!this.datetime) {
                var headers = this.request.headers, date = new Date(headers.Date || headers.date || new Date);
                this.datetime = date.toISOString().replace(/[:\-]|\.\d{3}/g, "");
                if (this.isCodeCommitGit) this.datetime = this.datetime.slice(0, -1);
            }
            return this.datetime;
        };
        RequestSigner.prototype.getDate = function() {
            return this.getDateTime().substr(0, 8);
        };
        RequestSigner.prototype.authHeader = function() {
            return [ "AWS4-HMAC-SHA256 Credential=" + this.credentials.accessKeyId + "/" + this.credentialString(), "SignedHeaders=" + this.signedHeaders(), "Signature=" + this.signature() ].join(", ");
        };
        RequestSigner.prototype.signature = function() {
            var date = this.getDate(), cacheKey = [ this.credentials.secretAccessKey, date, this.region, this.service ].join(), kDate, kRegion, kService, kCredentials = credentialsCache.get(cacheKey);
            if (!kCredentials) {
                kDate = hmac("AWS4" + this.credentials.secretAccessKey, date);
                kRegion = hmac(kDate, this.region);
                kService = hmac(kRegion, this.service);
                kCredentials = hmac(kService, "aws4_request");
                credentialsCache.set(cacheKey, kCredentials);
            }
            return hmac(kCredentials, this.stringToSign(), "hex");
        };
        RequestSigner.prototype.stringToSign = function() {
            return [ "AWS4-HMAC-SHA256", this.getDateTime(), this.credentialString(), hash(this.canonicalString(), "hex") ].join("\n");
        };
        RequestSigner.prototype.canonicalString = function() {
            if (!this.parsedPath) this.prepareRequest();
            var pathStr = this.parsedPath.path, query = this.parsedPath.query, headers = this.request.headers, queryStr = "", normalizePath = this.service !== "s3", decodePath = this.service === "s3" || this.request.doNotEncodePath, decodeSlashesInPath = this.service === "s3", firstValOnly = this.service === "s3", bodyHash;
            if (this.service === "s3" && this.request.signQuery) {
                bodyHash = "UNSIGNED-PAYLOAD";
            } else if (this.isCodeCommitGit) {
                bodyHash = "";
            } else {
                bodyHash = headers["X-Amz-Content-Sha256"] || headers["x-amz-content-sha256"] || hash(this.request.body || "", "hex");
            }
            if (query) {
                var reducedQuery = Object.keys(query).reduce((function(obj, key) {
                    if (!key) return obj;
                    obj[encodeRfc3986Full(key)] = !Array.isArray(query[key]) ? query[key] : firstValOnly ? query[key][0] : query[key];
                    return obj;
                }), {});
                var encodedQueryPieces = [];
                Object.keys(reducedQuery).sort().forEach((function(key) {
                    if (!Array.isArray(reducedQuery[key])) {
                        encodedQueryPieces.push(key + "=" + encodeRfc3986Full(reducedQuery[key]));
                    } else {
                        reducedQuery[key].map(encodeRfc3986Full).sort().forEach((function(val) {
                            encodedQueryPieces.push(key + "=" + val);
                        }));
                    }
                }));
                queryStr = encodedQueryPieces.join("&");
            }
            if (pathStr !== "/") {
                if (normalizePath) pathStr = pathStr.replace(/\/{2,}/g, "/");
                pathStr = pathStr.split("/").reduce((function(path, piece) {
                    if (normalizePath && piece === "..") {
                        path.pop();
                    } else if (!normalizePath || piece !== ".") {
                        if (decodePath) piece = decodeURIComponent(piece.replace(/\+/g, " "));
                        path.push(encodeRfc3986Full(piece));
                    }
                    return path;
                }), []).join("/");
                if (pathStr[0] !== "/") pathStr = "/" + pathStr;
                if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, "/");
            }
            return [ this.request.method || "GET", pathStr, queryStr, this.canonicalHeaders() + "\n", this.signedHeaders(), bodyHash ].join("\n");
        };
        RequestSigner.prototype.canonicalHeaders = function() {
            var headers = this.request.headers;
            function trimAll(header) {
                return header.toString().trim().replace(/\s+/g, " ");
            }
            return Object.keys(headers).filter((function(key) {
                return HEADERS_TO_IGNORE[key.toLowerCase()] == null;
            })).sort((function(a, b) {
                return a.toLowerCase() < b.toLowerCase() ? -1 : 1;
            })).map((function(key) {
                return key.toLowerCase() + ":" + trimAll(headers[key]);
            })).join("\n");
        };
        RequestSigner.prototype.signedHeaders = function() {
            return Object.keys(this.request.headers).map((function(key) {
                return key.toLowerCase();
            })).filter((function(key) {
                return HEADERS_TO_IGNORE[key] == null;
            })).sort().join(";");
        };
        RequestSigner.prototype.credentialString = function() {
            return [ this.getDate(), this.region, this.service, "aws4_request" ].join("/");
        };
        RequestSigner.prototype.defaultCredentials = function() {
            var env = process.env;
            return {
                accessKeyId: env.AWS_ACCESS_KEY_ID || env.AWS_ACCESS_KEY,
                secretAccessKey: env.AWS_SECRET_ACCESS_KEY || env.AWS_SECRET_KEY,
                sessionToken: env.AWS_SESSION_TOKEN
            };
        };
        RequestSigner.prototype.parsePath = function() {
            var path = this.request.path || "/";
            if (/[^0-9A-Za-z;,/?:@&=+$\-_.!~*'()#%]/.test(path)) {
                path = encodeURI(decodeURI(path));
            }
            var queryIx = path.indexOf("?"), query = null;
            if (queryIx >= 0) {
                query = querystring.parse(path.slice(queryIx + 1));
                path = path.slice(0, queryIx);
            }
            this.parsedPath = {
                path,
                query
            };
        };
        RequestSigner.prototype.formatPath = function() {
            var path = this.parsedPath.path, query = this.parsedPath.query;
            if (!query) return path;
            if (query[""] != null) delete query[""];
            return path + "?" + encodeRfc3986(querystring.stringify(query));
        };
        aws4.RequestSigner = RequestSigner;
        aws4.sign = function(request, credentials) {
            return new RequestSigner(request, credentials).sign();
        };
    }, module => {
        module.exports = function(size) {
            return new LruCache(size);
        };
        function LruCache(size) {
            this.capacity = size | 0;
            this.map = Object.create(null);
            this.list = new DoublyLinkedList;
        }
        LruCache.prototype.get = function(key) {
            var node = this.map[key];
            if (node == null) return undefined;
            this.used(node);
            return node.val;
        };
        LruCache.prototype.set = function(key, val) {
            var node = this.map[key];
            if (node != null) {
                node.val = val;
            } else {
                if (!this.capacity) this.prune();
                if (!this.capacity) return false;
                node = new DoublyLinkedNode(key, val);
                this.map[key] = node;
                this.capacity--;
            }
            this.used(node);
            return true;
        };
        LruCache.prototype.used = function(node) {
            this.list.moveToFront(node);
        };
        LruCache.prototype.prune = function() {
            var node = this.list.pop();
            if (node != null) {
                delete this.map[node.key];
                this.capacity++;
            }
        };
        function DoublyLinkedList() {
            this.firstNode = null;
            this.lastNode = null;
        }
        DoublyLinkedList.prototype.moveToFront = function(node) {
            if (this.firstNode == node) return;
            this.remove(node);
            if (this.firstNode == null) {
                this.firstNode = node;
                this.lastNode = node;
                node.prev = null;
                node.next = null;
            } else {
                node.prev = null;
                node.next = this.firstNode;
                node.next.prev = node;
                this.firstNode = node;
            }
        };
        DoublyLinkedList.prototype.pop = function() {
            var lastNode = this.lastNode;
            if (lastNode != null) {
                this.remove(lastNode);
            }
            return lastNode;
        };
        DoublyLinkedList.prototype.remove = function(node) {
            if (this.firstNode == node) {
                this.firstNode = node.next;
            } else if (node.prev != null) {
                node.prev.next = node.next;
            }
            if (this.lastNode == node) {
                this.lastNode = node.prev;
            } else if (node.next != null) {
                node.next.prev = node.prev;
            }
        };
        function DoublyLinkedNode(key, val) {
            this.key = key;
            this.val = val;
            this.prev = null;
            this.next = null;
        }
    }, (__unused_webpack_module, exports) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.getAuthErrorMessage = void 0;
        exports.getAuthErrorMessage = function(error) {
            var data = error.response && error.response.data;
            if (data) {
                return data.message;
            }
        };
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.ZipSource = exports.RandomAccessZipSource = exports.StreamZipSource = exports.matchSupportedExtensions = void 0;
        const blockmap_1 = __webpack_require__(216);
        const path_1 = __webpack_require__(15);
        const stream_1 = __webpack_require__(17);
        const yauzl_1 = __webpack_require__(232);
        const constants_1 = __webpack_require__(3);
        const zip_1 = __webpack_require__(236);
        const source_destination_1 = __webpack_require__(25);
        const source_source_1 = __webpack_require__(24);
        const block_transform_stream_1 = __webpack_require__(20);
        const errors_1 = __webpack_require__(4);
        const shared_1 = __webpack_require__(55);
        const sparse_filter_stream_1 = __webpack_require__(54);
        const stream_limiter_1 = __webpack_require__(22);
        const utils_1 = __webpack_require__(6);
        function blockmapToBlocks(blockmap) {
            return blockmap.ranges.map((range => {
                const offset = range.start * blockmap.blockSize;
                const length = (range.end - range.start + 1) * blockmap.blockSize;
                const checksum = range.checksum;
                const checksumType = blockmap.checksumType === "sha1" || blockmap.checksumType === "sha256" ? blockmap.checksumType : undefined;
                return {
                    checksum,
                    checksumType,
                    blocks: [ {
                        offset,
                        length
                    } ]
                };
            }));
        }
        function matchSupportedExtensions(filename) {
            const extension = path_1.posix.extname(filename);
            return extension.length > 1 && source_destination_1.SourceDestination.imageExtensions.includes(extension.slice(1));
        }
        exports.matchSupportedExtensions = matchSupportedExtensions;
        class StreamZipSource extends source_source_1.SourceSource {
            constructor(source, match = matchSupportedExtensions) {
                super(source);
                this.match = match;
            }
            async canCreateReadStream() {
                return true;
            }
            async getEntry() {
                if (this.entry === undefined) {
                    const entry = await (0, zip_1.getFileStreamFromZipStream)(await this.source.createReadStream(), this.match);
                    this.entry = entry;
                    const onData = () => {
                        entry.removeListener("data", onData);
                        this.entry = undefined;
                    };
                    entry.on("data", onData);
                    entry.pause();
                }
                return this.entry;
            }
            async createReadStream({start = 0, end} = {}) {
                if (start !== 0) {
                    throw new errors_1.NotCapable;
                }
                const stream = await this.getEntry();
                if (end !== undefined) {
                    const transform = new stream_limiter_1.StreamLimiter(stream, end + 1);
                    return transform;
                }
                return stream;
            }
            async _getMetadata() {
                const entry = await this.getEntry();
                return {
                    size: entry.size,
                    compressedSize: entry.compressedSize,
                    name: path_1.posix.basename(entry.path)
                };
            }
        }
        exports.StreamZipSource = StreamZipSource;
        class SourceRandomAccessReader extends yauzl_1.RandomAccessReader {
            constructor(source) {
                super();
                this.source = source;
            }
            _readStreamForRange(start, end) {
                const passthrough = new stream_1.PassThrough;
                this.source.createReadStream({
                    start,
                    end: end - 1
                }).then((stream => {
                    stream.on("error", passthrough.emit.bind(passthrough, "error"));
                    stream.pipe(passthrough);
                })).catch(passthrough.emit.bind(passthrough, "error"));
                return passthrough;
            }
        }
        class RandomAccessZipSource extends source_source_1.SourceSource {
            constructor(source, match = matchSupportedExtensions) {
                super(source);
                this.match = match;
                this.entries = [];
                this.ready = this.init();
            }
            async init() {
                await this.source.open();
                const sourceMetadata = await this.source.getMetadata();
                const reader = new SourceRandomAccessReader(this.source);
                this.zip = await (0, utils_1.fromCallback)((callback => {
                    if (sourceMetadata.size === undefined) {
                        throw new errors_1.NotCapable;
                    }
                    (0, yauzl_1.fromRandomAccessReader)(reader, sourceMetadata.size, {
                        autoClose: false
                    }, callback);
                }));
                this.zip.on("entry", (entry => {
                    this.entries.push(entry);
                }));
                await new Promise(((resolve, reject) => {
                    this.zip.on("end", resolve);
                    this.zip.on("error", reject);
                }));
            }
            async canCreateReadStream() {
                return true;
            }
            async canCreateSparseReadStream() {
                const metadata = await this.getMetadata();
                return metadata.blockMap !== undefined;
            }
            async getEntries() {
                await this.ready;
                return this.entries;
            }
            async getImageEntry() {
                const entries = (await this.getEntries()).filter((e => this.match(e.fileName)));
                const entry = (0, utils_1.maxBy)(entries, (e => e.uncompressedSize));
                if (entry === undefined) {
                    throw new Error(constants_1.NO_MATCHING_FILE_MSG);
                }
                if (entry.compressionMethod !== 0 && entry.compressionMethod !== 8) {
                    throw new Error(`unsupported compression method: ${entry.compressionMethod}`);
                }
                return entry;
            }
            async _open() {
                await this.ready;
                await this.getImageEntry();
            }
            async getEntryByName(name) {
                const entries = await this.getEntries();
                for (const entry of entries) {
                    if (entry.fileName === name) {
                        return entry;
                    }
                }
            }
            async getStream(name) {
                const entry = await this.getEntryByName(name);
                if (entry !== undefined) {
                    return await (0, utils_1.fromCallback)((callback => {
                        this.zip.openReadStream(entry, callback);
                    }));
                }
            }
            async getString(name) {
                const stream = await this.getStream(name);
                if (stream !== undefined) {
                    const buffer = await (0, utils_1.streamToBuffer)(stream);
                    return buffer.toString();
                }
            }
            async getJson(name) {
                const data = await this.getString(name);
                if (data !== undefined) {
                    return JSON.parse(data);
                }
            }
            async createReadStream({start = 0, end, alignment, numBuffers}) {
                if (start !== 0) {
                    throw new errors_1.NotCapable;
                }
                const entry = await this.getImageEntry();
                const stream = await this.getStream(entry.fileName);
                if (stream === undefined) {
                    throw new errors_1.NotCapable;
                }
                if (end !== undefined) {
                    const transform = new stream_limiter_1.StreamLimiter(stream, end + 1);
                    return block_transform_stream_1.BlockTransformStream.alignIfNeeded(transform, alignment, numBuffers);
                }
                return block_transform_stream_1.BlockTransformStream.alignIfNeeded(stream, alignment, numBuffers);
            }
            async createSparseReadStream({generateChecksums = false, alignment, numBuffers} = {}) {
                const metadata = await this.getMetadata();
                if (metadata.blocks === undefined) {
                    throw new errors_1.NotCapable;
                }
                const transform = new sparse_filter_stream_1.SparseFilterStream({
                    blocks: metadata.blocks,
                    verify: !generateChecksums,
                    generateChecksums
                });
                const stream = await this.createReadStream({
                    alignment,
                    numBuffers
                });
                stream.pipe(transform);
                return transform;
            }
            async _getMetadata() {
                const entry = await this.getImageEntry();
                const result = {
                    size: entry.uncompressedSize,
                    compressedSize: entry.compressedSize
                };
                const prefix = path_1.posix.join(path_1.posix.dirname(entry.fileName), ".meta");
                result.logo = await this.getString(path_1.posix.join(prefix, "logo.svg"));
                result.instructions = await this.getString(path_1.posix.join(prefix, "instructions.markdown"));
                const blockMap = await this.getString(path_1.posix.join(prefix, "image.bmap"));
                if (blockMap !== undefined) {
                    result.blockMap = blockmap_1.BlockMap.parse(blockMap);
                    result.blocks = blockmapToBlocks(result.blockMap);
                    result.blockmappedSize = (0, shared_1.blocksLength)(result.blocks);
                }
                let manifest;
                try {
                    manifest = await this.getJson(path_1.posix.join(prefix, "manifest.json"));
                } catch (error) {
                    throw new Error("Invalid archive manifest.json");
                }
                let name;
                if (manifest !== undefined) {
                    name = manifest.name;
                    for (const key of RandomAccessZipSource.manifestFields) {
                        result[key] = manifest[key];
                    }
                }
                result.name = name || path_1.posix.basename(entry.fileName);
                if (result.logo || result.instructions || result.blockMap || manifest) {
                    result.isEtch = true;
                }
                return result;
            }
        }
        exports.RandomAccessZipSource = RandomAccessZipSource;
        RandomAccessZipSource.manifestFields = [ "bytesToZeroOutFromTheBeginning", "checksum", "checksumType", "recommendedDriveSize", "releaseNotesUrl", "supportUrl", "url", "version" ];
        class ZipSource extends source_source_1.SourceSource {
            constructor(source, preferStreamSource = false, match = matchSupportedExtensions) {
                super(source);
                this.preferStreamSource = preferStreamSource;
                this.match = match;
                this.ready = this.prepare();
            }
            async prepare() {
                if (!this.preferStreamSource && await this.source.canRead()) {
                    this.implementation = new RandomAccessZipSource(this.source, this.match);
                } else {
                    this.implementation = new StreamZipSource(this.source, this.match);
                }
            }
            async canCreateReadStream() {
                await this.ready;
                return await this.implementation.canCreateReadStream();
            }
            async open() {
                await this.ready;
                return await this.implementation.open();
            }
            async canCreateSparseReadStream() {
                await this.ready;
                return await this.implementation.canCreateSparseReadStream();
            }
            async createReadStream({emitProgress = false, start = 0, end, alignment, numBuffers} = {}) {
                await this.ready;
                const stream = await this.implementation.createReadStream({
                    emitProgress,
                    start,
                    end
                });
                return block_transform_stream_1.BlockTransformStream.alignIfNeeded(stream, alignment, numBuffers);
            }
            async createSparseReadStream({generateChecksums = false, alignment, numBuffers} = {}) {
                await this.ready;
                return await this.implementation.createSparseReadStream({
                    generateChecksums,
                    alignment,
                    numBuffers
                });
            }
            async _getMetadata() {
                await this.ready;
                const metadata = await this.implementation.getMetadata();
                return {
                    ...metadata,
                    isCompressed: true
                };
            }
        }
        exports.ZipSource = ZipSource;
        ZipSource.mimetype = "application/zip";
        source_destination_1.SourceDestination.register(ZipSource);
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        const tslib_1 = __webpack_require__(108);
        tslib_1.__exportStar(__webpack_require__(217), exports);
        tslib_1.__exportStar(__webpack_require__(227), exports);
        tslib_1.__exportStar(__webpack_require__(228), exports);
        tslib_1.__exportStar(__webpack_require__(225), exports);
        tslib_1.__exportStar(__webpack_require__(226), exports);
        tslib_1.__exportStar(__webpack_require__(229), exports);
        tslib_1.__exportStar(__webpack_require__(230), exports);
        tslib_1.__exportStar(__webpack_require__(231), exports);
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.BlockMap = void 0;
        const crypto_1 = __webpack_require__(56);
        const xml_js_1 = __webpack_require__(218);
        const parse_1 = __webpack_require__(225);
        const range_1 = __webpack_require__(226);
        function xmlTag(tag, text) {
            return xml_js_1.js2xml({
                [tag]: {
                    _text: text
                }
            }, {
                compact: true
            });
        }
        class BlockMap {
            constructor(options = {}) {
                this.version = options.version || "2.0";
                this.imageSize = options.imageSize || 0;
                this.blockSize = options.blockSize || 4096;
                this.blocksCount = options.blocksCount || 0;
                this.mappedBlocksCount = options.mappedBlocksCount || 0;
                this.checksum = options.checksum;
                this.checksumType = options.checksumType || "sha256";
                this.ranges = (options.ranges || []).map(range_1.Range.from);
            }
            injectChecksum(bmap) {
                const checksum = this.checksum || "";
                const zerofill = xmlTag("BmapFileChecksum", checksum.replace(/./g, "0"));
                const value = bmap.replace(xmlTag("BmapFileChecksum", checksum), zerofill);
                const digest = crypto_1.createHash(this.checksumType).update(value).digest("hex");
                return value.replace(zerofill, xmlTag("BmapFileChecksum", digest));
            }
            static fromJSON(data) {
                const options = typeof data === "string" ? JSON.parse(data) : data;
                return new BlockMap(options);
            }
            toString() {
                const ranges2 = this.ranges.map((range => {
                    const blockRange = range.start !== range.end ? range.start + "-" + range.end : range.start;
                    return {
                        _attributes: {
                            chksum: range.checksum
                        },
                        _text: blockRange
                    };
                }));
                const data2 = {
                    _declaration: {
                        _attributes: {
                            version: "1.0",
                            encoding: "UTF-8"
                        }
                    },
                    bmap: {
                        _attributes: {
                            version: "2.0"
                        },
                        ImageSize: {
                            _text: this.imageSize
                        },
                        BlockSize: {
                            _text: this.blockSize
                        },
                        BlocksCount: {
                            _text: this.blocksCount
                        },
                        MappedBlocksCount: {
                            _text: this.mappedBlocksCount
                        },
                        ChecksumType: {
                            _text: this.checksumType
                        },
                        BmapFileChecksum: {
                            _text: this.checksum
                        },
                        BlockMap: {
                            Range: ranges2
                        }
                    }
                };
                const bmap2 = xml_js_1.js2xml(data2, {
                    compact: true,
                    spaces: 2
                }) + "\n";
                return this.injectChecksum(bmap2);
            }
            static parse(value, verify = true) {
                return new BlockMap(parse_1.parse(value, verify));
            }
        }
        exports.BlockMap = BlockMap;
        BlockMap.versions = [ "1.2", "1.3", "1.4", "2.0" ];
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var xml2js = __webpack_require__(219);
        var xml2json = __webpack_require__(222);
        var js2xml = __webpack_require__(223);
        var json2xml = __webpack_require__(224);
        module.exports = {
            xml2js,
            xml2json,
            js2xml,
            json2xml
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var sax = __webpack_require__(159);
        var expat = {
            on: function() {},
            parse: function() {}
        };
        var helper = __webpack_require__(220);
        var isArray = __webpack_require__(221).isArray;
        var options;
        var pureJsParser = true;
        var currentElement;
        function validateOptions(userOptions) {
            options = helper.copyOptions(userOptions);
            helper.ensureFlagExists("ignoreDeclaration", options);
            helper.ensureFlagExists("ignoreInstruction", options);
            helper.ensureFlagExists("ignoreAttributes", options);
            helper.ensureFlagExists("ignoreText", options);
            helper.ensureFlagExists("ignoreComment", options);
            helper.ensureFlagExists("ignoreCdata", options);
            helper.ensureFlagExists("ignoreDoctype", options);
            helper.ensureFlagExists("compact", options);
            helper.ensureFlagExists("alwaysChildren", options);
            helper.ensureFlagExists("addParent", options);
            helper.ensureFlagExists("trim", options);
            helper.ensureFlagExists("nativeType", options);
            helper.ensureFlagExists("nativeTypeAttributes", options);
            helper.ensureFlagExists("sanitize", options);
            helper.ensureFlagExists("instructionHasAttributes", options);
            helper.ensureFlagExists("captureSpacesBetweenElements", options);
            helper.ensureAlwaysArrayExists(options);
            helper.ensureKeyExists("declaration", options);
            helper.ensureKeyExists("instruction", options);
            helper.ensureKeyExists("attributes", options);
            helper.ensureKeyExists("text", options);
            helper.ensureKeyExists("comment", options);
            helper.ensureKeyExists("cdata", options);
            helper.ensureKeyExists("doctype", options);
            helper.ensureKeyExists("type", options);
            helper.ensureKeyExists("name", options);
            helper.ensureKeyExists("elements", options);
            helper.ensureKeyExists("parent", options);
            helper.checkFnExists("doctype", options);
            helper.checkFnExists("instruction", options);
            helper.checkFnExists("cdata", options);
            helper.checkFnExists("comment", options);
            helper.checkFnExists("text", options);
            helper.checkFnExists("instructionName", options);
            helper.checkFnExists("elementName", options);
            helper.checkFnExists("attributeName", options);
            helper.checkFnExists("attributeValue", options);
            helper.checkFnExists("attributes", options);
            return options;
        }
        function nativeType(value) {
            var nValue = Number(value);
            if (!isNaN(nValue)) {
                return nValue;
            }
            var bValue = value.toLowerCase();
            if (bValue === "true") {
                return true;
            } else if (bValue === "false") {
                return false;
            }
            return value;
        }
        function addField(type, value) {
            var key;
            if (options.compact) {
                if (!currentElement[options[type + "Key"]] && (isArray(options.alwaysArray) ? options.alwaysArray.indexOf(options[type + "Key"]) !== -1 : options.alwaysArray)) {
                    currentElement[options[type + "Key"]] = [];
                }
                if (currentElement[options[type + "Key"]] && !isArray(currentElement[options[type + "Key"]])) {
                    currentElement[options[type + "Key"]] = [ currentElement[options[type + "Key"]] ];
                }
                if (type + "Fn" in options && typeof value === "string") {
                    value = options[type + "Fn"](value, currentElement);
                }
                if (type === "instruction" && ("instructionFn" in options || "instructionNameFn" in options)) {
                    for (key in value) {
                        if (value.hasOwnProperty(key)) {
                            if ("instructionFn" in options) {
                                value[key] = options.instructionFn(value[key], key, currentElement);
                            } else {
                                var temp = value[key];
                                delete value[key];
                                value[options.instructionNameFn(key, temp, currentElement)] = temp;
                            }
                        }
                    }
                }
                if (isArray(currentElement[options[type + "Key"]])) {
                    currentElement[options[type + "Key"]].push(value);
                } else {
                    currentElement[options[type + "Key"]] = value;
                }
            } else {
                if (!currentElement[options.elementsKey]) {
                    currentElement[options.elementsKey] = [];
                }
                var element = {};
                element[options.typeKey] = type;
                if (type === "instruction") {
                    for (key in value) {
                        if (value.hasOwnProperty(key)) {
                            break;
                        }
                    }
                    element[options.nameKey] = "instructionNameFn" in options ? options.instructionNameFn(key, value, currentElement) : key;
                    if (options.instructionHasAttributes) {
                        element[options.attributesKey] = value[key][options.attributesKey];
                        if ("instructionFn" in options) {
                            element[options.attributesKey] = options.instructionFn(element[options.attributesKey], key, currentElement);
                        }
                    } else {
                        if ("instructionFn" in options) {
                            value[key] = options.instructionFn(value[key], key, currentElement);
                        }
                        element[options.instructionKey] = value[key];
                    }
                } else {
                    if (type + "Fn" in options) {
                        value = options[type + "Fn"](value, currentElement);
                    }
                    element[options[type + "Key"]] = value;
                }
                if (options.addParent) {
                    element[options.parentKey] = currentElement;
                }
                currentElement[options.elementsKey].push(element);
            }
        }
        function manipulateAttributes(attributes) {
            if ("attributesFn" in options && attributes) {
                attributes = options.attributesFn(attributes, currentElement);
            }
            if ((options.trim || "attributeValueFn" in options || "attributeNameFn" in options || options.nativeTypeAttributes) && attributes) {
                var key;
                for (key in attributes) {
                    if (attributes.hasOwnProperty(key)) {
                        if (options.trim) attributes[key] = attributes[key].trim();
                        if (options.nativeTypeAttributes) {
                            attributes[key] = nativeType(attributes[key]);
                        }
                        if ("attributeValueFn" in options) attributes[key] = options.attributeValueFn(attributes[key], key, currentElement);
                        if ("attributeNameFn" in options) {
                            var temp = attributes[key];
                            delete attributes[key];
                            attributes[options.attributeNameFn(key, attributes[key], currentElement)] = temp;
                        }
                    }
                }
            }
            return attributes;
        }
        function onInstruction(instruction) {
            var attributes = {};
            if (instruction.body && (instruction.name.toLowerCase() === "xml" || options.instructionHasAttributes)) {
                var attrsRegExp = /([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g;
                var match;
                while ((match = attrsRegExp.exec(instruction.body)) !== null) {
                    attributes[match[1]] = match[2] || match[3] || match[4];
                }
                attributes = manipulateAttributes(attributes);
            }
            if (instruction.name.toLowerCase() === "xml") {
                if (options.ignoreDeclaration) {
                    return;
                }
                currentElement[options.declarationKey] = {};
                if (Object.keys(attributes).length) {
                    currentElement[options.declarationKey][options.attributesKey] = attributes;
                }
                if (options.addParent) {
                    currentElement[options.declarationKey][options.parentKey] = currentElement;
                }
            } else {
                if (options.ignoreInstruction) {
                    return;
                }
                if (options.trim) {
                    instruction.body = instruction.body.trim();
                }
                var value = {};
                if (options.instructionHasAttributes && Object.keys(attributes).length) {
                    value[instruction.name] = {};
                    value[instruction.name][options.attributesKey] = attributes;
                } else {
                    value[instruction.name] = instruction.body;
                }
                addField("instruction", value);
            }
        }
        function onStartElement(name, attributes) {
            var element;
            if (typeof name === "object") {
                attributes = name.attributes;
                name = name.name;
            }
            attributes = manipulateAttributes(attributes);
            if ("elementNameFn" in options) {
                name = options.elementNameFn(name, currentElement);
            }
            if (options.compact) {
                element = {};
                if (!options.ignoreAttributes && attributes && Object.keys(attributes).length) {
                    element[options.attributesKey] = {};
                    var key;
                    for (key in attributes) {
                        if (attributes.hasOwnProperty(key)) {
                            element[options.attributesKey][key] = attributes[key];
                        }
                    }
                }
                if (!(name in currentElement) && (isArray(options.alwaysArray) ? options.alwaysArray.indexOf(name) !== -1 : options.alwaysArray)) {
                    currentElement[name] = [];
                }
                if (currentElement[name] && !isArray(currentElement[name])) {
                    currentElement[name] = [ currentElement[name] ];
                }
                if (isArray(currentElement[name])) {
                    currentElement[name].push(element);
                } else {
                    currentElement[name] = element;
                }
            } else {
                if (!currentElement[options.elementsKey]) {
                    currentElement[options.elementsKey] = [];
                }
                element = {};
                element[options.typeKey] = "element";
                element[options.nameKey] = name;
                if (!options.ignoreAttributes && attributes && Object.keys(attributes).length) {
                    element[options.attributesKey] = attributes;
                }
                if (options.alwaysChildren) {
                    element[options.elementsKey] = [];
                }
                currentElement[options.elementsKey].push(element);
            }
            element[options.parentKey] = currentElement;
            currentElement = element;
        }
        function onText(text) {
            if (options.ignoreText) {
                return;
            }
            if (!text.trim() && !options.captureSpacesBetweenElements) {
                return;
            }
            if (options.trim) {
                text = text.trim();
            }
            if (options.nativeType) {
                text = nativeType(text);
            }
            if (options.sanitize) {
                text = text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
            }
            addField("text", text);
        }
        function onComment(comment) {
            if (options.ignoreComment) {
                return;
            }
            if (options.trim) {
                comment = comment.trim();
            }
            addField("comment", comment);
        }
        function onEndElement(name) {
            var parentElement = currentElement[options.parentKey];
            if (!options.addParent) {
                delete currentElement[options.parentKey];
            }
            currentElement = parentElement;
        }
        function onCdata(cdata) {
            if (options.ignoreCdata) {
                return;
            }
            if (options.trim) {
                cdata = cdata.trim();
            }
            addField("cdata", cdata);
        }
        function onDoctype(doctype) {
            if (options.ignoreDoctype) {
                return;
            }
            doctype = doctype.replace(/^ /, "");
            if (options.trim) {
                doctype = doctype.trim();
            }
            addField("doctype", doctype);
        }
        function onError(error) {
            error.note = error;
        }
        module.exports = function(xml, userOptions) {
            var parser = pureJsParser ? sax.parser(true, {}) : parser = new expat.Parser("UTF-8");
            var result = {};
            currentElement = result;
            options = validateOptions(userOptions);
            if (pureJsParser) {
                parser.opt = {
                    strictEntities: true
                };
                parser.onopentag = onStartElement;
                parser.ontext = onText;
                parser.oncomment = onComment;
                parser.onclosetag = onEndElement;
                parser.onerror = onError;
                parser.oncdata = onCdata;
                parser.ondoctype = onDoctype;
                parser.onprocessinginstruction = onInstruction;
            } else {
                parser.on("startElement", onStartElement);
                parser.on("text", onText);
                parser.on("comment", onComment);
                parser.on("endElement", onEndElement);
                parser.on("error", onError);
            }
            if (pureJsParser) {
                parser.write(xml).close();
            } else {
                if (!parser.parse(xml)) {
                    throw new Error("XML parsing error: " + parser.getError());
                }
            }
            if (result[options.elementsKey]) {
                var temp = result[options.elementsKey];
                delete result[options.elementsKey];
                result[options.elementsKey] = temp;
                delete result.text;
            }
            return result;
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var isArray = __webpack_require__(221).isArray;
        module.exports = {
            copyOptions: function(options) {
                var key, copy = {};
                for (key in options) {
                    if (options.hasOwnProperty(key)) {
                        copy[key] = options[key];
                    }
                }
                return copy;
            },
            ensureFlagExists: function(item, options) {
                if (!(item in options) || typeof options[item] !== "boolean") {
                    options[item] = false;
                }
            },
            ensureSpacesExists: function(options) {
                if (!("spaces" in options) || typeof options.spaces !== "number" && typeof options.spaces !== "string") {
                    options.spaces = 0;
                }
            },
            ensureAlwaysArrayExists: function(options) {
                if (!("alwaysArray" in options) || typeof options.alwaysArray !== "boolean" && !isArray(options.alwaysArray)) {
                    options.alwaysArray = false;
                }
            },
            ensureKeyExists: function(key, options) {
                if (!(key + "Key" in options) || typeof options[key + "Key"] !== "string") {
                    options[key + "Key"] = options.compact ? "_" + key : key;
                }
            },
            checkFnExists: function(key, options) {
                return key + "Fn" in options;
            }
        };
    }, module => {
        module.exports = {
            isArray: function(value) {
                if (Array.isArray) {
                    return Array.isArray(value);
                }
                return Object.prototype.toString.call(value) === "[object Array]";
            }
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var helper = __webpack_require__(220);
        var xml2js = __webpack_require__(219);
        function validateOptions(userOptions) {
            var options = helper.copyOptions(userOptions);
            helper.ensureSpacesExists(options);
            return options;
        }
        module.exports = function(xml, userOptions) {
            var options, js, json, parentKey;
            options = validateOptions(userOptions);
            js = xml2js(xml, options);
            parentKey = "compact" in options && options.compact ? "_parent" : "parent";
            if ("addParent" in options && options.addParent) {
                json = JSON.stringify(js, (function(k, v) {
                    return k === parentKey ? "_" : v;
                }), options.spaces);
            } else {
                json = JSON.stringify(js, null, options.spaces);
            }
            return json.replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var helper = __webpack_require__(220);
        var isArray = __webpack_require__(221).isArray;
        var currentElement, currentElementName;
        function validateOptions(userOptions) {
            var options = helper.copyOptions(userOptions);
            helper.ensureFlagExists("ignoreDeclaration", options);
            helper.ensureFlagExists("ignoreInstruction", options);
            helper.ensureFlagExists("ignoreAttributes", options);
            helper.ensureFlagExists("ignoreText", options);
            helper.ensureFlagExists("ignoreComment", options);
            helper.ensureFlagExists("ignoreCdata", options);
            helper.ensureFlagExists("ignoreDoctype", options);
            helper.ensureFlagExists("compact", options);
            helper.ensureFlagExists("indentText", options);
            helper.ensureFlagExists("indentCdata", options);
            helper.ensureFlagExists("indentAttributes", options);
            helper.ensureFlagExists("indentInstruction", options);
            helper.ensureFlagExists("fullTagEmptyElement", options);
            helper.ensureFlagExists("noQuotesForNativeAttributes", options);
            helper.ensureSpacesExists(options);
            if (typeof options.spaces === "number") {
                options.spaces = Array(options.spaces + 1).join(" ");
            }
            helper.ensureKeyExists("declaration", options);
            helper.ensureKeyExists("instruction", options);
            helper.ensureKeyExists("attributes", options);
            helper.ensureKeyExists("text", options);
            helper.ensureKeyExists("comment", options);
            helper.ensureKeyExists("cdata", options);
            helper.ensureKeyExists("doctype", options);
            helper.ensureKeyExists("type", options);
            helper.ensureKeyExists("name", options);
            helper.ensureKeyExists("elements", options);
            helper.checkFnExists("doctype", options);
            helper.checkFnExists("instruction", options);
            helper.checkFnExists("cdata", options);
            helper.checkFnExists("comment", options);
            helper.checkFnExists("text", options);
            helper.checkFnExists("instructionName", options);
            helper.checkFnExists("elementName", options);
            helper.checkFnExists("attributeName", options);
            helper.checkFnExists("attributeValue", options);
            helper.checkFnExists("attributes", options);
            helper.checkFnExists("fullTagEmptyElement", options);
            return options;
        }
        function writeIndentation(options, depth, firstLine) {
            return (!firstLine && options.spaces ? "\n" : "") + Array(depth + 1).join(options.spaces);
        }
        function writeAttributes(attributes, options, depth) {
            if (options.ignoreAttributes) {
                return "";
            }
            if ("attributesFn" in options) {
                attributes = options.attributesFn(attributes, currentElementName, currentElement);
            }
            var key, attr, attrName, quote, result = [];
            for (key in attributes) {
                if (attributes.hasOwnProperty(key) && attributes[key] !== null && attributes[key] !== undefined) {
                    quote = options.noQuotesForNativeAttributes && typeof attributes[key] !== "string" ? "" : '"';
                    attr = "" + attributes[key];
                    attr = attr.replace(/"/g, "&quot;");
                    attrName = "attributeNameFn" in options ? options.attributeNameFn(key, attr, currentElementName, currentElement) : key;
                    result.push(options.spaces && options.indentAttributes ? writeIndentation(options, depth + 1, false) : " ");
                    result.push(attrName + "=" + quote + ("attributeValueFn" in options ? options.attributeValueFn(attr, key, currentElementName, currentElement) : attr) + quote);
                }
            }
            if (attributes && Object.keys(attributes).length && options.spaces && options.indentAttributes) {
                result.push(writeIndentation(options, depth, false));
            }
            return result.join("");
        }
        function writeDeclaration(declaration, options, depth) {
            currentElement = declaration;
            currentElementName = "xml";
            return options.ignoreDeclaration ? "" : "<?" + "xml" + writeAttributes(declaration[options.attributesKey], options, depth) + "?>";
        }
        function writeInstruction(instruction, options, depth) {
            if (options.ignoreInstruction) {
                return "";
            }
            var key;
            for (key in instruction) {
                if (instruction.hasOwnProperty(key)) {
                    break;
                }
            }
            var instructionName = "instructionNameFn" in options ? options.instructionNameFn(key, instruction[key], currentElementName, currentElement) : key;
            if (typeof instruction[key] === "object") {
                currentElement = instruction;
                currentElementName = instructionName;
                return "<?" + instructionName + writeAttributes(instruction[key][options.attributesKey], options, depth) + "?>";
            } else {
                var instructionValue = instruction[key] ? instruction[key] : "";
                if ("instructionFn" in options) instructionValue = options.instructionFn(instructionValue, key, currentElementName, currentElement);
                return "<?" + instructionName + (instructionValue ? " " + instructionValue : "") + "?>";
            }
        }
        function writeComment(comment, options) {
            return options.ignoreComment ? "" : "\x3c!--" + ("commentFn" in options ? options.commentFn(comment, currentElementName, currentElement) : comment) + "--\x3e";
        }
        function writeCdata(cdata, options) {
            return options.ignoreCdata ? "" : "<![CDATA[" + ("cdataFn" in options ? options.cdataFn(cdata, currentElementName, currentElement) : cdata.replace("]]>", "]]]]><![CDATA[>")) + "]]>";
        }
        function writeDoctype(doctype, options) {
            return options.ignoreDoctype ? "" : "<!DOCTYPE " + ("doctypeFn" in options ? options.doctypeFn(doctype, currentElementName, currentElement) : doctype) + ">";
        }
        function writeText(text, options) {
            if (options.ignoreText) return "";
            text = "" + text;
            text = text.replace(/&amp;/g, "&");
            text = text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
            return "textFn" in options ? options.textFn(text, currentElementName, currentElement) : text;
        }
        function hasContent(element, options) {
            var i;
            if (element.elements && element.elements.length) {
                for (i = 0; i < element.elements.length; ++i) {
                    switch (element.elements[i][options.typeKey]) {
                      case "text":
                        if (options.indentText) {
                            return true;
                        }
                        break;

                      case "cdata":
                        if (options.indentCdata) {
                            return true;
                        }
                        break;

                      case "instruction":
                        if (options.indentInstruction) {
                            return true;
                        }
                        break;

                      case "doctype":
                      case "comment":
                      case "element":
                        return true;

                      default:
                        return true;
                    }
                }
            }
            return false;
        }
        function writeElement(element, options, depth) {
            currentElement = element;
            currentElementName = element.name;
            var xml = [], elementName = "elementNameFn" in options ? options.elementNameFn(element.name, element) : element.name;
            xml.push("<" + elementName);
            if (element[options.attributesKey]) {
                xml.push(writeAttributes(element[options.attributesKey], options, depth));
            }
            var withClosingTag = element[options.elementsKey] && element[options.elementsKey].length || element[options.attributesKey] && element[options.attributesKey]["xml:space"] === "preserve";
            if (!withClosingTag) {
                if ("fullTagEmptyElementFn" in options) {
                    withClosingTag = options.fullTagEmptyElementFn(element.name, element);
                } else {
                    withClosingTag = options.fullTagEmptyElement;
                }
            }
            if (withClosingTag) {
                xml.push(">");
                if (element[options.elementsKey] && element[options.elementsKey].length) {
                    xml.push(writeElements(element[options.elementsKey], options, depth + 1));
                    currentElement = element;
                    currentElementName = element.name;
                }
                xml.push(options.spaces && hasContent(element, options) ? "\n" + Array(depth + 1).join(options.spaces) : "");
                xml.push("</" + elementName + ">");
            } else {
                xml.push("/>");
            }
            return xml.join("");
        }
        function writeElements(elements, options, depth, firstLine) {
            return elements.reduce((function(xml, element) {
                var indent = writeIndentation(options, depth, firstLine && !xml);
                switch (element.type) {
                  case "element":
                    return xml + indent + writeElement(element, options, depth);

                  case "comment":
                    return xml + indent + writeComment(element[options.commentKey], options);

                  case "doctype":
                    return xml + indent + writeDoctype(element[options.doctypeKey], options);

                  case "cdata":
                    return xml + (options.indentCdata ? indent : "") + writeCdata(element[options.cdataKey], options);

                  case "text":
                    return xml + (options.indentText ? indent : "") + writeText(element[options.textKey], options);

                  case "instruction":
                    var instruction = {};
                    instruction[element[options.nameKey]] = element[options.attributesKey] ? element : element[options.instructionKey];
                    return xml + (options.indentInstruction ? indent : "") + writeInstruction(instruction, options, depth);
                }
            }), "");
        }
        function hasContentCompact(element, options, anyContent) {
            var key;
            for (key in element) {
                if (element.hasOwnProperty(key)) {
                    switch (key) {
                      case options.parentKey:
                      case options.attributesKey:
                        break;

                      case options.textKey:
                        if (options.indentText || anyContent) {
                            return true;
                        }
                        break;

                      case options.cdataKey:
                        if (options.indentCdata || anyContent) {
                            return true;
                        }
                        break;

                      case options.instructionKey:
                        if (options.indentInstruction || anyContent) {
                            return true;
                        }
                        break;

                      case options.doctypeKey:
                      case options.commentKey:
                        return true;

                      default:
                        return true;
                    }
                }
            }
            return false;
        }
        function writeElementCompact(element, name, options, depth, indent) {
            currentElement = element;
            currentElementName = name;
            var elementName = "elementNameFn" in options ? options.elementNameFn(name, element) : name;
            if (typeof element === "undefined" || element === null || element === "") {
                return "fullTagEmptyElementFn" in options && options.fullTagEmptyElementFn(name, element) || options.fullTagEmptyElement ? "<" + elementName + "></" + elementName + ">" : "<" + elementName + "/>";
            }
            var xml = [];
            if (name) {
                xml.push("<" + elementName);
                if (typeof element !== "object") {
                    xml.push(">" + writeText(element, options) + "</" + elementName + ">");
                    return xml.join("");
                }
                if (element[options.attributesKey]) {
                    xml.push(writeAttributes(element[options.attributesKey], options, depth));
                }
                var withClosingTag = hasContentCompact(element, options, true) || element[options.attributesKey] && element[options.attributesKey]["xml:space"] === "preserve";
                if (!withClosingTag) {
                    if ("fullTagEmptyElementFn" in options) {
                        withClosingTag = options.fullTagEmptyElementFn(name, element);
                    } else {
                        withClosingTag = options.fullTagEmptyElement;
                    }
                }
                if (withClosingTag) {
                    xml.push(">");
                } else {
                    xml.push("/>");
                    return xml.join("");
                }
            }
            xml.push(writeElementsCompact(element, options, depth + 1, false));
            currentElement = element;
            currentElementName = name;
            if (name) {
                xml.push((indent ? writeIndentation(options, depth, false) : "") + "</" + elementName + ">");
            }
            return xml.join("");
        }
        function writeElementsCompact(element, options, depth, firstLine) {
            var i, key, nodes, xml = [];
            for (key in element) {
                if (element.hasOwnProperty(key)) {
                    nodes = isArray(element[key]) ? element[key] : [ element[key] ];
                    for (i = 0; i < nodes.length; ++i) {
                        switch (key) {
                          case options.declarationKey:
                            xml.push(writeDeclaration(nodes[i], options, depth));
                            break;

                          case options.instructionKey:
                            xml.push((options.indentInstruction ? writeIndentation(options, depth, firstLine) : "") + writeInstruction(nodes[i], options, depth));
                            break;

                          case options.attributesKey:
                          case options.parentKey:
                            break;

                          case options.textKey:
                            xml.push((options.indentText ? writeIndentation(options, depth, firstLine) : "") + writeText(nodes[i], options));
                            break;

                          case options.cdataKey:
                            xml.push((options.indentCdata ? writeIndentation(options, depth, firstLine) : "") + writeCdata(nodes[i], options));
                            break;

                          case options.doctypeKey:
                            xml.push(writeIndentation(options, depth, firstLine) + writeDoctype(nodes[i], options));
                            break;

                          case options.commentKey:
                            xml.push(writeIndentation(options, depth, firstLine) + writeComment(nodes[i], options));
                            break;

                          default:
                            xml.push(writeIndentation(options, depth, firstLine) + writeElementCompact(nodes[i], key, options, depth, hasContentCompact(nodes[i], options)));
                        }
                        firstLine = firstLine && !xml.length;
                    }
                }
            }
            return xml.join("");
        }
        module.exports = function(js, options) {
            options = validateOptions(options);
            var xml = [];
            currentElement = js;
            currentElementName = "_root_";
            if (options.compact) {
                xml.push(writeElementsCompact(js, options, 0, true));
            } else {
                if (js[options.declarationKey]) {
                    xml.push(writeDeclaration(js[options.declarationKey], options, 0));
                }
                if (js[options.elementsKey] && js[options.elementsKey].length) {
                    xml.push(writeElements(js[options.elementsKey], options, 0, !xml.length));
                }
            }
            return xml.join("");
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var js2xml = __webpack_require__(223);
        module.exports = function(json, options) {
            if (json instanceof Buffer) {
                json = json.toString();
            }
            var js = null;
            if (typeof json === "string") {
                try {
                    js = JSON.parse(json);
                } catch (e) {
                    throw new Error("The JSON structure is invalid");
                }
            } else {
                js = json;
            }
            return js2xml(js, options);
        };
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.parse = void 0;
        const crypto_1 = __webpack_require__(56);
        const xml_js_1 = __webpack_require__(218);
        const blockmap_1 = __webpack_require__(217);
        function firstChild(element, name) {
            if (element.elements !== undefined) {
                return element.elements.find((e => e.name === name));
            }
        }
        function firstChildThrow(element, name) {
            const result = firstChild(element, name);
            if (result === undefined) {
                throw new Error(`Missing tag "${name}"`);
            }
            return result;
        }
        function getAttribute(element, name) {
            if (element.attributes !== undefined) {
                return element.attributes[name];
            }
        }
        function getAttributeThrow(element, name) {
            const result = getAttribute(element, name);
            if (result === undefined) {
                throw new Error(`Missing attribute "${name}"`);
            }
            return result;
        }
        function getText(element) {
            if (Array.isArray(element)) {
                return element.map(getText).join("");
            }
            if (element.type === "element") {
                return getText(element.elements || []);
            }
            if (element.type === "text" && element.text !== undefined) {
                return "" + element.text;
            }
            return "";
        }
        function textContentThrow(element, name) {
            return getText(firstChildThrow(element, name)).trim();
        }
        function textContent(element, name) {
            const child = firstChild(element, name);
            if (child !== undefined) {
                return getText(child).trim();
            }
        }
        function getRanges(element) {
            const ranges = [];
            for (const node of element.elements || []) {
                if (node.type === "element" && node.name !== undefined && node.name.toLowerCase() === "range") {
                    const [start, end] = getText(node).trim().split("-");
                    const checksum = getAttribute(node, "sha1") || getAttribute(node, "chksum");
                    if (checksum === undefined) {
                        throw new Error("No checksum in range");
                    }
                    if (typeof checksum !== "string") {
                        throw new Error("Checksum is not a string");
                    }
                    const range = {
                        start: parseInt(start, 10),
                        end: parseInt(end || start, 10),
                        checksum
                    };
                    ranges.push(range);
                }
            }
            return ranges;
        }
        function maskChecksum(value) {
            const pattern = /BmapFileChecksum/.test(value) ? /(<BmapFileChecksum>\s*)([a-z0-9]+)(\s*<\/BmapFileChecksum>)/i : /(<BmapFileSHA1>\s*)([a-z0-9]+)(\s*<\/BmapFileSHA1>)/i;
            return value.replace(pattern, ((_match, start, checksum, end) => start + checksum.replace(/./g, "0") + end));
        }
        function parse(value, verify = true) {
            value = value.toString();
            const data = xml_js_1.xml2js(value, {
                compact: false
            });
            const bmap = firstChildThrow(data, "bmap");
            const version = getAttributeThrow(bmap, "version");
            if (typeof version !== "string") {
                throw new Error(`Version is not a string: ${version}`);
            }
            if (!blockmap_1.BlockMap.versions.includes(version)) {
                throw new Error(`Unsupported block map version "${version}"`);
            }
            const imageSize = parseInt(textContentThrow(bmap, "ImageSize"), 10);
            const blockSize = parseInt(textContentThrow(bmap, "BlockSize"), 10);
            const blocksCount = parseInt(textContentThrow(bmap, "BlocksCount"), 10);
            const mappedBlocksCount = parseInt(textContentThrow(bmap, "MappedBlocksCount"), 10);
            const checksum = textContent(bmap, "BmapFileChecksum") || textContent(bmap, "BmapFileSHA1");
            const checksumType = textContent(bmap, "ChecksumType") || "sha1";
            const map = firstChildThrow(bmap, "BlockMap");
            const ranges = getRanges(map);
            if (verify && checksum !== undefined) {
                const file = maskChecksum(value);
                const digest = crypto_1.createHash(checksumType).update(file).digest("hex");
                if (checksum !== digest) {
                    throw new Error(`File checksum mismatch: ${checksum} != ${digest}`);
                }
            }
            return {
                version,
                imageSize,
                blockSize,
                blocksCount,
                mappedBlocksCount,
                checksum,
                checksumType,
                ranges
            };
        }
        exports.parse = parse;
    }, (__unused_webpack_module, exports) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.Range = void 0;
        class Range {
            constructor(start = 0, end = 0, checksum) {
                this.start = start;
                this.end = end;
                this.checksum = checksum;
            }
            static from(value) {
                return new Range(value.start, value.end, value.checksum);
            }
            get length() {
                return this.end - this.start + 1;
            }
            set length(value) {
                this.end = this.start + value - 1;
            }
        }
        exports.Range = Range;
    }, (__unused_webpack_module, exports) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.Chunk = void 0;
        class Chunk {
            constructor(buffer, position) {
                this.buffer = buffer;
                this.position = position;
            }
            get length() {
                return this.buffer.length;
            }
        }
        exports.Chunk = Chunk;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.FilterStream = void 0;
        const crypto_1 = __webpack_require__(56);
        const debug_1 = __webpack_require__(63);
        const stream_1 = __webpack_require__(17);
        const chunk_1 = __webpack_require__(227);
        const read_range_1 = __webpack_require__(229);
        const debug = debug_1.debug("blockmap:filterstream");
        class FilterStream extends stream_1.Transform {
            constructor(blockMap, verify = true, generateChecksums = false, chunkSize = 64 * 1024) {
                super({
                    readableObjectMode: true
                });
                this.blockMap = blockMap;
                this.verify = verify;
                this.generateChecksums = generateChecksums;
                this.chunkSize = chunkSize;
                this.rangesRead = 0;
                this.rangesVerified = 0;
                this.blocksRead = 0;
                this.bytesRead = 0;
                this.blocksWritten = 0;
                this.bytesWritten = 0;
                this.position = 0;
                this._chunks = [];
                this._bytes = 0;
                if (verify && generateChecksums) {
                    throw new Error("verify and generateChecksums options are mutually exclusive");
                }
                this.ranges = this._getByteRangesFromBlockMap();
                this.currentRange = this.ranges.shift();
                debug("range:next", this.currentRange);
                if (verify || generateChecksums) {
                    this._hash = crypto_1.createHash(this.blockMap.checksumType);
                }
            }
            _getByteRangesFromBlockMap() {
                return this.blockMap.ranges.map((range => new read_range_1.ReadRange(range, this.blockMap.blockSize)));
            }
            _verifyRange() {
                if (this._hash === undefined || this.currentRange === undefined) {
                    return;
                }
                const digest = this._hash.digest("hex");
                debug("verify:checksum", this.currentRange.checksum);
                debug("verify:digest  ", digest);
                this._hash = crypto_1.createHash(this.blockMap.checksumType);
                if (this.verify && this.currentRange.checksum !== digest) {
                    const error = new read_range_1.ReadRangeError(`Invalid checksum for range [${this.currentRange.startLBA},${this.currentRange.endLBA}], bytes ${this.currentRange.start}-${this.currentRange.end}`, this.currentRange, digest);
                    this.emit("error", error);
                    return;
                }
                if (this.generateChecksums) {
                    this.currentRange.range.checksum = digest;
                } else {
                    this.rangesVerified++;
                }
            }
            _rangeInChunk(chunk) {
                if (this.currentRange === undefined) {
                    return false;
                }
                const rangeStart = this.currentRange.start + this.currentRange.offset;
                const isRangeInChunk = rangeStart >= this.position && rangeStart < this.position + chunk.length;
                debug("range-in-chunk", isRangeInChunk);
                return isRangeInChunk;
            }
            _transformBlock(chunk, next) {
                let start = 0;
                let end = 0;
                let length = 0;
                let block;
                while (this.currentRange && this._rangeInChunk(chunk)) {
                    start = this.currentRange.start + this.currentRange.offset - this.position;
                    end = start + this.currentRange.length - this.currentRange.offset;
                    debug("slice", start, "-", end);
                    block = new chunk_1.Chunk(chunk.slice(start, end), this.currentRange.start + this.currentRange.offset);
                    if (end > chunk.length) {
                        length = chunk.length - start;
                        debug("chunk:partial", length);
                        if (length % this.blockMap.blockSize !== 0) {
                            debug("chunk:buffer", "length < block size");
                            this._chunks.push(block.buffer);
                            this._bytes += block.length;
                            this.position += chunk.length - block.length;
                            return process.nextTick(next);
                        }
                    }
                    this.currentRange.offset += block.length;
                    this.bytesWritten += block.length;
                    this.blocksWritten += block.length / this.blockMap.blockSize;
                    debug("push", block.position, block.position / this.blockMap.blockSize, block);
                    this.push(block);
                    if (this._hash !== undefined) {
                        this._hash.update(block.buffer);
                    }
                    if (this.currentRange.length === this.currentRange.offset) {
                        this._verifyRange();
                        this.rangesRead++;
                        this.currentRange = this.currentRange = this.ranges.shift();
                        debug("range:next", this.currentRange);
                    }
                }
                this.position += chunk.length;
                process.nextTick(next);
            }
            _transform(chunk, _encoding, next) {
                debug("position", this.position);
                debug("chunk", chunk.length, chunk);
                this.bytesRead += chunk.length;
                this.blocksRead += chunk.length / this.blockMap.blockSize;
                if (this.currentRange === undefined) {
                    debug("no current range");
                    this.position += chunk.length;
                    return process.nextTick(next);
                }
                if (!this._rangeInChunk(chunk)) {
                    debug("chunk:ignore");
                    this.position += chunk.length;
                    return process.nextTick(next);
                }
                if (this._bytes && this._bytes < this.chunkSize) {
                    debug("chunk:buffer", "not enough bytes");
                    this._chunks.push(chunk);
                    this._bytes += chunk.length;
                    return process.nextTick(next);
                }
                if (this._bytes) {
                    debug("chunk:concat", this._bytes + chunk.length);
                    this._chunks.push(chunk);
                    this._bytes += chunk.length;
                    chunk = Buffer.concat(this._chunks, this._bytes);
                    this._chunks = [];
                    this._bytes = 0;
                }
                this._transformBlock(chunk, next);
            }
            _flush(done) {
                if (this._bytes) {
                    const chunk = Buffer.concat(this._chunks, this._bytes);
                    this._chunks = [];
                    this._bytes = 0;
                    this._transformBlock(chunk, done);
                } else {
                    done();
                }
            }
        }
        exports.FilterStream = FilterStream;
    }, (__unused_webpack_module, exports) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.ReadRangeError = exports.ReadRange = void 0;
        class ReadRange {
            constructor(range, blockSize) {
                this.range = range;
                this.offset = 0;
                this.checksum = range.checksum;
                this.start = range.start * blockSize;
                this.end = (range.end + 1) * blockSize;
                this.length = range.length * blockSize;
                this.startLBA = range.start;
                this.endLBA = range.end;
            }
        }
        exports.ReadRange = ReadRange;
        class ReadRangeError extends Error {
            constructor(message, range, checksum) {
                super(message);
                this.range = range;
                this.checksum = checksum;
            }
        }
        exports.ReadRangeError = ReadRangeError;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.ReadStream = void 0;
        const tslib_1 = __webpack_require__(108);
        const crypto_1 = __webpack_require__(56);
        const debug_1 = __webpack_require__(63);
        const fs_1 = __webpack_require__(14);
        const stream_1 = __webpack_require__(17);
        const chunk_1 = __webpack_require__(227);
        const read_range_1 = __webpack_require__(229);
        const debug = debug_1.debug("blockmap:readstream");
        class ReadStream extends stream_1.Readable {
            constructor(fdOrReadFn, blockMap, verify = true, generateChecksums = false, start = 0, end = Infinity, chunkSize = 64 * 1024) {
                super({
                    objectMode: true
                });
                this.blockMap = blockMap;
                this.verify = verify;
                this.generateChecksums = generateChecksums;
                this.start = start;
                this.end = end;
                this.chunkSize = chunkSize;
                this.rangesRead = 0;
                this.rangesVerified = 0;
                this.blocksRead = 0;
                this.bytesRead = 0;
                this.position = 0;
                if (verify && generateChecksums) {
                    throw new Error("verify and generateChecksums options are mutually exclusive");
                }
                if (start < 0) {
                    throw new Error("Start must not be negative");
                }
                if (start > end) {
                    throw new Error("Start must be less or equal to end");
                }
                if (verify || generateChecksums) {
                    this._hash = crypto_1.createHash(blockMap.checksumType);
                }
                this.ranges = this._prepareRanges();
                if (typeof fdOrReadFn === "number") {
                    this.readFn = (buf, offset, length, position) => new Promise(((resolve, reject) => {
                        fs_1.read(fdOrReadFn, buf, offset, length, position, ((error, bytesRead, buffer) => {
                            if (error) {
                                reject(error);
                            } else {
                                resolve({
                                    bytesRead,
                                    buffer
                                });
                            }
                        }));
                    }));
                } else {
                    this.readFn = fdOrReadFn;
                }
            }
            _prepareRanges() {
                return this.blockMap.ranges.map((range => {
                    const readRange = new read_range_1.ReadRange(range, this.blockMap.blockSize);
                    readRange.start += this.start;
                    readRange.end += this.start;
                    return readRange;
                })).filter((readRange => readRange.end <= this.end + this.start));
            }
            _verifyRange() {
                if (this.currentRange === undefined || this._hash === undefined) {
                    return;
                }
                const digest = this._hash.digest("hex");
                debug("verify:checksum", this.currentRange.checksum);
                debug("verify:digest  ", digest);
                this._hash = crypto_1.createHash(this.blockMap.checksumType);
                if (this.verify && this.currentRange.checksum !== digest) {
                    const error = new read_range_1.ReadRangeError(`Invalid checksum for range [${this.currentRange.startLBA},${this.currentRange.endLBA}], bytes ${this.currentRange.start}-${this.currentRange.end}`, this.currentRange, digest);
                    this.emit("error", error);
                }
                if (this.generateChecksums) {
                    this.currentRange.range.checksum = digest;
                } else {
                    this.rangesVerified++;
                }
            }
            _readBlock() {
                return tslib_1.__awaiter(this, void 0, void 0, (function*() {
                    if (this.currentRange === undefined) {
                        return;
                    }
                    const length = Math.min(this.currentRange.length - this.currentRange.offset, this.chunkSize);
                    const position = this.currentRange.start + this.currentRange.offset;
                    const chunk = new chunk_1.Chunk(Buffer.allocUnsafe(length), position);
                    debug("read-block:position", position);
                    debug("read-block:length", length);
                    try {
                        const {bytesRead} = yield this.readFn(chunk.buffer, 0, length, position);
                        if (bytesRead !== length) {
                            throw new Error(`Bytes read mismatch: ${bytesRead} != ${length}`);
                        }
                        this.currentRange.offset += bytesRead;
                        this.blocksRead += bytesRead / this.blockMap.blockSize;
                        this.bytesRead += bytesRead;
                        this.position += bytesRead;
                        debug("read-block:blocksRead", this.blocksRead);
                        if (this._hash !== undefined) {
                            this._hash.update(chunk.buffer);
                        }
                        this.push(chunk);
                    } catch (error) {
                        this.emit("error", error);
                    }
                }));
            }
            _advanceRange() {
                return tslib_1.__awaiter(this, void 0, void 0, (function*() {
                    if (this.ranges.length > 0) {
                        this.currentRange = this.ranges.shift();
                        this.rangesRead++;
                        debug("read:range %O", this.currentRange);
                        yield this._readBlock();
                    } else {
                        this.push(null);
                    }
                }));
            }
            _read() {
                return tslib_1.__awaiter(this, void 0, void 0, (function*() {
                    if (this.currentRange === undefined) {
                        yield this._advanceRange();
                    } else if (this.currentRange.offset === this.currentRange.length) {
                        this._verifyRange();
                        yield this._advanceRange();
                    } else {
                        yield this._readBlock();
                    }
                }));
            }
        }
        exports.ReadStream = ReadStream;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.withOpenFile = void 0;
        const tslib_1 = __webpack_require__(108);
        const fs = __webpack_require__(14);
        function open(filename) {
            return new Promise(((resolve, reject) => {
                fs.open(filename, "r", ((error, fd) => {
                    if (error) {
                        reject(error);
                    } else {
                        resolve(fd);
                    }
                }));
            }));
        }
        function close(fd) {
            return new Promise(((resolve, reject) => {
                fs.close(fd, (error => {
                    if (error) {
                        reject(error);
                    } else {
                        resolve();
                    }
                }));
            }));
        }
        function withOpenFile(filename, fn) {
            return tslib_1.__awaiter(this, void 0, void 0, (function*() {
                const fd = yield open(filename);
                try {
                    yield fn(fd);
                } finally {
                    yield close(fd);
                }
            }));
        }
        exports.withOpenFile = withOpenFile;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        var fs = __webpack_require__(14);
        var zlib = __webpack_require__(23);
        var fd_slicer = __webpack_require__(233);
        var crc32 = __webpack_require__(235);
        var util = __webpack_require__(58);
        var EventEmitter = __webpack_require__(26).EventEmitter;
        var Transform = __webpack_require__(17).Transform;
        var PassThrough = __webpack_require__(17).PassThrough;
        var Writable = __webpack_require__(17).Writable;
        exports.open = open;
        exports.fromFd = fromFd;
        exports.fromBuffer = fromBuffer;
        exports.fromRandomAccessReader = fromRandomAccessReader;
        exports.dosDateTimeToDate = dosDateTimeToDate;
        exports.validateFileName = validateFileName;
        exports.ZipFile = ZipFile;
        exports.Entry = Entry;
        exports.RandomAccessReader = RandomAccessReader;
        function open(path, options, callback) {
            if (typeof options === "function") {
                callback = options;
                options = null;
            }
            if (options == null) options = {};
            if (options.autoClose == null) options.autoClose = true;
            if (options.lazyEntries == null) options.lazyEntries = false;
            if (options.decodeStrings == null) options.decodeStrings = true;
            if (options.validateEntrySizes == null) options.validateEntrySizes = true;
            if (options.strictFileNames == null) options.strictFileNames = false;
            if (callback == null) callback = defaultCallback;
            fs.open(path, "r", (function(err, fd) {
                if (err) return callback(err);
                fromFd(fd, options, (function(err, zipfile) {
                    if (err) fs.close(fd, defaultCallback);
                    callback(err, zipfile);
                }));
            }));
        }
        function fromFd(fd, options, callback) {
            if (typeof options === "function") {
                callback = options;
                options = null;
            }
            if (options == null) options = {};
            if (options.autoClose == null) options.autoClose = false;
            if (options.lazyEntries == null) options.lazyEntries = false;
            if (options.decodeStrings == null) options.decodeStrings = true;
            if (options.validateEntrySizes == null) options.validateEntrySizes = true;
            if (options.strictFileNames == null) options.strictFileNames = false;
            if (callback == null) callback = defaultCallback;
            fs.fstat(fd, (function(err, stats) {
                if (err) return callback(err);
                var reader = fd_slicer.createFromFd(fd, {
                    autoClose: true
                });
                fromRandomAccessReader(reader, stats.size, options, callback);
            }));
        }
        function fromBuffer(buffer, options, callback) {
            if (typeof options === "function") {
                callback = options;
                options = null;
            }
            if (options == null) options = {};
            options.autoClose = false;
            if (options.lazyEntries == null) options.lazyEntries = false;
            if (options.decodeStrings == null) options.decodeStrings = true;
            if (options.validateEntrySizes == null) options.validateEntrySizes = true;
            if (options.strictFileNames == null) options.strictFileNames = false;
            var reader = fd_slicer.createFromBuffer(buffer, {
                maxChunkSize: 65536
            });
            fromRandomAccessReader(reader, buffer.length, options, callback);
        }
        function fromRandomAccessReader(reader, totalSize, options, callback) {
            if (typeof options === "function") {
                callback = options;
                options = null;
            }
            if (options == null) options = {};
            if (options.autoClose == null) options.autoClose = true;
            if (options.lazyEntries == null) options.lazyEntries = false;
            if (options.decodeStrings == null) options.decodeStrings = true;
            var decodeStrings = !!options.decodeStrings;
            if (options.validateEntrySizes == null) options.validateEntrySizes = true;
            if (options.strictFileNames == null) options.strictFileNames = false;
            if (callback == null) callback = defaultCallback;
            if (typeof totalSize !== "number") throw new Error("expected totalSize parameter to be a number");
            if (totalSize > Number.MAX_SAFE_INTEGER) {
                throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.");
            }
            reader.ref();
            var eocdrWithoutCommentSize = 22;
            var maxCommentSize = 65535;
            var bufferSize = Math.min(eocdrWithoutCommentSize + maxCommentSize, totalSize);
            var buffer = newBuffer(bufferSize);
            var bufferReadStart = totalSize - buffer.length;
            readAndAssertNoEof(reader, buffer, 0, bufferSize, bufferReadStart, (function(err) {
                if (err) return callback(err);
                for (var i = bufferSize - eocdrWithoutCommentSize; i >= 0; i -= 1) {
                    if (buffer.readUInt32LE(i) !== 101010256) continue;
                    var eocdrBuffer = buffer.slice(i);
                    var diskNumber = eocdrBuffer.readUInt16LE(4);
                    if (diskNumber !== 0) {
                        return callback(new Error("multi-disk zip files are not supported: found disk number: " + diskNumber));
                    }
                    var entryCount = eocdrBuffer.readUInt16LE(10);
                    var centralDirectoryOffset = eocdrBuffer.readUInt32LE(16);
                    var commentLength = eocdrBuffer.readUInt16LE(20);
                    var expectedCommentLength = eocdrBuffer.length - eocdrWithoutCommentSize;
                    if (commentLength !== expectedCommentLength) {
                        return callback(new Error("invalid comment length. expected: " + expectedCommentLength + ". found: " + commentLength));
                    }
                    var comment = decodeStrings ? decodeBuffer(eocdrBuffer, 22, eocdrBuffer.length, false) : eocdrBuffer.slice(22);
                    if (!(entryCount === 65535 || centralDirectoryOffset === 4294967295)) {
                        return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options.autoClose, options.lazyEntries, decodeStrings, options.validateEntrySizes, options.strictFileNames));
                    }
                    var zip64EocdlBuffer = newBuffer(20);
                    var zip64EocdlOffset = bufferReadStart + i - zip64EocdlBuffer.length;
                    readAndAssertNoEof(reader, zip64EocdlBuffer, 0, zip64EocdlBuffer.length, zip64EocdlOffset, (function(err) {
                        if (err) return callback(err);
                        if (zip64EocdlBuffer.readUInt32LE(0) !== 117853008) {
                            return callback(new Error("invalid zip64 end of central directory locator signature"));
                        }
                        var zip64EocdrOffset = readUInt64LE(zip64EocdlBuffer, 8);
                        var zip64EocdrBuffer = newBuffer(56);
                        readAndAssertNoEof(reader, zip64EocdrBuffer, 0, zip64EocdrBuffer.length, zip64EocdrOffset, (function(err) {
                            if (err) return callback(err);
                            if (zip64EocdrBuffer.readUInt32LE(0) !== 101075792) {
                                return callback(new Error("invalid zip64 end of central directory record signature"));
                            }
                            entryCount = readUInt64LE(zip64EocdrBuffer, 32);
                            centralDirectoryOffset = readUInt64LE(zip64EocdrBuffer, 48);
                            return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options.autoClose, options.lazyEntries, decodeStrings, options.validateEntrySizes, options.strictFileNames));
                        }));
                    }));
                    return;
                }
                callback(new Error("end of central directory record signature not found"));
            }));
        }
        util.inherits(ZipFile, EventEmitter);
        function ZipFile(reader, centralDirectoryOffset, fileSize, entryCount, comment, autoClose, lazyEntries, decodeStrings, validateEntrySizes, strictFileNames) {
            var self = this;
            EventEmitter.call(self);
            self.reader = reader;
            self.reader.on("error", (function(err) {
                emitError(self, err);
            }));
            self.reader.once("close", (function() {
                self.emit("close");
            }));
            self.readEntryCursor = centralDirectoryOffset;
            self.fileSize = fileSize;
            self.entryCount = entryCount;
            self.comment = comment;
            self.entriesRead = 0;
            self.autoClose = !!autoClose;
            self.lazyEntries = !!lazyEntries;
            self.decodeStrings = !!decodeStrings;
            self.validateEntrySizes = !!validateEntrySizes;
            self.strictFileNames = !!strictFileNames;
            self.isOpen = true;
            self.emittedError = false;
            if (!self.lazyEntries) self._readEntry();
        }
        ZipFile.prototype.close = function() {
            if (!this.isOpen) return;
            this.isOpen = false;
            this.reader.unref();
        };
        function emitErrorAndAutoClose(self, err) {
            if (self.autoClose) self.close();
            emitError(self, err);
        }
        function emitError(self, err) {
            if (self.emittedError) return;
            self.emittedError = true;
            self.emit("error", err);
        }
        ZipFile.prototype.readEntry = function() {
            if (!this.lazyEntries) throw new Error("readEntry() called without lazyEntries:true");
            this._readEntry();
        };
        ZipFile.prototype._readEntry = function() {
            var self = this;
            if (self.entryCount === self.entriesRead) {
                setImmediate((function() {
                    if (self.autoClose) self.close();
                    if (self.emittedError) return;
                    self.emit("end");
                }));
                return;
            }
            if (self.emittedError) return;
            var buffer = newBuffer(46);
            readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, (function(err) {
                if (err) return emitErrorAndAutoClose(self, err);
                if (self.emittedError) return;
                var entry = new Entry;
                var signature = buffer.readUInt32LE(0);
                if (signature !== 33639248) return emitErrorAndAutoClose(self, new Error("invalid central directory file header signature: 0x" + signature.toString(16)));
                entry.versionMadeBy = buffer.readUInt16LE(4);
                entry.versionNeededToExtract = buffer.readUInt16LE(6);
                entry.generalPurposeBitFlag = buffer.readUInt16LE(8);
                entry.compressionMethod = buffer.readUInt16LE(10);
                entry.lastModFileTime = buffer.readUInt16LE(12);
                entry.lastModFileDate = buffer.readUInt16LE(14);
                entry.crc32 = buffer.readUInt32LE(16);
                entry.compressedSize = buffer.readUInt32LE(20);
                entry.uncompressedSize = buffer.readUInt32LE(24);
                entry.fileNameLength = buffer.readUInt16LE(28);
                entry.extraFieldLength = buffer.readUInt16LE(30);
                entry.fileCommentLength = buffer.readUInt16LE(32);
                entry.internalFileAttributes = buffer.readUInt16LE(36);
                entry.externalFileAttributes = buffer.readUInt32LE(38);
                entry.relativeOffsetOfLocalHeader = buffer.readUInt32LE(42);
                if (entry.generalPurposeBitFlag & 64) return emitErrorAndAutoClose(self, new Error("strong encryption is not supported"));
                self.readEntryCursor += 46;
                buffer = newBuffer(entry.fileNameLength + entry.extraFieldLength + entry.fileCommentLength);
                readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, (function(err) {
                    if (err) return emitErrorAndAutoClose(self, err);
                    if (self.emittedError) return;
                    var isUtf8 = (entry.generalPurposeBitFlag & 2048) !== 0;
                    entry.fileName = self.decodeStrings ? decodeBuffer(buffer, 0, entry.fileNameLength, isUtf8) : buffer.slice(0, entry.fileNameLength);
                    var fileCommentStart = entry.fileNameLength + entry.extraFieldLength;
                    var extraFieldBuffer = buffer.slice(entry.fileNameLength, fileCommentStart);
                    entry.extraFields = [];
                    var i = 0;
                    while (i < extraFieldBuffer.length - 3) {
                        var headerId = extraFieldBuffer.readUInt16LE(i + 0);
                        var dataSize = extraFieldBuffer.readUInt16LE(i + 2);
                        var dataStart = i + 4;
                        var dataEnd = dataStart + dataSize;
                        if (dataEnd > extraFieldBuffer.length) return emitErrorAndAutoClose(self, new Error("extra field length exceeds extra field buffer size"));
                        var dataBuffer = newBuffer(dataSize);
                        extraFieldBuffer.copy(dataBuffer, 0, dataStart, dataEnd);
                        entry.extraFields.push({
                            id: headerId,
                            data: dataBuffer
                        });
                        i = dataEnd;
                    }
                    entry.fileComment = self.decodeStrings ? decodeBuffer(buffer, fileCommentStart, fileCommentStart + entry.fileCommentLength, isUtf8) : buffer.slice(fileCommentStart, fileCommentStart + entry.fileCommentLength);
                    entry.comment = entry.fileComment;
                    self.readEntryCursor += buffer.length;
                    self.entriesRead += 1;
                    if (entry.uncompressedSize === 4294967295 || entry.compressedSize === 4294967295 || entry.relativeOffsetOfLocalHeader === 4294967295) {
                        var zip64EiefBuffer = null;
                        for (var i = 0; i < entry.extraFields.length; i++) {
                            var extraField = entry.extraFields[i];
                            if (extraField.id === 1) {
                                zip64EiefBuffer = extraField.data;
                                break;
                            }
                        }
                        if (zip64EiefBuffer == null) {
                            return emitErrorAndAutoClose(self, new Error("expected zip64 extended information extra field"));
                        }
                        var index = 0;
                        if (entry.uncompressedSize === 4294967295) {
                            if (index + 8 > zip64EiefBuffer.length) {
                                return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include uncompressed size"));
                            }
                            entry.uncompressedSize = readUInt64LE(zip64EiefBuffer, index);
                            index += 8;
                        }
                        if (entry.compressedSize === 4294967295) {
                            if (index + 8 > zip64EiefBuffer.length) {
                                return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include compressed size"));
                            }
                            entry.compressedSize = readUInt64LE(zip64EiefBuffer, index);
                            index += 8;
                        }
                        if (entry.relativeOffsetOfLocalHeader === 4294967295) {
                            if (index + 8 > zip64EiefBuffer.length) {
                                return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include relative header offset"));
                            }
                            entry.relativeOffsetOfLocalHeader = readUInt64LE(zip64EiefBuffer, index);
                            index += 8;
                        }
                    }
                    if (self.decodeStrings) {
                        for (var i = 0; i < entry.extraFields.length; i++) {
                            var extraField = entry.extraFields[i];
                            if (extraField.id === 28789) {
                                if (extraField.data.length < 6) {
                                    continue;
                                }
                                if (extraField.data.readUInt8(0) !== 1) {
                                    continue;
                                }
                                var oldNameCrc32 = extraField.data.readUInt32LE(1);
                                if (crc32.unsigned(buffer.slice(0, entry.fileNameLength)) !== oldNameCrc32) {
                                    continue;
                                }
                                entry.fileName = decodeBuffer(extraField.data, 5, extraField.data.length, true);
                                break;
                            }
                        }
                    }
                    if (self.validateEntrySizes && entry.compressionMethod === 0) {
                        var expectedCompressedSize = entry.uncompressedSize;
                        if (entry.isEncrypted()) {
                            expectedCompressedSize += 12;
                        }
                        if (entry.compressedSize !== expectedCompressedSize) {
                            var msg = "compressed/uncompressed size mismatch for stored file: " + entry.compressedSize + " != " + entry.uncompressedSize;
                            return emitErrorAndAutoClose(self, new Error(msg));
                        }
                    }
                    if (self.decodeStrings) {
                        if (!self.strictFileNames) {
                            entry.fileName = entry.fileName.replace(/\\/g, "/");
                        }
                        var errorMessage = validateFileName(entry.fileName, self.validateFileNameOptions);
                        if (errorMessage != null) return emitErrorAndAutoClose(self, new Error(errorMessage));
                    }
                    self.emit("entry", entry);
                    if (!self.lazyEntries) self._readEntry();
                }));
            }));
        };
        ZipFile.prototype.openReadStream = function(entry, options, callback) {
            var self = this;
            var relativeStart = 0;
            var relativeEnd = entry.compressedSize;
            if (callback == null) {
                callback = options;
                options = {};
            } else {
                if (options.decrypt != null) {
                    if (!entry.isEncrypted()) {
                        throw new Error("options.decrypt can only be specified for encrypted entries");
                    }
                    if (options.decrypt !== false) throw new Error("invalid options.decrypt value: " + options.decrypt);
                    if (entry.isCompressed()) {
                        if (options.decompress !== false) throw new Error("entry is encrypted and compressed, and options.decompress !== false");
                    }
                }
                if (options.decompress != null) {
                    if (!entry.isCompressed()) {
                        throw new Error("options.decompress can only be specified for compressed entries");
                    }
                    if (!(options.decompress === false || options.decompress === true)) {
                        throw new Error("invalid options.decompress value: " + options.decompress);
                    }
                }
                if (options.start != null || options.end != null) {
                    if (entry.isCompressed() && options.decompress !== false) {
                        throw new Error("start/end range not allowed for compressed entry without options.decompress === false");
                    }
                    if (entry.isEncrypted() && options.decrypt !== false) {
                        throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false");
                    }
                }
                if (options.start != null) {
                    relativeStart = options.start;
                    if (relativeStart < 0) throw new Error("options.start < 0");
                    if (relativeStart > entry.compressedSize) throw new Error("options.start > entry.compressedSize");
                }
                if (options.end != null) {
                    relativeEnd = options.end;
                    if (relativeEnd < 0) throw new Error("options.end < 0");
                    if (relativeEnd > entry.compressedSize) throw new Error("options.end > entry.compressedSize");
                    if (relativeEnd < relativeStart) throw new Error("options.end < options.start");
                }
            }
            if (!self.isOpen) return callback(new Error("closed"));
            if (entry.isEncrypted()) {
                if (options.decrypt !== false) return callback(new Error("entry is encrypted, and options.decrypt !== false"));
            }
            self.reader.ref();
            var buffer = newBuffer(30);
            readAndAssertNoEof(self.reader, buffer, 0, buffer.length, entry.relativeOffsetOfLocalHeader, (function(err) {
                try {
                    if (err) return callback(err);
                    var signature = buffer.readUInt32LE(0);
                    if (signature !== 67324752) {
                        return callback(new Error("invalid local file header signature: 0x" + signature.toString(16)));
                    }
                    var fileNameLength = buffer.readUInt16LE(26);
                    var extraFieldLength = buffer.readUInt16LE(28);
                    var localFileHeaderEnd = entry.relativeOffsetOfLocalHeader + buffer.length + fileNameLength + extraFieldLength;
                    var decompress;
                    if (entry.compressionMethod === 0) {
                        decompress = false;
                    } else if (entry.compressionMethod === 8) {
                        decompress = options.decompress != null ? options.decompress : true;
                    } else {
                        return callback(new Error("unsupported compression method: " + entry.compressionMethod));
                    }
                    var fileDataStart = localFileHeaderEnd;
                    var fileDataEnd = fileDataStart + entry.compressedSize;
                    if (entry.compressedSize !== 0) {
                        if (fileDataEnd > self.fileSize) {
                            return callback(new Error("file data overflows file bounds: " + fileDataStart + " + " + entry.compressedSize + " > " + self.fileSize));
                        }
                    }
                    var readStream = self.reader.createReadStream({
                        start: fileDataStart + relativeStart,
                        end: fileDataStart + relativeEnd
                    });
                    var endpointStream = readStream;
                    if (decompress) {
                        var destroyed = false;
                        var inflateFilter = zlib.createInflateRaw();
                        readStream.on("error", (function(err) {
                            setImmediate((function() {
                                if (!destroyed) inflateFilter.emit("error", err);
                            }));
                        }));
                        readStream.pipe(inflateFilter);
                        if (self.validateEntrySizes) {
                            endpointStream = new AssertByteCountStream(entry.uncompressedSize);
                            inflateFilter.on("error", (function(err) {
                                setImmediate((function() {
                                    if (!destroyed) endpointStream.emit("error", err);
                                }));
                            }));
                            inflateFilter.pipe(endpointStream);
                        } else {
                            endpointStream = inflateFilter;
                        }
                        endpointStream.destroy = function() {
                            destroyed = true;
                            if (inflateFilter !== endpointStream) inflateFilter.unpipe(endpointStream);
                            readStream.unpipe(inflateFilter);
                            readStream.destroy();
                        };
                    }
                    callback(null, endpointStream);
                } finally {
                    self.reader.unref();
                }
            }));
        };
        function Entry() {}
        Entry.prototype.getLastModDate = function() {
            return dosDateTimeToDate(this.lastModFileDate, this.lastModFileTime);
        };
        Entry.prototype.isEncrypted = function() {
            return (this.generalPurposeBitFlag & 1) !== 0;
        };
        Entry.prototype.isCompressed = function() {
            return this.compressionMethod === 8;
        };
        function dosDateTimeToDate(date, time) {
            var day = date & 31;
            var month = (date >> 5 & 15) - 1;
            var year = (date >> 9 & 127) + 1980;
            var millisecond = 0;
            var second = (time & 31) * 2;
            var minute = time >> 5 & 63;
            var hour = time >> 11 & 31;
            return new Date(year, month, day, hour, minute, second, millisecond);
        }
        function validateFileName(fileName) {
            if (fileName.indexOf("\\") !== -1) {
                return "invalid characters in fileName: " + fileName;
            }
            if (/^[a-zA-Z]:/.test(fileName) || /^\//.test(fileName)) {
                return "absolute path: " + fileName;
            }
            if (fileName.split("/").indexOf("..") !== -1) {
                return "invalid relative path: " + fileName;
            }
            return null;
        }
        function readAndAssertNoEof(reader, buffer, offset, length, position, callback) {
            if (length === 0) {
                return setImmediate((function() {
                    callback(null, newBuffer(0));
                }));
            }
            reader.read(buffer, offset, length, position, (function(err, bytesRead) {
                if (err) return callback(err);
                if (bytesRead < length) {
                    return callback(new Error("unexpected EOF"));
                }
                callback();
            }));
        }
        util.inherits(AssertByteCountStream, Transform);
        function AssertByteCountStream(byteCount) {
            Transform.call(this);
            this.actualByteCount = 0;
            this.expectedByteCount = byteCount;
        }
        AssertByteCountStream.prototype._transform = function(chunk, encoding, cb) {
            this.actualByteCount += chunk.length;
            if (this.actualByteCount > this.expectedByteCount) {
                var msg = "too many bytes in the stream. expected " + this.expectedByteCount + ". got at least " + this.actualByteCount;
                return cb(new Error(msg));
            }
            cb(null, chunk);
        };
        AssertByteCountStream.prototype._flush = function(cb) {
            if (this.actualByteCount < this.expectedByteCount) {
                var msg = "not enough bytes in the stream. expected " + this.expectedByteCount + ". got only " + this.actualByteCount;
                return cb(new Error(msg));
            }
            cb();
        };
        util.inherits(RandomAccessReader, EventEmitter);
        function RandomAccessReader() {
            EventEmitter.call(this);
            this.refCount = 0;
        }
        RandomAccessReader.prototype.ref = function() {
            this.refCount += 1;
        };
        RandomAccessReader.prototype.unref = function() {
            var self = this;
            self.refCount -= 1;
            if (self.refCount > 0) return;
            if (self.refCount < 0) throw new Error("invalid unref");
            self.close(onCloseDone);
            function onCloseDone(err) {
                if (err) return self.emit("error", err);
                self.emit("close");
            }
        };
        RandomAccessReader.prototype.createReadStream = function(options) {
            var start = options.start;
            var end = options.end;
            if (start === end) {
                var emptyStream = new PassThrough;
                setImmediate((function() {
                    emptyStream.end();
                }));
                return emptyStream;
            }
            var stream = this._readStreamForRange(start, end);
            var destroyed = false;
            var refUnrefFilter = new RefUnrefFilter(this);
            stream.on("error", (function(err) {
                setImmediate((function() {
                    if (!destroyed) refUnrefFilter.emit("error", err);
                }));
            }));
            refUnrefFilter.destroy = function() {
                stream.unpipe(refUnrefFilter);
                refUnrefFilter.unref();
                stream.destroy();
            };
            var byteCounter = new AssertByteCountStream(end - start);
            refUnrefFilter.on("error", (function(err) {
                setImmediate((function() {
                    if (!destroyed) byteCounter.emit("error", err);
                }));
            }));
            byteCounter.destroy = function() {
                destroyed = true;
                refUnrefFilter.unpipe(byteCounter);
                refUnrefFilter.destroy();
            };
            return stream.pipe(refUnrefFilter).pipe(byteCounter);
        };
        RandomAccessReader.prototype._readStreamForRange = function(start, end) {
            throw new Error("not implemented");
        };
        RandomAccessReader.prototype.read = function(buffer, offset, length, position, callback) {
            var readStream = this.createReadStream({
                start: position,
                end: position + length
            });
            var writeStream = new Writable;
            var written = 0;
            writeStream._write = function(chunk, encoding, cb) {
                chunk.copy(buffer, offset + written, 0, chunk.length);
                written += chunk.length;
                cb();
            };
            writeStream.on("finish", callback);
            readStream.on("error", (function(error) {
                callback(error);
            }));
            readStream.pipe(writeStream);
        };
        RandomAccessReader.prototype.close = function(callback) {
            setImmediate(callback);
        };
        util.inherits(RefUnrefFilter, PassThrough);
        function RefUnrefFilter(context) {
            PassThrough.call(this);
            this.context = context;
            this.context.ref();
            this.unreffedYet = false;
        }
        RefUnrefFilter.prototype._flush = function(cb) {
            this.unref();
            cb();
        };
        RefUnrefFilter.prototype.unref = function(cb) {
            if (this.unreffedYet) return;
            this.unreffedYet = true;
            this.context.unref();
        };
        var cp437 = "\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñÑªº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ";
        function decodeBuffer(buffer, start, end, isUtf8) {
            if (isUtf8) {
                return buffer.toString("utf8", start, end);
            } else {
                var result = "";
                for (var i = start; i < end; i++) {
                    result += cp437[buffer[i]];
                }
                return result;
            }
        }
        function readUInt64LE(buffer, offset) {
            var lower32 = buffer.readUInt32LE(offset);
            var upper32 = buffer.readUInt32LE(offset + 4);
            return upper32 * 4294967296 + lower32;
        }
        var newBuffer;
        if (typeof Buffer.allocUnsafe === "function") {
            newBuffer = function(len) {
                return Buffer.allocUnsafe(len);
            };
        } else {
            newBuffer = function(len) {
                return new Buffer(len);
            };
        }
        function defaultCallback(err) {
            if (err) throw err;
        }
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        var fs = __webpack_require__(14);
        var util = __webpack_require__(58);
        var stream = __webpack_require__(17);
        var Readable = stream.Readable;
        var Writable = stream.Writable;
        var PassThrough = stream.PassThrough;
        var Pend = __webpack_require__(234);
        var EventEmitter = __webpack_require__(26).EventEmitter;
        exports.createFromBuffer = createFromBuffer;
        exports.createFromFd = createFromFd;
        exports.BufferSlicer = BufferSlicer;
        exports.FdSlicer = FdSlicer;
        util.inherits(FdSlicer, EventEmitter);
        function FdSlicer(fd, options) {
            options = options || {};
            EventEmitter.call(this);
            this.fd = fd;
            this.pend = new Pend;
            this.pend.max = 1;
            this.refCount = 0;
            this.autoClose = !!options.autoClose;
        }
        FdSlicer.prototype.read = function(buffer, offset, length, position, callback) {
            var self = this;
            self.pend.go((function(cb) {
                fs.read(self.fd, buffer, offset, length, position, (function(err, bytesRead, buffer) {
                    cb();
                    callback(err, bytesRead, buffer);
                }));
            }));
        };
        FdSlicer.prototype.write = function(buffer, offset, length, position, callback) {
            var self = this;
            self.pend.go((function(cb) {
                fs.write(self.fd, buffer, offset, length, position, (function(err, written, buffer) {
                    cb();
                    callback(err, written, buffer);
                }));
            }));
        };
        FdSlicer.prototype.createReadStream = function(options) {
            return new ReadStream(this, options);
        };
        FdSlicer.prototype.createWriteStream = function(options) {
            return new WriteStream(this, options);
        };
        FdSlicer.prototype.ref = function() {
            this.refCount += 1;
        };
        FdSlicer.prototype.unref = function() {
            var self = this;
            self.refCount -= 1;
            if (self.refCount > 0) return;
            if (self.refCount < 0) throw new Error("invalid unref");
            if (self.autoClose) {
                fs.close(self.fd, onCloseDone);
            }
            function onCloseDone(err) {
                if (err) {
                    self.emit("error", err);
                } else {
                    self.emit("close");
                }
            }
        };
        util.inherits(ReadStream, Readable);
        function ReadStream(context, options) {
            options = options || {};
            Readable.call(this, options);
            this.context = context;
            this.context.ref();
            this.start = options.start || 0;
            this.endOffset = options.end;
            this.pos = this.start;
            this.destroyed = false;
        }
        ReadStream.prototype._read = function(n) {
            var self = this;
            if (self.destroyed) return;
            var toRead = Math.min(self._readableState.highWaterMark, n);
            if (self.endOffset != null) {
                toRead = Math.min(toRead, self.endOffset - self.pos);
            }
            if (toRead <= 0) {
                self.destroyed = true;
                self.push(null);
                self.context.unref();
                return;
            }
            self.context.pend.go((function(cb) {
                if (self.destroyed) return cb();
                var buffer = new Buffer(toRead);
                fs.read(self.context.fd, buffer, 0, toRead, self.pos, (function(err, bytesRead) {
                    if (err) {
                        self.destroy(err);
                    } else if (bytesRead === 0) {
                        self.destroyed = true;
                        self.push(null);
                        self.context.unref();
                    } else {
                        self.pos += bytesRead;
                        self.push(buffer.slice(0, bytesRead));
                    }
                    cb();
                }));
            }));
        };
        ReadStream.prototype.destroy = function(err) {
            if (this.destroyed) return;
            err = err || new Error("stream destroyed");
            this.destroyed = true;
            this.emit("error", err);
            this.context.unref();
        };
        util.inherits(WriteStream, Writable);
        function WriteStream(context, options) {
            options = options || {};
            Writable.call(this, options);
            this.context = context;
            this.context.ref();
            this.start = options.start || 0;
            this.endOffset = options.end == null ? Infinity : +options.end;
            this.bytesWritten = 0;
            this.pos = this.start;
            this.destroyed = false;
            this.on("finish", this.destroy.bind(this));
        }
        WriteStream.prototype._write = function(buffer, encoding, callback) {
            var self = this;
            if (self.destroyed) return;
            if (self.pos + buffer.length > self.endOffset) {
                var err = new Error("maximum file length exceeded");
                err.code = "ETOOBIG";
                self.destroy();
                callback(err);
                return;
            }
            self.context.pend.go((function(cb) {
                if (self.destroyed) return cb();
                fs.write(self.context.fd, buffer, 0, buffer.length, self.pos, (function(err, bytes) {
                    if (err) {
                        self.destroy();
                        cb();
                        callback(err);
                    } else {
                        self.bytesWritten += bytes;
                        self.pos += bytes;
                        self.emit("progress");
                        cb();
                        callback();
                    }
                }));
            }));
        };
        WriteStream.prototype.destroy = function() {
            if (this.destroyed) return;
            this.destroyed = true;
            this.context.unref();
        };
        util.inherits(BufferSlicer, EventEmitter);
        function BufferSlicer(buffer, options) {
            EventEmitter.call(this);
            options = options || {};
            this.refCount = 0;
            this.buffer = buffer;
            this.maxChunkSize = options.maxChunkSize || Number.MAX_SAFE_INTEGER;
        }
        BufferSlicer.prototype.read = function(buffer, offset, length, position, callback) {
            var end = position + length;
            var delta = end - this.buffer.length;
            var written = delta > 0 ? delta : length;
            this.buffer.copy(buffer, offset, position, end);
            setImmediate((function() {
                callback(null, written);
            }));
        };
        BufferSlicer.prototype.write = function(buffer, offset, length, position, callback) {
            buffer.copy(this.buffer, position, offset, offset + length);
            setImmediate((function() {
                callback(null, length, buffer);
            }));
        };
        BufferSlicer.prototype.createReadStream = function(options) {
            options = options || {};
            var readStream = new PassThrough(options);
            readStream.destroyed = false;
            readStream.start = options.start || 0;
            readStream.endOffset = options.end;
            readStream.pos = readStream.endOffset || this.buffer.length;
            var entireSlice = this.buffer.slice(readStream.start, readStream.pos);
            var offset = 0;
            while (true) {
                var nextOffset = offset + this.maxChunkSize;
                if (nextOffset >= entireSlice.length) {
                    if (offset < entireSlice.length) {
                        readStream.write(entireSlice.slice(offset, entireSlice.length));
                    }
                    break;
                }
                readStream.write(entireSlice.slice(offset, nextOffset));
                offset = nextOffset;
            }
            readStream.end();
            readStream.destroy = function() {
                readStream.destroyed = true;
            };
            return readStream;
        };
        BufferSlicer.prototype.createWriteStream = function(options) {
            var bufferSlicer = this;
            options = options || {};
            var writeStream = new Writable(options);
            writeStream.start = options.start || 0;
            writeStream.endOffset = options.end == null ? this.buffer.length : +options.end;
            writeStream.bytesWritten = 0;
            writeStream.pos = writeStream.start;
            writeStream.destroyed = false;
            writeStream._write = function(buffer, encoding, callback) {
                if (writeStream.destroyed) return;
                var end = writeStream.pos + buffer.length;
                if (end > writeStream.endOffset) {
                    var err = new Error("maximum file length exceeded");
                    err.code = "ETOOBIG";
                    writeStream.destroyed = true;
                    callback(err);
                    return;
                }
                buffer.copy(bufferSlicer.buffer, writeStream.pos, 0, buffer.length);
                writeStream.bytesWritten += buffer.length;
                writeStream.pos = end;
                writeStream.emit("progress");
                callback();
            };
            writeStream.destroy = function() {
                writeStream.destroyed = true;
            };
            return writeStream;
        };
        BufferSlicer.prototype.ref = function() {
            this.refCount += 1;
        };
        BufferSlicer.prototype.unref = function() {
            this.refCount -= 1;
            if (this.refCount < 0) {
                throw new Error("invalid unref");
            }
        };
        function createFromBuffer(buffer, options) {
            return new BufferSlicer(buffer, options);
        }
        function createFromFd(fd, options) {
            return new FdSlicer(fd, options);
        }
    }, module => {
        module.exports = Pend;
        function Pend() {
            this.pending = 0;
            this.max = Infinity;
            this.listeners = [];
            this.waiting = [];
            this.error = null;
        }
        Pend.prototype.go = function(fn) {
            if (this.pending < this.max) {
                pendGo(this, fn);
            } else {
                this.waiting.push(fn);
            }
        };
        Pend.prototype.wait = function(cb) {
            if (this.pending === 0) {
                cb(this.error);
            } else {
                this.listeners.push(cb);
            }
        };
        Pend.prototype.hold = function() {
            return pendHold(this);
        };
        function pendHold(self) {
            self.pending += 1;
            var called = false;
            return onCb;
            function onCb(err) {
                if (called) throw new Error("callback called twice");
                called = true;
                self.error = self.error || err;
                self.pending -= 1;
                if (self.waiting.length > 0 && self.pending < self.max) {
                    pendGo(self, self.waiting.shift());
                } else if (self.pending === 0) {
                    var listeners = self.listeners;
                    self.listeners = [];
                    listeners.forEach(cbListener);
                }
            }
            function cbListener(listener) {
                listener(self.error);
            }
        }
        function pendGo(self, fn) {
            fn(pendHold(self));
        }
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var Buffer = __webpack_require__(79).Buffer;
        var CRC_TABLE = [ 0, 1996959894, 3993919788, 2567524794, 124634137, 1886057615, 3915621685, 2657392035, 249268274, 2044508324, 3772115230, 2547177864, 162941995, 2125561021, 3887607047, 2428444049, 498536548, 1789927666, 4089016648, 2227061214, 450548861, 1843258603, 4107580753, 2211677639, 325883990, 1684777152, 4251122042, 2321926636, 335633487, 1661365465, 4195302755, 2366115317, 997073096, 1281953886, 3579855332, 2724688242, 1006888145, 1258607687, 3524101629, 2768942443, 901097722, 1119000684, 3686517206, 2898065728, 853044451, 1172266101, 3705015759, 2882616665, 651767980, 1373503546, 3369554304, 3218104598, 565507253, 1454621731, 3485111705, 3099436303, 671266974, 1594198024, 3322730930, 2970347812, 795835527, 1483230225, 3244367275, 3060149565, 1994146192, 31158534, 2563907772, 4023717930, 1907459465, 112637215, 2680153253, 3904427059, 2013776290, 251722036, 2517215374, 3775830040, 2137656763, 141376813, 2439277719, 3865271297, 1802195444, 476864866, 2238001368, 4066508878, 1812370925, 453092731, 2181625025, 4111451223, 1706088902, 314042704, 2344532202, 4240017532, 1658658271, 366619977, 2362670323, 4224994405, 1303535960, 984961486, 2747007092, 3569037538, 1256170817, 1037604311, 2765210733, 3554079995, 1131014506, 879679996, 2909243462, 3663771856, 1141124467, 855842277, 2852801631, 3708648649, 1342533948, 654459306, 3188396048, 3373015174, 1466479909, 544179635, 3110523913, 3462522015, 1591671054, 702138776, 2966460450, 3352799412, 1504918807, 783551873, 3082640443, 3233442989, 3988292384, 2596254646, 62317068, 1957810842, 3939845945, 2647816111, 81470997, 1943803523, 3814918930, 2489596804, 225274430, 2053790376, 3826175755, 2466906013, 167816743, 2097651377, 4027552580, 2265490386, 503444072, 1762050814, 4150417245, 2154129355, 426522225, 1852507879, 4275313526, 2312317920, 282753626, 1742555852, 4189708143, 2394877945, 397917763, 1622183637, 3604390888, 2714866558, 953729732, 1340076626, 3518719985, 2797360999, 1068828381, 1219638859, 3624741850, 2936675148, 906185462, 1090812512, 3747672003, 2825379669, 829329135, 1181335161, 3412177804, 3160834842, 628085408, 1382605366, 3423369109, 3138078467, 570562233, 1426400815, 3317316542, 2998733608, 733239954, 1555261956, 3268935591, 3050360625, 752459403, 1541320221, 2607071920, 3965973030, 1969922972, 40735498, 2617837225, 3943577151, 1913087877, 83908371, 2512341634, 3803740692, 2075208622, 213261112, 2463272603, 3855990285, 2094854071, 198958881, 2262029012, 4057260610, 1759359992, 534414190, 2176718541, 4139329115, 1873836001, 414664567, 2282248934, 4279200368, 1711684554, 285281116, 2405801727, 4167216745, 1634467795, 376229701, 2685067896, 3608007406, 1308918612, 956543938, 2808555105, 3495958263, 1231636301, 1047427035, 2932959818, 3654703836, 1088359270, 936918e3, 2847714899, 3736837829, 1202900863, 817233897, 3183342108, 3401237130, 1404277552, 615818150, 3134207493, 3453421203, 1423857449, 601450431, 3009837614, 3294710456, 1567103746, 711928724, 3020668471, 3272380065, 1510334235, 755167117 ];
        if (typeof Int32Array !== "undefined") {
            CRC_TABLE = new Int32Array(CRC_TABLE);
        }
        function ensureBuffer(input) {
            if (Buffer.isBuffer(input)) {
                return input;
            }
            var hasNewBufferAPI = typeof Buffer.alloc === "function" && typeof Buffer.from === "function";
            if (typeof input === "number") {
                return hasNewBufferAPI ? Buffer.alloc(input) : new Buffer(input);
            } else if (typeof input === "string") {
                return hasNewBufferAPI ? Buffer.from(input) : new Buffer(input);
            } else {
                throw new Error("input must be buffer, number, or string, received " + typeof input);
            }
        }
        function bufferizeInt(num) {
            var tmp = ensureBuffer(4);
            tmp.writeInt32BE(num, 0);
            return tmp;
        }
        function _crc32(buf, previous) {
            buf = ensureBuffer(buf);
            if (Buffer.isBuffer(previous)) {
                previous = previous.readUInt32BE(0);
            }
            var crc = ~~previous ^ -1;
            for (var n = 0; n < buf.length; n++) {
                crc = CRC_TABLE[(crc ^ buf[n]) & 255] ^ crc >>> 8;
            }
            return crc ^ -1;
        }
        function crc32() {
            return bufferizeInt(_crc32.apply(null, arguments));
        }
        crc32.signed = function() {
            return _crc32.apply(null, arguments);
        };
        crc32.unsigned = function() {
            return _crc32.apply(null, arguments) >>> 0;
        };
        module.exports = crc32;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.getFileStreamFromZipStream = void 0;
        const unzip = __webpack_require__(237);
        const constants_1 = __webpack_require__(3);
        const getFileStreamFromZipStream = async (zipStream, match) => await new Promise(((resolve, reject) => {
            let found = false;
            zipStream.on("error", reject);
            const unzipper = unzip.Parse();
            unzipper.on("error", reject);
            zipStream.pipe(unzipper);
            unzipper.on("entry", (entry => {
                if (!found && entry.type === "File" && match(entry.path)) {
                    found = true;
                    if (entry.size !== undefined) {
                        entry.compressedSize = unzipper.unzipStream.parsedEntity.compressedSize;
                    }
                    entry.on("end", (() => {
                        var _a, _b;
                        (_a = zipStream.unpipe) === null || _a === void 0 ? void 0 : _a.call(zipStream, unzipper);
                        (_b = zipStream.destroy) === null || _b === void 0 ? void 0 : _b.call(zipStream);
                    }));
                    resolve(entry);
                } else {
                    entry.autodrain();
                }
            }));
            zipStream.on("end", (() => {
                if (!found) {
                    reject(new Error(constants_1.NO_MATCHING_FILE_MSG));
                }
            }));
        }));
        exports.getFileStreamFromZipStream = getFileStreamFromZipStream;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        exports.Parse = __webpack_require__(238);
        exports.Extract = __webpack_require__(247);
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var Transform = __webpack_require__(17).Transform;
        var util = __webpack_require__(58);
        var UnzipStream = __webpack_require__(239);
        function ParserStream(opts) {
            if (!(this instanceof ParserStream)) {
                return new ParserStream(opts);
            }
            var transformOpts = opts || {};
            Transform.call(this, {
                readableObjectMode: true
            });
            this.opts = opts || {};
            this.unzipStream = new UnzipStream(this.opts);
            var self = this;
            this.unzipStream.on("entry", (function(entry) {
                self.push(entry);
            }));
            this.unzipStream.on("error", (function(error) {
                self.emit("error", error);
            }));
        }
        util.inherits(ParserStream, Transform);
        ParserStream.prototype._transform = function(chunk, encoding, cb) {
            this.unzipStream.write(chunk, encoding, cb);
        };
        ParserStream.prototype._flush = function(cb) {
            var self = this;
            this.unzipStream.end((function() {
                process.nextTick((function() {
                    self.emit("close");
                }));
                cb();
            }));
        };
        ParserStream.prototype.on = function(eventName, fn) {
            if (eventName === "entry") {
                return Transform.prototype.on.call(this, "data", fn);
            }
            return Transform.prototype.on.call(this, eventName, fn);
        };
        ParserStream.prototype.drainAll = function() {
            this.unzipStream.drainAll();
            return this.pipe(new Transform({
                objectMode: true,
                transform: function(d, e, cb) {
                    cb();
                }
            }));
        };
        module.exports = ParserStream;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var binary = __webpack_require__(240);
        var stream = __webpack_require__(17);
        var util = __webpack_require__(58);
        var zlib = __webpack_require__(23);
        var MatcherStream = __webpack_require__(245);
        var Entry = __webpack_require__(246);
        const states = {
            STREAM_START: 0,
            START: 1,
            LOCAL_FILE_HEADER: 2,
            LOCAL_FILE_HEADER_SUFFIX: 3,
            FILE_DATA: 4,
            FILE_DATA_END: 5,
            DATA_DESCRIPTOR: 6,
            CENTRAL_DIRECTORY_FILE_HEADER: 7,
            CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX: 8,
            CDIR64_END: 9,
            CDIR64_END_DATA_SECTOR: 10,
            CDIR64_LOCATOR: 11,
            CENTRAL_DIRECTORY_END: 12,
            CENTRAL_DIRECTORY_END_COMMENT: 13,
            TRAILING_JUNK: 14,
            ERROR: 99
        };
        const FOUR_GIGS = 4294967296;
        const SIG_LOCAL_FILE_HEADER = 67324752;
        const SIG_DATA_DESCRIPTOR = 134695760;
        const SIG_CDIR_RECORD = 33639248;
        const SIG_CDIR64_RECORD_END = 101075792;
        const SIG_CDIR64_LOCATOR_END = 117853008;
        const SIG_CDIR_RECORD_END = 101010256;
        function UnzipStream(options) {
            if (!(this instanceof UnzipStream)) {
                return new UnzipStream(options);
            }
            stream.Transform.call(this);
            this.options = options || {};
            this.data = new Buffer("");
            this.state = states.STREAM_START;
            this.skippedBytes = 0;
            this.parsedEntity = null;
            this.outStreamInfo = {};
        }
        util.inherits(UnzipStream, stream.Transform);
        UnzipStream.prototype.processDataChunk = function(chunk) {
            var requiredLength;
            switch (this.state) {
              case states.STREAM_START:
              case states.START:
                requiredLength = 4;
                break;

              case states.LOCAL_FILE_HEADER:
                requiredLength = 26;
                break;

              case states.LOCAL_FILE_HEADER_SUFFIX:
                requiredLength = this.parsedEntity.fileNameLength + this.parsedEntity.extraFieldLength;
                break;

              case states.DATA_DESCRIPTOR:
                requiredLength = 12;
                break;

              case states.CENTRAL_DIRECTORY_FILE_HEADER:
                requiredLength = 42;
                break;

              case states.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX:
                requiredLength = this.parsedEntity.fileNameLength + this.parsedEntity.extraFieldLength + this.parsedEntity.fileCommentLength;
                break;

              case states.CDIR64_END:
                requiredLength = 52;
                break;

              case states.CDIR64_END_DATA_SECTOR:
                requiredLength = this.parsedEntity.centralDirectoryRecordSize - 44;
                break;

              case states.CDIR64_LOCATOR:
                requiredLength = 16;
                break;

              case states.CENTRAL_DIRECTORY_END:
                requiredLength = 18;
                break;

              case states.CENTRAL_DIRECTORY_END_COMMENT:
                requiredLength = this.parsedEntity.commentLength;
                break;

              case states.FILE_DATA:
                return 0;

              case states.FILE_DATA_END:
                return 0;

              case states.TRAILING_JUNK:
                if (this.options.debug) console.log("found", chunk.length, "bytes of TRAILING_JUNK");
                return chunk.length;

              default:
                return chunk.length;
            }
            var chunkLength = chunk.length;
            if (chunkLength < requiredLength) {
                return 0;
            }
            switch (this.state) {
              case states.STREAM_START:
              case states.START:
                var signature = chunk.readUInt32LE(0);
                switch (signature) {
                  case SIG_LOCAL_FILE_HEADER:
                    this.state = states.LOCAL_FILE_HEADER;
                    break;

                  case SIG_CDIR_RECORD:
                    this.state = states.CENTRAL_DIRECTORY_FILE_HEADER;
                    break;

                  case SIG_CDIR64_RECORD_END:
                    this.state = states.CDIR64_END;
                    break;

                  case SIG_CDIR64_LOCATOR_END:
                    this.state = states.CDIR64_LOCATOR;
                    break;

                  case SIG_CDIR_RECORD_END:
                    this.state = states.CENTRAL_DIRECTORY_END;
                    break;

                  default:
                    var isStreamStart = this.state === states.STREAM_START;
                    if (!isStreamStart && (signature & 65535) !== 19280 && this.skippedBytes < 26) {
                        var remaining = signature;
                        var toSkip = 4;
                        for (var i = 1; i < 4 && remaining !== 0; i++) {
                            remaining = remaining >>> 8;
                            if ((remaining & 255) === 80) {
                                toSkip = i;
                                break;
                            }
                        }
                        this.skippedBytes += toSkip;
                        if (this.options.debug) console.log("Skipped", this.skippedBytes, "bytes");
                        return toSkip;
                    }
                    this.state = states.ERROR;
                    var errMsg = isStreamStart ? "Not a valid zip file" : "Invalid signature in zip file";
                    if (this.options.debug) {
                        var sig = chunk.readUInt32LE(0);
                        var asString;
                        try {
                            asString = chunk.slice(0, 4).toString();
                        } catch (e) {}
                        console.log("Unexpected signature in zip file: 0x" + sig.toString(16), '"' + asString + '", skipped', this.skippedBytes, "bytes");
                    }
                    this.emit("error", new Error(errMsg));
                    return chunk.length;
                }
                this.skippedBytes = 0;
                return requiredLength;

              case states.LOCAL_FILE_HEADER:
                this.parsedEntity = this._readFile(chunk);
                this.state = states.LOCAL_FILE_HEADER_SUFFIX;
                return requiredLength;

              case states.LOCAL_FILE_HEADER_SUFFIX:
                var entry = new Entry;
                var isUtf8 = (this.parsedEntity.flags & 2048) !== 0;
                entry.path = this._decodeString(chunk.slice(0, this.parsedEntity.fileNameLength), isUtf8);
                var extraDataBuffer = chunk.slice(this.parsedEntity.fileNameLength, this.parsedEntity.fileNameLength + this.parsedEntity.extraFieldLength);
                var extra = this._readExtraFields(extraDataBuffer);
                if (extra && extra.parsed) {
                    if (extra.parsed.path && !isUtf8) {
                        entry.path = extra.parsed.path;
                    }
                    if (Number.isFinite(extra.parsed.uncompressedSize) && this.parsedEntity.uncompressedSize === FOUR_GIGS - 1) {
                        this.parsedEntity.uncompressedSize = extra.parsed.uncompressedSize;
                    }
                    if (Number.isFinite(extra.parsed.compressedSize) && this.parsedEntity.compressedSize === FOUR_GIGS - 1) {
                        this.parsedEntity.compressedSize = extra.parsed.compressedSize;
                    }
                }
                this.parsedEntity.extra = extra.parsed || {};
                if (this.options.debug) {
                    const debugObj = Object.assign({}, this.parsedEntity, {
                        path: entry.path,
                        flags: "0x" + this.parsedEntity.flags.toString(16),
                        extraFields: extra && extra.debug
                    });
                    console.log("decoded LOCAL_FILE_HEADER:", JSON.stringify(debugObj, null, 2));
                }
                this._prepareOutStream(this.parsedEntity, entry);
                this.emit("entry", entry);
                this.state = states.FILE_DATA;
                return requiredLength;

              case states.CENTRAL_DIRECTORY_FILE_HEADER:
                this.parsedEntity = this._readCentralDirectoryEntry(chunk);
                this.state = states.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX;
                return requiredLength;

              case states.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX:
                var isUtf8 = (this.parsedEntity.flags & 2048) !== 0;
                var path = this._decodeString(chunk.slice(0, this.parsedEntity.fileNameLength), isUtf8);
                var extraDataBuffer = chunk.slice(this.parsedEntity.fileNameLength, this.parsedEntity.fileNameLength + this.parsedEntity.extraFieldLength);
                var extra = this._readExtraFields(extraDataBuffer);
                if (extra && extra.parsed && extra.parsed.path && !isUtf8) {
                    path = extra.parsed.path;
                }
                this.parsedEntity.extra = extra.parsed;
                var isUnix = (this.parsedEntity.versionMadeBy & 65280) >> 8 === 3;
                var unixAttrs, isSymlink;
                if (isUnix) {
                    unixAttrs = this.parsedEntity.externalFileAttributes >>> 16;
                    var fileType = unixAttrs >>> 12;
                    isSymlink = (fileType & 10) === 10;
                }
                if (this.options.debug) {
                    const debugObj = Object.assign({}, this.parsedEntity, {
                        path,
                        flags: "0x" + this.parsedEntity.flags.toString(16),
                        unixAttrs: unixAttrs && "0" + unixAttrs.toString(8),
                        isSymlink,
                        extraFields: extra.debug
                    });
                    console.log("decoded CENTRAL_DIRECTORY_FILE_HEADER:", JSON.stringify(debugObj, null, 2));
                }
                this.state = states.START;
                return requiredLength;

              case states.CDIR64_END:
                this.parsedEntity = this._readEndOfCentralDirectory64(chunk);
                if (this.options.debug) {
                    console.log("decoded CDIR64_END_RECORD:", this.parsedEntity);
                }
                this.state = states.CDIR64_END_DATA_SECTOR;
                return requiredLength;

              case states.CDIR64_END_DATA_SECTOR:
                this.state = states.START;
                return requiredLength;

              case states.CDIR64_LOCATOR:
                this.state = states.START;
                return requiredLength;

              case states.CENTRAL_DIRECTORY_END:
                this.parsedEntity = this._readEndOfCentralDirectory(chunk);
                if (this.options.debug) {
                    console.log("decoded CENTRAL_DIRECTORY_END:", this.parsedEntity);
                }
                this.state = states.CENTRAL_DIRECTORY_END_COMMENT;
                return requiredLength;

              case states.CENTRAL_DIRECTORY_END_COMMENT:
                if (this.options.debug) {
                    console.log("decoded CENTRAL_DIRECTORY_END_COMMENT:", chunk.slice(0, requiredLength).toString());
                }
                this.state = states.TRAILING_JUNK;
                return requiredLength;

              case states.ERROR:
                return chunk.length;

              default:
                console.log("didn't handle state #", this.state, "discarding");
                return chunk.length;
            }
        };
        UnzipStream.prototype._prepareOutStream = function(vars, entry) {
            var self = this;
            var isDirectory = vars.uncompressedSize === 0 && /[\/\\]$/.test(entry.path);
            entry.path = entry.path.replace(/^([/\\]*[.]+[/\\]+)*[/\\]*/, "");
            entry.type = isDirectory ? "Directory" : "File";
            entry.isDirectory = isDirectory;
            var fileSizeKnown = !(vars.flags & 8);
            if (fileSizeKnown) {
                entry.size = vars.uncompressedSize;
            }
            var isVersionSupported = vars.versionsNeededToExtract <= 45;
            this.outStreamInfo = {
                stream: null,
                limit: fileSizeKnown ? vars.compressedSize : -1,
                written: 0
            };
            if (!fileSizeKnown) {
                var pattern = new Buffer(4);
                pattern.writeUInt32LE(SIG_DATA_DESCRIPTOR, 0);
                var zip64Mode = vars.extra.zip64Mode;
                var extraSize = zip64Mode ? 20 : 12;
                var searchPattern = {
                    pattern,
                    requiredExtraSize: extraSize
                };
                var matcherStream = new MatcherStream(searchPattern, (function(matchedChunk, sizeSoFar) {
                    var vars = self._readDataDescriptor(matchedChunk, zip64Mode);
                    var compressedSizeMatches = vars.compressedSize === sizeSoFar;
                    if (!zip64Mode && !compressedSizeMatches && sizeSoFar >= FOUR_GIGS) {
                        var overflown = sizeSoFar - FOUR_GIGS;
                        while (overflown >= 0) {
                            compressedSizeMatches = vars.compressedSize === overflown;
                            if (compressedSizeMatches) break;
                            overflown -= FOUR_GIGS;
                        }
                    }
                    if (!compressedSizeMatches) {
                        return;
                    }
                    self.state = states.FILE_DATA_END;
                    var sliceOffset = zip64Mode ? 24 : 16;
                    if (self.data.length > 0) {
                        self.data = Buffer.concat([ matchedChunk.slice(sliceOffset), self.data ]);
                    } else {
                        self.data = matchedChunk.slice(sliceOffset);
                    }
                    return true;
                }));
                this.outStreamInfo.stream = matcherStream;
            } else {
                this.outStreamInfo.stream = new stream.PassThrough;
            }
            var isEncrypted = vars.flags & 1 || vars.flags & 64;
            if (isEncrypted || !isVersionSupported) {
                var message = isEncrypted ? "Encrypted files are not supported!" : "Zip version " + Math.floor(vars.versionsNeededToExtract / 10) + "." + vars.versionsNeededToExtract % 10 + " is not supported";
                entry.skip = true;
                setImmediate((() => {
                    entry.emit("error", new Error(message));
                }));
                this.outStreamInfo.stream.pipe((new Entry).autodrain());
                return;
            }
            var isCompressed = vars.compressionMethod > 0;
            if (isCompressed) {
                var inflater = zlib.createInflateRaw();
                inflater.on("error", (function(err) {
                    self.state = states.ERROR;
                    self.emit("error", err);
                }));
                this.outStreamInfo.stream.pipe(inflater).pipe(entry);
            } else {
                this.outStreamInfo.stream.pipe(entry);
            }
            if (this._drainAllEntries) {
                entry.autodrain();
            }
        };
        UnzipStream.prototype._readFile = function(data) {
            var vars = binary.parse(data).word16lu("versionsNeededToExtract").word16lu("flags").word16lu("compressionMethod").word16lu("lastModifiedTime").word16lu("lastModifiedDate").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").word16lu("fileNameLength").word16lu("extraFieldLength").vars;
            return vars;
        };
        UnzipStream.prototype._readExtraFields = function(data) {
            var extra = {};
            var result = {
                parsed: extra
            };
            if (this.options.debug) {
                result.debug = [];
            }
            var index = 0;
            while (index < data.length) {
                var vars = binary.parse(data).skip(index).word16lu("extraId").word16lu("extraSize").vars;
                index += 4;
                var fieldType = undefined;
                switch (vars.extraId) {
                  case 1:
                    fieldType = "Zip64 extended information extra field";
                    var z64vars = binary.parse(data.slice(index, index + vars.extraSize)).word64lu("uncompressedSize").word64lu("compressedSize").word64lu("offsetToLocalHeader").word32lu("diskStartNumber").vars;
                    if (z64vars.uncompressedSize !== null) {
                        extra.uncompressedSize = z64vars.uncompressedSize;
                    }
                    if (z64vars.compressedSize !== null) {
                        extra.compressedSize = z64vars.compressedSize;
                    }
                    extra.zip64Mode = true;
                    break;

                  case 10:
                    fieldType = "NTFS extra field";
                    break;

                  case 21589:
                    fieldType = "extended timestamp";
                    var timestampFields = data.readUInt8(index);
                    var offset = 1;
                    if (vars.extraSize >= offset + 4 && timestampFields & 1) {
                        extra.mtime = new Date(data.readUInt32LE(index + offset) * 1e3);
                        offset += 4;
                    }
                    if (vars.extraSize >= offset + 4 && timestampFields & 2) {
                        extra.atime = new Date(data.readUInt32LE(index + offset) * 1e3);
                        offset += 4;
                    }
                    if (vars.extraSize >= offset + 4 && timestampFields & 4) {
                        extra.ctime = new Date(data.readUInt32LE(index + offset) * 1e3);
                    }
                    break;

                  case 28789:
                    fieldType = "Info-ZIP Unicode Path Extra Field";
                    var fieldVer = data.readUInt8(index);
                    if (fieldVer === 1) {
                        var offset = 1;
                        var nameCrc32 = data.readUInt32LE(index + offset);
                        offset += 4;
                        var pathBuffer = data.slice(index + offset);
                        extra.path = pathBuffer.toString();
                    }
                    break;

                  case 13:
                  case 22613:
                    fieldType = vars.extraId === 13 ? "PKWARE Unix" : "Info-ZIP UNIX (type 1)";
                    var offset = 0;
                    if (vars.extraSize >= 8) {
                        var atime = new Date(data.readUInt32LE(index + offset) * 1e3);
                        offset += 4;
                        var mtime = new Date(data.readUInt32LE(index + offset) * 1e3);
                        offset += 4;
                        extra.atime = atime;
                        extra.mtime = mtime;
                        if (vars.extraSize >= 12) {
                            var uid = data.readUInt16LE(index + offset);
                            offset += 2;
                            var gid = data.readUInt16LE(index + offset);
                            offset += 2;
                            extra.uid = uid;
                            extra.gid = gid;
                        }
                    }
                    break;

                  case 30805:
                    fieldType = "Info-ZIP UNIX (type 2)";
                    var offset = 0;
                    if (vars.extraSize >= 4) {
                        var uid = data.readUInt16LE(index + offset);
                        offset += 2;
                        var gid = data.readUInt16LE(index + offset);
                        offset += 2;
                        extra.uid = uid;
                        extra.gid = gid;
                    }
                    break;

                  case 30837:
                    fieldType = "Info-ZIP New Unix";
                    var offset = 0;
                    var extraVer = data.readUInt8(index);
                    offset += 1;
                    if (extraVer === 1) {
                        var uidSize = data.readUInt8(index + offset);
                        offset += 1;
                        if (uidSize <= 6) {
                            extra.uid = data.readUIntLE(index + offset, uidSize);
                        }
                        offset += uidSize;
                        var gidSize = data.readUInt8(index + offset);
                        offset += 1;
                        if (gidSize <= 6) {
                            extra.gid = data.readUIntLE(index + offset, gidSize);
                        }
                    }
                    break;

                  case 30062:
                    fieldType = "ASi Unix";
                    var offset = 0;
                    if (vars.extraSize >= 14) {
                        var crc = data.readUInt32LE(index + offset);
                        offset += 4;
                        var mode = data.readUInt16LE(index + offset);
                        offset += 2;
                        var sizdev = data.readUInt32LE(index + offset);
                        offset += 4;
                        var uid = data.readUInt16LE(index + offset);
                        offset += 2;
                        var gid = data.readUInt16LE(index + offset);
                        offset += 2;
                        extra.mode = mode;
                        extra.uid = uid;
                        extra.gid = gid;
                        if (vars.extraSize > 14) {
                            var start = index + offset;
                            var end = index + vars.extraSize - 14;
                            var symlinkName = this._decodeString(data.slice(start, end));
                            extra.symlink = symlinkName;
                        }
                    }
                    break;
                }
                if (this.options.debug) {
                    result.debug.push({
                        extraId: "0x" + vars.extraId.toString(16),
                        description: fieldType,
                        data: data.slice(index, index + vars.extraSize).inspect()
                    });
                }
                index += vars.extraSize;
            }
            return result;
        };
        UnzipStream.prototype._readDataDescriptor = function(data, zip64Mode) {
            if (zip64Mode) {
                var vars = binary.parse(data).word32lu("dataDescriptorSignature").word32lu("crc32").word64lu("compressedSize").word64lu("uncompressedSize").vars;
                return vars;
            }
            var vars = binary.parse(data).word32lu("dataDescriptorSignature").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").vars;
            return vars;
        };
        UnzipStream.prototype._readCentralDirectoryEntry = function(data) {
            var vars = binary.parse(data).word16lu("versionMadeBy").word16lu("versionsNeededToExtract").word16lu("flags").word16lu("compressionMethod").word16lu("lastModifiedTime").word16lu("lastModifiedDate").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").word16lu("fileNameLength").word16lu("extraFieldLength").word16lu("fileCommentLength").word16lu("diskNumber").word16lu("internalFileAttributes").word32lu("externalFileAttributes").word32lu("offsetToLocalFileHeader").vars;
            return vars;
        };
        UnzipStream.prototype._readEndOfCentralDirectory64 = function(data) {
            var vars = binary.parse(data).word64lu("centralDirectoryRecordSize").word16lu("versionMadeBy").word16lu("versionsNeededToExtract").word32lu("diskNumber").word32lu("diskNumberWithCentralDirectoryStart").word64lu("centralDirectoryEntries").word64lu("totalCentralDirectoryEntries").word64lu("sizeOfCentralDirectory").word64lu("offsetToStartOfCentralDirectory").vars;
            return vars;
        };
        UnzipStream.prototype._readEndOfCentralDirectory = function(data) {
            var vars = binary.parse(data).word16lu("diskNumber").word16lu("diskStart").word16lu("centralDirectoryEntries").word16lu("totalCentralDirectoryEntries").word32lu("sizeOfCentralDirectory").word32lu("offsetToStartOfCentralDirectory").word16lu("commentLength").vars;
            return vars;
        };
        const cp437 = "\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñÑªº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ";
        UnzipStream.prototype._decodeString = function(buffer, isUtf8) {
            if (isUtf8) {
                return buffer.toString("utf8");
            }
            if (this.options.decodeString) {
                return this.options.decodeString(buffer);
            }
            let result = "";
            for (var i = 0; i < buffer.length; i++) {
                result += cp437[buffer[i]];
            }
            return result;
        };
        UnzipStream.prototype._parseOrOutput = function(encoding, cb) {
            var consume;
            while ((consume = this.processDataChunk(this.data)) > 0) {
                this.data = this.data.slice(consume);
                if (this.data.length === 0) break;
            }
            if (this.state === states.FILE_DATA) {
                if (this.outStreamInfo.limit >= 0) {
                    var remaining = this.outStreamInfo.limit - this.outStreamInfo.written;
                    var packet;
                    if (remaining < this.data.length) {
                        packet = this.data.slice(0, remaining);
                        this.data = this.data.slice(remaining);
                    } else {
                        packet = this.data;
                        this.data = new Buffer("");
                    }
                    this.outStreamInfo.written += packet.length;
                    if (this.outStreamInfo.limit === this.outStreamInfo.written) {
                        this.state = states.START;
                        this.outStreamInfo.stream.end(packet, encoding, cb);
                    } else {
                        this.outStreamInfo.stream.write(packet, encoding, cb);
                    }
                } else {
                    var packet = this.data;
                    this.data = new Buffer("");
                    this.outStreamInfo.written += packet.length;
                    var outputStream = this.outStreamInfo.stream;
                    outputStream.write(packet, encoding, (() => {
                        if (this.state === states.FILE_DATA_END) {
                            this.state = states.START;
                            return outputStream.end(cb);
                        }
                        cb();
                    }));
                }
                return;
            }
            cb();
        };
        UnzipStream.prototype.drainAll = function() {
            this._drainAllEntries = true;
        };
        UnzipStream.prototype._transform = function(chunk, encoding, cb) {
            var self = this;
            if (self.data.length > 0) {
                self.data = Buffer.concat([ self.data, chunk ]);
            } else {
                self.data = chunk;
            }
            var startDataLength = self.data.length;
            var done = function() {
                if (self.data.length > 0 && self.data.length < startDataLength) {
                    startDataLength = self.data.length;
                    self._parseOrOutput(encoding, done);
                    return;
                }
                cb();
            };
            self._parseOrOutput(encoding, done);
        };
        UnzipStream.prototype._flush = function(cb) {
            var self = this;
            if (self.data.length > 0) {
                self._parseOrOutput("buffer", (function() {
                    if (self.data.length > 0) return setImmediate((function() {
                        self._flush(cb);
                    }));
                    cb();
                }));
                return;
            }
            if (self.state === states.FILE_DATA) {
                return cb(new Error("Stream finished in an invalid state, uncompression failed"));
            }
            setImmediate(cb);
        };
        module.exports = UnzipStream;
    }, (module, exports, __webpack_require__) => {
        var Chainsaw = __webpack_require__(241);
        var EventEmitter = __webpack_require__(26).EventEmitter;
        var Buffers = __webpack_require__(243);
        var Vars = __webpack_require__(244);
        var Stream = __webpack_require__(17).Stream;
        exports = module.exports = function(bufOrEm, eventName) {
            if (Buffer.isBuffer(bufOrEm)) {
                return exports.parse(bufOrEm);
            }
            var s = exports.stream();
            if (bufOrEm && bufOrEm.pipe) {
                bufOrEm.pipe(s);
            } else if (bufOrEm) {
                bufOrEm.on(eventName || "data", (function(buf) {
                    s.write(buf);
                }));
                bufOrEm.on("end", (function() {
                    s.end();
                }));
            }
            return s;
        };
        exports.stream = function(input) {
            if (input) return exports.apply(null, arguments);
            var pending = null;
            function getBytes(bytes, cb, skip) {
                pending = {
                    bytes,
                    skip,
                    cb: function(buf) {
                        pending = null;
                        cb(buf);
                    }
                };
                dispatch();
            }
            var offset = null;
            function dispatch() {
                if (!pending) {
                    if (caughtEnd) done = true;
                    return;
                }
                if (typeof pending === "function") {
                    pending();
                } else {
                    var bytes = offset + pending.bytes;
                    if (buffers.length >= bytes) {
                        var buf;
                        if (offset == null) {
                            buf = buffers.splice(0, bytes);
                            if (!pending.skip) {
                                buf = buf.slice();
                            }
                        } else {
                            if (!pending.skip) {
                                buf = buffers.slice(offset, bytes);
                            }
                            offset = bytes;
                        }
                        if (pending.skip) {
                            pending.cb();
                        } else {
                            pending.cb(buf);
                        }
                    }
                }
            }
            function builder(saw) {
                function next() {
                    if (!done) saw.next();
                }
                var self = words((function(bytes, cb) {
                    return function(name) {
                        getBytes(bytes, (function(buf) {
                            vars.set(name, cb(buf));
                            next();
                        }));
                    };
                }));
                self.tap = function(cb) {
                    saw.nest(cb, vars.store);
                };
                self.into = function(key, cb) {
                    if (!vars.get(key)) vars.set(key, {});
                    var parent = vars;
                    vars = Vars(parent.get(key));
                    saw.nest((function() {
                        cb.apply(this, arguments);
                        this.tap((function() {
                            vars = parent;
                        }));
                    }), vars.store);
                };
                self.flush = function() {
                    vars.store = {};
                    next();
                };
                self.loop = function(cb) {
                    var end = false;
                    saw.nest(false, (function loop() {
                        this.vars = vars.store;
                        cb.call(this, (function() {
                            end = true;
                            next();
                        }), vars.store);
                        this.tap(function() {
                            if (end) saw.next(); else loop.call(this);
                        }.bind(this));
                    }), vars.store);
                };
                self.buffer = function(name, bytes) {
                    if (typeof bytes === "string") {
                        bytes = vars.get(bytes);
                    }
                    getBytes(bytes, (function(buf) {
                        vars.set(name, buf);
                        next();
                    }));
                };
                self.skip = function(bytes) {
                    if (typeof bytes === "string") {
                        bytes = vars.get(bytes);
                    }
                    getBytes(bytes, (function() {
                        next();
                    }));
                };
                self.scan = function find(name, search) {
                    if (typeof search === "string") {
                        search = new Buffer(search);
                    } else if (!Buffer.isBuffer(search)) {
                        throw new Error("search must be a Buffer or a string");
                    }
                    var taken = 0;
                    pending = function() {
                        var pos = buffers.indexOf(search, offset + taken);
                        var i = pos - offset - taken;
                        if (pos !== -1) {
                            pending = null;
                            if (offset != null) {
                                vars.set(name, buffers.slice(offset, offset + taken + i));
                                offset += taken + i + search.length;
                            } else {
                                vars.set(name, buffers.slice(0, taken + i));
                                buffers.splice(0, taken + i + search.length);
                            }
                            next();
                            dispatch();
                        } else {
                            i = Math.max(buffers.length - search.length - offset - taken, 0);
                        }
                        taken += i;
                    };
                    dispatch();
                };
                self.peek = function(cb) {
                    offset = 0;
                    saw.nest((function() {
                        cb.call(this, vars.store);
                        this.tap((function() {
                            offset = null;
                        }));
                    }));
                };
                return self;
            }
            var stream = Chainsaw.light(builder);
            stream.writable = true;
            var buffers = Buffers();
            stream.write = function(buf) {
                buffers.push(buf);
                dispatch();
            };
            var vars = Vars();
            var done = false, caughtEnd = false;
            stream.end = function() {
                caughtEnd = true;
            };
            stream.pipe = Stream.prototype.pipe;
            Object.getOwnPropertyNames(EventEmitter.prototype).forEach((function(name) {
                stream[name] = EventEmitter.prototype[name];
            }));
            return stream;
        };
        exports.parse = function parse(buffer) {
            var self = words((function(bytes, cb) {
                return function(name) {
                    if (offset + bytes <= buffer.length) {
                        var buf = buffer.slice(offset, offset + bytes);
                        offset += bytes;
                        vars.set(name, cb(buf));
                    } else {
                        vars.set(name, null);
                    }
                    return self;
                };
            }));
            var offset = 0;
            var vars = Vars();
            self.vars = vars.store;
            self.tap = function(cb) {
                cb.call(self, vars.store);
                return self;
            };
            self.into = function(key, cb) {
                if (!vars.get(key)) {
                    vars.set(key, {});
                }
                var parent = vars;
                vars = Vars(parent.get(key));
                cb.call(self, vars.store);
                vars = parent;
                return self;
            };
            self.loop = function(cb) {
                var end = false;
                var ender = function() {
                    end = true;
                };
                while (end === false) {
                    cb.call(self, ender, vars.store);
                }
                return self;
            };
            self.buffer = function(name, size) {
                if (typeof size === "string") {
                    size = vars.get(size);
                }
                var buf = buffer.slice(offset, Math.min(buffer.length, offset + size));
                offset += size;
                vars.set(name, buf);
                return self;
            };
            self.skip = function(bytes) {
                if (typeof bytes === "string") {
                    bytes = vars.get(bytes);
                }
                offset += bytes;
                return self;
            };
            self.scan = function(name, search) {
                if (typeof search === "string") {
                    search = new Buffer(search);
                } else if (!Buffer.isBuffer(search)) {
                    throw new Error("search must be a Buffer or a string");
                }
                vars.set(name, null);
                for (var i = 0; i + offset <= buffer.length - search.length + 1; i++) {
                    for (var j = 0; j < search.length && buffer[offset + i + j] === search[j]; j++) ;
                    if (j === search.length) break;
                }
                vars.set(name, buffer.slice(offset, offset + i));
                offset += i + search.length;
                return self;
            };
            self.peek = function(cb) {
                var was = offset;
                cb.call(self, vars.store);
                offset = was;
                return self;
            };
            self.flush = function() {
                vars.store = {};
                return self;
            };
            self.eof = function() {
                return offset >= buffer.length;
            };
            return self;
        };
        function decodeLEu(bytes) {
            var acc = 0;
            for (var i = 0; i < bytes.length; i++) {
                acc += Math.pow(256, i) * bytes[i];
            }
            return acc;
        }
        function decodeBEu(bytes) {
            var acc = 0;
            for (var i = 0; i < bytes.length; i++) {
                acc += Math.pow(256, bytes.length - i - 1) * bytes[i];
            }
            return acc;
        }
        function decodeBEs(bytes) {
            var val = decodeBEu(bytes);
            if ((bytes[0] & 128) == 128) {
                val -= Math.pow(256, bytes.length);
            }
            return val;
        }
        function decodeLEs(bytes) {
            var val = decodeLEu(bytes);
            if ((bytes[bytes.length - 1] & 128) == 128) {
                val -= Math.pow(256, bytes.length);
            }
            return val;
        }
        function words(decode) {
            var self = {};
            [ 1, 2, 4, 8 ].forEach((function(bytes) {
                var bits = bytes * 8;
                self["word" + bits + "le"] = self["word" + bits + "lu"] = decode(bytes, decodeLEu);
                self["word" + bits + "ls"] = decode(bytes, decodeLEs);
                self["word" + bits + "be"] = self["word" + bits + "bu"] = decode(bytes, decodeBEu);
                self["word" + bits + "bs"] = decode(bytes, decodeBEs);
            }));
            self.word8 = self.word8u = self.word8be;
            self.word8s = self.word8bs;
            return self;
        }
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var Traverse = __webpack_require__(242);
        var EventEmitter = __webpack_require__(26).EventEmitter;
        module.exports = Chainsaw;
        function Chainsaw(builder) {
            var saw = Chainsaw.saw(builder, {});
            var r = builder.call(saw.handlers, saw);
            if (r !== undefined) saw.handlers = r;
            saw.record();
            return saw.chain();
        }
        Chainsaw.light = function ChainsawLight(builder) {
            var saw = Chainsaw.saw(builder, {});
            var r = builder.call(saw.handlers, saw);
            if (r !== undefined) saw.handlers = r;
            return saw.chain();
        };
        Chainsaw.saw = function(builder, handlers) {
            var saw = new EventEmitter;
            saw.handlers = handlers;
            saw.actions = [];
            saw.chain = function() {
                var ch = Traverse(saw.handlers).map((function(node) {
                    if (this.isRoot) return node;
                    var ps = this.path;
                    if (typeof node === "function") {
                        this.update((function() {
                            saw.actions.push({
                                path: ps,
                                args: [].slice.call(arguments)
                            });
                            return ch;
                        }));
                    }
                }));
                process.nextTick((function() {
                    saw.emit("begin");
                    saw.next();
                }));
                return ch;
            };
            saw.pop = function() {
                return saw.actions.shift();
            };
            saw.next = function() {
                var action = saw.pop();
                if (!action) {
                    saw.emit("end");
                } else if (!action.trap) {
                    var node = saw.handlers;
                    action.path.forEach((function(key) {
                        node = node[key];
                    }));
                    node.apply(saw.handlers, action.args);
                }
            };
            saw.nest = function(cb) {
                var args = [].slice.call(arguments, 1);
                var autonext = true;
                if (typeof cb === "boolean") {
                    var autonext = cb;
                    cb = args.shift();
                }
                var s = Chainsaw.saw(builder, {});
                var r = builder.call(s.handlers, s);
                if (r !== undefined) s.handlers = r;
                if ("undefined" !== typeof saw.step) {
                    s.record();
                }
                cb.apply(s.chain(), args);
                if (autonext !== false) s.on("end", saw.next);
            };
            saw.record = function() {
                upgradeChainsaw(saw);
            };
            [ "trap", "down", "jump" ].forEach((function(method) {
                saw[method] = function() {
                    throw new Error("To use the trap, down and jump features, please " + "call record() first to start recording actions.");
                };
            }));
            return saw;
        };
        function upgradeChainsaw(saw) {
            saw.step = 0;
            saw.pop = function() {
                return saw.actions[saw.step++];
            };
            saw.trap = function(name, cb) {
                var ps = Array.isArray(name) ? name : [ name ];
                saw.actions.push({
                    path: ps,
                    step: saw.step,
                    cb,
                    trap: true
                });
            };
            saw.down = function(name) {
                var ps = (Array.isArray(name) ? name : [ name ]).join("/");
                var i = saw.actions.slice(saw.step).map((function(x) {
                    if (x.trap && x.step <= saw.step) return false;
                    return x.path.join("/") == ps;
                })).indexOf(true);
                if (i >= 0) saw.step += i; else saw.step = saw.actions.length;
                var act = saw.actions[saw.step - 1];
                if (act && act.trap) {
                    saw.step = act.step;
                    act.cb();
                } else saw.next();
            };
            saw.jump = function(step) {
                saw.step = step;
                saw.next();
            };
        }
    }, module => {
        module.exports = Traverse;
        function Traverse(obj) {
            if (!(this instanceof Traverse)) return new Traverse(obj);
            this.value = obj;
        }
        Traverse.prototype.get = function(ps) {
            var node = this.value;
            for (var i = 0; i < ps.length; i++) {
                var key = ps[i];
                if (!Object.hasOwnProperty.call(node, key)) {
                    node = undefined;
                    break;
                }
                node = node[key];
            }
            return node;
        };
        Traverse.prototype.set = function(ps, value) {
            var node = this.value;
            for (var i = 0; i < ps.length - 1; i++) {
                var key = ps[i];
                if (!Object.hasOwnProperty.call(node, key)) node[key] = {};
                node = node[key];
            }
            node[ps[i]] = value;
            return value;
        };
        Traverse.prototype.map = function(cb) {
            return walk(this.value, cb, true);
        };
        Traverse.prototype.forEach = function(cb) {
            this.value = walk(this.value, cb, false);
            return this.value;
        };
        Traverse.prototype.reduce = function(cb, init) {
            var skip = arguments.length === 1;
            var acc = skip ? this.value : init;
            this.forEach((function(x) {
                if (!this.isRoot || !skip) {
                    acc = cb.call(this, acc, x);
                }
            }));
            return acc;
        };
        Traverse.prototype.deepEqual = function(obj) {
            if (arguments.length !== 1) {
                throw new Error("deepEqual requires exactly one object to compare against");
            }
            var equal = true;
            var node = obj;
            this.forEach((function(y) {
                var notEqual = function() {
                    equal = false;
                    return undefined;
                }.bind(this);
                if (!this.isRoot) {
                    if (typeof node !== "object") return notEqual();
                    node = node[this.key];
                }
                var x = node;
                this.post((function() {
                    node = x;
                }));
                var toS = function(o) {
                    return Object.prototype.toString.call(o);
                };
                if (this.circular) {
                    if (Traverse(obj).get(this.circular.path) !== x) notEqual();
                } else if (typeof x !== typeof y) {
                    notEqual();
                } else if (x === null || y === null || x === undefined || y === undefined) {
                    if (x !== y) notEqual();
                } else if (x.__proto__ !== y.__proto__) {
                    notEqual();
                } else if (x === y) {} else if (typeof x === "function") {
                    if (x instanceof RegExp) {
                        if (x.toString() != y.toString()) notEqual();
                    } else if (x !== y) notEqual();
                } else if (typeof x === "object") {
                    if (toS(y) === "[object Arguments]" || toS(x) === "[object Arguments]") {
                        if (toS(x) !== toS(y)) {
                            notEqual();
                        }
                    } else if (x instanceof Date || y instanceof Date) {
                        if (!(x instanceof Date) || !(y instanceof Date) || x.getTime() !== y.getTime()) {
                            notEqual();
                        }
                    } else {
                        var kx = Object.keys(x);
                        var ky = Object.keys(y);
                        if (kx.length !== ky.length) return notEqual();
                        for (var i = 0; i < kx.length; i++) {
                            var k = kx[i];
                            if (!Object.hasOwnProperty.call(y, k)) {
                                notEqual();
                            }
                        }
                    }
                }
            }));
            return equal;
        };
        Traverse.prototype.paths = function() {
            var acc = [];
            this.forEach((function(x) {
                acc.push(this.path);
            }));
            return acc;
        };
        Traverse.prototype.nodes = function() {
            var acc = [];
            this.forEach((function(x) {
                acc.push(this.node);
            }));
            return acc;
        };
        Traverse.prototype.clone = function() {
            var parents = [], nodes = [];
            return function clone(src) {
                for (var i = 0; i < parents.length; i++) {
                    if (parents[i] === src) {
                        return nodes[i];
                    }
                }
                if (typeof src === "object" && src !== null) {
                    var dst = copy(src);
                    parents.push(src);
                    nodes.push(dst);
                    Object.keys(src).forEach((function(key) {
                        dst[key] = clone(src[key]);
                    }));
                    parents.pop();
                    nodes.pop();
                    return dst;
                } else {
                    return src;
                }
            }(this.value);
        };
        function walk(root, cb, immutable) {
            var path = [];
            var parents = [];
            var alive = true;
            return function walker(node_) {
                var node = immutable ? copy(node_) : node_;
                var modifiers = {};
                var state = {
                    node,
                    node_,
                    path: [].concat(path),
                    parent: parents.slice(-1)[0],
                    key: path.slice(-1)[0],
                    isRoot: path.length === 0,
                    level: path.length,
                    circular: null,
                    update: function(x) {
                        if (!state.isRoot) {
                            state.parent.node[state.key] = x;
                        }
                        state.node = x;
                    },
                    delete: function() {
                        delete state.parent.node[state.key];
                    },
                    remove: function() {
                        if (Array.isArray(state.parent.node)) {
                            state.parent.node.splice(state.key, 1);
                        } else {
                            delete state.parent.node[state.key];
                        }
                    },
                    before: function(f) {
                        modifiers.before = f;
                    },
                    after: function(f) {
                        modifiers.after = f;
                    },
                    pre: function(f) {
                        modifiers.pre = f;
                    },
                    post: function(f) {
                        modifiers.post = f;
                    },
                    stop: function() {
                        alive = false;
                    }
                };
                if (!alive) return state;
                if (typeof node === "object" && node !== null) {
                    state.isLeaf = Object.keys(node).length == 0;
                    for (var i = 0; i < parents.length; i++) {
                        if (parents[i].node_ === node_) {
                            state.circular = parents[i];
                            break;
                        }
                    }
                } else {
                    state.isLeaf = true;
                }
                state.notLeaf = !state.isLeaf;
                state.notRoot = !state.isRoot;
                var ret = cb.call(state, state.node);
                if (ret !== undefined && state.update) state.update(ret);
                if (modifiers.before) modifiers.before.call(state, state.node);
                if (typeof state.node == "object" && state.node !== null && !state.circular) {
                    parents.push(state);
                    var keys = Object.keys(state.node);
                    keys.forEach((function(key, i) {
                        path.push(key);
                        if (modifiers.pre) modifiers.pre.call(state, state.node[key], key);
                        var child = walker(state.node[key]);
                        if (immutable && Object.hasOwnProperty.call(state.node, key)) {
                            state.node[key] = child.node;
                        }
                        child.isLast = i == keys.length - 1;
                        child.isFirst = i == 0;
                        if (modifiers.post) modifiers.post.call(state, child);
                        path.pop();
                    }));
                    parents.pop();
                }
                if (modifiers.after) modifiers.after.call(state, state.node);
                return state;
            }(root).node;
        }
        Object.keys(Traverse.prototype).forEach((function(key) {
            Traverse[key] = function(obj) {
                var args = [].slice.call(arguments, 1);
                var t = Traverse(obj);
                return t[key].apply(t, args);
            };
        }));
        function copy(src) {
            if (typeof src === "object" && src !== null) {
                var dst;
                if (Array.isArray(src)) {
                    dst = [];
                } else if (src instanceof Date) {
                    dst = new Date(src);
                } else if (src instanceof Boolean) {
                    dst = new Boolean(src);
                } else if (src instanceof Number) {
                    dst = new Number(src);
                } else if (src instanceof String) {
                    dst = new String(src);
                } else {
                    dst = Object.create(Object.getPrototypeOf(src));
                }
                Object.keys(src).forEach((function(key) {
                    dst[key] = src[key];
                }));
                return dst;
            } else return src;
        }
    }, module => {
        module.exports = Buffers;
        function Buffers(bufs) {
            if (!(this instanceof Buffers)) return new Buffers(bufs);
            this.buffers = bufs || [];
            this.length = this.buffers.reduce((function(size, buf) {
                return size + buf.length;
            }), 0);
        }
        Buffers.prototype.push = function() {
            for (var i = 0; i < arguments.length; i++) {
                if (!Buffer.isBuffer(arguments[i])) {
                    throw new TypeError("Tried to push a non-buffer");
                }
            }
            for (var i = 0; i < arguments.length; i++) {
                var buf = arguments[i];
                this.buffers.push(buf);
                this.length += buf.length;
            }
            return this.length;
        };
        Buffers.prototype.unshift = function() {
            for (var i = 0; i < arguments.length; i++) {
                if (!Buffer.isBuffer(arguments[i])) {
                    throw new TypeError("Tried to unshift a non-buffer");
                }
            }
            for (var i = 0; i < arguments.length; i++) {
                var buf = arguments[i];
                this.buffers.unshift(buf);
                this.length += buf.length;
            }
            return this.length;
        };
        Buffers.prototype.copy = function(dst, dStart, start, end) {
            return this.slice(start, end).copy(dst, dStart, 0, end - start);
        };
        Buffers.prototype.splice = function(i, howMany) {
            var buffers = this.buffers;
            var index = i >= 0 ? i : this.length - i;
            var reps = [].slice.call(arguments, 2);
            if (howMany === undefined) {
                howMany = this.length - index;
            } else if (howMany > this.length - index) {
                howMany = this.length - index;
            }
            for (var i = 0; i < reps.length; i++) {
                this.length += reps[i].length;
            }
            var removed = new Buffers;
            var bytes = 0;
            var startBytes = 0;
            for (var ii = 0; ii < buffers.length && startBytes + buffers[ii].length < index; ii++) {
                startBytes += buffers[ii].length;
            }
            if (index - startBytes > 0) {
                var start = index - startBytes;
                if (start + howMany < buffers[ii].length) {
                    removed.push(buffers[ii].slice(start, start + howMany));
                    var orig = buffers[ii];
                    var buf0 = new Buffer(start);
                    for (var i = 0; i < start; i++) {
                        buf0[i] = orig[i];
                    }
                    var buf1 = new Buffer(orig.length - start - howMany);
                    for (var i = start + howMany; i < orig.length; i++) {
                        buf1[i - howMany - start] = orig[i];
                    }
                    if (reps.length > 0) {
                        var reps_ = reps.slice();
                        reps_.unshift(buf0);
                        reps_.push(buf1);
                        buffers.splice.apply(buffers, [ ii, 1 ].concat(reps_));
                        ii += reps_.length;
                        reps = [];
                    } else {
                        buffers.splice(ii, 1, buf0, buf1);
                        ii += 2;
                    }
                } else {
                    removed.push(buffers[ii].slice(start));
                    buffers[ii] = buffers[ii].slice(0, start);
                    ii++;
                }
            }
            if (reps.length > 0) {
                buffers.splice.apply(buffers, [ ii, 0 ].concat(reps));
                ii += reps.length;
            }
            while (removed.length < howMany) {
                var buf = buffers[ii];
                var len = buf.length;
                var take = Math.min(len, howMany - removed.length);
                if (take === len) {
                    removed.push(buf);
                    buffers.splice(ii, 1);
                } else {
                    removed.push(buf.slice(0, take));
                    buffers[ii] = buffers[ii].slice(take);
                }
            }
            this.length -= removed.length;
            return removed;
        };
        Buffers.prototype.slice = function(i, j) {
            var buffers = this.buffers;
            if (j === undefined) j = this.length;
            if (i === undefined) i = 0;
            if (j > this.length) j = this.length;
            var startBytes = 0;
            for (var si = 0; si < buffers.length && startBytes + buffers[si].length <= i; si++) {
                startBytes += buffers[si].length;
            }
            var target = new Buffer(j - i);
            var ti = 0;
            for (var ii = si; ti < j - i && ii < buffers.length; ii++) {
                var len = buffers[ii].length;
                var start = ti === 0 ? i - startBytes : 0;
                var end = ti + len >= j - i ? Math.min(start + (j - i) - ti, len) : len;
                buffers[ii].copy(target, ti, start, end);
                ti += end - start;
            }
            return target;
        };
        Buffers.prototype.pos = function(i) {
            if (i < 0 || i >= this.length) throw new Error("oob");
            var l = i, bi = 0, bu = null;
            for (;;) {
                bu = this.buffers[bi];
                if (l < bu.length) {
                    return {
                        buf: bi,
                        offset: l
                    };
                } else {
                    l -= bu.length;
                }
                bi++;
            }
        };
        Buffers.prototype.get = function get(i) {
            var pos = this.pos(i);
            return this.buffers[pos.buf].get(pos.offset);
        };
        Buffers.prototype.set = function set(i, b) {
            var pos = this.pos(i);
            return this.buffers[pos.buf].set(pos.offset, b);
        };
        Buffers.prototype.indexOf = function(needle, offset) {
            if ("string" === typeof needle) {
                needle = new Buffer(needle);
            } else if (needle instanceof Buffer) {} else {
                throw new Error("Invalid type for a search string");
            }
            if (!needle.length) {
                return 0;
            }
            if (!this.length) {
                return -1;
            }
            var i = 0, j = 0, match = 0, mstart, pos = 0;
            if (offset) {
                var p = this.pos(offset);
                i = p.buf;
                j = p.offset;
                pos = offset;
            }
            for (;;) {
                while (j >= this.buffers[i].length) {
                    j = 0;
                    i++;
                    if (i >= this.buffers.length) {
                        return -1;
                    }
                }
                var char = this.buffers[i][j];
                if (char == needle[match]) {
                    if (match == 0) {
                        mstart = {
                            i,
                            j,
                            pos
                        };
                    }
                    match++;
                    if (match == needle.length) {
                        return mstart.pos;
                    }
                } else if (match != 0) {
                    i = mstart.i;
                    j = mstart.j;
                    pos = mstart.pos;
                    match = 0;
                }
                j++;
                pos++;
            }
        };
        Buffers.prototype.toBuffer = function() {
            return this.slice();
        };
        Buffers.prototype.toString = function(encoding, start, end) {
            return this.slice(start, end).toString(encoding);
        };
    }, module => {
        module.exports = function(store) {
            function getset(name, value) {
                var node = vars.store;
                var keys = name.split(".");
                keys.slice(0, -1).forEach((function(k) {
                    if (node[k] === undefined) node[k] = {};
                    node = node[k];
                }));
                var key = keys[keys.length - 1];
                if (arguments.length == 1) {
                    return node[key];
                } else {
                    return node[key] = value;
                }
            }
            var vars = {
                get: function(name) {
                    return getset(name);
                },
                set: function(name, value) {
                    return getset(name, value);
                },
                store: store || {}
            };
            return vars;
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var Transform = __webpack_require__(17).Transform;
        var util = __webpack_require__(58);
        function MatcherStream(patternDesc, matchFn) {
            if (!(this instanceof MatcherStream)) {
                return new MatcherStream;
            }
            Transform.call(this);
            var p = typeof patternDesc === "object" ? patternDesc.pattern : patternDesc;
            this.pattern = Buffer.isBuffer(p) ? p : Buffer.from(p);
            this.requiredLength = this.pattern.length;
            if (patternDesc.requiredExtraSize) this.requiredLength += patternDesc.requiredExtraSize;
            this.data = new Buffer("");
            this.bytesSoFar = 0;
            this.matchFn = matchFn;
        }
        util.inherits(MatcherStream, Transform);
        MatcherStream.prototype.checkDataChunk = function(ignoreMatchZero) {
            var enoughData = this.data.length >= this.requiredLength;
            if (!enoughData) {
                return;
            }
            var matchIndex = this.data.indexOf(this.pattern, ignoreMatchZero ? 1 : 0);
            if (matchIndex >= 0 && matchIndex + this.requiredLength > this.data.length) {
                if (matchIndex > 0) {
                    var packet = this.data.slice(0, matchIndex);
                    this.push(packet);
                    this.bytesSoFar += matchIndex;
                    this.data = this.data.slice(matchIndex);
                }
                return;
            }
            if (matchIndex === -1) {
                var packetLen = this.data.length - this.requiredLength + 1;
                var packet = this.data.slice(0, packetLen);
                this.push(packet);
                this.bytesSoFar += packetLen;
                this.data = this.data.slice(packetLen);
                return;
            }
            if (matchIndex > 0) {
                var packet = this.data.slice(0, matchIndex);
                this.data = this.data.slice(matchIndex);
                this.push(packet);
                this.bytesSoFar += matchIndex;
            }
            var finished = this.matchFn ? this.matchFn(this.data, this.bytesSoFar) : true;
            if (finished) {
                this.data = new Buffer("");
                return;
            }
            return true;
        };
        MatcherStream.prototype._transform = function(chunk, encoding, cb) {
            this.data = Buffer.concat([ this.data, chunk ]);
            var firstIteration = true;
            while (this.checkDataChunk(!firstIteration)) {
                firstIteration = false;
            }
            cb();
        };
        MatcherStream.prototype._flush = function(cb) {
            if (this.data.length > 0) {
                var firstIteration = true;
                while (this.checkDataChunk(!firstIteration)) {
                    firstIteration = false;
                }
            }
            if (this.data.length > 0) {
                this.push(this.data);
                this.data = null;
            }
            cb();
        };
        module.exports = MatcherStream;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var stream = __webpack_require__(17);
        var inherits = __webpack_require__(58).inherits;
        function Entry() {
            if (!(this instanceof Entry)) {
                return new Entry;
            }
            stream.PassThrough.call(this);
            this.path = null;
            this.type = null;
            this.isDirectory = false;
        }
        inherits(Entry, stream.PassThrough);
        Entry.prototype.autodrain = function() {
            return this.pipe(new stream.Transform({
                transform: function(d, e, cb) {
                    cb();
                }
            }));
        };
        module.exports = Entry;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var fs = __webpack_require__(14);
        var path = __webpack_require__(15);
        var util = __webpack_require__(58);
        var mkdirp = __webpack_require__(248);
        var Transform = __webpack_require__(17).Transform;
        var UnzipStream = __webpack_require__(239);
        function Extract(opts) {
            if (!(this instanceof Extract)) return new Extract(opts);
            Transform.call(this);
            this.opts = opts || {};
            this.unzipStream = new UnzipStream(this.opts);
            this.unfinishedEntries = 0;
            this.afterFlushWait = false;
            this.createdDirectories = {};
            var self = this;
            this.unzipStream.on("entry", this._processEntry.bind(this));
            this.unzipStream.on("error", (function(error) {
                self.emit("error", error);
            }));
        }
        util.inherits(Extract, Transform);
        Extract.prototype._transform = function(chunk, encoding, cb) {
            this.unzipStream.write(chunk, encoding, cb);
        };
        Extract.prototype._flush = function(cb) {
            var self = this;
            var allDone = function() {
                process.nextTick((function() {
                    self.emit("close");
                }));
                cb();
            };
            this.unzipStream.end((function() {
                if (self.unfinishedEntries > 0) {
                    self.afterFlushWait = true;
                    return self.on("await-finished", allDone);
                }
                allDone();
            }));
        };
        Extract.prototype._processEntry = function(entry) {
            var self = this;
            var destPath = path.join(this.opts.path, entry.path);
            var directory = entry.isDirectory ? destPath : path.dirname(destPath);
            this.unfinishedEntries++;
            var writeFileFn = function() {
                var pipedStream = fs.createWriteStream(destPath);
                pipedStream.on("close", (function() {
                    self.unfinishedEntries--;
                    self._notifyAwaiter();
                }));
                pipedStream.on("error", (function(error) {
                    self.emit("error", error);
                }));
                entry.pipe(pipedStream);
            };
            if (this.createdDirectories[directory] || directory === ".") {
                return writeFileFn();
            }
            mkdirp(directory, (function(err) {
                if (err) return self.emit("error", err);
                self.createdDirectories[directory] = true;
                if (entry.isDirectory) {
                    self.unfinishedEntries--;
                    self._notifyAwaiter();
                    return;
                }
                writeFileFn();
            }));
        };
        Extract.prototype._notifyAwaiter = function() {
            if (this.afterFlushWait && this.unfinishedEntries === 0) {
                this.emit("await-finished");
                this.afterFlushWait = false;
            }
        };
        module.exports = Extract;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var path = __webpack_require__(15);
        var fs = __webpack_require__(14);
        var _0777 = parseInt("0777", 8);
        module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
        function mkdirP(p, opts, f, made) {
            if (typeof opts === "function") {
                f = opts;
                opts = {};
            } else if (!opts || typeof opts !== "object") {
                opts = {
                    mode: opts
                };
            }
            var mode = opts.mode;
            var xfs = opts.fs || fs;
            if (mode === undefined) {
                mode = _0777;
            }
            if (!made) made = null;
            var cb = f || function() {};
            p = path.resolve(p);
            xfs.mkdir(p, mode, (function(er) {
                if (!er) {
                    made = made || p;
                    return cb(null, made);
                }
                switch (er.code) {
                  case "ENOENT":
                    if (path.dirname(p) === p) return cb(er);
                    mkdirP(path.dirname(p), opts, (function(er, made) {
                        if (er) cb(er, made); else mkdirP(p, opts, cb, made);
                    }));
                    break;

                  default:
                    xfs.stat(p, (function(er2, stat) {
                        if (er2 || !stat.isDirectory()) cb(er, made); else cb(null, made);
                    }));
                    break;
                }
            }));
        }
        mkdirP.sync = function sync(p, opts, made) {
            if (!opts || typeof opts !== "object") {
                opts = {
                    mode: opts
                };
            }
            var mode = opts.mode;
            var xfs = opts.fs || fs;
            if (mode === undefined) {
                mode = _0777;
            }
            if (!made) made = null;
            p = path.resolve(p);
            try {
                xfs.mkdirSync(p, mode);
                made = made || p;
            } catch (err0) {
                switch (err0.code) {
                  case "ENOENT":
                    made = sync(path.dirname(p), opts, made);
                    sync(p, opts, made);
                    break;

                  default:
                    var stat;
                    try {
                        stat = xfs.statSync(p);
                    } catch (err1) {
                        throw err0;
                    }
                    if (!stat.isDirectory()) throw err0;
                    break;
                }
            }
            return made;
        };
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.BalenaS3CompressedSource = void 0;
        const CombinedStream = __webpack_require__(250);
        const file_disk_1 = __webpack_require__(29);
        const gzip_stream_1 = __webpack_require__(252);
        const stream_1 = __webpack_require__(17);
        const ZipPartStream = __webpack_require__(278);
        const zlib_1 = __webpack_require__(23);
        const balena_s3_source_1 = __webpack_require__(209);
        const configure_1 = __webpack_require__(101);
        const configure_2 = __webpack_require__(102);
        const copy_1 = __webpack_require__(104);
        const errors_1 = __webpack_require__(4);
        const stream_limiter_1 = __webpack_require__(22);
        const utils_1 = __webpack_require__(6);
        class BalenaS3CompressedSource extends balena_s3_source_1.BalenaS3SourceBase {
            constructor({format, filenamePrefix, configuration, ...options}) {
                super(options);
                this.configuredParts = new Map;
                this.format = format;
                this.filenamePrefix = filenamePrefix;
                this.configuration = configuration;
            }
            async getSize() {
                return (await this.createStream(true)).zLen;
            }
            getFilename() {
                return [ this.filenamePrefix, this.deviceType, this.osVersion, this.buildId.endsWith(".dev") ? "dev" : undefined, this.supervisorVersion, this.release ].filter((p => p !== undefined)).join("-");
            }
            async _getMetadata() {
                return {
                    supervisorVersion: this.supervisorVersion,
                    osVersion: this.osVersion,
                    lastModified: this.lastModified,
                    size: this.size,
                    version: this.buildId,
                    name: this.filename,
                    format: this.format
                };
            }
            async getSupervisorVersion() {
                const response = await this.download("VERSION");
                const lastModified = new Date(response.headers["last-modified"]);
                const supervisorVersion = response.data.trim();
                return {
                    supervisorVersion,
                    lastModified
                };
            }
            async getOsVersion() {
                const response = await this.download("VERSION_HOSTOS");
                return response.data.trim();
            }
            async getImageJSON() {
                const imageJSON = (await this.download("image.json")).data;
                return imageJSON;
            }
            async getDeviceTypeJSON() {
                return (await this.download("device-type.json")).data;
            }
            async getPartStream(filename) {
                const response = await this.download(`compressed/${filename}`, "stream");
                return response.data;
            }
            findPartitionPart(imageJSON, partition) {
                for (const {parts} of Object.values(imageJSON)) {
                    for (const part of parts) {
                        if (part.partitionIndex === `(${partition})`) {
                            return part;
                        }
                    }
                }
                throw new Error(`Couldn't find compressed image part for partition ${partition}`);
            }
            findImagePart(imageJSON, image) {
                var _a, _b;
                const [part] = (_b = (_a = imageJSON[image]) === null || _a === void 0 ? void 0 : _a.parts) !== null && _b !== void 0 ? _b : [];
                if (part === undefined) {
                    throw new Error(`Couldn't find compressed part for image ${image}`);
                }
                return part;
            }
            findPart(definition) {
                if (definition.partition !== undefined) {
                    const partition = (0, configure_1.normalizePartition)(definition.partition);
                    return this.findPartitionPart(this.imageJSON, partition);
                } else if (definition.image !== undefined) {
                    return this.findImagePart(this.imageJSON, definition.image);
                } else {
                    throw new Error("No partition or image to configure found");
                }
            }
            async extractDeflateToDisk(filename) {
                const stream = await this.getPartStream(filename);
                const combined = CombinedStream.create();
                combined.append(stream);
                combined.append(gzip_stream_1.DEFLATE_END);
                const inflate = (0, zlib_1.createInflateRaw)();
                combined.pipe(inflate);
                return new file_disk_1.BufferDisk(await (0, utils_1.streamToBuffer)(inflate));
            }
            async configure() {
                var _a, _b;
                if (this.configuration === undefined) {
                    return;
                }
                const disks = new Map;
                const self = this;
                async function getDisk(definition) {
                    const filename = self.findPart(definition).filename;
                    const d = disks.get(filename);
                    if (d !== undefined) {
                        return d;
                    }
                    const d2 = await self.extractDeflateToDisk(filename);
                    disks.set(filename, d2);
                    return d2;
                }
                await (0, configure_2.configure)(await getDisk(this.deviceTypeJSON.configuration.config), undefined, this.configuration);
                for (const cpy of (_a = this.deviceTypeJSON.configuration.operations) !== null && _a !== void 0 ? _a : []) {
                    if ((0, configure_1.shouldRunOperation)((_b = this.configuration) !== null && _b !== void 0 ? _b : {}, cpy)) {
                        await (0, copy_1.copy)(await getDisk(cpy.from), undefined, cpy.from.path, await getDisk(cpy.to), undefined, cpy.to.path);
                    }
                }
                await Promise.all(Array.from(disks.entries()).map((async ([filename, disk]) => {
                    const stream = (await disk.getStream()).pipe((0, gzip_stream_1.createDeflatePart)());
                    const buffer = await (0, utils_1.streamToBuffer)(stream);
                    const {crc, zLen} = stream.metadata();
                    this.configuredParts.set(filename, {
                        crc,
                        zLen,
                        buffer
                    });
                })));
            }
            async _open() {
                const [{supervisorVersion, lastModified}, osVersion, imageJSON, deviceTypeJSON] = await Promise.all([ this.getSupervisorVersion(), this.getOsVersion(), this.getImageJSON(), this.getDeviceTypeJSON() ]);
                if (deviceTypeJSON.yocto.archive) {
                    this.format = "zip";
                }
                this.supervisorVersion = supervisorVersion;
                this.lastModified = lastModified;
                this.osVersion = osVersion;
                this.deviceTypeJSON = deviceTypeJSON;
                this.filename = this.getFilename();
                const keys = Object.keys(imageJSON);
                if (keys.length === 1 && keys[0] === "resin.img") {
                    this.filename += ".img";
                    this.imageJSON = {
                        [this.filename]: imageJSON["resin.img"]
                    };
                } else {
                    this.imageJSON = imageJSON;
                }
                await this.configure();
                this.size = await this.getSize();
            }
            async getParts(fake) {
                return Promise.all(Object.entries(this.imageJSON).map((async ([filename, {parts}]) => ({
                    filename,
                    parts: await Promise.all(parts.map((async p => {
                        let stream;
                        let {crc, zLen} = p;
                        const configuredPart = this.configuredParts.get(p.filename);
                        if (configuredPart !== undefined) {
                            ({buffer: stream, crc, zLen} = configuredPart);
                        } else if (fake) {
                            stream = new stream_1.Readable;
                        } else {
                            stream = await this.getPartStream(p.filename);
                        }
                        return {
                            ...p,
                            crc,
                            zLen,
                            stream
                        };
                    })))
                }))));
            }
            async createZipStream(fake) {
                const entries = (await this.getParts(fake)).map((({filename, parts}) => ZipPartStream.createEntry(filename, parts)));
                return ZipPartStream.create(entries);
            }
            async createGzipStream(fake) {
                const [{parts}] = await this.getParts(fake);
                return (0, gzip_stream_1.createGzipFromParts)(parts);
            }
            async createStream(fake = false) {
                return await (this.format === "zip" ? this.createZipStream(fake) : this.createGzipStream(fake));
            }
            async createReadStream(options = {}) {
                if (options.start !== undefined) {
                    throw new errors_1.NotCapable;
                }
                const stream = await this.createStream();
                if (options.end !== undefined) {
                    return new stream_limiter_1.StreamLimiter(stream, options.end + 1);
                }
                return stream;
            }
        }
        exports.BalenaS3CompressedSource = BalenaS3CompressedSource;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var util = __webpack_require__(58);
        var Stream = __webpack_require__(17).Stream;
        var DelayedStream = __webpack_require__(251);
        module.exports = CombinedStream;
        function CombinedStream() {
            this.writable = false;
            this.readable = true;
            this.dataSize = 0;
            this.maxDataSize = 2 * 1024 * 1024;
            this.pauseStreams = true;
            this._released = false;
            this._streams = [];
            this._currentStream = null;
            this._insideLoop = false;
            this._pendingNext = false;
        }
        util.inherits(CombinedStream, Stream);
        CombinedStream.create = function(options) {
            var combinedStream = new this;
            options = options || {};
            for (var option in options) {
                combinedStream[option] = options[option];
            }
            return combinedStream;
        };
        CombinedStream.isStreamLike = function(stream) {
            return typeof stream !== "function" && typeof stream !== "string" && typeof stream !== "boolean" && typeof stream !== "number" && !Buffer.isBuffer(stream);
        };
        CombinedStream.prototype.append = function(stream) {
            var isStreamLike = CombinedStream.isStreamLike(stream);
            if (isStreamLike) {
                if (!(stream instanceof DelayedStream)) {
                    var newStream = DelayedStream.create(stream, {
                        maxDataSize: Infinity,
                        pauseStream: this.pauseStreams
                    });
                    stream.on("data", this._checkDataSize.bind(this));
                    stream = newStream;
                }
                this._handleErrors(stream);
                if (this.pauseStreams) {
                    stream.pause();
                }
            }
            this._streams.push(stream);
            return this;
        };
        CombinedStream.prototype.pipe = function(dest, options) {
            Stream.prototype.pipe.call(this, dest, options);
            this.resume();
            return dest;
        };
        CombinedStream.prototype._getNext = function() {
            this._currentStream = null;
            if (this._insideLoop) {
                this._pendingNext = true;
                return;
            }
            this._insideLoop = true;
            try {
                do {
                    this._pendingNext = false;
                    this._realGetNext();
                } while (this._pendingNext);
            } finally {
                this._insideLoop = false;
            }
        };
        CombinedStream.prototype._realGetNext = function() {
            var stream = this._streams.shift();
            if (typeof stream == "undefined") {
                this.end();
                return;
            }
            if (typeof stream !== "function") {
                this._pipeNext(stream);
                return;
            }
            var getStream = stream;
            getStream(function(stream) {
                var isStreamLike = CombinedStream.isStreamLike(stream);
                if (isStreamLike) {
                    stream.on("data", this._checkDataSize.bind(this));
                    this._handleErrors(stream);
                }
                this._pipeNext(stream);
            }.bind(this));
        };
        CombinedStream.prototype._pipeNext = function(stream) {
            this._currentStream = stream;
            var isStreamLike = CombinedStream.isStreamLike(stream);
            if (isStreamLike) {
                stream.on("end", this._getNext.bind(this));
                stream.pipe(this, {
                    end: false
                });
                return;
            }
            var value = stream;
            this.write(value);
            this._getNext();
        };
        CombinedStream.prototype._handleErrors = function(stream) {
            var self = this;
            stream.on("error", (function(err) {
                self._emitError(err);
            }));
        };
        CombinedStream.prototype.write = function(data) {
            this.emit("data", data);
        };
        CombinedStream.prototype.pause = function() {
            if (!this.pauseStreams) {
                return;
            }
            if (this.pauseStreams && this._currentStream && typeof this._currentStream.pause == "function") this._currentStream.pause();
            this.emit("pause");
        };
        CombinedStream.prototype.resume = function() {
            if (!this._released) {
                this._released = true;
                this.writable = true;
                this._getNext();
            }
            if (this.pauseStreams && this._currentStream && typeof this._currentStream.resume == "function") this._currentStream.resume();
            this.emit("resume");
        };
        CombinedStream.prototype.end = function() {
            this._reset();
            this.emit("end");
        };
        CombinedStream.prototype.destroy = function() {
            this._reset();
            this.emit("close");
        };
        CombinedStream.prototype._reset = function() {
            this.writable = false;
            this._streams = [];
            this._currentStream = null;
        };
        CombinedStream.prototype._checkDataSize = function() {
            this._updateDataSize();
            if (this.dataSize <= this.maxDataSize) {
                return;
            }
            var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded.";
            this._emitError(new Error(message));
        };
        CombinedStream.prototype._updateDataSize = function() {
            this.dataSize = 0;
            var self = this;
            this._streams.forEach((function(stream) {
                if (!stream.dataSize) {
                    return;
                }
                self.dataSize += stream.dataSize;
            }));
            if (this._currentStream && this._currentStream.dataSize) {
                this.dataSize += this._currentStream.dataSize;
            }
        };
        CombinedStream.prototype._emitError = function(err) {
            this._reset();
            this.emit("error", err);
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var Stream = __webpack_require__(17).Stream;
        var util = __webpack_require__(58);
        module.exports = DelayedStream;
        function DelayedStream() {
            this.source = null;
            this.dataSize = 0;
            this.maxDataSize = 1024 * 1024;
            this.pauseStream = true;
            this._maxDataSizeExceeded = false;
            this._released = false;
            this._bufferedEvents = [];
        }
        util.inherits(DelayedStream, Stream);
        DelayedStream.create = function(source, options) {
            var delayedStream = new this;
            options = options || {};
            for (var option in options) {
                delayedStream[option] = options[option];
            }
            delayedStream.source = source;
            var realEmit = source.emit;
            source.emit = function() {
                delayedStream._handleEmit(arguments);
                return realEmit.apply(source, arguments);
            };
            source.on("error", (function() {}));
            if (delayedStream.pauseStream) {
                source.pause();
            }
            return delayedStream;
        };
        Object.defineProperty(DelayedStream.prototype, "readable", {
            configurable: true,
            enumerable: true,
            get: function() {
                return this.source.readable;
            }
        });
        DelayedStream.prototype.setEncoding = function() {
            return this.source.setEncoding.apply(this.source, arguments);
        };
        DelayedStream.prototype.resume = function() {
            if (!this._released) {
                this.release();
            }
            this.source.resume();
        };
        DelayedStream.prototype.pause = function() {
            this.source.pause();
        };
        DelayedStream.prototype.release = function() {
            this._released = true;
            this._bufferedEvents.forEach(function(args) {
                this.emit.apply(this, args);
            }.bind(this));
            this._bufferedEvents = [];
        };
        DelayedStream.prototype.pipe = function() {
            var r = Stream.prototype.pipe.apply(this, arguments);
            this.resume();
            return r;
        };
        DelayedStream.prototype._handleEmit = function(args) {
            if (this._released) {
                this.emit.apply(this, args);
                return;
            }
            if (args[0] === "data") {
                this.dataSize += args[1].length;
                this._checkIfMaxDataSizeExceeded();
            }
            this._bufferedEvents.push(args);
        };
        DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {
            if (this._maxDataSizeExceeded) {
                return;
            }
            if (this.dataSize <= this.maxDataSize) {
                return;
            }
            this._maxDataSizeExceeded = true;
            var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded.";
            this.emit("error", new Error(message));
        };
    }, function(__unused_webpack_module, exports, __webpack_require__) {
        (function() {
            var CombinedStream, DEFLATE_END, DEFLATE_END_LENGTH, DeflateCRC32Stream, DeflatePartStream, GZIP_HEADER, crcUtils;
            crcUtils = __webpack_require__(253);
            CombinedStream = __webpack_require__(250);
            ({DeflateCRC32Stream} = __webpack_require__(255));
            exports.GZIP_HEADER = GZIP_HEADER = Buffer.from([ 31, 139, 8, 0, 0, 0, 0, 0, 0, 255 ]);
            exports.DEFLATE_END = DEFLATE_END = Buffer.from([ 3, 0 ]);
            exports.DEFLATE_END_LENGTH = DEFLATE_END_LENGTH = DEFLATE_END.length;
            DeflatePartStream = class DeflatePartStream extends DeflateCRC32Stream {
                constructor() {
                    super(...arguments);
                    this.buf = Buffer.alloc(0);
                }
                push(chunk) {
                    if (chunk !== null) {
                        if (chunk.length >= DEFLATE_END_LENGTH) {
                            super.push(this.buf);
                            return this.buf = chunk;
                        } else {
                            return this.buf = Buffer.concat([ this.buf, chunk ]);
                        }
                    } else {
                        if (this.buf.length >= DEFLATE_END_LENGTH && this.buf.slice(-DEFLATE_END_LENGTH).equals(DEFLATE_END)) {
                            this.buf = this.buf.slice(0, -DEFLATE_END_LENGTH);
                        }
                        super.push(this.buf);
                        return super.push(null);
                    }
                }
                end() {
                    return this.flush((() => super.end()));
                }
                metadata() {
                    return {
                        crc: this.digest().readUInt32BE(0),
                        len: this.size(),
                        zLen: this.size(true)
                    };
                }
            };
            exports.createDeflatePart = function() {
                return new DeflatePartStream;
            };
            exports.createGzipFromParts = function(parts) {
                var i, len, len1, out, stream;
                out = CombinedStream.create();
                out.append(GZIP_HEADER);
                for (i = 0, len1 = parts.length; i < len1; i++) {
                    ({stream} = parts[i]);
                    out.append(stream);
                }
                out.append(DEFLATE_END);
                out.append(crcUtils.crc32_combine_multi(parts).combinedCrc32);
                len = Buffer.alloc(4);
                len.writeUInt32LE(parts.map((function(p) {
                    return p.len;
                })).reduce((function(a, b) {
                    return a + b;
                })), 0);
                out.append(len);
                out.zLen = parts.map((function(p) {
                    return p.zLen;
                })).reduce((function(a, b) {
                    return a + b;
                })) + 20;
                return out;
            };
        }).call(this);
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        const Module = __webpack_require__(254);
        const ready = new Promise((resolve => {
            Module.onRuntimeInitialized = resolve;
        }));
        exports.ready = ready;
        function crc32_combine(crc1, crc2, len2) {
            const value = Module.ccall("crc32_combine", "number", [ "number", "number", "number" ], [ crc1, crc2, len2 ]);
            const buffer = Buffer.alloc(4);
            buffer.writeInt32LE(value);
            return buffer;
        }
        exports.crc32_combine = crc32_combine;
        const message = "The argument should be an Array of at least 2 Objects with 'crc' and 'len' keys";
        exports.message = message;
        function crc32_combine_multi(crcs) {
            if (!Array.isArray(crcs)) {
                throw new Error(message);
            }
            if (crcs.length < 2) {
                throw new Error(message);
            }
            let {crc: result, len: intLength} = crcs[0];
            for (const {crc, len} of crcs.slice(1)) {
                if (!Number.isInteger(crc) || !Number.isInteger(len)) {
                    throw new Error(message);
                }
                result = crc32_combine(result, crc, len).readUInt32LE();
                intLength += len;
            }
            const combinedCrc32 = Buffer.alloc(4);
            combinedCrc32.writeUInt32LE(result);
            return {
                combinedCrc32,
                intLength
            };
        }
        exports.crc32_combine_multi = crc32_combine_multi;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var __dirname = "node_modules\\@balena\\node-crc-utils";
        var Module = typeof Module !== "undefined" ? Module : {};
        var moduleOverrides = {};
        var key;
        for (key in Module) {
            if (Module.hasOwnProperty(key)) {
                moduleOverrides[key] = Module[key];
            }
        }
        var arguments_ = [];
        var thisProgram = "./this.program";
        var quit_ = function(status, toThrow) {
            throw toThrow;
        };
        var ENVIRONMENT_IS_WEB = false;
        var ENVIRONMENT_IS_WORKER = false;
        var ENVIRONMENT_IS_NODE = false;
        var ENVIRONMENT_IS_SHELL = false;
        ENVIRONMENT_IS_WEB = typeof window === "object";
        ENVIRONMENT_IS_WORKER = typeof importScripts === "function";
        ENVIRONMENT_IS_NODE = typeof process === "object" && typeof process.versions === "object" && typeof process.versions.node === "string";
        ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;
        var scriptDirectory = "";
        function locateFile(path) {
            if (Module["locateFile"]) {
                return Module["locateFile"](path, scriptDirectory);
            }
            return scriptDirectory + path;
        }
        var read_, readAsync, readBinary, setWindowTitle;
        var nodeFS;
        var nodePath;
        if (ENVIRONMENT_IS_NODE) {
            if (ENVIRONMENT_IS_WORKER) {
                scriptDirectory = __webpack_require__(15).dirname(scriptDirectory) + "/";
            } else {
                const Path = __webpack_require__(15);
                let electron;
                try {
                    electron = __webpack_require__(1);
                } catch {}
                function appPath() {
                    return Path.isAbsolute(__dirname) ? __dirname : Path.join(electron.remote.app.getAppPath().replace(/\.asar$/, (() => process.platform === "darwin" ? "-" + process.arch : "")), "generated");
                }
                scriptDirectory = Path.join(appPath(), "modules", "@balena", "node-crc-utils", "/");
            }
            read_ = function shell_read(filename, binary) {
                if (!nodeFS) nodeFS = __webpack_require__(14);
                if (!nodePath) nodePath = __webpack_require__(15);
                filename = nodePath["normalize"](filename);
                return nodeFS["readFileSync"](filename, binary ? null : "utf8");
            };
            readBinary = function readBinary(filename) {
                var ret = read_(filename, true);
                if (!ret.buffer) {
                    ret = new Uint8Array(ret);
                }
                assert(ret.buffer);
                return ret;
            };
            if (process["argv"].length > 1) {
                thisProgram = process["argv"][1].replace(/\\/g, "/");
            }
            arguments_ = process["argv"].slice(2);
            if (true) {
                module["exports"] = Module;
            }
            process["on"]("uncaughtException", (function(ex) {
                if (!(ex instanceof ExitStatus)) {
                    throw ex;
                }
            }));
            process["on"]("unhandledRejection", abort);
            quit_ = function(status) {
                process["exit"](status);
            };
            Module["inspect"] = function() {
                return "[Emscripten Module object]";
            };
        } else if (ENVIRONMENT_IS_SHELL) {
            if (typeof read != "undefined") {
                read_ = function shell_read(f) {
                    return read(f);
                };
            }
            readBinary = function readBinary(f) {
                var data;
                if (typeof readbuffer === "function") {
                    return new Uint8Array(readbuffer(f));
                }
                data = read(f, "binary");
                assert(typeof data === "object");
                return data;
            };
            if (typeof scriptArgs != "undefined") {
                arguments_ = scriptArgs;
            } else if (typeof arguments != "undefined") {
                arguments_ = arguments;
            }
            if (typeof quit === "function") {
                quit_ = function(status) {
                    quit(status);
                };
            }
            if (typeof print !== "undefined") {
                if (typeof console === "undefined") console = {};
                console.log = print;
                console.warn = console.error = typeof printErr !== "undefined" ? printErr : print;
            }
        } else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
            if (ENVIRONMENT_IS_WORKER) {
                scriptDirectory = self.location.href;
            } else if (document.currentScript) {
                scriptDirectory = document.currentScript.src;
            }
            if (scriptDirectory.indexOf("blob:") !== 0) {
                scriptDirectory = scriptDirectory.substr(0, scriptDirectory.lastIndexOf("/") + 1);
            } else {
                scriptDirectory = "";
            }
            {
                read_ = function shell_read(url) {
                    var xhr = new XMLHttpRequest;
                    xhr.open("GET", url, false);
                    xhr.send(null);
                    return xhr.responseText;
                };
                if (ENVIRONMENT_IS_WORKER) {
                    readBinary = function readBinary(url) {
                        var xhr = new XMLHttpRequest;
                        xhr.open("GET", url, false);
                        xhr.responseType = "arraybuffer";
                        xhr.send(null);
                        return new Uint8Array(xhr.response);
                    };
                }
                readAsync = function readAsync(url, onload, onerror) {
                    var xhr = new XMLHttpRequest;
                    xhr.open("GET", url, true);
                    xhr.responseType = "arraybuffer";
                    xhr.onload = function xhr_onload() {
                        if (xhr.status == 200 || xhr.status == 0 && xhr.response) {
                            onload(xhr.response);
                            return;
                        }
                        onerror();
                    };
                    xhr.onerror = onerror;
                    xhr.send(null);
                };
            }
            setWindowTitle = function(title) {
                document.title = title;
            };
        } else {}
        var out = Module["print"] || console.log.bind(console);
        var err = Module["printErr"] || console.warn.bind(console);
        for (key in moduleOverrides) {
            if (moduleOverrides.hasOwnProperty(key)) {
                Module[key] = moduleOverrides[key];
            }
        }
        moduleOverrides = null;
        if (Module["arguments"]) arguments_ = Module["arguments"];
        if (Module["thisProgram"]) thisProgram = Module["thisProgram"];
        if (Module["quit"]) quit_ = Module["quit"];
        var wasmBinary;
        if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"];
        var noExitRuntime;
        if (Module["noExitRuntime"]) noExitRuntime = Module["noExitRuntime"];
        if (typeof WebAssembly !== "object") {
            abort("no native wasm support detected");
        }
        var wasmMemory;
        var wasmTable;
        var ABORT = false;
        var EXITSTATUS = 0;
        function assert(condition, text) {
            if (!condition) {
                abort("Assertion failed: " + text);
            }
        }
        function getCFunc(ident) {
            var func = Module["_" + ident];
            assert(func, "Cannot call unknown function " + ident + ", make sure it is exported");
            return func;
        }
        function ccall(ident, returnType, argTypes, args, opts) {
            var toC = {
                string: function(str) {
                    var ret = 0;
                    if (str !== null && str !== undefined && str !== 0) {
                        var len = (str.length << 2) + 1;
                        ret = stackAlloc(len);
                        stringToUTF8(str, ret, len);
                    }
                    return ret;
                },
                array: function(arr) {
                    var ret = stackAlloc(arr.length);
                    writeArrayToMemory(arr, ret);
                    return ret;
                }
            };
            function convertReturnValue(ret) {
                if (returnType === "string") return UTF8ToString(ret);
                if (returnType === "boolean") return Boolean(ret);
                return ret;
            }
            var func = getCFunc(ident);
            var cArgs = [];
            var stack = 0;
            if (args) {
                for (var i = 0; i < args.length; i++) {
                    var converter = toC[argTypes[i]];
                    if (converter) {
                        if (stack === 0) stack = stackSave();
                        cArgs[i] = converter(args[i]);
                    } else {
                        cArgs[i] = args[i];
                    }
                }
            }
            var ret = func.apply(null, cArgs);
            ret = convertReturnValue(ret);
            if (stack !== 0) stackRestore(stack);
            return ret;
        }
        var UTF8Decoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf8") : undefined;
        function UTF8ArrayToString(heap, idx, maxBytesToRead) {
            var endIdx = idx + maxBytesToRead;
            var endPtr = idx;
            while (heap[endPtr] && !(endPtr >= endIdx)) ++endPtr;
            if (endPtr - idx > 16 && heap.subarray && UTF8Decoder) {
                return UTF8Decoder.decode(heap.subarray(idx, endPtr));
            } else {
                var str = "";
                while (idx < endPtr) {
                    var u0 = heap[idx++];
                    if (!(u0 & 128)) {
                        str += String.fromCharCode(u0);
                        continue;
                    }
                    var u1 = heap[idx++] & 63;
                    if ((u0 & 224) == 192) {
                        str += String.fromCharCode((u0 & 31) << 6 | u1);
                        continue;
                    }
                    var u2 = heap[idx++] & 63;
                    if ((u0 & 240) == 224) {
                        u0 = (u0 & 15) << 12 | u1 << 6 | u2;
                    } else {
                        u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heap[idx++] & 63;
                    }
                    if (u0 < 65536) {
                        str += String.fromCharCode(u0);
                    } else {
                        var ch = u0 - 65536;
                        str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023);
                    }
                }
            }
            return str;
        }
        function UTF8ToString(ptr, maxBytesToRead) {
            return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : "";
        }
        function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) {
            if (!(maxBytesToWrite > 0)) return 0;
            var startIdx = outIdx;
            var endIdx = outIdx + maxBytesToWrite - 1;
            for (var i = 0; i < str.length; ++i) {
                var u = str.charCodeAt(i);
                if (u >= 55296 && u <= 57343) {
                    var u1 = str.charCodeAt(++i);
                    u = 65536 + ((u & 1023) << 10) | u1 & 1023;
                }
                if (u <= 127) {
                    if (outIdx >= endIdx) break;
                    heap[outIdx++] = u;
                } else if (u <= 2047) {
                    if (outIdx + 1 >= endIdx) break;
                    heap[outIdx++] = 192 | u >> 6;
                    heap[outIdx++] = 128 | u & 63;
                } else if (u <= 65535) {
                    if (outIdx + 2 >= endIdx) break;
                    heap[outIdx++] = 224 | u >> 12;
                    heap[outIdx++] = 128 | u >> 6 & 63;
                    heap[outIdx++] = 128 | u & 63;
                } else {
                    if (outIdx + 3 >= endIdx) break;
                    heap[outIdx++] = 240 | u >> 18;
                    heap[outIdx++] = 128 | u >> 12 & 63;
                    heap[outIdx++] = 128 | u >> 6 & 63;
                    heap[outIdx++] = 128 | u & 63;
                }
            }
            heap[outIdx] = 0;
            return outIdx - startIdx;
        }
        function stringToUTF8(str, outPtr, maxBytesToWrite) {
            return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite);
        }
        function writeArrayToMemory(array, buffer) {
            HEAP8.set(array, buffer);
        }
        var WASM_PAGE_SIZE = 65536;
        var buffer, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64;
        function updateGlobalBufferAndViews(buf) {
            buffer = buf;
            Module["HEAP8"] = HEAP8 = new Int8Array(buf);
            Module["HEAP16"] = HEAP16 = new Int16Array(buf);
            Module["HEAP32"] = HEAP32 = new Int32Array(buf);
            Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf);
            Module["HEAPU16"] = HEAPU16 = new Uint16Array(buf);
            Module["HEAPU32"] = HEAPU32 = new Uint32Array(buf);
            Module["HEAPF32"] = HEAPF32 = new Float32Array(buf);
            Module["HEAPF64"] = HEAPF64 = new Float64Array(buf);
        }
        var INITIAL_INITIAL_MEMORY = Module["INITIAL_MEMORY"] || 16777216;
        if (Module["wasmMemory"]) {
            wasmMemory = Module["wasmMemory"];
        } else {
            wasmMemory = new WebAssembly.Memory({
                initial: INITIAL_INITIAL_MEMORY / WASM_PAGE_SIZE,
                maximum: INITIAL_INITIAL_MEMORY / WASM_PAGE_SIZE
            });
        }
        if (wasmMemory) {
            buffer = wasmMemory.buffer;
        }
        INITIAL_INITIAL_MEMORY = buffer.byteLength;
        updateGlobalBufferAndViews(buffer);
        var __ATPRERUN__ = [];
        var __ATINIT__ = [];
        var __ATMAIN__ = [];
        var __ATPOSTRUN__ = [];
        var runtimeInitialized = false;
        function preRun() {
            if (Module["preRun"]) {
                if (typeof Module["preRun"] == "function") Module["preRun"] = [ Module["preRun"] ];
                while (Module["preRun"].length) {
                    addOnPreRun(Module["preRun"].shift());
                }
            }
            callRuntimeCallbacks(__ATPRERUN__);
        }
        function initRuntime() {
            runtimeInitialized = true;
            callRuntimeCallbacks(__ATINIT__);
        }
        function preMain() {
            callRuntimeCallbacks(__ATMAIN__);
        }
        function postRun() {
            if (Module["postRun"]) {
                if (typeof Module["postRun"] == "function") Module["postRun"] = [ Module["postRun"] ];
                while (Module["postRun"].length) {
                    addOnPostRun(Module["postRun"].shift());
                }
            }
            callRuntimeCallbacks(__ATPOSTRUN__);
        }
        function addOnPreRun(cb) {
            __ATPRERUN__.unshift(cb);
        }
        function addOnPostRun(cb) {
            __ATPOSTRUN__.unshift(cb);
        }
        var runDependencies = 0;
        var runDependencyWatcher = null;
        var dependenciesFulfilled = null;
        function addRunDependency(id) {
            runDependencies++;
            if (Module["monitorRunDependencies"]) {
                Module["monitorRunDependencies"](runDependencies);
            }
        }
        function removeRunDependency(id) {
            runDependencies--;
            if (Module["monitorRunDependencies"]) {
                Module["monitorRunDependencies"](runDependencies);
            }
            if (runDependencies == 0) {
                if (runDependencyWatcher !== null) {
                    clearInterval(runDependencyWatcher);
                    runDependencyWatcher = null;
                }
                if (dependenciesFulfilled) {
                    var callback = dependenciesFulfilled;
                    dependenciesFulfilled = null;
                    callback();
                }
            }
        }
        Module["preloadedImages"] = {};
        Module["preloadedAudios"] = {};
        function abort(what) {
            if (Module["onAbort"]) {
                Module["onAbort"](what);
            }
            what += "";
            err(what);
            ABORT = true;
            EXITSTATUS = 1;
            what = "abort(" + what + "). Build with -s ASSERTIONS=1 for more info.";
            var e = new WebAssembly.RuntimeError(what);
            throw e;
        }
        function hasPrefix(str, prefix) {
            return String.prototype.startsWith ? str.startsWith(prefix) : str.indexOf(prefix) === 0;
        }
        var dataURIPrefix = "data:application/octet-stream;base64,";
        function isDataURI(filename) {
            return hasPrefix(filename, dataURIPrefix);
        }
        var fileURIPrefix = "file://";
        function isFileURI(filename) {
            return hasPrefix(filename, fileURIPrefix);
        }
        var wasmBinaryFile = "crc32.wasm";
        if (!isDataURI(wasmBinaryFile)) {
            wasmBinaryFile = locateFile(wasmBinaryFile);
        }
        function getBinary() {
            try {
                if (wasmBinary) {
                    return new Uint8Array(wasmBinary);
                }
                if (readBinary) {
                    return readBinary(wasmBinaryFile);
                } else {
                    throw "both async and sync fetching of the wasm failed";
                }
            } catch (err) {
                abort(err);
            }
        }
        function getBinaryPromise() {
            if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) && typeof fetch === "function" && !isFileURI(wasmBinaryFile)) {
                return fetch(wasmBinaryFile, {
                    credentials: "same-origin"
                }).then((function(response) {
                    if (!response["ok"]) {
                        throw "failed to load wasm binary file at '" + wasmBinaryFile + "'";
                    }
                    return response["arrayBuffer"]();
                })).catch((function() {
                    return getBinary();
                }));
            }
            return Promise.resolve().then(getBinary);
        }
        function createWasm() {
            var info = {
                a: asmLibraryArg
            };
            function receiveInstance(instance, module) {
                var exports = instance.exports;
                Module["asm"] = exports;
                wasmTable = Module["asm"]["b"];
                removeRunDependency("wasm-instantiate");
            }
            addRunDependency("wasm-instantiate");
            function receiveInstantiatedSource(output) {
                receiveInstance(output["instance"]);
            }
            function instantiateArrayBuffer(receiver) {
                return getBinaryPromise().then((function(binary) {
                    return WebAssembly.instantiate(binary, info);
                })).then(receiver, (function(reason) {
                    err("failed to asynchronously prepare wasm: " + reason);
                    abort(reason);
                }));
            }
            function instantiateAsync() {
                if (!wasmBinary && typeof WebAssembly.instantiateStreaming === "function" && !isDataURI(wasmBinaryFile) && !isFileURI(wasmBinaryFile) && typeof fetch === "function") {
                    fetch(wasmBinaryFile, {
                        credentials: "same-origin"
                    }).then((function(response) {
                        var result = WebAssembly.instantiateStreaming(response, info);
                        return result.then(receiveInstantiatedSource, (function(reason) {
                            err("wasm streaming compile failed: " + reason);
                            err("falling back to ArrayBuffer instantiation");
                            return instantiateArrayBuffer(receiveInstantiatedSource);
                        }));
                    }));
                } else {
                    return instantiateArrayBuffer(receiveInstantiatedSource);
                }
            }
            if (Module["instantiateWasm"]) {
                try {
                    var exports = Module["instantiateWasm"](info, receiveInstance);
                    return exports;
                } catch (e) {
                    err("Module.instantiateWasm callback failed with error: " + e);
                    return false;
                }
            }
            instantiateAsync();
            return {};
        }
        function callRuntimeCallbacks(callbacks) {
            while (callbacks.length > 0) {
                var callback = callbacks.shift();
                if (typeof callback == "function") {
                    callback(Module);
                    continue;
                }
                var func = callback.func;
                if (typeof func === "number") {
                    if (callback.arg === undefined) {
                        wasmTable.get(func)();
                    } else {
                        wasmTable.get(func)(callback.arg);
                    }
                } else {
                    func(callback.arg === undefined ? null : callback.arg);
                }
            }
        }
        __ATINIT__.push({
            func: function() {
                ___wasm_call_ctors();
            }
        });
        var asmLibraryArg = {
            a: wasmMemory
        };
        var asm = createWasm();
        var ___wasm_call_ctors = Module["___wasm_call_ctors"] = function() {
            return (___wasm_call_ctors = Module["___wasm_call_ctors"] = Module["asm"]["c"]).apply(null, arguments);
        };
        var _crc32_combine = Module["_crc32_combine"] = function() {
            return (_crc32_combine = Module["_crc32_combine"] = Module["asm"]["d"]).apply(null, arguments);
        };
        var stackSave = Module["stackSave"] = function() {
            return (stackSave = Module["stackSave"] = Module["asm"]["e"]).apply(null, arguments);
        };
        var stackRestore = Module["stackRestore"] = function() {
            return (stackRestore = Module["stackRestore"] = Module["asm"]["f"]).apply(null, arguments);
        };
        var stackAlloc = Module["stackAlloc"] = function() {
            return (stackAlloc = Module["stackAlloc"] = Module["asm"]["g"]).apply(null, arguments);
        };
        Module["ccall"] = ccall;
        var calledRun;
        function ExitStatus(status) {
            this.name = "ExitStatus";
            this.message = "Program terminated with exit(" + status + ")";
            this.status = status;
        }
        dependenciesFulfilled = function runCaller() {
            if (!calledRun) run();
            if (!calledRun) dependenciesFulfilled = runCaller;
        };
        function run(args) {
            args = args || arguments_;
            if (runDependencies > 0) {
                return;
            }
            preRun();
            if (runDependencies > 0) return;
            function doRun() {
                if (calledRun) return;
                calledRun = true;
                Module["calledRun"] = true;
                if (ABORT) return;
                initRuntime();
                preMain();
                if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"]();
                postRun();
            }
            if (Module["setStatus"]) {
                Module["setStatus"]("Running...");
                setTimeout((function() {
                    setTimeout((function() {
                        Module["setStatus"]("");
                    }), 1);
                    doRun();
                }), 1);
            } else {
                doRun();
            }
        }
        Module["run"] = run;
        if (Module["preInit"]) {
            if (typeof Module["preInit"] == "function") Module["preInit"] = [ Module["preInit"] ];
            while (Module["preInit"].length > 0) {
                Module["preInit"].pop()();
            }
        }
        noExitRuntime = true;
        run();
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        module.exports = {
            CRC32Stream: __webpack_require__(256),
            DeflateCRC32Stream: __webpack_require__(277)
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        const {Transform} = __webpack_require__(257);
        const crc32 = __webpack_require__(276);
        class CRC32Stream extends Transform {
            constructor(options) {
                super(options);
                this.checksum = Buffer.allocUnsafe(4);
                this.checksum.writeInt32BE(0, 0);
                this.rawSize = 0;
            }
            _transform(chunk, encoding, callback) {
                if (chunk) {
                    this.checksum = crc32.buf(chunk, this.checksum) >>> 0;
                    this.rawSize += chunk.length;
                }
                callback(null, chunk);
            }
            digest(encoding) {
                const checksum = Buffer.allocUnsafe(4);
                checksum.writeUInt32BE(this.checksum >>> 0, 0);
                return encoding ? checksum.toString(encoding) : checksum;
            }
            hex() {
                return this.digest("hex").toUpperCase();
            }
            size() {
                return this.rawSize;
            }
        }
        module.exports = CRC32Stream;
    }, (module, exports, __webpack_require__) => {
        exports = module.exports = __webpack_require__(258);
        exports.Stream = exports;
        exports.Readable = exports;
        exports.Writable = __webpack_require__(266);
        exports.Duplex = __webpack_require__(265);
        exports.Transform = __webpack_require__(273);
        exports.PassThrough = __webpack_require__(274);
        exports.finished = __webpack_require__(271);
        exports.pipeline = __webpack_require__(275);
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        module.exports = Readable;
        var Duplex;
        Readable.ReadableState = ReadableState;
        var EE = __webpack_require__(26).EventEmitter;
        var EElistenerCount = function EElistenerCount(emitter, type) {
            return emitter.listeners(type).length;
        };
        var Stream = __webpack_require__(259);
        var Buffer = __webpack_require__(79).Buffer;
        var OurUint8Array = global.Uint8Array || function() {};
        function _uint8ArrayToBuffer(chunk) {
            return Buffer.from(chunk);
        }
        function _isUint8Array(obj) {
            return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
        }
        var debugUtil = __webpack_require__(58);
        var debug;
        if (debugUtil && debugUtil.debuglog) {
            debug = debugUtil.debuglog("stream");
        } else {
            debug = function debug() {};
        }
        var BufferList = __webpack_require__(260);
        var destroyImpl = __webpack_require__(261);
        var _require = __webpack_require__(262), getHighWaterMark = _require.getHighWaterMark;
        var _require$codes = __webpack_require__(263).q, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;
        var StringDecoder;
        var createReadableStreamAsyncIterator;
        var from;
        __webpack_require__(264)(Readable, Stream);
        var errorOrDestroy = destroyImpl.errorOrDestroy;
        var kProxyEvents = [ "error", "close", "destroy", "pause", "resume" ];
        function prependListener(emitter, event, fn) {
            if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn);
            if (!emitter._events || !emitter._events[event]) emitter.on(event, fn); else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn); else emitter._events[event] = [ fn, emitter._events[event] ];
        }
        function ReadableState(options, stream, isDuplex) {
            Duplex = Duplex || __webpack_require__(265);
            options = options || {};
            if (typeof isDuplex !== "boolean") isDuplex = stream instanceof Duplex;
            this.objectMode = !!options.objectMode;
            if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
            this.highWaterMark = getHighWaterMark(this, options, "readableHighWaterMark", isDuplex);
            this.buffer = new BufferList;
            this.length = 0;
            this.pipes = null;
            this.pipesCount = 0;
            this.flowing = null;
            this.ended = false;
            this.endEmitted = false;
            this.reading = false;
            this.sync = true;
            this.needReadable = false;
            this.emittedReadable = false;
            this.readableListening = false;
            this.resumeScheduled = false;
            this.paused = true;
            this.emitClose = options.emitClose !== false;
            this.autoDestroy = !!options.autoDestroy;
            this.destroyed = false;
            this.defaultEncoding = options.defaultEncoding || "utf8";
            this.awaitDrain = 0;
            this.readingMore = false;
            this.decoder = null;
            this.encoding = null;
            if (options.encoding) {
                if (!StringDecoder) StringDecoder = __webpack_require__(268).s;
                this.decoder = new StringDecoder(options.encoding);
                this.encoding = options.encoding;
            }
        }
        function Readable(options) {
            Duplex = Duplex || __webpack_require__(265);
            if (!(this instanceof Readable)) return new Readable(options);
            var isDuplex = this instanceof Duplex;
            this._readableState = new ReadableState(options, this, isDuplex);
            this.readable = true;
            if (options) {
                if (typeof options.read === "function") this._read = options.read;
                if (typeof options.destroy === "function") this._destroy = options.destroy;
            }
            Stream.call(this);
        }
        Object.defineProperty(Readable.prototype, "destroyed", {
            enumerable: false,
            get: function get() {
                if (this._readableState === undefined) {
                    return false;
                }
                return this._readableState.destroyed;
            },
            set: function set(value) {
                if (!this._readableState) {
                    return;
                }
                this._readableState.destroyed = value;
            }
        });
        Readable.prototype.destroy = destroyImpl.destroy;
        Readable.prototype._undestroy = destroyImpl.undestroy;
        Readable.prototype._destroy = function(err, cb) {
            cb(err);
        };
        Readable.prototype.push = function(chunk, encoding) {
            var state = this._readableState;
            var skipChunkCheck;
            if (!state.objectMode) {
                if (typeof chunk === "string") {
                    encoding = encoding || state.defaultEncoding;
                    if (encoding !== state.encoding) {
                        chunk = Buffer.from(chunk, encoding);
                        encoding = "";
                    }
                    skipChunkCheck = true;
                }
            } else {
                skipChunkCheck = true;
            }
            return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
        };
        Readable.prototype.unshift = function(chunk) {
            return readableAddChunk(this, chunk, null, true, false);
        };
        function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
            debug("readableAddChunk", chunk);
            var state = stream._readableState;
            if (chunk === null) {
                state.reading = false;
                onEofChunk(stream, state);
            } else {
                var er;
                if (!skipChunkCheck) er = chunkInvalid(state, chunk);
                if (er) {
                    errorOrDestroy(stream, er);
                } else if (state.objectMode || chunk && chunk.length > 0) {
                    if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
                        chunk = _uint8ArrayToBuffer(chunk);
                    }
                    if (addToFront) {
                        if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT); else addChunk(stream, state, chunk, true);
                    } else if (state.ended) {
                        errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF);
                    } else if (state.destroyed) {
                        return false;
                    } else {
                        state.reading = false;
                        if (state.decoder && !encoding) {
                            chunk = state.decoder.write(chunk);
                            if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false); else maybeReadMore(stream, state);
                        } else {
                            addChunk(stream, state, chunk, false);
                        }
                    }
                } else if (!addToFront) {
                    state.reading = false;
                    maybeReadMore(stream, state);
                }
            }
            return !state.ended && (state.length < state.highWaterMark || state.length === 0);
        }
        function addChunk(stream, state, chunk, addToFront) {
            if (state.flowing && state.length === 0 && !state.sync) {
                state.awaitDrain = 0;
                stream.emit("data", chunk);
            } else {
                state.length += state.objectMode ? 1 : chunk.length;
                if (addToFront) state.buffer.unshift(chunk); else state.buffer.push(chunk);
                if (state.needReadable) emitReadable(stream);
            }
            maybeReadMore(stream, state);
        }
        function chunkInvalid(state, chunk) {
            var er;
            if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== undefined && !state.objectMode) {
                er = new ERR_INVALID_ARG_TYPE("chunk", [ "string", "Buffer", "Uint8Array" ], chunk);
            }
            return er;
        }
        Readable.prototype.isPaused = function() {
            return this._readableState.flowing === false;
        };
        Readable.prototype.setEncoding = function(enc) {
            if (!StringDecoder) StringDecoder = __webpack_require__(268).s;
            var decoder = new StringDecoder(enc);
            this._readableState.decoder = decoder;
            this._readableState.encoding = this._readableState.decoder.encoding;
            var p = this._readableState.buffer.head;
            var content = "";
            while (p !== null) {
                content += decoder.write(p.data);
                p = p.next;
            }
            this._readableState.buffer.clear();
            if (content !== "") this._readableState.buffer.push(content);
            this._readableState.length = content.length;
            return this;
        };
        var MAX_HWM = 1073741824;
        function computeNewHighWaterMark(n) {
            if (n >= MAX_HWM) {
                n = MAX_HWM;
            } else {
                n--;
                n |= n >>> 1;
                n |= n >>> 2;
                n |= n >>> 4;
                n |= n >>> 8;
                n |= n >>> 16;
                n++;
            }
            return n;
        }
        function howMuchToRead(n, state) {
            if (n <= 0 || state.length === 0 && state.ended) return 0;
            if (state.objectMode) return 1;
            if (n !== n) {
                if (state.flowing && state.length) return state.buffer.head.data.length; else return state.length;
            }
            if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
            if (n <= state.length) return n;
            if (!state.ended) {
                state.needReadable = true;
                return 0;
            }
            return state.length;
        }
        Readable.prototype.read = function(n) {
            debug("read", n);
            n = parseInt(n, 10);
            var state = this._readableState;
            var nOrig = n;
            if (n !== 0) state.emittedReadable = false;
            if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {
                debug("read: emitReadable", state.length, state.ended);
                if (state.length === 0 && state.ended) endReadable(this); else emitReadable(this);
                return null;
            }
            n = howMuchToRead(n, state);
            if (n === 0 && state.ended) {
                if (state.length === 0) endReadable(this);
                return null;
            }
            var doRead = state.needReadable;
            debug("need readable", doRead);
            if (state.length === 0 || state.length - n < state.highWaterMark) {
                doRead = true;
                debug("length less than watermark", doRead);
            }
            if (state.ended || state.reading) {
                doRead = false;
                debug("reading or ended", doRead);
            } else if (doRead) {
                debug("do read");
                state.reading = true;
                state.sync = true;
                if (state.length === 0) state.needReadable = true;
                this._read(state.highWaterMark);
                state.sync = false;
                if (!state.reading) n = howMuchToRead(nOrig, state);
            }
            var ret;
            if (n > 0) ret = fromList(n, state); else ret = null;
            if (ret === null) {
                state.needReadable = state.length <= state.highWaterMark;
                n = 0;
            } else {
                state.length -= n;
                state.awaitDrain = 0;
            }
            if (state.length === 0) {
                if (!state.ended) state.needReadable = true;
                if (nOrig !== n && state.ended) endReadable(this);
            }
            if (ret !== null) this.emit("data", ret);
            return ret;
        };
        function onEofChunk(stream, state) {
            debug("onEofChunk");
            if (state.ended) return;
            if (state.decoder) {
                var chunk = state.decoder.end();
                if (chunk && chunk.length) {
                    state.buffer.push(chunk);
                    state.length += state.objectMode ? 1 : chunk.length;
                }
            }
            state.ended = true;
            if (state.sync) {
                emitReadable(stream);
            } else {
                state.needReadable = false;
                if (!state.emittedReadable) {
                    state.emittedReadable = true;
                    emitReadable_(stream);
                }
            }
        }
        function emitReadable(stream) {
            var state = stream._readableState;
            debug("emitReadable", state.needReadable, state.emittedReadable);
            state.needReadable = false;
            if (!state.emittedReadable) {
                debug("emitReadable", state.flowing);
                state.emittedReadable = true;
                process.nextTick(emitReadable_, stream);
            }
        }
        function emitReadable_(stream) {
            var state = stream._readableState;
            debug("emitReadable_", state.destroyed, state.length, state.ended);
            if (!state.destroyed && (state.length || state.ended)) {
                stream.emit("readable");
                state.emittedReadable = false;
            }
            state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;
            flow(stream);
        }
        function maybeReadMore(stream, state) {
            if (!state.readingMore) {
                state.readingMore = true;
                process.nextTick(maybeReadMore_, stream, state);
            }
        }
        function maybeReadMore_(stream, state) {
            while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) {
                var len = state.length;
                debug("maybeReadMore read 0");
                stream.read(0);
                if (len === state.length) break;
            }
            state.readingMore = false;
        }
        Readable.prototype._read = function(n) {
            errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED("_read()"));
        };
        Readable.prototype.pipe = function(dest, pipeOpts) {
            var src = this;
            var state = this._readableState;
            switch (state.pipesCount) {
              case 0:
                state.pipes = dest;
                break;

              case 1:
                state.pipes = [ state.pipes, dest ];
                break;

              default:
                state.pipes.push(dest);
                break;
            }
            state.pipesCount += 1;
            debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts);
            var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
            var endFn = doEnd ? onend : unpipe;
            if (state.endEmitted) process.nextTick(endFn); else src.once("end", endFn);
            dest.on("unpipe", onunpipe);
            function onunpipe(readable, unpipeInfo) {
                debug("onunpipe");
                if (readable === src) {
                    if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
                        unpipeInfo.hasUnpiped = true;
                        cleanup();
                    }
                }
            }
            function onend() {
                debug("onend");
                dest.end();
            }
            var ondrain = pipeOnDrain(src);
            dest.on("drain", ondrain);
            var cleanedUp = false;
            function cleanup() {
                debug("cleanup");
                dest.removeListener("close", onclose);
                dest.removeListener("finish", onfinish);
                dest.removeListener("drain", ondrain);
                dest.removeListener("error", onerror);
                dest.removeListener("unpipe", onunpipe);
                src.removeListener("end", onend);
                src.removeListener("end", unpipe);
                src.removeListener("data", ondata);
                cleanedUp = true;
                if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
            }
            src.on("data", ondata);
            function ondata(chunk) {
                debug("ondata");
                var ret = dest.write(chunk);
                debug("dest.write", ret);
                if (ret === false) {
                    if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
                        debug("false write response, pause", state.awaitDrain);
                        state.awaitDrain++;
                    }
                    src.pause();
                }
            }
            function onerror(er) {
                debug("onerror", er);
                unpipe();
                dest.removeListener("error", onerror);
                if (EElistenerCount(dest, "error") === 0) errorOrDestroy(dest, er);
            }
            prependListener(dest, "error", onerror);
            function onclose() {
                dest.removeListener("finish", onfinish);
                unpipe();
            }
            dest.once("close", onclose);
            function onfinish() {
                debug("onfinish");
                dest.removeListener("close", onclose);
                unpipe();
            }
            dest.once("finish", onfinish);
            function unpipe() {
                debug("unpipe");
                src.unpipe(dest);
            }
            dest.emit("pipe", src);
            if (!state.flowing) {
                debug("pipe resume");
                src.resume();
            }
            return dest;
        };
        function pipeOnDrain(src) {
            return function pipeOnDrainFunctionResult() {
                var state = src._readableState;
                debug("pipeOnDrain", state.awaitDrain);
                if (state.awaitDrain) state.awaitDrain--;
                if (state.awaitDrain === 0 && EElistenerCount(src, "data")) {
                    state.flowing = true;
                    flow(src);
                }
            };
        }
        Readable.prototype.unpipe = function(dest) {
            var state = this._readableState;
            var unpipeInfo = {
                hasUnpiped: false
            };
            if (state.pipesCount === 0) return this;
            if (state.pipesCount === 1) {
                if (dest && dest !== state.pipes) return this;
                if (!dest) dest = state.pipes;
                state.pipes = null;
                state.pipesCount = 0;
                state.flowing = false;
                if (dest) dest.emit("unpipe", this, unpipeInfo);
                return this;
            }
            if (!dest) {
                var dests = state.pipes;
                var len = state.pipesCount;
                state.pipes = null;
                state.pipesCount = 0;
                state.flowing = false;
                for (var i = 0; i < len; i++) {
                    dests[i].emit("unpipe", this, {
                        hasUnpiped: false
                    });
                }
                return this;
            }
            var index = indexOf(state.pipes, dest);
            if (index === -1) return this;
            state.pipes.splice(index, 1);
            state.pipesCount -= 1;
            if (state.pipesCount === 1) state.pipes = state.pipes[0];
            dest.emit("unpipe", this, unpipeInfo);
            return this;
        };
        Readable.prototype.on = function(ev, fn) {
            var res = Stream.prototype.on.call(this, ev, fn);
            var state = this._readableState;
            if (ev === "data") {
                state.readableListening = this.listenerCount("readable") > 0;
                if (state.flowing !== false) this.resume();
            } else if (ev === "readable") {
                if (!state.endEmitted && !state.readableListening) {
                    state.readableListening = state.needReadable = true;
                    state.flowing = false;
                    state.emittedReadable = false;
                    debug("on readable", state.length, state.reading);
                    if (state.length) {
                        emitReadable(this);
                    } else if (!state.reading) {
                        process.nextTick(nReadingNextTick, this);
                    }
                }
            }
            return res;
        };
        Readable.prototype.addListener = Readable.prototype.on;
        Readable.prototype.removeListener = function(ev, fn) {
            var res = Stream.prototype.removeListener.call(this, ev, fn);
            if (ev === "readable") {
                process.nextTick(updateReadableListening, this);
            }
            return res;
        };
        Readable.prototype.removeAllListeners = function(ev) {
            var res = Stream.prototype.removeAllListeners.apply(this, arguments);
            if (ev === "readable" || ev === undefined) {
                process.nextTick(updateReadableListening, this);
            }
            return res;
        };
        function updateReadableListening(self) {
            var state = self._readableState;
            state.readableListening = self.listenerCount("readable") > 0;
            if (state.resumeScheduled && !state.paused) {
                state.flowing = true;
            } else if (self.listenerCount("data") > 0) {
                self.resume();
            }
        }
        function nReadingNextTick(self) {
            debug("readable nexttick read 0");
            self.read(0);
        }
        Readable.prototype.resume = function() {
            var state = this._readableState;
            if (!state.flowing) {
                debug("resume");
                state.flowing = !state.readableListening;
                resume(this, state);
            }
            state.paused = false;
            return this;
        };
        function resume(stream, state) {
            if (!state.resumeScheduled) {
                state.resumeScheduled = true;
                process.nextTick(resume_, stream, state);
            }
        }
        function resume_(stream, state) {
            debug("resume", state.reading);
            if (!state.reading) {
                stream.read(0);
            }
            state.resumeScheduled = false;
            stream.emit("resume");
            flow(stream);
            if (state.flowing && !state.reading) stream.read(0);
        }
        Readable.prototype.pause = function() {
            debug("call pause flowing=%j", this._readableState.flowing);
            if (this._readableState.flowing !== false) {
                debug("pause");
                this._readableState.flowing = false;
                this.emit("pause");
            }
            this._readableState.paused = true;
            return this;
        };
        function flow(stream) {
            var state = stream._readableState;
            debug("flow", state.flowing);
            while (state.flowing && stream.read() !== null) {
            }
        }
        Readable.prototype.wrap = function(stream) {
            var _this = this;
            var state = this._readableState;
            var paused = false;
            stream.on("end", (function() {
                debug("wrapped end");
                if (state.decoder && !state.ended) {
                    var chunk = state.decoder.end();
                    if (chunk && chunk.length) _this.push(chunk);
                }
                _this.push(null);
            }));
            stream.on("data", (function(chunk) {
                debug("wrapped data");
                if (state.decoder) chunk = state.decoder.write(chunk);
                if (state.objectMode && (chunk === null || chunk === undefined)) return; else if (!state.objectMode && (!chunk || !chunk.length)) return;
                var ret = _this.push(chunk);
                if (!ret) {
                    paused = true;
                    stream.pause();
                }
            }));
            for (var i in stream) {
                if (this[i] === undefined && typeof stream[i] === "function") {
                    this[i] = function methodWrap(method) {
                        return function methodWrapReturnFunction() {
                            return stream[method].apply(stream, arguments);
                        };
                    }(i);
                }
            }
            for (var n = 0; n < kProxyEvents.length; n++) {
                stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
            }
            this._read = function(n) {
                debug("wrapped _read", n);
                if (paused) {
                    paused = false;
                    stream.resume();
                }
            };
            return this;
        };
        if (typeof Symbol === "function") {
            Readable.prototype[Symbol.asyncIterator] = function() {
                if (createReadableStreamAsyncIterator === undefined) {
                    createReadableStreamAsyncIterator = __webpack_require__(270);
                }
                return createReadableStreamAsyncIterator(this);
            };
        }
        Object.defineProperty(Readable.prototype, "readableHighWaterMark", {
            enumerable: false,
            get: function get() {
                return this._readableState.highWaterMark;
            }
        });
        Object.defineProperty(Readable.prototype, "readableBuffer", {
            enumerable: false,
            get: function get() {
                return this._readableState && this._readableState.buffer;
            }
        });
        Object.defineProperty(Readable.prototype, "readableFlowing", {
            enumerable: false,
            get: function get() {
                return this._readableState.flowing;
            },
            set: function set(state) {
                if (this._readableState) {
                    this._readableState.flowing = state;
                }
            }
        });
        Readable._fromList = fromList;
        Object.defineProperty(Readable.prototype, "readableLength", {
            enumerable: false,
            get: function get() {
                return this._readableState.length;
            }
        });
        function fromList(n, state) {
            if (state.length === 0) return null;
            var ret;
            if (state.objectMode) ret = state.buffer.shift(); else if (!n || n >= state.length) {
                if (state.decoder) ret = state.buffer.join(""); else if (state.buffer.length === 1) ret = state.buffer.first(); else ret = state.buffer.concat(state.length);
                state.buffer.clear();
            } else {
                ret = state.buffer.consume(n, state.decoder);
            }
            return ret;
        }
        function endReadable(stream) {
            var state = stream._readableState;
            debug("endReadable", state.endEmitted);
            if (!state.endEmitted) {
                state.ended = true;
                process.nextTick(endReadableNT, state, stream);
            }
        }
        function endReadableNT(state, stream) {
            debug("endReadableNT", state.endEmitted, state.length);
            if (!state.endEmitted && state.length === 0) {
                state.endEmitted = true;
                stream.readable = false;
                stream.emit("end");
                if (state.autoDestroy) {
                    var wState = stream._writableState;
                    if (!wState || wState.autoDestroy && wState.finished) {
                        stream.destroy();
                    }
                }
            }
        }
        if (typeof Symbol === "function") {
            Readable.from = function(iterable, opts) {
                if (from === undefined) {
                    from = __webpack_require__(272);
                }
                return from(Readable, iterable, opts);
            };
        }
        function indexOf(xs, x) {
            for (var i = 0, l = xs.length; i < l; i++) {
                if (xs[i] === x) return i;
            }
            return -1;
        }
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        module.exports = __webpack_require__(26).EventEmitter;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        function ownKeys(object, enumerableOnly) {
            var keys = Object.keys(object);
            if (Object.getOwnPropertySymbols) {
                var symbols = Object.getOwnPropertySymbols(object);
                if (enumerableOnly) symbols = symbols.filter((function(sym) {
                    return Object.getOwnPropertyDescriptor(object, sym).enumerable;
                }));
                keys.push.apply(keys, symbols);
            }
            return keys;
        }
        function _objectSpread(target) {
            for (var i = 1; i < arguments.length; i++) {
                var source = arguments[i] != null ? arguments[i] : {};
                if (i % 2) {
                    ownKeys(Object(source), true).forEach((function(key) {
                        _defineProperty(target, key, source[key]);
                    }));
                } else if (Object.getOwnPropertyDescriptors) {
                    Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
                } else {
                    ownKeys(Object(source)).forEach((function(key) {
                        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
                    }));
                }
            }
            return target;
        }
        function _defineProperty(obj, key, value) {
            if (key in obj) {
                Object.defineProperty(obj, key, {
                    value,
                    enumerable: true,
                    configurable: true,
                    writable: true
                });
            } else {
                obj[key] = value;
            }
            return obj;
        }
        function _classCallCheck(instance, Constructor) {
            if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
            }
        }
        function _defineProperties(target, props) {
            for (var i = 0; i < props.length; i++) {
                var descriptor = props[i];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor) descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
            }
        }
        function _createClass(Constructor, protoProps, staticProps) {
            if (protoProps) _defineProperties(Constructor.prototype, protoProps);
            if (staticProps) _defineProperties(Constructor, staticProps);
            return Constructor;
        }
        var _require = __webpack_require__(79), Buffer = _require.Buffer;
        var _require2 = __webpack_require__(58), inspect = _require2.inspect;
        var custom = inspect && inspect.custom || "inspect";
        function copyBuffer(src, target, offset) {
            Buffer.prototype.copy.call(src, target, offset);
        }
        module.exports = function() {
            function BufferList() {
                _classCallCheck(this, BufferList);
                this.head = null;
                this.tail = null;
                this.length = 0;
            }
            _createClass(BufferList, [ {
                key: "push",
                value: function push(v) {
                    var entry = {
                        data: v,
                        next: null
                    };
                    if (this.length > 0) this.tail.next = entry; else this.head = entry;
                    this.tail = entry;
                    ++this.length;
                }
            }, {
                key: "unshift",
                value: function unshift(v) {
                    var entry = {
                        data: v,
                        next: this.head
                    };
                    if (this.length === 0) this.tail = entry;
                    this.head = entry;
                    ++this.length;
                }
            }, {
                key: "shift",
                value: function shift() {
                    if (this.length === 0) return;
                    var ret = this.head.data;
                    if (this.length === 1) this.head = this.tail = null; else this.head = this.head.next;
                    --this.length;
                    return ret;
                }
            }, {
                key: "clear",
                value: function clear() {
                    this.head = this.tail = null;
                    this.length = 0;
                }
            }, {
                key: "join",
                value: function join(s) {
                    if (this.length === 0) return "";
                    var p = this.head;
                    var ret = "" + p.data;
                    while (p = p.next) {
                        ret += s + p.data;
                    }
                    return ret;
                }
            }, {
                key: "concat",
                value: function concat(n) {
                    if (this.length === 0) return Buffer.alloc(0);
                    var ret = Buffer.allocUnsafe(n >>> 0);
                    var p = this.head;
                    var i = 0;
                    while (p) {
                        copyBuffer(p.data, ret, i);
                        i += p.data.length;
                        p = p.next;
                    }
                    return ret;
                }
            }, {
                key: "consume",
                value: function consume(n, hasStrings) {
                    var ret;
                    if (n < this.head.data.length) {
                        ret = this.head.data.slice(0, n);
                        this.head.data = this.head.data.slice(n);
                    } else if (n === this.head.data.length) {
                        ret = this.shift();
                    } else {
                        ret = hasStrings ? this._getString(n) : this._getBuffer(n);
                    }
                    return ret;
                }
            }, {
                key: "first",
                value: function first() {
                    return this.head.data;
                }
            }, {
                key: "_getString",
                value: function _getString(n) {
                    var p = this.head;
                    var c = 1;
                    var ret = p.data;
                    n -= ret.length;
                    while (p = p.next) {
                        var str = p.data;
                        var nb = n > str.length ? str.length : n;
                        if (nb === str.length) ret += str; else ret += str.slice(0, n);
                        n -= nb;
                        if (n === 0) {
                            if (nb === str.length) {
                                ++c;
                                if (p.next) this.head = p.next; else this.head = this.tail = null;
                            } else {
                                this.head = p;
                                p.data = str.slice(nb);
                            }
                            break;
                        }
                        ++c;
                    }
                    this.length -= c;
                    return ret;
                }
            }, {
                key: "_getBuffer",
                value: function _getBuffer(n) {
                    var ret = Buffer.allocUnsafe(n);
                    var p = this.head;
                    var c = 1;
                    p.data.copy(ret);
                    n -= p.data.length;
                    while (p = p.next) {
                        var buf = p.data;
                        var nb = n > buf.length ? buf.length : n;
                        buf.copy(ret, ret.length - n, 0, nb);
                        n -= nb;
                        if (n === 0) {
                            if (nb === buf.length) {
                                ++c;
                                if (p.next) this.head = p.next; else this.head = this.tail = null;
                            } else {
                                this.head = p;
                                p.data = buf.slice(nb);
                            }
                            break;
                        }
                        ++c;
                    }
                    this.length -= c;
                    return ret;
                }
            }, {
                key: custom,
                value: function value(_, options) {
                    return inspect(this, _objectSpread({}, options, {
                        depth: 0,
                        customInspect: false
                    }));
                }
            } ]);
            return BufferList;
        }();
    }, module => {
        "use strict";
        function destroy(err, cb) {
            var _this = this;
            var readableDestroyed = this._readableState && this._readableState.destroyed;
            var writableDestroyed = this._writableState && this._writableState.destroyed;
            if (readableDestroyed || writableDestroyed) {
                if (cb) {
                    cb(err);
                } else if (err) {
                    if (!this._writableState) {
                        process.nextTick(emitErrorNT, this, err);
                    } else if (!this._writableState.errorEmitted) {
                        this._writableState.errorEmitted = true;
                        process.nextTick(emitErrorNT, this, err);
                    }
                }
                return this;
            }
            if (this._readableState) {
                this._readableState.destroyed = true;
            }
            if (this._writableState) {
                this._writableState.destroyed = true;
            }
            this._destroy(err || null, (function(err) {
                if (!cb && err) {
                    if (!_this._writableState) {
                        process.nextTick(emitErrorAndCloseNT, _this, err);
                    } else if (!_this._writableState.errorEmitted) {
                        _this._writableState.errorEmitted = true;
                        process.nextTick(emitErrorAndCloseNT, _this, err);
                    } else {
                        process.nextTick(emitCloseNT, _this);
                    }
                } else if (cb) {
                    process.nextTick(emitCloseNT, _this);
                    cb(err);
                } else {
                    process.nextTick(emitCloseNT, _this);
                }
            }));
            return this;
        }
        function emitErrorAndCloseNT(self, err) {
            emitErrorNT(self, err);
            emitCloseNT(self);
        }
        function emitCloseNT(self) {
            if (self._writableState && !self._writableState.emitClose) return;
            if (self._readableState && !self._readableState.emitClose) return;
            self.emit("close");
        }
        function undestroy() {
            if (this._readableState) {
                this._readableState.destroyed = false;
                this._readableState.reading = false;
                this._readableState.ended = false;
                this._readableState.endEmitted = false;
            }
            if (this._writableState) {
                this._writableState.destroyed = false;
                this._writableState.ended = false;
                this._writableState.ending = false;
                this._writableState.finalCalled = false;
                this._writableState.prefinished = false;
                this._writableState.finished = false;
                this._writableState.errorEmitted = false;
            }
        }
        function emitErrorNT(self, err) {
            self.emit("error", err);
        }
        function errorOrDestroy(stream, err) {
            var rState = stream._readableState;
            var wState = stream._writableState;
            if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err); else stream.emit("error", err);
        }
        module.exports = {
            destroy,
            undestroy,
            errorOrDestroy
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var ERR_INVALID_OPT_VALUE = __webpack_require__(263).q.ERR_INVALID_OPT_VALUE;
        function highWaterMarkFrom(options, isDuplex, duplexKey) {
            return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;
        }
        function getHighWaterMark(state, options, duplexKey, isDuplex) {
            var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
            if (hwm != null) {
                if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
                    var name = isDuplex ? duplexKey : "highWaterMark";
                    throw new ERR_INVALID_OPT_VALUE(name, hwm);
                }
                return Math.floor(hwm);
            }
            return state.objectMode ? 16 : 16 * 1024;
        }
        module.exports = {
            getHighWaterMark
        };
    }, module => {
        "use strict";
        function _inheritsLoose(subClass, superClass) {
            subClass.prototype = Object.create(superClass.prototype);
            subClass.prototype.constructor = subClass;
            subClass.__proto__ = superClass;
        }
        var codes = {};
        function createErrorType(code, message, Base) {
            if (!Base) {
                Base = Error;
            }
            function getMessage(arg1, arg2, arg3) {
                if (typeof message === "string") {
                    return message;
                } else {
                    return message(arg1, arg2, arg3);
                }
            }
            var NodeError = function(_Base) {
                _inheritsLoose(NodeError, _Base);
                function NodeError(arg1, arg2, arg3) {
                    return _Base.call(this, getMessage(arg1, arg2, arg3)) || this;
                }
                return NodeError;
            }(Base);
            NodeError.prototype.name = Base.name;
            NodeError.prototype.code = code;
            codes[code] = NodeError;
        }
        function oneOf(expected, thing) {
            if (Array.isArray(expected)) {
                var len = expected.length;
                expected = expected.map((function(i) {
                    return String(i);
                }));
                if (len > 2) {
                    return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(", "), ", or ") + expected[len - 1];
                } else if (len === 2) {
                    return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]);
                } else {
                    return "of ".concat(thing, " ").concat(expected[0]);
                }
            } else {
                return "of ".concat(thing, " ").concat(String(expected));
            }
        }
        function startsWith(str, search, pos) {
            return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
        }
        function endsWith(str, search, this_len) {
            if (this_len === undefined || this_len > str.length) {
                this_len = str.length;
            }
            return str.substring(this_len - search.length, this_len) === search;
        }
        function includes(str, search, start) {
            if (typeof start !== "number") {
                start = 0;
            }
            if (start + search.length > str.length) {
                return false;
            } else {
                return str.indexOf(search, start) !== -1;
            }
        }
        createErrorType("ERR_INVALID_OPT_VALUE", (function(name, value) {
            return 'The value "' + value + '" is invalid for option "' + name + '"';
        }), TypeError);
        createErrorType("ERR_INVALID_ARG_TYPE", (function(name, expected, actual) {
            var determiner;
            if (typeof expected === "string" && startsWith(expected, "not ")) {
                determiner = "must not be";
                expected = expected.replace(/^not /, "");
            } else {
                determiner = "must be";
            }
            var msg;
            if (endsWith(name, " argument")) {
                msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
            } else {
                var type = includes(name, ".") ? "property" : "argument";
                msg = 'The "'.concat(name, '" ').concat(type, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
            }
            msg += ". Received type ".concat(typeof actual);
            return msg;
        }), TypeError);
        createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
        createErrorType("ERR_METHOD_NOT_IMPLEMENTED", (function(name) {
            return "The " + name + " method is not implemented";
        }));
        createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
        createErrorType("ERR_STREAM_DESTROYED", (function(name) {
            return "Cannot call " + name + " after a stream was destroyed";
        }));
        createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
        createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
        createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end");
        createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError);
        createErrorType("ERR_UNKNOWN_ENCODING", (function(arg) {
            return "Unknown encoding: " + arg;
        }), TypeError);
        createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event");
        module.exports.q = codes;
    }, module => {
        if (typeof Object.create === "function") {
            module.exports = function inherits(ctor, superCtor) {
                if (superCtor) {
                    ctor.super_ = superCtor;
                    ctor.prototype = Object.create(superCtor.prototype, {
                        constructor: {
                            value: ctor,
                            enumerable: false,
                            writable: true,
                            configurable: true
                        }
                    });
                }
            };
        } else {
            module.exports = function inherits(ctor, superCtor) {
                if (superCtor) {
                    ctor.super_ = superCtor;
                    var TempCtor = function() {};
                    TempCtor.prototype = superCtor.prototype;
                    ctor.prototype = new TempCtor;
                    ctor.prototype.constructor = ctor;
                }
            };
        }
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var objectKeys = Object.keys || function(obj) {
            var keys = [];
            for (var key in obj) {
                keys.push(key);
            }
            return keys;
        };
        module.exports = Duplex;
        var Readable = __webpack_require__(258);
        var Writable = __webpack_require__(266);
        __webpack_require__(264)(Duplex, Readable);
        {
            var keys = objectKeys(Writable.prototype);
            for (var v = 0; v < keys.length; v++) {
                var method = keys[v];
                if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
            }
        }
        function Duplex(options) {
            if (!(this instanceof Duplex)) return new Duplex(options);
            Readable.call(this, options);
            Writable.call(this, options);
            this.allowHalfOpen = true;
            if (options) {
                if (options.readable === false) this.readable = false;
                if (options.writable === false) this.writable = false;
                if (options.allowHalfOpen === false) {
                    this.allowHalfOpen = false;
                    this.once("end", onend);
                }
            }
        }
        Object.defineProperty(Duplex.prototype, "writableHighWaterMark", {
            enumerable: false,
            get: function get() {
                return this._writableState.highWaterMark;
            }
        });
        Object.defineProperty(Duplex.prototype, "writableBuffer", {
            enumerable: false,
            get: function get() {
                return this._writableState && this._writableState.getBuffer();
            }
        });
        Object.defineProperty(Duplex.prototype, "writableLength", {
            enumerable: false,
            get: function get() {
                return this._writableState.length;
            }
        });
        function onend() {
            if (this._writableState.ended) return;
            process.nextTick(onEndNT, this);
        }
        function onEndNT(self) {
            self.end();
        }
        Object.defineProperty(Duplex.prototype, "destroyed", {
            enumerable: false,
            get: function get() {
                if (this._readableState === undefined || this._writableState === undefined) {
                    return false;
                }
                return this._readableState.destroyed && this._writableState.destroyed;
            },
            set: function set(value) {
                if (this._readableState === undefined || this._writableState === undefined) {
                    return;
                }
                this._readableState.destroyed = value;
                this._writableState.destroyed = value;
            }
        });
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        module.exports = Writable;
        function WriteReq(chunk, encoding, cb) {
            this.chunk = chunk;
            this.encoding = encoding;
            this.callback = cb;
            this.next = null;
        }
        function CorkedRequest(state) {
            var _this = this;
            this.next = null;
            this.entry = null;
            this.finish = function() {
                onCorkedFinish(_this, state);
            };
        }
        var Duplex;
        Writable.WritableState = WritableState;
        var internalUtil = {
            deprecate: __webpack_require__(267)
        };
        var Stream = __webpack_require__(259);
        var Buffer = __webpack_require__(79).Buffer;
        var OurUint8Array = global.Uint8Array || function() {};
        function _uint8ArrayToBuffer(chunk) {
            return Buffer.from(chunk);
        }
        function _isUint8Array(obj) {
            return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
        }
        var destroyImpl = __webpack_require__(261);
        var _require = __webpack_require__(262), getHighWaterMark = _require.getHighWaterMark;
        var _require$codes = __webpack_require__(263).q, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;
        var errorOrDestroy = destroyImpl.errorOrDestroy;
        __webpack_require__(264)(Writable, Stream);
        function nop() {}
        function WritableState(options, stream, isDuplex) {
            Duplex = Duplex || __webpack_require__(265);
            options = options || {};
            if (typeof isDuplex !== "boolean") isDuplex = stream instanceof Duplex;
            this.objectMode = !!options.objectMode;
            if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
            this.highWaterMark = getHighWaterMark(this, options, "writableHighWaterMark", isDuplex);
            this.finalCalled = false;
            this.needDrain = false;
            this.ending = false;
            this.ended = false;
            this.finished = false;
            this.destroyed = false;
            var noDecode = options.decodeStrings === false;
            this.decodeStrings = !noDecode;
            this.defaultEncoding = options.defaultEncoding || "utf8";
            this.length = 0;
            this.writing = false;
            this.corked = 0;
            this.sync = true;
            this.bufferProcessing = false;
            this.onwrite = function(er) {
                onwrite(stream, er);
            };
            this.writecb = null;
            this.writelen = 0;
            this.bufferedRequest = null;
            this.lastBufferedRequest = null;
            this.pendingcb = 0;
            this.prefinished = false;
            this.errorEmitted = false;
            this.emitClose = options.emitClose !== false;
            this.autoDestroy = !!options.autoDestroy;
            this.bufferedRequestCount = 0;
            this.corkedRequestsFree = new CorkedRequest(this);
        }
        WritableState.prototype.getBuffer = function getBuffer() {
            var current = this.bufferedRequest;
            var out = [];
            while (current) {
                out.push(current);
                current = current.next;
            }
            return out;
        };
        (function() {
            try {
                Object.defineProperty(WritableState.prototype, "buffer", {
                    get: internalUtil.deprecate((function writableStateBufferGetter() {
                        return this.getBuffer();
                    }), "_writableState.buffer is deprecated. Use _writableState.getBuffer " + "instead.", "DEP0003")
                });
            } catch (_) {}
        })();
        var realHasInstance;
        if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") {
            realHasInstance = Function.prototype[Symbol.hasInstance];
            Object.defineProperty(Writable, Symbol.hasInstance, {
                value: function value(object) {
                    if (realHasInstance.call(this, object)) return true;
                    if (this !== Writable) return false;
                    return object && object._writableState instanceof WritableState;
                }
            });
        } else {
            realHasInstance = function realHasInstance(object) {
                return object instanceof this;
            };
        }
        function Writable(options) {
            Duplex = Duplex || __webpack_require__(265);
            var isDuplex = this instanceof Duplex;
            if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options);
            this._writableState = new WritableState(options, this, isDuplex);
            this.writable = true;
            if (options) {
                if (typeof options.write === "function") this._write = options.write;
                if (typeof options.writev === "function") this._writev = options.writev;
                if (typeof options.destroy === "function") this._destroy = options.destroy;
                if (typeof options.final === "function") this._final = options.final;
            }
            Stream.call(this);
        }
        Writable.prototype.pipe = function() {
            errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE);
        };
        function writeAfterEnd(stream, cb) {
            var er = new ERR_STREAM_WRITE_AFTER_END;
            errorOrDestroy(stream, er);
            process.nextTick(cb, er);
        }
        function validChunk(stream, state, chunk, cb) {
            var er;
            if (chunk === null) {
                er = new ERR_STREAM_NULL_VALUES;
            } else if (typeof chunk !== "string" && !state.objectMode) {
                er = new ERR_INVALID_ARG_TYPE("chunk", [ "string", "Buffer" ], chunk);
            }
            if (er) {
                errorOrDestroy(stream, er);
                process.nextTick(cb, er);
                return false;
            }
            return true;
        }
        Writable.prototype.write = function(chunk, encoding, cb) {
            var state = this._writableState;
            var ret = false;
            var isBuf = !state.objectMode && _isUint8Array(chunk);
            if (isBuf && !Buffer.isBuffer(chunk)) {
                chunk = _uint8ArrayToBuffer(chunk);
            }
            if (typeof encoding === "function") {
                cb = encoding;
                encoding = null;
            }
            if (isBuf) encoding = "buffer"; else if (!encoding) encoding = state.defaultEncoding;
            if (typeof cb !== "function") cb = nop;
            if (state.ending) writeAfterEnd(this, cb); else if (isBuf || validChunk(this, state, chunk, cb)) {
                state.pendingcb++;
                ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
            }
            return ret;
        };
        Writable.prototype.cork = function() {
            this._writableState.corked++;
        };
        Writable.prototype.uncork = function() {
            var state = this._writableState;
            if (state.corked) {
                state.corked--;
                if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
            }
        };
        Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
            if (typeof encoding === "string") encoding = encoding.toLowerCase();
            if (!([ "hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw" ].indexOf((encoding + "").toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding);
            this._writableState.defaultEncoding = encoding;
            return this;
        };
        Object.defineProperty(Writable.prototype, "writableBuffer", {
            enumerable: false,
            get: function get() {
                return this._writableState && this._writableState.getBuffer();
            }
        });
        function decodeChunk(state, chunk, encoding) {
            if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") {
                chunk = Buffer.from(chunk, encoding);
            }
            return chunk;
        }
        Object.defineProperty(Writable.prototype, "writableHighWaterMark", {
            enumerable: false,
            get: function get() {
                return this._writableState.highWaterMark;
            }
        });
        function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
            if (!isBuf) {
                var newChunk = decodeChunk(state, chunk, encoding);
                if (chunk !== newChunk) {
                    isBuf = true;
                    encoding = "buffer";
                    chunk = newChunk;
                }
            }
            var len = state.objectMode ? 1 : chunk.length;
            state.length += len;
            var ret = state.length < state.highWaterMark;
            if (!ret) state.needDrain = true;
            if (state.writing || state.corked) {
                var last = state.lastBufferedRequest;
                state.lastBufferedRequest = {
                    chunk,
                    encoding,
                    isBuf,
                    callback: cb,
                    next: null
                };
                if (last) {
                    last.next = state.lastBufferedRequest;
                } else {
                    state.bufferedRequest = state.lastBufferedRequest;
                }
                state.bufferedRequestCount += 1;
            } else {
                doWrite(stream, state, false, len, chunk, encoding, cb);
            }
            return ret;
        }
        function doWrite(stream, state, writev, len, chunk, encoding, cb) {
            state.writelen = len;
            state.writecb = cb;
            state.writing = true;
            state.sync = true;
            if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED("write")); else if (writev) stream._writev(chunk, state.onwrite); else stream._write(chunk, encoding, state.onwrite);
            state.sync = false;
        }
        function onwriteError(stream, state, sync, er, cb) {
            --state.pendingcb;
            if (sync) {
                process.nextTick(cb, er);
                process.nextTick(finishMaybe, stream, state);
                stream._writableState.errorEmitted = true;
                errorOrDestroy(stream, er);
            } else {
                cb(er);
                stream._writableState.errorEmitted = true;
                errorOrDestroy(stream, er);
                finishMaybe(stream, state);
            }
        }
        function onwriteStateUpdate(state) {
            state.writing = false;
            state.writecb = null;
            state.length -= state.writelen;
            state.writelen = 0;
        }
        function onwrite(stream, er) {
            var state = stream._writableState;
            var sync = state.sync;
            var cb = state.writecb;
            if (typeof cb !== "function") throw new ERR_MULTIPLE_CALLBACK;
            onwriteStateUpdate(state);
            if (er) onwriteError(stream, state, sync, er, cb); else {
                var finished = needFinish(state) || stream.destroyed;
                if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
                    clearBuffer(stream, state);
                }
                if (sync) {
                    process.nextTick(afterWrite, stream, state, finished, cb);
                } else {
                    afterWrite(stream, state, finished, cb);
                }
            }
        }
        function afterWrite(stream, state, finished, cb) {
            if (!finished) onwriteDrain(stream, state);
            state.pendingcb--;
            cb();
            finishMaybe(stream, state);
        }
        function onwriteDrain(stream, state) {
            if (state.length === 0 && state.needDrain) {
                state.needDrain = false;
                stream.emit("drain");
            }
        }
        function clearBuffer(stream, state) {
            state.bufferProcessing = true;
            var entry = state.bufferedRequest;
            if (stream._writev && entry && entry.next) {
                var l = state.bufferedRequestCount;
                var buffer = new Array(l);
                var holder = state.corkedRequestsFree;
                holder.entry = entry;
                var count = 0;
                var allBuffers = true;
                while (entry) {
                    buffer[count] = entry;
                    if (!entry.isBuf) allBuffers = false;
                    entry = entry.next;
                    count += 1;
                }
                buffer.allBuffers = allBuffers;
                doWrite(stream, state, true, state.length, buffer, "", holder.finish);
                state.pendingcb++;
                state.lastBufferedRequest = null;
                if (holder.next) {
                    state.corkedRequestsFree = holder.next;
                    holder.next = null;
                } else {
                    state.corkedRequestsFree = new CorkedRequest(state);
                }
                state.bufferedRequestCount = 0;
            } else {
                while (entry) {
                    var chunk = entry.chunk;
                    var encoding = entry.encoding;
                    var cb = entry.callback;
                    var len = state.objectMode ? 1 : chunk.length;
                    doWrite(stream, state, false, len, chunk, encoding, cb);
                    entry = entry.next;
                    state.bufferedRequestCount--;
                    if (state.writing) {
                        break;
                    }
                }
                if (entry === null) state.lastBufferedRequest = null;
            }
            state.bufferedRequest = entry;
            state.bufferProcessing = false;
        }
        Writable.prototype._write = function(chunk, encoding, cb) {
            cb(new ERR_METHOD_NOT_IMPLEMENTED("_write()"));
        };
        Writable.prototype._writev = null;
        Writable.prototype.end = function(chunk, encoding, cb) {
            var state = this._writableState;
            if (typeof chunk === "function") {
                cb = chunk;
                chunk = null;
                encoding = null;
            } else if (typeof encoding === "function") {
                cb = encoding;
                encoding = null;
            }
            if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
            if (state.corked) {
                state.corked = 1;
                this.uncork();
            }
            if (!state.ending) endWritable(this, state, cb);
            return this;
        };
        Object.defineProperty(Writable.prototype, "writableLength", {
            enumerable: false,
            get: function get() {
                return this._writableState.length;
            }
        });
        function needFinish(state) {
            return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
        }
        function callFinal(stream, state) {
            stream._final((function(err) {
                state.pendingcb--;
                if (err) {
                    errorOrDestroy(stream, err);
                }
                state.prefinished = true;
                stream.emit("prefinish");
                finishMaybe(stream, state);
            }));
        }
        function prefinish(stream, state) {
            if (!state.prefinished && !state.finalCalled) {
                if (typeof stream._final === "function" && !state.destroyed) {
                    state.pendingcb++;
                    state.finalCalled = true;
                    process.nextTick(callFinal, stream, state);
                } else {
                    state.prefinished = true;
                    stream.emit("prefinish");
                }
            }
        }
        function finishMaybe(stream, state) {
            var need = needFinish(state);
            if (need) {
                prefinish(stream, state);
                if (state.pendingcb === 0) {
                    state.finished = true;
                    stream.emit("finish");
                    if (state.autoDestroy) {
                        var rState = stream._readableState;
                        if (!rState || rState.autoDestroy && rState.endEmitted) {
                            stream.destroy();
                        }
                    }
                }
            }
            return need;
        }
        function endWritable(stream, state, cb) {
            state.ending = true;
            finishMaybe(stream, state);
            if (cb) {
                if (state.finished) process.nextTick(cb); else stream.once("finish", cb);
            }
            state.ended = true;
            stream.writable = false;
        }
        function onCorkedFinish(corkReq, state, err) {
            var entry = corkReq.entry;
            corkReq.entry = null;
            while (entry) {
                var cb = entry.callback;
                state.pendingcb--;
                cb(err);
                entry = entry.next;
            }
            state.corkedRequestsFree.next = corkReq;
        }
        Object.defineProperty(Writable.prototype, "destroyed", {
            enumerable: false,
            get: function get() {
                if (this._writableState === undefined) {
                    return false;
                }
                return this._writableState.destroyed;
            },
            set: function set(value) {
                if (!this._writableState) {
                    return;
                }
                this._writableState.destroyed = value;
            }
        });
        Writable.prototype.destroy = destroyImpl.destroy;
        Writable.prototype._undestroy = destroyImpl.undestroy;
        Writable.prototype._destroy = function(err, cb) {
            cb(err);
        };
    }, module => {
        module.exports = deprecate;
        function deprecate(fn, msg) {
            if (config("noDeprecation")) {
                return fn;
            }
            var warned = false;
            function deprecated() {
                if (!warned) {
                    if (config("throwDeprecation")) {
                        throw new Error(msg);
                    } else if (config("traceDeprecation")) {
                        console.trace(msg);
                    } else {
                        console.warn(msg);
                    }
                    warned = true;
                }
                return fn.apply(this, arguments);
            }
            return deprecated;
        }
        function config(name) {
            try {
                if (!global.localStorage) return false;
            } catch (_) {
                return false;
            }
            var val = global.localStorage[name];
            if (null == val) return false;
            return String(val).toLowerCase() === "true";
        }
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        var Buffer = __webpack_require__(269).Buffer;
        var isEncoding = Buffer.isEncoding || function(encoding) {
            encoding = "" + encoding;
            switch (encoding && encoding.toLowerCase()) {
              case "hex":
              case "utf8":
              case "utf-8":
              case "ascii":
              case "binary":
              case "base64":
              case "ucs2":
              case "ucs-2":
              case "utf16le":
              case "utf-16le":
              case "raw":
                return true;

              default:
                return false;
            }
        };
        function _normalizeEncoding(enc) {
            if (!enc) return "utf8";
            var retried;
            while (true) {
                switch (enc) {
                  case "utf8":
                  case "utf-8":
                    return "utf8";

                  case "ucs2":
                  case "ucs-2":
                  case "utf16le":
                  case "utf-16le":
                    return "utf16le";

                  case "latin1":
                  case "binary":
                    return "latin1";

                  case "base64":
                  case "ascii":
                  case "hex":
                    return enc;

                  default:
                    if (retried) return;
                    enc = ("" + enc).toLowerCase();
                    retried = true;
                }
            }
        }
        function normalizeEncoding(enc) {
            var nenc = _normalizeEncoding(enc);
            if (typeof nenc !== "string" && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc);
            return nenc || enc;
        }
        exports.s = StringDecoder;
        function StringDecoder(encoding) {
            this.encoding = normalizeEncoding(encoding);
            var nb;
            switch (this.encoding) {
              case "utf16le":
                this.text = utf16Text;
                this.end = utf16End;
                nb = 4;
                break;

              case "utf8":
                this.fillLast = utf8FillLast;
                nb = 4;
                break;

              case "base64":
                this.text = base64Text;
                this.end = base64End;
                nb = 3;
                break;

              default:
                this.write = simpleWrite;
                this.end = simpleEnd;
                return;
            }
            this.lastNeed = 0;
            this.lastTotal = 0;
            this.lastChar = Buffer.allocUnsafe(nb);
        }
        StringDecoder.prototype.write = function(buf) {
            if (buf.length === 0) return "";
            var r;
            var i;
            if (this.lastNeed) {
                r = this.fillLast(buf);
                if (r === undefined) return "";
                i = this.lastNeed;
                this.lastNeed = 0;
            } else {
                i = 0;
            }
            if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
            return r || "";
        };
        StringDecoder.prototype.end = utf8End;
        StringDecoder.prototype.text = utf8Text;
        StringDecoder.prototype.fillLast = function(buf) {
            if (this.lastNeed <= buf.length) {
                buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
                return this.lastChar.toString(this.encoding, 0, this.lastTotal);
            }
            buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
            this.lastNeed -= buf.length;
        };
        function utf8CheckByte(byte) {
            if (byte <= 127) return 0; else if (byte >> 5 === 6) return 2; else if (byte >> 4 === 14) return 3; else if (byte >> 3 === 30) return 4;
            return byte >> 6 === 2 ? -1 : -2;
        }
        function utf8CheckIncomplete(self, buf, i) {
            var j = buf.length - 1;
            if (j < i) return 0;
            var nb = utf8CheckByte(buf[j]);
            if (nb >= 0) {
                if (nb > 0) self.lastNeed = nb - 1;
                return nb;
            }
            if (--j < i || nb === -2) return 0;
            nb = utf8CheckByte(buf[j]);
            if (nb >= 0) {
                if (nb > 0) self.lastNeed = nb - 2;
                return nb;
            }
            if (--j < i || nb === -2) return 0;
            nb = utf8CheckByte(buf[j]);
            if (nb >= 0) {
                if (nb > 0) {
                    if (nb === 2) nb = 0; else self.lastNeed = nb - 3;
                }
                return nb;
            }
            return 0;
        }
        function utf8CheckExtraBytes(self, buf, p) {
            if ((buf[0] & 192) !== 128) {
                self.lastNeed = 0;
                return "�";
            }
            if (self.lastNeed > 1 && buf.length > 1) {
                if ((buf[1] & 192) !== 128) {
                    self.lastNeed = 1;
                    return "�";
                }
                if (self.lastNeed > 2 && buf.length > 2) {
                    if ((buf[2] & 192) !== 128) {
                        self.lastNeed = 2;
                        return "�";
                    }
                }
            }
        }
        function utf8FillLast(buf) {
            var p = this.lastTotal - this.lastNeed;
            var r = utf8CheckExtraBytes(this, buf, p);
            if (r !== undefined) return r;
            if (this.lastNeed <= buf.length) {
                buf.copy(this.lastChar, p, 0, this.lastNeed);
                return this.lastChar.toString(this.encoding, 0, this.lastTotal);
            }
            buf.copy(this.lastChar, p, 0, buf.length);
            this.lastNeed -= buf.length;
        }
        function utf8Text(buf, i) {
            var total = utf8CheckIncomplete(this, buf, i);
            if (!this.lastNeed) return buf.toString("utf8", i);
            this.lastTotal = total;
            var end = buf.length - (total - this.lastNeed);
            buf.copy(this.lastChar, 0, end);
            return buf.toString("utf8", i, end);
        }
        function utf8End(buf) {
            var r = buf && buf.length ? this.write(buf) : "";
            if (this.lastNeed) return r + "�";
            return r;
        }
        function utf16Text(buf, i) {
            if ((buf.length - i) % 2 === 0) {
                var r = buf.toString("utf16le", i);
                if (r) {
                    var c = r.charCodeAt(r.length - 1);
                    if (c >= 55296 && c <= 56319) {
                        this.lastNeed = 2;
                        this.lastTotal = 4;
                        this.lastChar[0] = buf[buf.length - 2];
                        this.lastChar[1] = buf[buf.length - 1];
                        return r.slice(0, -1);
                    }
                }
                return r;
            }
            this.lastNeed = 1;
            this.lastTotal = 2;
            this.lastChar[0] = buf[buf.length - 1];
            return buf.toString("utf16le", i, buf.length - 1);
        }
        function utf16End(buf) {
            var r = buf && buf.length ? this.write(buf) : "";
            if (this.lastNeed) {
                var end = this.lastTotal - this.lastNeed;
                return r + this.lastChar.toString("utf16le", 0, end);
            }
            return r;
        }
        function base64Text(buf, i) {
            var n = (buf.length - i) % 3;
            if (n === 0) return buf.toString("base64", i);
            this.lastNeed = 3 - n;
            this.lastTotal = 3;
            if (n === 1) {
                this.lastChar[0] = buf[buf.length - 1];
            } else {
                this.lastChar[0] = buf[buf.length - 2];
                this.lastChar[1] = buf[buf.length - 1];
            }
            return buf.toString("base64", i, buf.length - n);
        }
        function base64End(buf) {
            var r = buf && buf.length ? this.write(buf) : "";
            if (this.lastNeed) return r + this.lastChar.toString("base64", 0, 3 - this.lastNeed);
            return r;
        }
        function simpleWrite(buf) {
            return buf.toString(this.encoding);
        }
        function simpleEnd(buf) {
            return buf && buf.length ? this.write(buf) : "";
        }
    }, (module, exports, __webpack_require__) => {
        var buffer = __webpack_require__(79);
        var Buffer = buffer.Buffer;
        function copyProps(src, dst) {
            for (var key in src) {
                dst[key] = src[key];
            }
        }
        if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
            module.exports = buffer;
        } else {
            copyProps(buffer, exports);
            exports.Buffer = SafeBuffer;
        }
        function SafeBuffer(arg, encodingOrOffset, length) {
            return Buffer(arg, encodingOrOffset, length);
        }
        copyProps(Buffer, SafeBuffer);
        SafeBuffer.from = function(arg, encodingOrOffset, length) {
            if (typeof arg === "number") {
                throw new TypeError("Argument must not be a number");
            }
            return Buffer(arg, encodingOrOffset, length);
        };
        SafeBuffer.alloc = function(size, fill, encoding) {
            if (typeof size !== "number") {
                throw new TypeError("Argument must be a number");
            }
            var buf = Buffer(size);
            if (fill !== undefined) {
                if (typeof encoding === "string") {
                    buf.fill(fill, encoding);
                } else {
                    buf.fill(fill);
                }
            } else {
                buf.fill(0);
            }
            return buf;
        };
        SafeBuffer.allocUnsafe = function(size) {
            if (typeof size !== "number") {
                throw new TypeError("Argument must be a number");
            }
            return Buffer(size);
        };
        SafeBuffer.allocUnsafeSlow = function(size) {
            if (typeof size !== "number") {
                throw new TypeError("Argument must be a number");
            }
            return buffer.SlowBuffer(size);
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var _Object$setPrototypeO;
        function _defineProperty(obj, key, value) {
            if (key in obj) {
                Object.defineProperty(obj, key, {
                    value,
                    enumerable: true,
                    configurable: true,
                    writable: true
                });
            } else {
                obj[key] = value;
            }
            return obj;
        }
        var finished = __webpack_require__(271);
        var kLastResolve = Symbol("lastResolve");
        var kLastReject = Symbol("lastReject");
        var kError = Symbol("error");
        var kEnded = Symbol("ended");
        var kLastPromise = Symbol("lastPromise");
        var kHandlePromise = Symbol("handlePromise");
        var kStream = Symbol("stream");
        function createIterResult(value, done) {
            return {
                value,
                done
            };
        }
        function readAndResolve(iter) {
            var resolve = iter[kLastResolve];
            if (resolve !== null) {
                var data = iter[kStream].read();
                if (data !== null) {
                    iter[kLastPromise] = null;
                    iter[kLastResolve] = null;
                    iter[kLastReject] = null;
                    resolve(createIterResult(data, false));
                }
            }
        }
        function onReadable(iter) {
            process.nextTick(readAndResolve, iter);
        }
        function wrapForNext(lastPromise, iter) {
            return function(resolve, reject) {
                lastPromise.then((function() {
                    if (iter[kEnded]) {
                        resolve(createIterResult(undefined, true));
                        return;
                    }
                    iter[kHandlePromise](resolve, reject);
                }), reject);
            };
        }
        var AsyncIteratorPrototype = Object.getPrototypeOf((function() {}));
        var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = {
            get stream() {
                return this[kStream];
            },
            next: function next() {
                var _this = this;
                var error = this[kError];
                if (error !== null) {
                    return Promise.reject(error);
                }
                if (this[kEnded]) {
                    return Promise.resolve(createIterResult(undefined, true));
                }
                if (this[kStream].destroyed) {
                    return new Promise((function(resolve, reject) {
                        process.nextTick((function() {
                            if (_this[kError]) {
                                reject(_this[kError]);
                            } else {
                                resolve(createIterResult(undefined, true));
                            }
                        }));
                    }));
                }
                var lastPromise = this[kLastPromise];
                var promise;
                if (lastPromise) {
                    promise = new Promise(wrapForNext(lastPromise, this));
                } else {
                    var data = this[kStream].read();
                    if (data !== null) {
                        return Promise.resolve(createIterResult(data, false));
                    }
                    promise = new Promise(this[kHandlePromise]);
                }
                this[kLastPromise] = promise;
                return promise;
            }
        }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, (function() {
            return this;
        })), _defineProperty(_Object$setPrototypeO, "return", (function _return() {
            var _this2 = this;
            return new Promise((function(resolve, reject) {
                _this2[kStream].destroy(null, (function(err) {
                    if (err) {
                        reject(err);
                        return;
                    }
                    resolve(createIterResult(undefined, true));
                }));
            }));
        })), _Object$setPrototypeO), AsyncIteratorPrototype);
        var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) {
            var _Object$create;
            var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, 
            _defineProperty(_Object$create, kStream, {
                value: stream,
                writable: true
            }), _defineProperty(_Object$create, kLastResolve, {
                value: null,
                writable: true
            }), _defineProperty(_Object$create, kLastReject, {
                value: null,
                writable: true
            }), _defineProperty(_Object$create, kError, {
                value: null,
                writable: true
            }), _defineProperty(_Object$create, kEnded, {
                value: stream._readableState.endEmitted,
                writable: true
            }), _defineProperty(_Object$create, kHandlePromise, {
                value: function value(resolve, reject) {
                    var data = iterator[kStream].read();
                    if (data) {
                        iterator[kLastPromise] = null;
                        iterator[kLastResolve] = null;
                        iterator[kLastReject] = null;
                        resolve(createIterResult(data, false));
                    } else {
                        iterator[kLastResolve] = resolve;
                        iterator[kLastReject] = reject;
                    }
                },
                writable: true
            }), _Object$create));
            iterator[kLastPromise] = null;
            finished(stream, (function(err) {
                if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") {
                    var reject = iterator[kLastReject];
                    if (reject !== null) {
                        iterator[kLastPromise] = null;
                        iterator[kLastResolve] = null;
                        iterator[kLastReject] = null;
                        reject(err);
                    }
                    iterator[kError] = err;
                    return;
                }
                var resolve = iterator[kLastResolve];
                if (resolve !== null) {
                    iterator[kLastPromise] = null;
                    iterator[kLastResolve] = null;
                    iterator[kLastReject] = null;
                    resolve(createIterResult(undefined, true));
                }
                iterator[kEnded] = true;
            }));
            stream.on("readable", onReadable.bind(null, iterator));
            return iterator;
        };
        module.exports = createReadableStreamAsyncIterator;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var ERR_STREAM_PREMATURE_CLOSE = __webpack_require__(263).q.ERR_STREAM_PREMATURE_CLOSE;
        function once(callback) {
            var called = false;
            return function() {
                if (called) return;
                called = true;
                for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
                    args[_key] = arguments[_key];
                }
                callback.apply(this, args);
            };
        }
        function noop() {}
        function isRequest(stream) {
            return stream.setHeader && typeof stream.abort === "function";
        }
        function eos(stream, opts, callback) {
            if (typeof opts === "function") return eos(stream, null, opts);
            if (!opts) opts = {};
            callback = once(callback || noop);
            var readable = opts.readable || opts.readable !== false && stream.readable;
            var writable = opts.writable || opts.writable !== false && stream.writable;
            var onlegacyfinish = function onlegacyfinish() {
                if (!stream.writable) onfinish();
            };
            var writableEnded = stream._writableState && stream._writableState.finished;
            var onfinish = function onfinish() {
                writable = false;
                writableEnded = true;
                if (!readable) callback.call(stream);
            };
            var readableEnded = stream._readableState && stream._readableState.endEmitted;
            var onend = function onend() {
                readable = false;
                readableEnded = true;
                if (!writable) callback.call(stream);
            };
            var onerror = function onerror(err) {
                callback.call(stream, err);
            };
            var onclose = function onclose() {
                var err;
                if (readable && !readableEnded) {
                    if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE;
                    return callback.call(stream, err);
                }
                if (writable && !writableEnded) {
                    if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE;
                    return callback.call(stream, err);
                }
            };
            var onrequest = function onrequest() {
                stream.req.on("finish", onfinish);
            };
            if (isRequest(stream)) {
                stream.on("complete", onfinish);
                stream.on("abort", onclose);
                if (stream.req) onrequest(); else stream.on("request", onrequest);
            } else if (writable && !stream._writableState) {
                stream.on("end", onlegacyfinish);
                stream.on("close", onlegacyfinish);
            }
            stream.on("end", onend);
            stream.on("finish", onfinish);
            if (opts.error !== false) stream.on("error", onerror);
            stream.on("close", onclose);
            return function() {
                stream.removeListener("complete", onfinish);
                stream.removeListener("abort", onclose);
                stream.removeListener("request", onrequest);
                if (stream.req) stream.req.removeListener("finish", onfinish);
                stream.removeListener("end", onlegacyfinish);
                stream.removeListener("close", onlegacyfinish);
                stream.removeListener("finish", onfinish);
                stream.removeListener("end", onend);
                stream.removeListener("error", onerror);
                stream.removeListener("close", onclose);
            };
        }
        module.exports = eos;
    }, module => {
        module.exports = function() {
            throw new Error("Readable.from is not available in the browser");
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        module.exports = Transform;
        var _require$codes = __webpack_require__(263).q, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;
        var Duplex = __webpack_require__(265);
        __webpack_require__(264)(Transform, Duplex);
        function afterTransform(er, data) {
            var ts = this._transformState;
            ts.transforming = false;
            var cb = ts.writecb;
            if (cb === null) {
                return this.emit("error", new ERR_MULTIPLE_CALLBACK);
            }
            ts.writechunk = null;
            ts.writecb = null;
            if (data != null) this.push(data);
            cb(er);
            var rs = this._readableState;
            rs.reading = false;
            if (rs.needReadable || rs.length < rs.highWaterMark) {
                this._read(rs.highWaterMark);
            }
        }
        function Transform(options) {
            if (!(this instanceof Transform)) return new Transform(options);
            Duplex.call(this, options);
            this._transformState = {
                afterTransform: afterTransform.bind(this),
                needTransform: false,
                transforming: false,
                writecb: null,
                writechunk: null,
                writeencoding: null
            };
            this._readableState.needReadable = true;
            this._readableState.sync = false;
            if (options) {
                if (typeof options.transform === "function") this._transform = options.transform;
                if (typeof options.flush === "function") this._flush = options.flush;
            }
            this.on("prefinish", prefinish);
        }
        function prefinish() {
            var _this = this;
            if (typeof this._flush === "function" && !this._readableState.destroyed) {
                this._flush((function(er, data) {
                    done(_this, er, data);
                }));
            } else {
                done(this, null, null);
            }
        }
        Transform.prototype.push = function(chunk, encoding) {
            this._transformState.needTransform = false;
            return Duplex.prototype.push.call(this, chunk, encoding);
        };
        Transform.prototype._transform = function(chunk, encoding, cb) {
            cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()"));
        };
        Transform.prototype._write = function(chunk, encoding, cb) {
            var ts = this._transformState;
            ts.writecb = cb;
            ts.writechunk = chunk;
            ts.writeencoding = encoding;
            if (!ts.transforming) {
                var rs = this._readableState;
                if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
            }
        };
        Transform.prototype._read = function(n) {
            var ts = this._transformState;
            if (ts.writechunk !== null && !ts.transforming) {
                ts.transforming = true;
                this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
            } else {
                ts.needTransform = true;
            }
        };
        Transform.prototype._destroy = function(err, cb) {
            Duplex.prototype._destroy.call(this, err, (function(err2) {
                cb(err2);
            }));
        };
        function done(stream, er, data) {
            if (er) return stream.emit("error", er);
            if (data != null) stream.push(data);
            if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0;
            if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING;
            return stream.push(null);
        }
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        module.exports = PassThrough;
        var Transform = __webpack_require__(273);
        __webpack_require__(264)(PassThrough, Transform);
        function PassThrough(options) {
            if (!(this instanceof PassThrough)) return new PassThrough(options);
            Transform.call(this, options);
        }
        PassThrough.prototype._transform = function(chunk, encoding, cb) {
            cb(null, chunk);
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var eos;
        function once(callback) {
            var called = false;
            return function() {
                if (called) return;
                called = true;
                callback.apply(void 0, arguments);
            };
        }
        var _require$codes = __webpack_require__(263).q, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
        function noop(err) {
            if (err) throw err;
        }
        function isRequest(stream) {
            return stream.setHeader && typeof stream.abort === "function";
        }
        function destroyer(stream, reading, writing, callback) {
            callback = once(callback);
            var closed = false;
            stream.on("close", (function() {
                closed = true;
            }));
            if (eos === undefined) eos = __webpack_require__(271);
            eos(stream, {
                readable: reading,
                writable: writing
            }, (function(err) {
                if (err) return callback(err);
                closed = true;
                callback();
            }));
            var destroyed = false;
            return function(err) {
                if (closed) return;
                if (destroyed) return;
                destroyed = true;
                if (isRequest(stream)) return stream.abort();
                if (typeof stream.destroy === "function") return stream.destroy();
                callback(err || new ERR_STREAM_DESTROYED("pipe"));
            };
        }
        function call(fn) {
            fn();
        }
        function pipe(from, to) {
            return from.pipe(to);
        }
        function popCallback(streams) {
            if (!streams.length) return noop;
            if (typeof streams[streams.length - 1] !== "function") return noop;
            return streams.pop();
        }
        function pipeline() {
            for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {
                streams[_key] = arguments[_key];
            }
            var callback = popCallback(streams);
            if (Array.isArray(streams[0])) streams = streams[0];
            if (streams.length < 2) {
                throw new ERR_MISSING_ARGS("streams");
            }
            var error;
            var destroys = streams.map((function(stream, i) {
                var reading = i < streams.length - 1;
                var writing = i > 0;
                return destroyer(stream, reading, writing, (function(err) {
                    if (!error) error = err;
                    if (err) destroys.forEach(call);
                    if (reading) return;
                    destroys.forEach(call);
                    callback(error);
                }));
            }));
            return streams.reduce(pipe);
        }
        module.exports = pipeline;
    }, (__unused_webpack_module, exports) => {
        var CRC32;
        (function(factory) {
            if (typeof DO_NOT_EXPORT_CRC === "undefined") {
                if (true) {
                    factory(exports);
                } else {}
            } else {
                factory(CRC32 = {});
            }
        })((function(CRC32) {
            CRC32.version = "1.2.0";
            function signed_crc_table() {
                var c = 0, table = new Array(256);
                for (var n = 0; n != 256; ++n) {
                    c = n;
                    c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1;
                    c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1;
                    c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1;
                    c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1;
                    c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1;
                    c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1;
                    c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1;
                    c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1;
                    table[n] = c;
                }
                return typeof Int32Array !== "undefined" ? new Int32Array(table) : table;
            }
            var T = signed_crc_table();
            function crc32_bstr(bstr, seed) {
                var C = seed ^ -1, L = bstr.length - 1;
                for (var i = 0; i < L; ) {
                    C = C >>> 8 ^ T[(C ^ bstr.charCodeAt(i++)) & 255];
                    C = C >>> 8 ^ T[(C ^ bstr.charCodeAt(i++)) & 255];
                }
                if (i === L) C = C >>> 8 ^ T[(C ^ bstr.charCodeAt(i)) & 255];
                return C ^ -1;
            }
            function crc32_buf(buf, seed) {
                if (buf.length > 1e4) return crc32_buf_8(buf, seed);
                var C = seed ^ -1, L = buf.length - 3;
                for (var i = 0; i < L; ) {
                    C = C >>> 8 ^ T[(C ^ buf[i++]) & 255];
                    C = C >>> 8 ^ T[(C ^ buf[i++]) & 255];
                    C = C >>> 8 ^ T[(C ^ buf[i++]) & 255];
                    C = C >>> 8 ^ T[(C ^ buf[i++]) & 255];
                }
                while (i < L + 3) C = C >>> 8 ^ T[(C ^ buf[i++]) & 255];
                return C ^ -1;
            }
            function crc32_buf_8(buf, seed) {
                var C = seed ^ -1, L = buf.length - 7;
                for (var i = 0; i < L; ) {
                    C = C >>> 8 ^ T[(C ^ buf[i++]) & 255];
                    C = C >>> 8 ^ T[(C ^ buf[i++]) & 255];
                    C = C >>> 8 ^ T[(C ^ buf[i++]) & 255];
                    C = C >>> 8 ^ T[(C ^ buf[i++]) & 255];
                    C = C >>> 8 ^ T[(C ^ buf[i++]) & 255];
                    C = C >>> 8 ^ T[(C ^ buf[i++]) & 255];
                    C = C >>> 8 ^ T[(C ^ buf[i++]) & 255];
                    C = C >>> 8 ^ T[(C ^ buf[i++]) & 255];
                }
                while (i < L + 7) C = C >>> 8 ^ T[(C ^ buf[i++]) & 255];
                return C ^ -1;
            }
            function crc32_str(str, seed) {
                var C = seed ^ -1;
                for (var i = 0, L = str.length, c, d; i < L; ) {
                    c = str.charCodeAt(i++);
                    if (c < 128) {
                        C = C >>> 8 ^ T[(C ^ c) & 255];
                    } else if (c < 2048) {
                        C = C >>> 8 ^ T[(C ^ (192 | c >> 6 & 31)) & 255];
                        C = C >>> 8 ^ T[(C ^ (128 | c & 63)) & 255];
                    } else if (c >= 55296 && c < 57344) {
                        c = (c & 1023) + 64;
                        d = str.charCodeAt(i++) & 1023;
                        C = C >>> 8 ^ T[(C ^ (240 | c >> 8 & 7)) & 255];
                        C = C >>> 8 ^ T[(C ^ (128 | c >> 2 & 63)) & 255];
                        C = C >>> 8 ^ T[(C ^ (128 | d >> 6 & 15 | (c & 3) << 4)) & 255];
                        C = C >>> 8 ^ T[(C ^ (128 | d & 63)) & 255];
                    } else {
                        C = C >>> 8 ^ T[(C ^ (224 | c >> 12 & 15)) & 255];
                        C = C >>> 8 ^ T[(C ^ (128 | c >> 6 & 63)) & 255];
                        C = C >>> 8 ^ T[(C ^ (128 | c & 63)) & 255];
                    }
                }
                return C ^ -1;
            }
            CRC32.table = T;
            CRC32.bstr = crc32_bstr;
            CRC32.buf = crc32_buf;
            CRC32.str = crc32_str;
        }));
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        const {DeflateRaw} = __webpack_require__(23);
        const crc32 = __webpack_require__(276);
        class DeflateCRC32Stream extends DeflateRaw {
            constructor(options) {
                super(options);
                this.checksum = Buffer.allocUnsafe(4);
                this.checksum.writeInt32BE(0, 0);
                this.rawSize = 0;
                this.compressedSize = 0;
            }
            push(chunk, encoding) {
                if (chunk) {
                    this.compressedSize += chunk.length;
                }
                return super.push(chunk, encoding);
            }
            _transform(chunk, encoding, callback) {
                if (chunk) {
                    this.checksum = crc32.buf(chunk, this.checksum) >>> 0;
                    this.rawSize += chunk.length;
                }
                super._transform(chunk, encoding, callback);
            }
            digest(encoding) {
                const checksum = Buffer.allocUnsafe(4);
                checksum.writeUInt32BE(this.checksum >>> 0, 0);
                return encoding ? checksum.toString(encoding) : checksum;
            }
            hex() {
                return this.digest("hex").toUpperCase();
            }
            size(compressed = false) {
                if (compressed) {
                    return this.compressedSize;
                } else {
                    return this.rawSize;
                }
            }
        }
        module.exports = DeflateCRC32Stream;
    }, function(__unused_webpack_module, exports, __webpack_require__) {
        (function() {
            var CombinedStream, DEFLATE_END, DeflateCRC32Stream, DeflatePartStream, ZIP_CD_DISK_START, ZIP_CD_EXTERNAL_ATT, ZIP_CD_FILE_COMM_LEN, ZIP_CD_INTERNAL_ATT, ZIP_CD_SIGNATURE, ZIP_CD_VERSION, ZIP_COMPRESSION_DEFLATE, ZIP_ECD_COMM_LEN, ZIP_ECD_DISK_NUM, ZIP_ECD_SIGNATURE, ZIP_ECD_SIZE, ZIP_ENTRY_EXTRAFIELD_LEN, ZIP_ENTRY_SIGNATURE, ZIP_FLAGS, ZIP_VERSION, centralDirectoryLength, crcUtils, create, createCDRecord, createEndOfCDRecord, createEntry, createFileHeader, dosFormatDate, dosFormatTime, fileHeaderLength, getCombinedCrc, iob, totalLength;
            crcUtils = __webpack_require__(253);
            CombinedStream = __webpack_require__(250);
            ({DeflateCRC32Stream} = __webpack_require__(255));
            ZIP_VERSION = Buffer.from([ 10, 0 ]);
            ZIP_FLAGS = Buffer.from([ 0, 0 ]);
            ZIP_ENTRY_SIGNATURE = Buffer.from([ 80, 75, 3, 4 ]);
            ZIP_ENTRY_EXTRAFIELD_LEN = Buffer.from([ 0, 0 ]);
            ZIP_COMPRESSION_DEFLATE = Buffer.from([ 8, 0 ]);
            ZIP_CD_SIGNATURE = Buffer.from([ 80, 75, 1, 2 ]);
            ZIP_CD_VERSION = Buffer.from([ 30, 3 ]);
            ZIP_CD_FILE_COMM_LEN = Buffer.from([ 0, 0 ]);
            ZIP_CD_DISK_START = Buffer.from([ 0, 0 ]);
            ZIP_CD_INTERNAL_ATT = Buffer.from([ 1, 0 ]);
            ZIP_CD_EXTERNAL_ATT = Buffer.from([ 0, 0, 164, 129 ]);
            ZIP_ECD_SIGNATURE = Buffer.from([ 80, 75, 5, 6 ]);
            ZIP_ECD_DISK_NUM = Buffer.from([ 0, 0 ]);
            ZIP_ECD_COMM_LEN = Buffer.from([ 0, 0 ]);
            ZIP_ECD_SIZE = 22;
            DEFLATE_END = Buffer.from([ 3, 0 ]);
            DeflatePartStream = class DeflatePartStream extends DeflateCRC32Stream {
                constructor() {
                    super(...arguments);
                    this.buf = Buffer.alloc(0);
                }
                push(chunk) {
                    if (chunk !== null) {
                        super.push(this.buf);
                        return this.buf = chunk;
                    } else {
                        if (this.buf.length >= 2 && this.buf.slice(-2).equals(DEFLATE_END)) {
                            this.buf = this.buf.slice(0, -2);
                        }
                        super.push(this.buf);
                        return super.push(null);
                    }
                }
                end() {
                    return this.flush((() => super.end()));
                }
                metadata() {
                    return {
                        crc: this.digest().readUInt32BE(0),
                        len: this.size(),
                        zLen: this.size(true)
                    };
                }
            };
            exports.createDeflatePart = function() {
                return new DeflatePartStream;
            };
            fileHeaderLength = function(filename) {
                return 30 + filename.length;
            };
            centralDirectoryLength = function(filename) {
                return 46 + filename.length;
            };
            iob = function(number, size) {
                var b;
                b = Buffer.alloc(size);
                b.fill(0).writeUIntLE(number, 0, size);
                return b;
            };
            createFileHeader = function({filename, compressed_size, uncompressed_size, crc, mtime, mdate}) {
                return Buffer.concat([ ZIP_ENTRY_SIGNATURE, ZIP_VERSION, ZIP_FLAGS, ZIP_COMPRESSION_DEFLATE, mtime, mdate, crc, iob(compressed_size, 4), iob(uncompressed_size, 4), iob(filename.length, 2), ZIP_ENTRY_EXTRAFIELD_LEN, Buffer.from(filename) ]);
            };
            createCDRecord = function({filename, compressed_size, uncompressed_size, crc, mtime, mdate}, fileHeaderOffset) {
                return Buffer.concat([ ZIP_CD_SIGNATURE, ZIP_CD_VERSION, ZIP_VERSION, ZIP_FLAGS, ZIP_COMPRESSION_DEFLATE, mtime, mdate, crc, iob(compressed_size, 4), iob(uncompressed_size, 4), iob(filename.length, 2), ZIP_ENTRY_EXTRAFIELD_LEN, ZIP_CD_FILE_COMM_LEN, ZIP_CD_DISK_START, ZIP_CD_INTERNAL_ATT, ZIP_CD_EXTERNAL_ATT, iob(fileHeaderOffset, 4), Buffer.from(filename) ]);
            };
            createEndOfCDRecord = function(entries) {
                var cd_offset, cd_size;
                cd_offset = entries.reduce((function(sum, x) {
                    return sum + fileHeaderLength(x.filename) + x.compressed_size;
                }), 0);
                cd_size = entries.reduce((function(sum, x) {
                    return sum + centralDirectoryLength(x.filename);
                }), 0);
                return Buffer.concat([ ZIP_ECD_SIGNATURE, ZIP_ECD_DISK_NUM, ZIP_CD_DISK_START, iob(entries.length, 2), iob(entries.length, 2), iob(cd_size, 4), iob(cd_offset, 4), ZIP_ECD_COMM_LEN ]);
            };
            dosFormatTime = function(d) {
                var buf;
                buf = Buffer.alloc(2);
                buf.writeUIntLE(d.getSeconds() / 2 + (d.getMinutes() << 5) + (d.getHours() << 11), 0, 2);
                return buf;
            };
            dosFormatDate = function(d) {
                var buf;
                buf = Buffer.alloc(2);
                buf.writeUIntLE(d.getDate() + (d.getMonth() + 1 << 5) + (d.getFullYear() - 1980 << 9), 0, 2);
                return buf;
            };
            getCombinedCrc = function(parts) {
                var buf;
                if (parts.length === 1) {
                    buf = Buffer.alloc(4);
                    buf.writeUInt32LE(parts[0].crc, 0, 4);
                    return buf;
                } else {
                    return crcUtils.crc32_combine_multi(parts).combinedCrc32;
                }
            };
            exports.totalLength = totalLength = function(entries) {
                return ZIP_ECD_SIZE + entries.reduce((function(sum, x) {
                    return sum + x.zLen;
                }), 0);
            };
            exports.createEntry = createEntry = function(filename, parts, mdate) {
                var compressed_size, contentLength, entry, i, len, stream, uncompressed_size;
                if (mdate == null) {
                    mdate = new Date;
                }
                compressed_size = parts.reduce((function(sum, x) {
                    return sum + x.zLen;
                }), DEFLATE_END.length);
                uncompressed_size = parts.reduce((function(sum, x) {
                    return sum + x.len;
                }), 0);
                contentLength = fileHeaderLength(filename) + compressed_size;
                entry = {
                    filename,
                    compressed_size,
                    uncompressed_size,
                    crc: getCombinedCrc(parts),
                    mtime: dosFormatTime(mdate),
                    mdate: dosFormatDate(mdate),
                    contentLength,
                    zLen: contentLength + centralDirectoryLength(filename),
                    stream: CombinedStream.create()
                };
                entry.stream.append(createFileHeader(entry));
                for (i = 0, len = parts.length; i < len; i++) {
                    ({stream} = parts[i]);
                    entry.stream.append(stream);
                }
                entry.stream.append(DEFLATE_END);
                return entry;
            };
            exports.create = create = function(entries) {
                var entry, i, j, len, len1, offset, out;
                out = CombinedStream.create();
                for (i = 0, len = entries.length; i < len; i++) {
                    entry = entries[i];
                    out.append(entry.stream);
                }
                offset = 0;
                for (j = 0, len1 = entries.length; j < len1; j++) {
                    entry = entries[j];
                    out.append(createCDRecord(entry, offset));
                    offset += entry.contentLength;
                }
                out.append(createEndOfCDRecord(entries));
                out.zLen = totalLength(entries);
                return out;
            };
            exports.createZip = function(filename, parts, mdate) {
                var entry;
                entry = createEntry(filename, parts, mdate);
                return create([ entry ]);
            };
        }).call(this);
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.SingleUseStreamSource = void 0;
        const source_destination_1 = __webpack_require__(25);
        const errors_1 = __webpack_require__(4);
        const stream_limiter_1 = __webpack_require__(22);
        class SingleUseStreamSource extends source_destination_1.SourceDestination {
            constructor(stream) {
                super();
                this.stream = stream;
                this.used = false;
            }
            async canCreateReadStream() {
                return !this.used;
            }
            async createReadStream({start = 0, end} = {}) {
                if (this.used) {
                    throw new errors_1.NotCapable("Single use source stream already used");
                }
                if (start !== 0) {
                    throw new errors_1.NotCapable("Can't seek in a single use stream");
                }
                let stream = this.stream;
                if (end !== undefined) {
                    stream = new stream_limiter_1.StreamLimiter(stream, end + 1);
                }
                this.used = true;
                return stream;
            }
        }
        exports.SingleUseStreamSource = SingleUseStreamSource;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        exports.XzSource = void 0;
        const lzma_native_1 = __webpack_require__(281);
        const os_1 = __webpack_require__(93);
        const util_1 = __webpack_require__(58);
        const compressed_source_1 = __webpack_require__(21);
        const source_destination_1 = __webpack_require__(25);
        const parseFileIndexAsync = (0, util_1.promisify)(lzma_native_1.parseFileIndex);
        class XzSource extends compressed_source_1.CompressedSource {
            createTransform() {
                return (0, lzma_native_1.createDecompressor)({
                    memlimit: Math.floor((0, os_1.totalmem)() * .2)
                });
            }
            async getSize() {
                if (!await this.source.canRead()) {
                    const sizeFromPartitionTable = await this.getSizeFromPartitionTable();
                    if (sizeFromPartitionTable !== undefined) {
                        return {
                            size: sizeFromPartitionTable,
                            isEstimated: true
                        };
                    }
                    return;
                }
                const {size} = await this.source.getMetadata();
                if (size === undefined) {
                    return;
                }
                const {uncompressedSize} = await parseFileIndexAsync({
                    fileSize: size,
                    read: async (count, offset, callback) => {
                        try {
                            const readResult = await this.source.read(Buffer.allocUnsafe(count), 0, count, offset);
                            callback(null, readResult.buffer);
                        } catch (error) {
                            callback(error);
                        }
                    }
                });
                return {
                    size: uncompressedSize,
                    isEstimated: false
                };
            }
        }
        exports.XzSource = XzSource;
        XzSource.mimetype = "application/x-xz";
        source_destination_1.SourceDestination.register(XzSource);
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        var __dirname = "node_modules\\lzma-native";
        (function() {
            "use strict";
            var stream = __webpack_require__(17);
            var assert = __webpack_require__(197);
            var fs = __webpack_require__(14);
            var util = __webpack_require__(58);
            var nodePreGyp = __webpack_require__(61);
            var path = __webpack_require__(15);
            var binding_path = nodePreGyp.find(path.resolve(path.join(__dirname, "./package.json")));
            var native = __webpack_require__(282);
            Object.assign(exports, native);
            exports.version = "6.0.1";
            var Stream = exports.Stream;
            Stream.curAsyncStreamsCount = 0;
            Stream.prototype.getStream = function(options) {
                options = options || {};
                return new JSLzmaStream(this, options);
            };
            class JSLzmaStream extends stream.Transform {
                constructor(nativeStream, options) {
                    super(options);
                    this.nativeStream = nativeStream;
                    this.synchronous = options.synchronous || !native.asyncCodeAvailable ? true : false;
                    this.chunkCallbacks = [];
                    this.totalIn_ = 0;
                    this.totalOut_ = 0;
                    this._writingLastChunk = false;
                    this._isFinished = false;
                    if (!this.synchronous) {
                        Stream.curAsyncStreamsCount++;
                        var oldCleanup = this.cleanup;
                        var countedCleanup = false;
                        this.cleanup = () => {
                            if (countedCleanup === false) {
                                Stream.curAsyncStreamsCount--;
                                countedCleanup = true;
                            }
                            oldCleanup.call(this);
                        };
                    }
                    this.once("error-cleanup", this.cleanup);
                    this.nativeStream.bufferHandler = (buf, processedChunks, err, totalIn, totalOut) => {
                        if (totalIn !== null) {
                            this.totalIn_ = totalIn;
                            this.totalOut_ = totalOut;
                        }
                        setImmediate((() => {
                            if (err) {
                                this.push(null);
                                this.emit("error-cleanup", err);
                                this.emit("error", err);
                                return;
                            }
                            if (totalIn !== null) {
                                this.emit("progress", {
                                    totalIn: this.totalIn_,
                                    totalOut: this.totalOut_
                                });
                            }
                            if (typeof processedChunks === "number") {
                                assert.ok(processedChunks <= this.chunkCallbacks.length);
                                var chunkCallbacks = this.chunkCallbacks.splice(0, processedChunks);
                                while (chunkCallbacks.length > 0) chunkCallbacks.shift().call(this);
                            } else if (buf === null) {
                                if (this._writingLastChunk) {
                                    this.push(null);
                                } else {
                                    this._isFinished = true;
                                    if (this.nativeStream && this.nativeStream._restart) {
                                        this.nativeStream._restart();
                                    } else {
                                        this.push(null);
                                    }
                                }
                            } else {
                                this.push(buf);
                            }
                        }));
                    };
                    if (typeof options.bufsize !== "undefined") {
                        this.bufsize = options.bufsize;
                    }
                }
                get bufsize() {
                    return this.setBufsize(null);
                }
                set bufsize(n) {
                    if (typeof n !== "number" || n <= 0) {
                        throw new TypeError("bufsize must be a positive number");
                    }
                    return this.setBufsize(n);
                }
                totalIn() {
                    return this.totalIn_;
                }
                totalOut() {
                    return this.totalOut_;
                }
                cleanup() {
                    if (this.nativeStream) {
                        this.nativeStream.resetUnderlying();
                    }
                    this.nativeStream = null;
                }
                _transform(chunk, encoding, callback) {
                    if (!this.nativeStream) return;
                    var possibleEndIndex = bufferIndexOfYZ(chunk);
                    if (possibleEndIndex !== -1) {
                        possibleEndIndex += 2;
                        if (possibleEndIndex !== chunk.length) {
                            this._transform(chunk.slice(0, possibleEndIndex), encoding, (() => {
                                this._transform(chunk.slice(possibleEndIndex), encoding, callback);
                            }));
                            return;
                        }
                    }
                    if (this._isFinished && chunk) {
                        chunk = skipLeadingZeroes(chunk);
                        if (chunk.length > 0) {
                            this._isFinished = false;
                        }
                    }
                    if (chunk && chunk.length === 0) {
                        return callback();
                    }
                    this.chunkCallbacks.push(callback);
                    try {
                        this.nativeStream.code(chunk, !this.synchronous);
                    } catch (e) {
                        this.emit("error-cleanup", e);
                        this.emit("error", e);
                    }
                }
                _writev(chunks, callback) {
                    chunks = chunks.map((chunk => chunk.chunk));
                    this._write(Buffer.concat(chunks), null, callback);
                }
                _flush(callback) {
                    this._writingLastChunk = true;
                    if (this._isFinished) {
                        this.cleanup();
                        callback(null);
                        return;
                    }
                    this._transform(null, null, (function() {
                        this.cleanup();
                        callback.apply(this, arguments);
                    }));
                }
            }
            Object.getOwnPropertyNames(native.Stream.prototype).forEach((function(key) {
                if (typeof native.Stream.prototype[key] !== "function" || key === "constructor") return;
                JSLzmaStream.prototype[key] = function() {
                    return this.nativeStream[key].apply(this.nativeStream, arguments);
                };
            }));
            Stream.prototype.rawEncoder = function(options) {
                return this.rawEncoder_(options.filters || []);
            };
            Stream.prototype.rawDecoder = function(options) {
                return this.rawDecoder_(options.filters || []);
            };
            Stream.prototype.easyEncoder = function(options) {
                var preset = options.preset || exports.PRESET_DEFAULT;
                var check = options.check || exports.CHECK_CRC32;
                if (typeof options.threads !== "undefined" && options.threads !== null) {
                    return this.mtEncoder_(Object.assign({
                        preset,
                        filters: null,
                        check
                    }, options));
                } else {
                    return this.easyEncoder_(preset, check);
                }
            };
            Stream.prototype.streamEncoder = function(options) {
                var filters = options.filters || [];
                var check = options.check || exports.CHECK_CRC32;
                if (typeof options.threads !== "undefined" && options.threads !== null) {
                    return this.mtEncoder_(Object.assign({
                        preset: null,
                        filters,
                        check
                    }, options));
                } else {
                    return this.streamEncoder_(filters, check);
                }
            };
            Stream.prototype.streamDecoder = function(options) {
                this._initOptions = options;
                this._restart = function() {
                    this.resetUnderlying();
                    this.streamDecoder(this._initOptions);
                };
                return this.streamDecoder_(options.memlimit || null, options.flags || 0);
            };
            Stream.prototype.autoDecoder = function(options) {
                this._initOptions = options;
                this._restart = function() {
                    this.resetUnderlying();
                    this.autoDecoder(this._initOptions);
                };
                return this.autoDecoder_(options.memlimit || null, options.flags || 0);
            };
            Stream.prototype.aloneDecoder = function(options) {
                return this.aloneDecoder_(options.memlimit || null);
            };
            var createStream = exports.createStream = function(coder, options) {
                if ([ "number", "object" ].indexOf(typeof coder) !== -1 && !options) {
                    options = coder;
                    coder = null;
                }
                if (parseInt(options) === parseInt(options)) options = {
                    preset: parseInt(options)
                };
                coder = coder || "easyEncoder";
                options = options || {};
                var stream = new Stream;
                stream[coder](options);
                if (options.memlimit) stream.memlimitSet(options.memlimit);
                return stream.getStream(options);
            };
            exports.createCompressor = function(options) {
                return createStream("easyEncoder", options);
            };
            exports.createDecompressor = function(options) {
                return createStream("autoDecoder", options);
            };
            exports.crc32 = function(input, encoding, presetCRC32) {
                if (typeof encoding === "number") {
                    presetCRC32 = encoding;
                    encoding = null;
                }
                if (typeof input === "string") input = Buffer.from(input, encoding);
                return exports.crc32_(input, presetCRC32 || 0);
            };
            exports.Compressor = function(preset, options) {
                options = Object.assign({}, options);
                if (preset) options.preset = preset;
                return createStream("easyEncoder", options);
            };
            exports.Decompressor = function(options) {
                return createStream("autoDecoder", options);
            };
            function singleStringCoding(stream, string, on_finish, on_progress) {
                on_progress = on_progress || function() {};
                on_finish = on_finish || function() {};
                if (!Buffer.isBuffer(string)) string = Buffer.from(string);
                var deferred = {}, failed = false;
                stream.once("error", (function(err) {
                    failed = true;
                    on_finish(null, err);
                }));
                deferred.promise = new Promise((function(resolve, reject) {
                    deferred.resolve = resolve;
                    deferred.reject = reject;
                }));
                deferred.promise.catch(noop);
                stream.once("error", (function(e) {
                    deferred.reject(e);
                }));
                var buffers = [];
                stream.on("data", (function(b) {
                    buffers.push(b);
                }));
                stream.once("end", (function() {
                    var result = Buffer.concat(buffers);
                    if (!failed) {
                        on_progress(1);
                        on_finish(result);
                    }
                    if (deferred) deferred.resolve(result);
                }));
                on_progress(0);
                stream.end(string);
                if (deferred) return deferred.promise;
            }
            exports.LZMA = function() {
                return {
                    compress: function(string, mode, on_finish, on_progress) {
                        var opt = {};
                        if (parseInt(mode) === parseInt(mode) && mode >= 1 && mode <= 9) opt.preset = parseInt(mode);
                        var stream = createStream("aloneEncoder", opt);
                        return singleStringCoding(stream, string, on_finish, on_progress);
                    },
                    decompress: function(byte_array, on_finish, on_progress) {
                        var stream = createStream("autoDecoder");
                        return singleStringCoding(stream, byte_array, on_finish, on_progress);
                    },
                    worker: function() {
                        return null;
                    }
                };
            };
            exports.compress = function(string, opt, on_finish) {
                if (typeof opt === "function") {
                    on_finish = opt;
                    opt = {};
                }
                var stream = createStream("easyEncoder", opt);
                return singleStringCoding(stream, string, on_finish);
            };
            exports.decompress = function(string, opt, on_finish) {
                if (typeof opt === "function") {
                    on_finish = opt;
                    opt = {};
                }
                var stream = createStream("autoDecoder", opt);
                return singleStringCoding(stream, string, on_finish);
            };
            if (util.promisify) {
                exports.compress[util.promisify.custom] = exports.compress;
                exports.decompress[util.promisify.custom] = exports.decompress;
            }
            exports.isXZ = function(buf) {
                return buf && buf.length >= 6 && buf[0] === 253 && buf[1] === 55 && buf[2] === 122 && buf[3] === 88 && buf[4] === 90 && buf[5] === 0;
            };
            exports.parseFileIndex = function(options, callback) {
                if (typeof options !== "object") {
                    throw new TypeError("parseFileIndex needs an options object");
                }
                var p = new native.IndexParser;
                if (typeof options.fileSize !== "number") {
                    throw new TypeError("parseFileeIndex needs options.fileSize");
                }
                if (typeof options.read !== "function") {
                    throw new TypeError("parseFileIndex needs a read callback");
                }
                p.init(options.fileSize, options.memlimit || 0);
                p.read_cb = function(count, offset) {
                    var inSameTick = true;
                    var bytesRead = count;
                    options.read(count, offset, (function(err, buffer) {
                        if (Buffer.isBuffer(err)) {
                            buffer = err;
                            err = null;
                        }
                        if (err) {
                            if (typeof callback === "undefined") {
                                throw err;
                            }
                            return callback(err, null);
                        }
                        p.feed(buffer);
                        bytesRead = buffer.length;
                        if (inSameTick) {
                            return;
                        }
                        var info;
                        try {
                            info = p.parse();
                        } catch (e) {
                            return callback(e, null);
                        }
                        if (info !== true) {
                            return callback(null, cleanupIndexInfo(info));
                        }
                    }));
                    inSameTick = false;
                    return bytesRead;
                };
                var info;
                try {
                    info = p.parse();
                } catch (e) {
                    if (typeof callback !== "undefined") {
                        callback(e, null);
                        return;
                    }
                    throw e;
                }
                if (info !== true) {
                    info = cleanupIndexInfo(info);
                    if (typeof callback !== "undefined" && info !== true) {
                        callback(null, info);
                    }
                    return info;
                }
            };
            exports.parseFileIndexFD = function(fd, callback) {
                return fs.fstat(fd, (function(err, stats) {
                    if (err) {
                        return callback(err, null);
                    }
                    exports.parseFileIndex({
                        fileSize: stats.size,
                        read: function(count, offset, cb) {
                            var buffer = Buffer.allocUnsafe(count);
                            fs.read(fd, buffer, 0, count, offset, (function(err, bytesRead, buffer) {
                                if (err) {
                                    return cb(err, null);
                                }
                                if (bytesRead !== count) {
                                    return cb(new Error("Truncated file!"), null);
                                }
                                cb(null, buffer);
                            }));
                        }
                    }, callback);
                }));
            };
            function cleanupIndexInfo(info) {
                var checkFlags = info.checks;
                info.checks = [];
                for (var i = 0; i < exports.CHECK_ID_MAX; i++) {
                    if (checkFlags & 1 << i) info.checks.push(i);
                }
                return info;
            }
            function skipLeadingZeroes(buffer) {
                var i;
                for (i = 0; i < buffer.length; i++) {
                    if (buffer[i] !== 0) break;
                }
                return buffer.slice(i);
            }
            function bufferIndexOfYZ(chunk) {
                if (!chunk) {
                    return -1;
                }
                if (chunk.indexOf) {
                    return chunk.indexOf("YZ");
                }
                var i;
                for (i = 0; i < chunk.length - 1; i++) {
                    if (chunk[i] === 89 && chunk[i + 1] === 90) {
                        return i;
                    }
                }
                return -1;
            }
            function noop() {}
        })();
    }, module => {
        module.exports = require("./modules/lzma-native/binding/lzma_native.node");
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        Object.defineProperty(exports, "__esModule", {
            value: true
        });
        const tslib_1 = __webpack_require__(108);
        (0, tslib_1.__exportStar)(__webpack_require__(54), exports);
        (0, tslib_1.__exportStar)(__webpack_require__(67), exports);
        (0, tslib_1.__exportStar)(__webpack_require__(99), exports);
        (0, tslib_1.__exportStar)(__webpack_require__(55), exports);
    }, function(module, exports, __webpack_require__) {
        module = __webpack_require__.nmd(module);
        var __WEBPACK_AMD_DEFINE_RESULT__;
        (function() {
            var undefined;
            var VERSION = "4.17.20";
            var LARGE_ARRAY_SIZE = 200;
            var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function";
            var HASH_UNDEFINED = "__lodash_hash_undefined__";
            var MAX_MEMOIZE_SIZE = 500;
            var PLACEHOLDER = "__lodash_placeholder__";
            var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
            var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
            var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512;
            var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "...";
            var HOT_COUNT = 800, HOT_SPAN = 16;
            var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3;
            var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0;
            var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
            var wrapFlags = [ [ "ary", WRAP_ARY_FLAG ], [ "bind", WRAP_BIND_FLAG ], [ "bindKey", WRAP_BIND_KEY_FLAG ], [ "curry", WRAP_CURRY_FLAG ], [ "curryRight", WRAP_CURRY_RIGHT_FLAG ], [ "flip", WRAP_FLIP_FLAG ], [ "partial", WRAP_PARTIAL_FLAG ], [ "partialRight", WRAP_PARTIAL_RIGHT_FLAG ], [ "rearg", WRAP_REARG_FLAG ] ];
            var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", domExcTag = "[object DOMException]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]", weakSetTag = "[object WeakSet]";
            var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
            var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
            var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
            var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g;
            var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
            var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source);
            var reTrim = /^\s+|\s+$/g, reTrimStart = /^\s+/, reTrimEnd = /\s+$/;
            var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /;
            var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
            var reEscapeChar = /\\(\\)?/g;
            var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
            var reFlags = /\w*$/;
            var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
            var reIsBinary = /^0b[01]+$/i;
            var reIsHostCtor = /^\[object .+?Constructor\]$/;
            var reIsOctal = /^0o[0-7]+$/i;
            var reIsUint = /^(?:0|[1-9]\d*)$/;
            var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
            var reNoMatch = /($^)/;
            var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
            var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
            var rsApos = "['’]", rsAstral = "[" + rsAstralRange + "]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d";
            var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [ rsNonAstral, rsRegional, rsSurrPair ].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [ rsDingbat, rsRegional, rsSurrPair ].join("|") + ")" + rsSeq, rsSymbol = "(?:" + [ rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral ].join("|") + ")";
            var reApos = RegExp(rsApos, "g");
            var reComboMark = RegExp(rsCombo, "g");
            var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
            var reUnicodeWord = RegExp([ rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [ rsBreak, rsUpper, "$" ].join("|") + ")", rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [ rsBreak, rsUpper + rsMiscLower, "$" ].join("|") + ")", rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower, rsUpper + "+" + rsOptContrUpper, rsOrdUpper, rsOrdLower, rsDigits, rsEmoji ].join("|"), "g");
            var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
            var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
            var contextProps = [ "Array", "Buffer", "DataView", "Date", "Error", "Float32Array", "Float64Array", "Function", "Int8Array", "Int16Array", "Int32Array", "Map", "Math", "Object", "Promise", "RegExp", "Set", "String", "Symbol", "TypeError", "Uint8Array", "Uint8ClampedArray", "Uint16Array", "Uint32Array", "WeakMap", "_", "clearTimeout", "isFinite", "parseInt", "setTimeout" ];
            var templateCounter = -1;
            var typedArrayTags = {};
            typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
            typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
            var cloneableTags = {};
            cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
            cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
            var deburredLetters = {
                À: "A",
                Á: "A",
                Â: "A",
                Ã: "A",
                Ä: "A",
                Å: "A",
                à: "a",
                á: "a",
                â: "a",
                ã: "a",
                ä: "a",
                å: "a",
                Ç: "C",
                ç: "c",
                Ð: "D",
                ð: "d",
                È: "E",
                É: "E",
                Ê: "E",
                Ë: "E",
                è: "e",
                é: "e",
                ê: "e",
                ë: "e",
                Ì: "I",
                Í: "I",
                Î: "I",
                Ï: "I",
                ì: "i",
                í: "i",
                î: "i",
                ï: "i",
                Ñ: "N",
                ñ: "n",
                Ò: "O",
                Ó: "O",
                Ô: "O",
                Õ: "O",
                Ö: "O",
                Ø: "O",
                ò: "o",
                ó: "o",
                ô: "o",
                õ: "o",
                ö: "o",
                ø: "o",
                Ù: "U",
                Ú: "U",
                Û: "U",
                Ü: "U",
                ù: "u",
                ú: "u",
                û: "u",
                ü: "u",
                Ý: "Y",
                ý: "y",
                ÿ: "y",
                Æ: "Ae",
                æ: "ae",
                Þ: "Th",
                þ: "th",
                ß: "ss",
                Ā: "A",
                Ă: "A",
                Ą: "A",
                ā: "a",
                ă: "a",
                ą: "a",
                Ć: "C",
                Ĉ: "C",
                Ċ: "C",
                Č: "C",
                ć: "c",
                ĉ: "c",
                ċ: "c",
                č: "c",
                Ď: "D",
                Đ: "D",
                ď: "d",
                đ: "d",
                Ē: "E",
                Ĕ: "E",
                Ė: "E",
                Ę: "E",
                Ě: "E",
                ē: "e",
                ĕ: "e",
                ė: "e",
                ę: "e",
                ě: "e",
                Ĝ: "G",
                Ğ: "G",
                Ġ: "G",
                Ģ: "G",
                ĝ: "g",
                ğ: "g",
                ġ: "g",
                ģ: "g",
                Ĥ: "H",
                Ħ: "H",
                ĥ: "h",
                ħ: "h",
                Ĩ: "I",
                Ī: "I",
                Ĭ: "I",
                Į: "I",
                İ: "I",
                ĩ: "i",
                ī: "i",
                ĭ: "i",
                į: "i",
                ı: "i",
                Ĵ: "J",
                ĵ: "j",
                Ķ: "K",
                ķ: "k",
                ĸ: "k",
                Ĺ: "L",
                Ļ: "L",
                Ľ: "L",
                Ŀ: "L",
                Ł: "L",
                ĺ: "l",
                ļ: "l",
                ľ: "l",
                ŀ: "l",
                ł: "l",
                Ń: "N",
                Ņ: "N",
                Ň: "N",
                Ŋ: "N",
                ń: "n",
                ņ: "n",
                ň: "n",
                ŋ: "n",
                Ō: "O",
                Ŏ: "O",
                Ő: "O",
                ō: "o",
                ŏ: "o",
                ő: "o",
                Ŕ: "R",
                Ŗ: "R",
                Ř: "R",
                ŕ: "r",
                ŗ: "r",
                ř: "r",
                Ś: "S",
                Ŝ: "S",
                Ş: "S",
                Š: "S",
                ś: "s",
                ŝ: "s",
                ş: "s",
                š: "s",
                Ţ: "T",
                Ť: "T",
                Ŧ: "T",
                ţ: "t",
                ť: "t",
                ŧ: "t",
                Ũ: "U",
                Ū: "U",
                Ŭ: "U",
                Ů: "U",
                Ű: "U",
                Ų: "U",
                ũ: "u",
                ū: "u",
                ŭ: "u",
                ů: "u",
                ű: "u",
                ų: "u",
                Ŵ: "W",
                ŵ: "w",
                Ŷ: "Y",
                ŷ: "y",
                Ÿ: "Y",
                Ź: "Z",
                Ż: "Z",
                Ž: "Z",
                ź: "z",
                ż: "z",
                ž: "z",
                Ĳ: "IJ",
                ĳ: "ij",
                Œ: "Oe",
                œ: "oe",
                ŉ: "'n",
                ſ: "s"
            };
            var htmlEscapes = {
                "&": "&amp;",
                "<": "&lt;",
                ">": "&gt;",
                '"': "&quot;",
                "'": "&#39;"
            };
            var htmlUnescapes = {
                "&amp;": "&",
                "&lt;": "<",
                "&gt;": ">",
                "&quot;": '"',
                "&#39;": "'"
            };
            var stringEscapes = {
                "\\": "\\",
                "'": "'",
                "\n": "n",
                "\r": "r",
                "\u2028": "u2028",
                "\u2029": "u2029"
            };
            var freeParseFloat = parseFloat, freeParseInt = parseInt;
            var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
            var freeSelf = typeof self == "object" && self && self.Object === Object && self;
            var root = freeGlobal || freeSelf || Function("return this")();
            var freeExports = true && exports && !exports.nodeType && exports;
            var freeModule = freeExports && "object" == "object" && module && !module.nodeType && module;
            var moduleExports = freeModule && freeModule.exports === freeExports;
            var freeProcess = moduleExports && freeGlobal.process;
            var nodeUtil = function() {
                try {
                    var types = freeModule && freeModule.require && freeModule.require("util").types;
                    if (types) {
                        return types;
                    }
                    return freeProcess && freeProcess.binding && freeProcess.binding("util");
                } catch (e) {}
            }();
            var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, nodeIsDate = nodeUtil && nodeUtil.isDate, nodeIsMap = nodeUtil && nodeUtil.isMap, nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, nodeIsSet = nodeUtil && nodeUtil.isSet, nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
            function apply(func, thisArg, args) {
                switch (args.length) {
                  case 0:
                    return func.call(thisArg);

                  case 1:
                    return func.call(thisArg, args[0]);

                  case 2:
                    return func.call(thisArg, args[0], args[1]);

                  case 3:
                    return func.call(thisArg, args[0], args[1], args[2]);
                }
                return func.apply(thisArg, args);
            }
            function arrayAggregator(array, setter, iteratee, accumulator) {
                var index = -1, length = array == null ? 0 : array.length;
                while (++index < length) {
                    var value = array[index];
                    setter(accumulator, value, iteratee(value), array);
                }
                return accumulator;
            }
            function arrayEach(array, iteratee) {
                var index = -1, length = array == null ? 0 : array.length;
                while (++index < length) {
                    if (iteratee(array[index], index, array) === false) {
                        break;
                    }
                }
                return array;
            }
            function arrayEachRight(array, iteratee) {
                var length = array == null ? 0 : array.length;
                while (length--) {
                    if (iteratee(array[length], length, array) === false) {
                        break;
                    }
                }
                return array;
            }
            function arrayEvery(array, predicate) {
                var index = -1, length = array == null ? 0 : array.length;
                while (++index < length) {
                    if (!predicate(array[index], index, array)) {
                        return false;
                    }
                }
                return true;
            }
            function arrayFilter(array, predicate) {
                var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
                while (++index < length) {
                    var value = array[index];
                    if (predicate(value, index, array)) {
                        result[resIndex++] = value;
                    }
                }
                return result;
            }
            function arrayIncludes(array, value) {
                var length = array == null ? 0 : array.length;
                return !!length && baseIndexOf(array, value, 0) > -1;
            }
            function arrayIncludesWith(array, value, comparator) {
                var index = -1, length = array == null ? 0 : array.length;
                while (++index < length) {
                    if (comparator(value, array[index])) {
                        return true;
                    }
                }
                return false;
            }
            function arrayMap(array, iteratee) {
                var index = -1, length = array == null ? 0 : array.length, result = Array(length);
                while (++index < length) {
                    result[index] = iteratee(array[index], index, array);
                }
                return result;
            }
            function arrayPush(array, values) {
                var index = -1, length = values.length, offset = array.length;
                while (++index < length) {
                    array[offset + index] = values[index];
                }
                return array;
            }
            function arrayReduce(array, iteratee, accumulator, initAccum) {
                var index = -1, length = array == null ? 0 : array.length;
                if (initAccum && length) {
                    accumulator = array[++index];
                }
                while (++index < length) {
                    accumulator = iteratee(accumulator, array[index], index, array);
                }
                return accumulator;
            }
            function arrayReduceRight(array, iteratee, accumulator, initAccum) {
                var length = array == null ? 0 : array.length;
                if (initAccum && length) {
                    accumulator = array[--length];
                }
                while (length--) {
                    accumulator = iteratee(accumulator, array[length], length, array);
                }
                return accumulator;
            }
            function arraySome(array, predicate) {
                var index = -1, length = array == null ? 0 : array.length;
                while (++index < length) {
                    if (predicate(array[index], index, array)) {
                        return true;
                    }
                }
                return false;
            }
            var asciiSize = baseProperty("length");
            function asciiToArray(string) {
                return string.split("");
            }
            function asciiWords(string) {
                return string.match(reAsciiWord) || [];
            }
            function baseFindKey(collection, predicate, eachFunc) {
                var result;
                eachFunc(collection, (function(value, key, collection) {
                    if (predicate(value, key, collection)) {
                        result = key;
                        return false;
                    }
                }));
                return result;
            }
            function baseFindIndex(array, predicate, fromIndex, fromRight) {
                var length = array.length, index = fromIndex + (fromRight ? 1 : -1);
                while (fromRight ? index-- : ++index < length) {
                    if (predicate(array[index], index, array)) {
                        return index;
                    }
                }
                return -1;
            }
            function baseIndexOf(array, value, fromIndex) {
                return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
            }
            function baseIndexOfWith(array, value, fromIndex, comparator) {
                var index = fromIndex - 1, length = array.length;
                while (++index < length) {
                    if (comparator(array[index], value)) {
                        return index;
                    }
                }
                return -1;
            }
            function baseIsNaN(value) {
                return value !== value;
            }
            function baseMean(array, iteratee) {
                var length = array == null ? 0 : array.length;
                return length ? baseSum(array, iteratee) / length : NAN;
            }
            function baseProperty(key) {
                return function(object) {
                    return object == null ? undefined : object[key];
                };
            }
            function basePropertyOf(object) {
                return function(key) {
                    return object == null ? undefined : object[key];
                };
            }
            function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
                eachFunc(collection, (function(value, index, collection) {
                    accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection);
                }));
                return accumulator;
            }
            function baseSortBy(array, comparer) {
                var length = array.length;
                array.sort(comparer);
                while (length--) {
                    array[length] = array[length].value;
                }
                return array;
            }
            function baseSum(array, iteratee) {
                var result, index = -1, length = array.length;
                while (++index < length) {
                    var current = iteratee(array[index]);
                    if (current !== undefined) {
                        result = result === undefined ? current : result + current;
                    }
                }
                return result;
            }
            function baseTimes(n, iteratee) {
                var index = -1, result = Array(n);
                while (++index < n) {
                    result[index] = iteratee(index);
                }
                return result;
            }
            function baseToPairs(object, props) {
                return arrayMap(props, (function(key) {
                    return [ key, object[key] ];
                }));
            }
            function baseUnary(func) {
                return function(value) {
                    return func(value);
                };
            }
            function baseValues(object, props) {
                return arrayMap(props, (function(key) {
                    return object[key];
                }));
            }
            function cacheHas(cache, key) {
                return cache.has(key);
            }
            function charsStartIndex(strSymbols, chrSymbols) {
                var index = -1, length = strSymbols.length;
                while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
                return index;
            }
            function charsEndIndex(strSymbols, chrSymbols) {
                var index = strSymbols.length;
                while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
                return index;
            }
            function countHolders(array, placeholder) {
                var length = array.length, result = 0;
                while (length--) {
                    if (array[length] === placeholder) {
                        ++result;
                    }
                }
                return result;
            }
            var deburrLetter = basePropertyOf(deburredLetters);
            var escapeHtmlChar = basePropertyOf(htmlEscapes);
            function escapeStringChar(chr) {
                return "\\" + stringEscapes[chr];
            }
            function getValue(object, key) {
                return object == null ? undefined : object[key];
            }
            function hasUnicode(string) {
                return reHasUnicode.test(string);
            }
            function hasUnicodeWord(string) {
                return reHasUnicodeWord.test(string);
            }
            function iteratorToArray(iterator) {
                var data, result = [];
                while (!(data = iterator.next()).done) {
                    result.push(data.value);
                }
                return result;
            }
            function mapToArray(map) {
                var index = -1, result = Array(map.size);
                map.forEach((function(value, key) {
                    result[++index] = [ key, value ];
                }));
                return result;
            }
            function overArg(func, transform) {
                return function(arg) {
                    return func(transform(arg));
                };
            }
            function replaceHolders(array, placeholder) {
                var index = -1, length = array.length, resIndex = 0, result = [];
                while (++index < length) {
                    var value = array[index];
                    if (value === placeholder || value === PLACEHOLDER) {
                        array[index] = PLACEHOLDER;
                        result[resIndex++] = index;
                    }
                }
                return result;
            }
            function setToArray(set) {
                var index = -1, result = Array(set.size);
                set.forEach((function(value) {
                    result[++index] = value;
                }));
                return result;
            }
            function setToPairs(set) {
                var index = -1, result = Array(set.size);
                set.forEach((function(value) {
                    result[++index] = [ value, value ];
                }));
                return result;
            }
            function strictIndexOf(array, value, fromIndex) {
                var index = fromIndex - 1, length = array.length;
                while (++index < length) {
                    if (array[index] === value) {
                        return index;
                    }
                }
                return -1;
            }
            function strictLastIndexOf(array, value, fromIndex) {
                var index = fromIndex + 1;
                while (index--) {
                    if (array[index] === value) {
                        return index;
                    }
                }
                return index;
            }
            function stringSize(string) {
                return hasUnicode(string) ? unicodeSize(string) : asciiSize(string);
            }
            function stringToArray(string) {
                return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string);
            }
            var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
            function unicodeSize(string) {
                var result = reUnicode.lastIndex = 0;
                while (reUnicode.test(string)) {
                    ++result;
                }
                return result;
            }
            function unicodeToArray(string) {
                return string.match(reUnicode) || [];
            }
            function unicodeWords(string) {
                return string.match(reUnicodeWord) || [];
            }
            var runInContext = function runInContext(context) {
                context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
                var Array = context.Array, Date = context.Date, Error = context.Error, Function = context.Function, Math = context.Math, Object = context.Object, RegExp = context.RegExp, String = context.String, TypeError = context.TypeError;
                var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype;
                var coreJsData = context["__core-js_shared__"];
                var funcToString = funcProto.toString;
                var hasOwnProperty = objectProto.hasOwnProperty;
                var idCounter = 0;
                var maskSrcKey = function() {
                    var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
                    return uid ? "Symbol(src)_1." + uid : "";
                }();
                var nativeObjectToString = objectProto.toString;
                var objectCtorString = funcToString.call(Object);
                var oldDash = root._;
                var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
                var Buffer = moduleExports ? context.Buffer : undefined, Symbol = context.Symbol, Uint8Array = context.Uint8Array, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, symIterator = Symbol ? Symbol.iterator : undefined, symToStringTag = Symbol ? Symbol.toStringTag : undefined;
                var defineProperty = function() {
                    try {
                        var func = getNative(Object, "defineProperty");
                        func({}, "", {});
                        return func;
                    } catch (e) {}
                }();
                var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date && Date.now !== root.Date.now && Date.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
                var nativeCeil = Math.ceil, nativeFloor = Math.floor, nativeGetSymbols = Object.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object.keys, Object), nativeMax = Math.max, nativeMin = Math.min, nativeNow = Date.now, nativeParseInt = context.parseInt, nativeRandom = Math.random, nativeReverse = arrayProto.reverse;
                var DataView = getNative(context, "DataView"), Map = getNative(context, "Map"), Promise = getNative(context, "Promise"), Set = getNative(context, "Set"), WeakMap = getNative(context, "WeakMap"), nativeCreate = getNative(Object, "create");
                var metaMap = WeakMap && new WeakMap;
                var realNames = {};
                var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap);
                var symbolProto = Symbol ? Symbol.prototype : undefined, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, symbolToString = symbolProto ? symbolProto.toString : undefined;
                function lodash(value) {
                    if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
                        if (value instanceof LodashWrapper) {
                            return value;
                        }
                        if (hasOwnProperty.call(value, "__wrapped__")) {
                            return wrapperClone(value);
                        }
                    }
                    return new LodashWrapper(value);
                }
                var baseCreate = function() {
                    function object() {}
                    return function(proto) {
                        if (!isObject(proto)) {
                            return {};
                        }
                        if (objectCreate) {
                            return objectCreate(proto);
                        }
                        object.prototype = proto;
                        var result = new object;
                        object.prototype = undefined;
                        return result;
                    };
                }();
                function baseLodash() {}
                function LodashWrapper(value, chainAll) {
                    this.__wrapped__ = value;
                    this.__actions__ = [];
                    this.__chain__ = !!chainAll;
                    this.__index__ = 0;
                    this.__values__ = undefined;
                }
                lodash.templateSettings = {
                    escape: reEscape,
                    evaluate: reEvaluate,
                    interpolate: reInterpolate,
                    variable: "",
                    imports: {
                        _: lodash
                    }
                };
                lodash.prototype = baseLodash.prototype;
                lodash.prototype.constructor = lodash;
                LodashWrapper.prototype = baseCreate(baseLodash.prototype);
                LodashWrapper.prototype.constructor = LodashWrapper;
                function LazyWrapper(value) {
                    this.__wrapped__ = value;
                    this.__actions__ = [];
                    this.__dir__ = 1;
                    this.__filtered__ = false;
                    this.__iteratees__ = [];
                    this.__takeCount__ = MAX_ARRAY_LENGTH;
                    this.__views__ = [];
                }
                function lazyClone() {
                    var result = new LazyWrapper(this.__wrapped__);
                    result.__actions__ = copyArray(this.__actions__);
                    result.__dir__ = this.__dir__;
                    result.__filtered__ = this.__filtered__;
                    result.__iteratees__ = copyArray(this.__iteratees__);
                    result.__takeCount__ = this.__takeCount__;
                    result.__views__ = copyArray(this.__views__);
                    return result;
                }
                function lazyReverse() {
                    if (this.__filtered__) {
                        var result = new LazyWrapper(this);
                        result.__dir__ = -1;
                        result.__filtered__ = true;
                    } else {
                        result = this.clone();
                        result.__dir__ *= -1;
                    }
                    return result;
                }
                function lazyValue() {
                    var array = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray(array), isRight = dir < 0, arrLength = isArr ? array.length : 0, view = getView(0, arrLength, this.__views__), start = view.start, end = view.end, length = end - start, index = isRight ? end : start - 1, iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin(length, this.__takeCount__);
                    if (!isArr || !isRight && arrLength == length && takeCount == length) {
                        return baseWrapperValue(array, this.__actions__);
                    }
                    var result = [];
                    outer: while (length-- && resIndex < takeCount) {
                        index += dir;
                        var iterIndex = -1, value = array[index];
                        while (++iterIndex < iterLength) {
                            var data = iteratees[iterIndex], iteratee = data.iteratee, type = data.type, computed = iteratee(value);
                            if (type == LAZY_MAP_FLAG) {
                                value = computed;
                            } else if (!computed) {
                                if (type == LAZY_FILTER_FLAG) {
                                    continue outer;
                                } else {
                                    break outer;
                                }
                            }
                        }
                        result[resIndex++] = value;
                    }
                    return result;
                }
                LazyWrapper.prototype = baseCreate(baseLodash.prototype);
                LazyWrapper.prototype.constructor = LazyWrapper;
                function Hash(entries) {
                    var index = -1, length = entries == null ? 0 : entries.length;
                    this.clear();
                    while (++index < length) {
                        var entry = entries[index];
                        this.set(entry[0], entry[1]);
                    }
                }
                function hashClear() {
                    this.__data__ = nativeCreate ? nativeCreate(null) : {};
                    this.size = 0;
                }
                function hashDelete(key) {
                    var result = this.has(key) && delete this.__data__[key];
                    this.size -= result ? 1 : 0;
                    return result;
                }
                function hashGet(key) {
                    var data = this.__data__;
                    if (nativeCreate) {
                        var result = data[key];
                        return result === HASH_UNDEFINED ? undefined : result;
                    }
                    return hasOwnProperty.call(data, key) ? data[key] : undefined;
                }
                function hashHas(key) {
                    var data = this.__data__;
                    return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
                }
                function hashSet(key, value) {
                    var data = this.__data__;
                    this.size += this.has(key) ? 0 : 1;
                    data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
                    return this;
                }
                Hash.prototype.clear = hashClear;
                Hash.prototype["delete"] = hashDelete;
                Hash.prototype.get = hashGet;
                Hash.prototype.has = hashHas;
                Hash.prototype.set = hashSet;
                function ListCache(entries) {
                    var index = -1, length = entries == null ? 0 : entries.length;
                    this.clear();
                    while (++index < length) {
                        var entry = entries[index];
                        this.set(entry[0], entry[1]);
                    }
                }
                function listCacheClear() {
                    this.__data__ = [];
                    this.size = 0;
                }
                function listCacheDelete(key) {
                    var data = this.__data__, index = assocIndexOf(data, key);
                    if (index < 0) {
                        return false;
                    }
                    var lastIndex = data.length - 1;
                    if (index == lastIndex) {
                        data.pop();
                    } else {
                        splice.call(data, index, 1);
                    }
                    --this.size;
                    return true;
                }
                function listCacheGet(key) {
                    var data = this.__data__, index = assocIndexOf(data, key);
                    return index < 0 ? undefined : data[index][1];
                }
                function listCacheHas(key) {
                    return assocIndexOf(this.__data__, key) > -1;
                }
                function listCacheSet(key, value) {
                    var data = this.__data__, index = assocIndexOf(data, key);
                    if (index < 0) {
                        ++this.size;
                        data.push([ key, value ]);
                    } else {
                        data[index][1] = value;
                    }
                    return this;
                }
                ListCache.prototype.clear = listCacheClear;
                ListCache.prototype["delete"] = listCacheDelete;
                ListCache.prototype.get = listCacheGet;
                ListCache.prototype.has = listCacheHas;
                ListCache.prototype.set = listCacheSet;
                function MapCache(entries) {
                    var index = -1, length = entries == null ? 0 : entries.length;
                    this.clear();
                    while (++index < length) {
                        var entry = entries[index];
                        this.set(entry[0], entry[1]);
                    }
                }
                function mapCacheClear() {
                    this.size = 0;
                    this.__data__ = {
                        hash: new Hash,
                        map: new (Map || ListCache),
                        string: new Hash
                    };
                }
                function mapCacheDelete(key) {
                    var result = getMapData(this, key)["delete"](key);
                    this.size -= result ? 1 : 0;
                    return result;
                }
                function mapCacheGet(key) {
                    return getMapData(this, key).get(key);
                }
                function mapCacheHas(key) {
                    return getMapData(this, key).has(key);
                }
                function mapCacheSet(key, value) {
                    var data = getMapData(this, key), size = data.size;
                    data.set(key, value);
                    this.size += data.size == size ? 0 : 1;
                    return this;
                }
                MapCache.prototype.clear = mapCacheClear;
                MapCache.prototype["delete"] = mapCacheDelete;
                MapCache.prototype.get = mapCacheGet;
                MapCache.prototype.has = mapCacheHas;
                MapCache.prototype.set = mapCacheSet;
                function SetCache(values) {
                    var index = -1, length = values == null ? 0 : values.length;
                    this.__data__ = new MapCache;
                    while (++index < length) {
                        this.add(values[index]);
                    }
                }
                function setCacheAdd(value) {
                    this.__data__.set(value, HASH_UNDEFINED);
                    return this;
                }
                function setCacheHas(value) {
                    return this.__data__.has(value);
                }
                SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
                SetCache.prototype.has = setCacheHas;
                function Stack(entries) {
                    var data = this.__data__ = new ListCache(entries);
                    this.size = data.size;
                }
                function stackClear() {
                    this.__data__ = new ListCache;
                    this.size = 0;
                }
                function stackDelete(key) {
                    var data = this.__data__, result = data["delete"](key);
                    this.size = data.size;
                    return result;
                }
                function stackGet(key) {
                    return this.__data__.get(key);
                }
                function stackHas(key) {
                    return this.__data__.has(key);
                }
                function stackSet(key, value) {
                    var data = this.__data__;
                    if (data instanceof ListCache) {
                        var pairs = data.__data__;
                        if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
                            pairs.push([ key, value ]);
                            this.size = ++data.size;
                            return this;
                        }
                        data = this.__data__ = new MapCache(pairs);
                    }
                    data.set(key, value);
                    this.size = data.size;
                    return this;
                }
                Stack.prototype.clear = stackClear;
                Stack.prototype["delete"] = stackDelete;
                Stack.prototype.get = stackGet;
                Stack.prototype.has = stackHas;
                Stack.prototype.set = stackSet;
                function arrayLikeKeys(value, inherited) {
                    var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
                    for (var key in value) {
                        if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) {
                            result.push(key);
                        }
                    }
                    return result;
                }
                function arraySample(array) {
                    var length = array.length;
                    return length ? array[baseRandom(0, length - 1)] : undefined;
                }
                function arraySampleSize(array, n) {
                    return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
                }
                function arrayShuffle(array) {
                    return shuffleSelf(copyArray(array));
                }
                function assignMergeValue(object, key, value) {
                    if (value !== undefined && !eq(object[key], value) || value === undefined && !(key in object)) {
                        baseAssignValue(object, key, value);
                    }
                }
                function assignValue(object, key, value) {
                    var objValue = object[key];
                    if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined && !(key in object)) {
                        baseAssignValue(object, key, value);
                    }
                }
                function assocIndexOf(array, key) {
                    var length = array.length;
                    while (length--) {
                        if (eq(array[length][0], key)) {
                            return length;
                        }
                    }
                    return -1;
                }
                function baseAggregator(collection, setter, iteratee, accumulator) {
                    baseEach(collection, (function(value, key, collection) {
                        setter(accumulator, value, iteratee(value), collection);
                    }));
                    return accumulator;
                }
                function baseAssign(object, source) {
                    return object && copyObject(source, keys(source), object);
                }
                function baseAssignIn(object, source) {
                    return object && copyObject(source, keysIn(source), object);
                }
                function baseAssignValue(object, key, value) {
                    if (key == "__proto__" && defineProperty) {
                        defineProperty(object, key, {
                            configurable: true,
                            enumerable: true,
                            value,
                            writable: true
                        });
                    } else {
                        object[key] = value;
                    }
                }
                function baseAt(object, paths) {
                    var index = -1, length = paths.length, result = Array(length), skip = object == null;
                    while (++index < length) {
                        result[index] = skip ? undefined : get(object, paths[index]);
                    }
                    return result;
                }
                function baseClamp(number, lower, upper) {
                    if (number === number) {
                        if (upper !== undefined) {
                            number = number <= upper ? number : upper;
                        }
                        if (lower !== undefined) {
                            number = number >= lower ? number : lower;
                        }
                    }
                    return number;
                }
                function baseClone(value, bitmask, customizer, key, object, stack) {
                    var result, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG;
                    if (customizer) {
                        result = object ? customizer(value, key, object, stack) : customizer(value);
                    }
                    if (result !== undefined) {
                        return result;
                    }
                    if (!isObject(value)) {
                        return value;
                    }
                    var isArr = isArray(value);
                    if (isArr) {
                        result = initCloneArray(value);
                        if (!isDeep) {
                            return copyArray(value, result);
                        }
                    } else {
                        var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
                        if (isBuffer(value)) {
                            return cloneBuffer(value, isDeep);
                        }
                        if (tag == objectTag || tag == argsTag || isFunc && !object) {
                            result = isFlat || isFunc ? {} : initCloneObject(value);
                            if (!isDeep) {
                                return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value));
                            }
                        } else {
                            if (!cloneableTags[tag]) {
                                return object ? value : {};
                            }
                            result = initCloneByTag(value, tag, isDeep);
                        }
                    }
                    stack || (stack = new Stack);
                    var stacked = stack.get(value);
                    if (stacked) {
                        return stacked;
                    }
                    stack.set(value, result);
                    if (isSet(value)) {
                        value.forEach((function(subValue) {
                            result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
                        }));
                    } else if (isMap(value)) {
                        value.forEach((function(subValue, key) {
                            result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
                        }));
                    }
                    var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
                    var props = isArr ? undefined : keysFunc(value);
                    arrayEach(props || value, (function(subValue, key) {
                        if (props) {
                            key = subValue;
                            subValue = value[key];
                        }
                        assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
                    }));
                    return result;
                }
                function baseConforms(source) {
                    var props = keys(source);
                    return function(object) {
                        return baseConformsTo(object, source, props);
                    };
                }
                function baseConformsTo(object, source, props) {
                    var length = props.length;
                    if (object == null) {
                        return !length;
                    }
                    object = Object(object);
                    while (length--) {
                        var key = props[length], predicate = source[key], value = object[key];
                        if (value === undefined && !(key in object) || !predicate(value)) {
                            return false;
                        }
                    }
                    return true;
                }
                function baseDelay(func, wait, args) {
                    if (typeof func != "function") {
                        throw new TypeError(FUNC_ERROR_TEXT);
                    }
                    return setTimeout((function() {
                        func.apply(undefined, args);
                    }), wait);
                }
                function baseDifference(array, values, iteratee, comparator) {
                    var index = -1, includes = arrayIncludes, isCommon = true, length = array.length, result = [], valuesLength = values.length;
                    if (!length) {
                        return result;
                    }
                    if (iteratee) {
                        values = arrayMap(values, baseUnary(iteratee));
                    }
                    if (comparator) {
                        includes = arrayIncludesWith;
                        isCommon = false;
                    } else if (values.length >= LARGE_ARRAY_SIZE) {
                        includes = cacheHas;
                        isCommon = false;
                        values = new SetCache(values);
                    }
                    outer: while (++index < length) {
                        var value = array[index], computed = iteratee == null ? value : iteratee(value);
                        value = comparator || value !== 0 ? value : 0;
                        if (isCommon && computed === computed) {
                            var valuesIndex = valuesLength;
                            while (valuesIndex--) {
                                if (values[valuesIndex] === computed) {
                                    continue outer;
                                }
                            }
                            result.push(value);
                        } else if (!includes(values, computed, comparator)) {
                            result.push(value);
                        }
                    }
                    return result;
                }
                var baseEach = createBaseEach(baseForOwn);
                var baseEachRight = createBaseEach(baseForOwnRight, true);
                function baseEvery(collection, predicate) {
                    var result = true;
                    baseEach(collection, (function(value, index, collection) {
                        result = !!predicate(value, index, collection);
                        return result;
                    }));
                    return result;
                }
                function baseExtremum(array, iteratee, comparator) {
                    var index = -1, length = array.length;
                    while (++index < length) {
                        var value = array[index], current = iteratee(value);
                        if (current != null && (computed === undefined ? current === current && !isSymbol(current) : comparator(current, computed))) {
                            var computed = current, result = value;
                        }
                    }
                    return result;
                }
                function baseFill(array, value, start, end) {
                    var length = array.length;
                    start = toInteger(start);
                    if (start < 0) {
                        start = -start > length ? 0 : length + start;
                    }
                    end = end === undefined || end > length ? length : toInteger(end);
                    if (end < 0) {
                        end += length;
                    }
                    end = start > end ? 0 : toLength(end);
                    while (start < end) {
                        array[start++] = value;
                    }
                    return array;
                }
                function baseFilter(collection, predicate) {
                    var result = [];
                    baseEach(collection, (function(value, index, collection) {
                        if (predicate(value, index, collection)) {
                            result.push(value);
                        }
                    }));
                    return result;
                }
                function baseFlatten(array, depth, predicate, isStrict, result) {
                    var index = -1, length = array.length;
                    predicate || (predicate = isFlattenable);
                    result || (result = []);
                    while (++index < length) {
                        var value = array[index];
                        if (depth > 0 && predicate(value)) {
                            if (depth > 1) {
                                baseFlatten(value, depth - 1, predicate, isStrict, result);
                            } else {
                                arrayPush(result, value);
                            }
                        } else if (!isStrict) {
                            result[result.length] = value;
                        }
                    }
                    return result;
                }
                var baseFor = createBaseFor();
                var baseForRight = createBaseFor(true);
                function baseForOwn(object, iteratee) {
                    return object && baseFor(object, iteratee, keys);
                }
                function baseForOwnRight(object, iteratee) {
                    return object && baseForRight(object, iteratee, keys);
                }
                function baseFunctions(object, props) {
                    return arrayFilter(props, (function(key) {
                        return isFunction(object[key]);
                    }));
                }
                function baseGet(object, path) {
                    path = castPath(path, object);
                    var index = 0, length = path.length;
                    while (object != null && index < length) {
                        object = object[toKey(path[index++])];
                    }
                    return index && index == length ? object : undefined;
                }
                function baseGetAllKeys(object, keysFunc, symbolsFunc) {
                    var result = keysFunc(object);
                    return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
                }
                function baseGetTag(value) {
                    if (value == null) {
                        return value === undefined ? undefinedTag : nullTag;
                    }
                    return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
                }
                function baseGt(value, other) {
                    return value > other;
                }
                function baseHas(object, key) {
                    return object != null && hasOwnProperty.call(object, key);
                }
                function baseHasIn(object, key) {
                    return object != null && key in Object(object);
                }
                function baseInRange(number, start, end) {
                    return number >= nativeMin(start, end) && number < nativeMax(start, end);
                }
                function baseIntersection(arrays, iteratee, comparator) {
                    var includes = comparator ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array(othLength), maxLength = Infinity, result = [];
                    while (othIndex--) {
                        var array = arrays[othIndex];
                        if (othIndex && iteratee) {
                            array = arrayMap(array, baseUnary(iteratee));
                        }
                        maxLength = nativeMin(array.length, maxLength);
                        caches[othIndex] = !comparator && (iteratee || length >= 120 && array.length >= 120) ? new SetCache(othIndex && array) : undefined;
                    }
                    array = arrays[0];
                    var index = -1, seen = caches[0];
                    outer: while (++index < length && result.length < maxLength) {
                        var value = array[index], computed = iteratee ? iteratee(value) : value;
                        value = comparator || value !== 0 ? value : 0;
                        if (!(seen ? cacheHas(seen, computed) : includes(result, computed, comparator))) {
                            othIndex = othLength;
                            while (--othIndex) {
                                var cache = caches[othIndex];
                                if (!(cache ? cacheHas(cache, computed) : includes(arrays[othIndex], computed, comparator))) {
                                    continue outer;
                                }
                            }
                            if (seen) {
                                seen.push(computed);
                            }
                            result.push(value);
                        }
                    }
                    return result;
                }
                function baseInverter(object, setter, iteratee, accumulator) {
                    baseForOwn(object, (function(value, key, object) {
                        setter(accumulator, iteratee(value), key, object);
                    }));
                    return accumulator;
                }
                function baseInvoke(object, path, args) {
                    path = castPath(path, object);
                    object = parent(object, path);
                    var func = object == null ? object : object[toKey(last(path))];
                    return func == null ? undefined : apply(func, object, args);
                }
                function baseIsArguments(value) {
                    return isObjectLike(value) && baseGetTag(value) == argsTag;
                }
                function baseIsArrayBuffer(value) {
                    return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
                }
                function baseIsDate(value) {
                    return isObjectLike(value) && baseGetTag(value) == dateTag;
                }
                function baseIsEqual(value, other, bitmask, customizer, stack) {
                    if (value === other) {
                        return true;
                    }
                    if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
                        return value !== value && other !== other;
                    }
                    return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
                }
                function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
                    var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
                    objTag = objTag == argsTag ? objectTag : objTag;
                    othTag = othTag == argsTag ? objectTag : othTag;
                    var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
                    if (isSameTag && isBuffer(object)) {
                        if (!isBuffer(other)) {
                            return false;
                        }
                        objIsArr = true;
                        objIsObj = false;
                    }
                    if (isSameTag && !objIsObj) {
                        stack || (stack = new Stack);
                        return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
                    }
                    if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
                        var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
                        if (objIsWrapped || othIsWrapped) {
                            var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
                            stack || (stack = new Stack);
                            return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
                        }
                    }
                    if (!isSameTag) {
                        return false;
                    }
                    stack || (stack = new Stack);
                    return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
                }
                function baseIsMap(value) {
                    return isObjectLike(value) && getTag(value) == mapTag;
                }
                function baseIsMatch(object, source, matchData, customizer) {
                    var index = matchData.length, length = index, noCustomizer = !customizer;
                    if (object == null) {
                        return !length;
                    }
                    object = Object(object);
                    while (index--) {
                        var data = matchData[index];
                        if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
                            return false;
                        }
                    }
                    while (++index < length) {
                        data = matchData[index];
                        var key = data[0], objValue = object[key], srcValue = data[1];
                        if (noCustomizer && data[2]) {
                            if (objValue === undefined && !(key in object)) {
                                return false;
                            }
                        } else {
                            var stack = new Stack;
                            if (customizer) {
                                var result = customizer(objValue, srcValue, key, object, source, stack);
                            }
                            if (!(result === undefined ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result)) {
                                return false;
                            }
                        }
                    }
                    return true;
                }
                function baseIsNative(value) {
                    if (!isObject(value) || isMasked(value)) {
                        return false;
                    }
                    var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
                    return pattern.test(toSource(value));
                }
                function baseIsRegExp(value) {
                    return isObjectLike(value) && baseGetTag(value) == regexpTag;
                }
                function baseIsSet(value) {
                    return isObjectLike(value) && getTag(value) == setTag;
                }
                function baseIsTypedArray(value) {
                    return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
                }
                function baseIteratee(value) {
                    if (typeof value == "function") {
                        return value;
                    }
                    if (value == null) {
                        return identity;
                    }
                    if (typeof value == "object") {
                        return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
                    }
                    return property(value);
                }
                function baseKeys(object) {
                    if (!isPrototype(object)) {
                        return nativeKeys(object);
                    }
                    var result = [];
                    for (var key in Object(object)) {
                        if (hasOwnProperty.call(object, key) && key != "constructor") {
                            result.push(key);
                        }
                    }
                    return result;
                }
                function baseKeysIn(object) {
                    if (!isObject(object)) {
                        return nativeKeysIn(object);
                    }
                    var isProto = isPrototype(object), result = [];
                    for (var key in object) {
                        if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) {
                            result.push(key);
                        }
                    }
                    return result;
                }
                function baseLt(value, other) {
                    return value < other;
                }
                function baseMap(collection, iteratee) {
                    var index = -1, result = isArrayLike(collection) ? Array(collection.length) : [];
                    baseEach(collection, (function(value, key, collection) {
                        result[++index] = iteratee(value, key, collection);
                    }));
                    return result;
                }
                function baseMatches(source) {
                    var matchData = getMatchData(source);
                    if (matchData.length == 1 && matchData[0][2]) {
                        return matchesStrictComparable(matchData[0][0], matchData[0][1]);
                    }
                    return function(object) {
                        return object === source || baseIsMatch(object, source, matchData);
                    };
                }
                function baseMatchesProperty(path, srcValue) {
                    if (isKey(path) && isStrictComparable(srcValue)) {
                        return matchesStrictComparable(toKey(path), srcValue);
                    }
                    return function(object) {
                        var objValue = get(object, path);
                        return objValue === undefined && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
                    };
                }
                function baseMerge(object, source, srcIndex, customizer, stack) {
                    if (object === source) {
                        return;
                    }
                    baseFor(source, (function(srcValue, key) {
                        stack || (stack = new Stack);
                        if (isObject(srcValue)) {
                            baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
                        } else {
                            var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : undefined;
                            if (newValue === undefined) {
                                newValue = srcValue;
                            }
                            assignMergeValue(object, key, newValue);
                        }
                    }), keysIn);
                }
                function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
                    var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
                    if (stacked) {
                        assignMergeValue(object, key, stacked);
                        return;
                    }
                    var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : undefined;
                    var isCommon = newValue === undefined;
                    if (isCommon) {
                        var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
                        newValue = srcValue;
                        if (isArr || isBuff || isTyped) {
                            if (isArray(objValue)) {
                                newValue = objValue;
                            } else if (isArrayLikeObject(objValue)) {
                                newValue = copyArray(objValue);
                            } else if (isBuff) {
                                isCommon = false;
                                newValue = cloneBuffer(srcValue, true);
                            } else if (isTyped) {
                                isCommon = false;
                                newValue = cloneTypedArray(srcValue, true);
                            } else {
                                newValue = [];
                            }
                        } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
                            newValue = objValue;
                            if (isArguments(objValue)) {
                                newValue = toPlainObject(objValue);
                            } else if (!isObject(objValue) || isFunction(objValue)) {
                                newValue = initCloneObject(srcValue);
                            }
                        } else {
                            isCommon = false;
                        }
                    }
                    if (isCommon) {
                        stack.set(srcValue, newValue);
                        mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
                        stack["delete"](srcValue);
                    }
                    assignMergeValue(object, key, newValue);
                }
                function baseNth(array, n) {
                    var length = array.length;
                    if (!length) {
                        return;
                    }
                    n += n < 0 ? length : 0;
                    return isIndex(n, length) ? array[n] : undefined;
                }
                function baseOrderBy(collection, iteratees, orders) {
                    if (iteratees.length) {
                        iteratees = arrayMap(iteratees, (function(iteratee) {
                            if (isArray(iteratee)) {
                                return function(value) {
                                    return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
                                };
                            }
                            return iteratee;
                        }));
                    } else {
                        iteratees = [ identity ];
                    }
                    var index = -1;
                    iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
                    var result = baseMap(collection, (function(value, key, collection) {
                        var criteria = arrayMap(iteratees, (function(iteratee) {
                            return iteratee(value);
                        }));
                        return {
                            criteria,
                            index: ++index,
                            value
                        };
                    }));
                    return baseSortBy(result, (function(object, other) {
                        return compareMultiple(object, other, orders);
                    }));
                }
                function basePick(object, paths) {
                    return basePickBy(object, paths, (function(value, path) {
                        return hasIn(object, path);
                    }));
                }
                function basePickBy(object, paths, predicate) {
                    var index = -1, length = paths.length, result = {};
                    while (++index < length) {
                        var path = paths[index], value = baseGet(object, path);
                        if (predicate(value, path)) {
                            baseSet(result, castPath(path, object), value);
                        }
                    }
                    return result;
                }
                function basePropertyDeep(path) {
                    return function(object) {
                        return baseGet(object, path);
                    };
                }
                function basePullAll(array, values, iteratee, comparator) {
                    var indexOf = comparator ? baseIndexOfWith : baseIndexOf, index = -1, length = values.length, seen = array;
                    if (array === values) {
                        values = copyArray(values);
                    }
                    if (iteratee) {
                        seen = arrayMap(array, baseUnary(iteratee));
                    }
                    while (++index < length) {
                        var fromIndex = 0, value = values[index], computed = iteratee ? iteratee(value) : value;
                        while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
                            if (seen !== array) {
                                splice.call(seen, fromIndex, 1);
                            }
                            splice.call(array, fromIndex, 1);
                        }
                    }
                    return array;
                }
                function basePullAt(array, indexes) {
                    var length = array ? indexes.length : 0, lastIndex = length - 1;
                    while (length--) {
                        var index = indexes[length];
                        if (length == lastIndex || index !== previous) {
                            var previous = index;
                            if (isIndex(index)) {
                                splice.call(array, index, 1);
                            } else {
                                baseUnset(array, index);
                            }
                        }
                    }
                    return array;
                }
                function baseRandom(lower, upper) {
                    return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
                }
                function baseRange(start, end, step, fromRight) {
                    var index = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result = Array(length);
                    while (length--) {
                        result[fromRight ? length : ++index] = start;
                        start += step;
                    }
                    return result;
                }
                function baseRepeat(string, n) {
                    var result = "";
                    if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
                        return result;
                    }
                    do {
                        if (n % 2) {
                            result += string;
                        }
                        n = nativeFloor(n / 2);
                        if (n) {
                            string += string;
                        }
                    } while (n);
                    return result;
                }
                function baseRest(func, start) {
                    return setToString(overRest(func, start, identity), func + "");
                }
                function baseSample(collection) {
                    return arraySample(values(collection));
                }
                function baseSampleSize(collection, n) {
                    var array = values(collection);
                    return shuffleSelf(array, baseClamp(n, 0, array.length));
                }
                function baseSet(object, path, value, customizer) {
                    if (!isObject(object)) {
                        return object;
                    }
                    path = castPath(path, object);
                    var index = -1, length = path.length, lastIndex = length - 1, nested = object;
                    while (nested != null && ++index < length) {
                        var key = toKey(path[index]), newValue = value;
                        if (key === "__proto__" || key === "constructor" || key === "prototype") {
                            return object;
                        }
                        if (index != lastIndex) {
                            var objValue = nested[key];
                            newValue = customizer ? customizer(objValue, key, nested) : undefined;
                            if (newValue === undefined) {
                                newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
                            }
                        }
                        assignValue(nested, key, newValue);
                        nested = nested[key];
                    }
                    return object;
                }
                var baseSetData = !metaMap ? identity : function(func, data) {
                    metaMap.set(func, data);
                    return func;
                };
                var baseSetToString = !defineProperty ? identity : function(func, string) {
                    return defineProperty(func, "toString", {
                        configurable: true,
                        enumerable: false,
                        value: constant(string),
                        writable: true
                    });
                };
                function baseShuffle(collection) {
                    return shuffleSelf(values(collection));
                }
                function baseSlice(array, start, end) {
                    var index = -1, length = array.length;
                    if (start < 0) {
                        start = -start > length ? 0 : length + start;
                    }
                    end = end > length ? length : end;
                    if (end < 0) {
                        end += length;
                    }
                    length = start > end ? 0 : end - start >>> 0;
                    start >>>= 0;
                    var result = Array(length);
                    while (++index < length) {
                        result[index] = array[index + start];
                    }
                    return result;
                }
                function baseSome(collection, predicate) {
                    var result;
                    baseEach(collection, (function(value, index, collection) {
                        result = predicate(value, index, collection);
                        return !result;
                    }));
                    return !!result;
                }
                function baseSortedIndex(array, value, retHighest) {
                    var low = 0, high = array == null ? low : array.length;
                    if (typeof value == "number" && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
                        while (low < high) {
                            var mid = low + high >>> 1, computed = array[mid];
                            if (computed !== null && !isSymbol(computed) && (retHighest ? computed <= value : computed < value)) {
                                low = mid + 1;
                            } else {
                                high = mid;
                            }
                        }
                        return high;
                    }
                    return baseSortedIndexBy(array, value, identity, retHighest);
                }
                function baseSortedIndexBy(array, value, iteratee, retHighest) {
                    var low = 0, high = array == null ? 0 : array.length;
                    if (high === 0) {
                        return 0;
                    }
                    value = iteratee(value);
                    var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol(value), valIsUndefined = value === undefined;
                    while (low < high) {
                        var mid = nativeFloor((low + high) / 2), computed = iteratee(array[mid]), othIsDefined = computed !== undefined, othIsNull = computed === null, othIsReflexive = computed === computed, othIsSymbol = isSymbol(computed);
                        if (valIsNaN) {
                            var setLow = retHighest || othIsReflexive;
                        } else if (valIsUndefined) {
                            setLow = othIsReflexive && (retHighest || othIsDefined);
                        } else if (valIsNull) {
                            setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
                        } else if (valIsSymbol) {
                            setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
                        } else if (othIsNull || othIsSymbol) {
                            setLow = false;
                        } else {
                            setLow = retHighest ? computed <= value : computed < value;
                        }
                        if (setLow) {
                            low = mid + 1;
                        } else {
                            high = mid;
                        }
                    }
                    return nativeMin(high, MAX_ARRAY_INDEX);
                }
                function baseSortedUniq(array, iteratee) {
                    var index = -1, length = array.length, resIndex = 0, result = [];
                    while (++index < length) {
                        var value = array[index], computed = iteratee ? iteratee(value) : value;
                        if (!index || !eq(computed, seen)) {
                            var seen = computed;
                            result[resIndex++] = value === 0 ? 0 : value;
                        }
                    }
                    return result;
                }
                function baseToNumber(value) {
                    if (typeof value == "number") {
                        return value;
                    }
                    if (isSymbol(value)) {
                        return NAN;
                    }
                    return +value;
                }
                function baseToString(value) {
                    if (typeof value == "string") {
                        return value;
                    }
                    if (isArray(value)) {
                        return arrayMap(value, baseToString) + "";
                    }
                    if (isSymbol(value)) {
                        return symbolToString ? symbolToString.call(value) : "";
                    }
                    var result = value + "";
                    return result == "0" && 1 / value == -INFINITY ? "-0" : result;
                }
                function baseUniq(array, iteratee, comparator) {
                    var index = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result;
                    if (comparator) {
                        isCommon = false;
                        includes = arrayIncludesWith;
                    } else if (length >= LARGE_ARRAY_SIZE) {
                        var set = iteratee ? null : createSet(array);
                        if (set) {
                            return setToArray(set);
                        }
                        isCommon = false;
                        includes = cacheHas;
                        seen = new SetCache;
                    } else {
                        seen = iteratee ? [] : result;
                    }
                    outer: while (++index < length) {
                        var value = array[index], computed = iteratee ? iteratee(value) : value;
                        value = comparator || value !== 0 ? value : 0;
                        if (isCommon && computed === computed) {
                            var seenIndex = seen.length;
                            while (seenIndex--) {
                                if (seen[seenIndex] === computed) {
                                    continue outer;
                                }
                            }
                            if (iteratee) {
                                seen.push(computed);
                            }
                            result.push(value);
                        } else if (!includes(seen, computed, comparator)) {
                            if (seen !== result) {
                                seen.push(computed);
                            }
                            result.push(value);
                        }
                    }
                    return result;
                }
                function baseUnset(object, path) {
                    path = castPath(path, object);
                    object = parent(object, path);
                    return object == null || delete object[toKey(last(path))];
                }
                function baseUpdate(object, path, updater, customizer) {
                    return baseSet(object, path, updater(baseGet(object, path)), customizer);
                }
                function baseWhile(array, predicate, isDrop, fromRight) {
                    var length = array.length, index = fromRight ? length : -1;
                    while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {}
                    return isDrop ? baseSlice(array, fromRight ? 0 : index, fromRight ? index + 1 : length) : baseSlice(array, fromRight ? index + 1 : 0, fromRight ? length : index);
                }
                function baseWrapperValue(value, actions) {
                    var result = value;
                    if (result instanceof LazyWrapper) {
                        result = result.value();
                    }
                    return arrayReduce(actions, (function(result, action) {
                        return action.func.apply(action.thisArg, arrayPush([ result ], action.args));
                    }), result);
                }
                function baseXor(arrays, iteratee, comparator) {
                    var length = arrays.length;
                    if (length < 2) {
                        return length ? baseUniq(arrays[0]) : [];
                    }
                    var index = -1, result = Array(length);
                    while (++index < length) {
                        var array = arrays[index], othIndex = -1;
                        while (++othIndex < length) {
                            if (othIndex != index) {
                                result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
                            }
                        }
                    }
                    return baseUniq(baseFlatten(result, 1), iteratee, comparator);
                }
                function baseZipObject(props, values, assignFunc) {
                    var index = -1, length = props.length, valsLength = values.length, result = {};
                    while (++index < length) {
                        var value = index < valsLength ? values[index] : undefined;
                        assignFunc(result, props[index], value);
                    }
                    return result;
                }
                function castArrayLikeObject(value) {
                    return isArrayLikeObject(value) ? value : [];
                }
                function castFunction(value) {
                    return typeof value == "function" ? value : identity;
                }
                function castPath(value, object) {
                    if (isArray(value)) {
                        return value;
                    }
                    return isKey(value, object) ? [ value ] : stringToPath(toString(value));
                }
                var castRest = baseRest;
                function castSlice(array, start, end) {
                    var length = array.length;
                    end = end === undefined ? length : end;
                    return !start && end >= length ? array : baseSlice(array, start, end);
                }
                var clearTimeout = ctxClearTimeout || function(id) {
                    return root.clearTimeout(id);
                };
                function cloneBuffer(buffer, isDeep) {
                    if (isDeep) {
                        return buffer.slice();
                    }
                    var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
                    buffer.copy(result);
                    return result;
                }
                function cloneArrayBuffer(arrayBuffer) {
                    var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
                    new Uint8Array(result).set(new Uint8Array(arrayBuffer));
                    return result;
                }
                function cloneDataView(dataView, isDeep) {
                    var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
                    return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
                }
                function cloneRegExp(regexp) {
                    var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
                    result.lastIndex = regexp.lastIndex;
                    return result;
                }
                function cloneSymbol(symbol) {
                    return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
                }
                function cloneTypedArray(typedArray, isDeep) {
                    var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
                    return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
                }
                function compareAscending(value, other) {
                    if (value !== other) {
                        var valIsDefined = value !== undefined, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value);
                        var othIsDefined = other !== undefined, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other);
                        if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
                            return 1;
                        }
                        if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
                            return -1;
                        }
                    }
                    return 0;
                }
                function compareMultiple(object, other, orders) {
                    var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
                    while (++index < length) {
                        var result = compareAscending(objCriteria[index], othCriteria[index]);
                        if (result) {
                            if (index >= ordersLength) {
                                return result;
                            }
                            var order = orders[index];
                            return result * (order == "desc" ? -1 : 1);
                        }
                    }
                    return object.index - other.index;
                }
                function composeArgs(args, partials, holders, isCurried) {
                    var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result = Array(leftLength + rangeLength), isUncurried = !isCurried;
                    while (++leftIndex < leftLength) {
                        result[leftIndex] = partials[leftIndex];
                    }
                    while (++argsIndex < holdersLength) {
                        if (isUncurried || argsIndex < argsLength) {
                            result[holders[argsIndex]] = args[argsIndex];
                        }
                    }
                    while (rangeLength--) {
                        result[leftIndex++] = args[argsIndex++];
                    }
                    return result;
                }
                function composeArgsRight(args, partials, holders, isCurried) {
                    var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result = Array(rangeLength + rightLength), isUncurried = !isCurried;
                    while (++argsIndex < rangeLength) {
                        result[argsIndex] = args[argsIndex];
                    }
                    var offset = argsIndex;
                    while (++rightIndex < rightLength) {
                        result[offset + rightIndex] = partials[rightIndex];
                    }
                    while (++holdersIndex < holdersLength) {
                        if (isUncurried || argsIndex < argsLength) {
                            result[offset + holders[holdersIndex]] = args[argsIndex++];
                        }
                    }
                    return result;
                }
                function copyArray(source, array) {
                    var index = -1, length = source.length;
                    array || (array = Array(length));
                    while (++index < length) {
                        array[index] = source[index];
                    }
                    return array;
                }
                function copyObject(source, props, object, customizer) {
                    var isNew = !object;
                    object || (object = {});
                    var index = -1, length = props.length;
                    while (++index < length) {
                        var key = props[index];
                        var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined;
                        if (newValue === undefined) {
                            newValue = source[key];
                        }
                        if (isNew) {
                            baseAssignValue(object, key, newValue);
                        } else {
                            assignValue(object, key, newValue);
                        }
                    }
                    return object;
                }
                function copySymbols(source, object) {
                    return copyObject(source, getSymbols(source), object);
                }
                function copySymbolsIn(source, object) {
                    return copyObject(source, getSymbolsIn(source), object);
                }
                function createAggregator(setter, initializer) {
                    return function(collection, iteratee) {
                        var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {};
                        return func(collection, setter, getIteratee(iteratee, 2), accumulator);
                    };
                }
                function createAssigner(assigner) {
                    return baseRest((function(object, sources) {
                        var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined;
                        customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, 
                        customizer) : undefined;
                        if (guard && isIterateeCall(sources[0], sources[1], guard)) {
                            customizer = length < 3 ? undefined : customizer;
                            length = 1;
                        }
                        object = Object(object);
                        while (++index < length) {
                            var source = sources[index];
                            if (source) {
                                assigner(object, source, index, customizer);
                            }
                        }
                        return object;
                    }));
                }
                function createBaseEach(eachFunc, fromRight) {
                    return function(collection, iteratee) {
                        if (collection == null) {
                            return collection;
                        }
                        if (!isArrayLike(collection)) {
                            return eachFunc(collection, iteratee);
                        }
                        var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection);
                        while (fromRight ? index-- : ++index < length) {
                            if (iteratee(iterable[index], index, iterable) === false) {
                                break;
                            }
                        }
                        return collection;
                    };
                }
                function createBaseFor(fromRight) {
                    return function(object, iteratee, keysFunc) {
                        var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
                        while (length--) {
                            var key = props[fromRight ? length : ++index];
                            if (iteratee(iterable[key], key, iterable) === false) {
                                break;
                            }
                        }
                        return object;
                    };
                }
                function createBind(func, bitmask, thisArg) {
                    var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
                    function wrapper() {
                        var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
                        return fn.apply(isBind ? thisArg : this, arguments);
                    }
                    return wrapper;
                }
                function createCaseFirst(methodName) {
                    return function(string) {
                        string = toString(string);
                        var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined;
                        var chr = strSymbols ? strSymbols[0] : string.charAt(0);
                        var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string.slice(1);
                        return chr[methodName]() + trailing;
                    };
                }
                function createCompounder(callback) {
                    return function(string) {
                        return arrayReduce(words(deburr(string).replace(reApos, "")), callback, "");
                    };
                }
                function createCtor(Ctor) {
                    return function() {
                        var args = arguments;
                        switch (args.length) {
                          case 0:
                            return new Ctor;

                          case 1:
                            return new Ctor(args[0]);

                          case 2:
                            return new Ctor(args[0], args[1]);

                          case 3:
                            return new Ctor(args[0], args[1], args[2]);

                          case 4:
                            return new Ctor(args[0], args[1], args[2], args[3]);

                          case 5:
                            return new Ctor(args[0], args[1], args[2], args[3], args[4]);

                          case 6:
                            return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);

                          case 7:
                            return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
                        }
                        var thisBinding = baseCreate(Ctor.prototype), result = Ctor.apply(thisBinding, args);
                        return isObject(result) ? result : thisBinding;
                    };
                }
                function createCurry(func, bitmask, arity) {
                    var Ctor = createCtor(func);
                    function wrapper() {
                        var length = arguments.length, args = Array(length), index = length, placeholder = getHolder(wrapper);
                        while (index--) {
                            args[index] = arguments[index];
                        }
                        var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder);
                        length -= holders.length;
                        if (length < arity) {
                            return createRecurry(func, bitmask, createHybrid, wrapper.placeholder, undefined, args, holders, undefined, undefined, arity - length);
                        }
                        var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
                        return apply(fn, this, args);
                    }
                    return wrapper;
                }
                function createFind(findIndexFunc) {
                    return function(collection, predicate, fromIndex) {
                        var iterable = Object(collection);
                        if (!isArrayLike(collection)) {
                            var iteratee = getIteratee(predicate, 3);
                            collection = keys(collection);
                            predicate = function(key) {
                                return iteratee(iterable[key], key, iterable);
                            };
                        }
                        var index = findIndexFunc(collection, predicate, fromIndex);
                        return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
                    };
                }
                function createFlow(fromRight) {
                    return flatRest((function(funcs) {
                        var length = funcs.length, index = length, prereq = LodashWrapper.prototype.thru;
                        if (fromRight) {
                            funcs.reverse();
                        }
                        while (index--) {
                            var func = funcs[index];
                            if (typeof func != "function") {
                                throw new TypeError(FUNC_ERROR_TEXT);
                            }
                            if (prereq && !wrapper && getFuncName(func) == "wrapper") {
                                var wrapper = new LodashWrapper([], true);
                            }
                        }
                        index = wrapper ? index : length;
                        while (++index < length) {
                            func = funcs[index];
                            var funcName = getFuncName(func), data = funcName == "wrapper" ? getData(func) : undefined;
                            if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1) {
                                wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
                            } else {
                                wrapper = func.length == 1 && isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func);
                            }
                        }
                        return function() {
                            var args = arguments, value = args[0];
                            if (wrapper && args.length == 1 && isArray(value)) {
                                return wrapper.plant(value).value();
                            }
                            var index = 0, result = length ? funcs[index].apply(this, args) : value;
                            while (++index < length) {
                                result = funcs[index].call(this, result);
                            }
                            return result;
                        };
                    }));
                }
                function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
                    var isAry = bitmask & WRAP_ARY_FLAG, isBind = bitmask & WRAP_BIND_FLAG, isBindKey = bitmask & WRAP_BIND_KEY_FLAG, isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? undefined : createCtor(func);
                    function wrapper() {
                        var length = arguments.length, args = Array(length), index = length;
                        while (index--) {
                            args[index] = arguments[index];
                        }
                        if (isCurried) {
                            var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder);
                        }
                        if (partials) {
                            args = composeArgs(args, partials, holders, isCurried);
                        }
                        if (partialsRight) {
                            args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
                        }
                        length -= holdersCount;
                        if (isCurried && length < arity) {
                            var newHolders = replaceHolders(args, placeholder);
                            return createRecurry(func, bitmask, createHybrid, wrapper.placeholder, thisArg, args, newHolders, argPos, ary, arity - length);
                        }
                        var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func;
                        length = args.length;
                        if (argPos) {
                            args = reorder(args, argPos);
                        } else if (isFlip && length > 1) {
                            args.reverse();
                        }
                        if (isAry && ary < length) {
                            args.length = ary;
                        }
                        if (this && this !== root && this instanceof wrapper) {
                            fn = Ctor || createCtor(fn);
                        }
                        return fn.apply(thisBinding, args);
                    }
                    return wrapper;
                }
                function createInverter(setter, toIteratee) {
                    return function(object, iteratee) {
                        return baseInverter(object, setter, toIteratee(iteratee), {});
                    };
                }
                function createMathOperation(operator, defaultValue) {
                    return function(value, other) {
                        var result;
                        if (value === undefined && other === undefined) {
                            return defaultValue;
                        }
                        if (value !== undefined) {
                            result = value;
                        }
                        if (other !== undefined) {
                            if (result === undefined) {
                                return other;
                            }
                            if (typeof value == "string" || typeof other == "string") {
                                value = baseToString(value);
                                other = baseToString(other);
                            } else {
                                value = baseToNumber(value);
                                other = baseToNumber(other);
                            }
                            result = operator(value, other);
                        }
                        return result;
                    };
                }
                function createOver(arrayFunc) {
                    return flatRest((function(iteratees) {
                        iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
                        return baseRest((function(args) {
                            var thisArg = this;
                            return arrayFunc(iteratees, (function(iteratee) {
                                return apply(iteratee, thisArg, args);
                            }));
                        }));
                    }));
                }
                function createPadding(length, chars) {
                    chars = chars === undefined ? " " : baseToString(chars);
                    var charsLength = chars.length;
                    if (charsLength < 2) {
                        return charsLength ? baseRepeat(chars, length) : chars;
                    }
                    var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
                    return hasUnicode(chars) ? castSlice(stringToArray(result), 0, length).join("") : result.slice(0, length);
                }
                function createPartial(func, bitmask, thisArg, partials) {
                    var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
                    function wrapper() {
                        var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array(leftLength + argsLength), fn = this && this !== root && this instanceof wrapper ? Ctor : func;
                        while (++leftIndex < leftLength) {
                            args[leftIndex] = partials[leftIndex];
                        }
                        while (argsLength--) {
                            args[leftIndex++] = arguments[++argsIndex];
                        }
                        return apply(fn, isBind ? thisArg : this, args);
                    }
                    return wrapper;
                }
                function createRange(fromRight) {
                    return function(start, end, step) {
                        if (step && typeof step != "number" && isIterateeCall(start, end, step)) {
                            end = step = undefined;
                        }
                        start = toFinite(start);
                        if (end === undefined) {
                            end = start;
                            start = 0;
                        } else {
                            end = toFinite(end);
                        }
                        step = step === undefined ? start < end ? 1 : -1 : toFinite(step);
                        return baseRange(start, end, step, fromRight);
                    };
                }
                function createRelationalOperation(operator) {
                    return function(value, other) {
                        if (!(typeof value == "string" && typeof other == "string")) {
                            value = toNumber(value);
                            other = toNumber(other);
                        }
                        return operator(value, other);
                    };
                }
                function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
                    var isCurry = bitmask & WRAP_CURRY_FLAG, newHolders = isCurry ? holders : undefined, newHoldersRight = isCurry ? undefined : holders, newPartials = isCurry ? partials : undefined, newPartialsRight = isCurry ? undefined : partials;
                    bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG;
                    bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
                    if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
                        bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
                    }
                    var newData = [ func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, newHoldersRight, argPos, ary, arity ];
                    var result = wrapFunc.apply(undefined, newData);
                    if (isLaziable(func)) {
                        setData(result, newData);
                    }
                    result.placeholder = placeholder;
                    return setWrapToString(result, func, bitmask);
                }
                function createRound(methodName) {
                    var func = Math[methodName];
                    return function(number, precision) {
                        number = toNumber(number);
                        precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
                        if (precision && nativeIsFinite(number)) {
                            var pair = (toString(number) + "e").split("e"), value = func(pair[0] + "e" + (+pair[1] + precision));
                            pair = (toString(value) + "e").split("e");
                            return +(pair[0] + "e" + (+pair[1] - precision));
                        }
                        return func(number);
                    };
                }
                var createSet = !(Set && 1 / setToArray(new Set([ , -0 ]))[1] == INFINITY) ? noop : function(values) {
                    return new Set(values);
                };
                function createToPairs(keysFunc) {
                    return function(object) {
                        var tag = getTag(object);
                        if (tag == mapTag) {
                            return mapToArray(object);
                        }
                        if (tag == setTag) {
                            return setToPairs(object);
                        }
                        return baseToPairs(object, keysFunc(object));
                    };
                }
                function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
                    var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
                    if (!isBindKey && typeof func != "function") {
                        throw new TypeError(FUNC_ERROR_TEXT);
                    }
                    var length = partials ? partials.length : 0;
                    if (!length) {
                        bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
                        partials = holders = undefined;
                    }
                    ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
                    arity = arity === undefined ? arity : toInteger(arity);
                    length -= holders ? holders.length : 0;
                    if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
                        var partialsRight = partials, holdersRight = holders;
                        partials = holders = undefined;
                    }
                    var data = isBindKey ? undefined : getData(func);
                    var newData = [ func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity ];
                    if (data) {
                        mergeData(newData, data);
                    }
                    func = newData[0];
                    bitmask = newData[1];
                    thisArg = newData[2];
                    partials = newData[3];
                    holders = newData[4];
                    arity = newData[9] = newData[9] === undefined ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0);
                    if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
                        bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
                    }
                    if (!bitmask || bitmask == WRAP_BIND_FLAG) {
                        var result = createBind(func, bitmask, thisArg);
                    } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
                        result = createCurry(func, bitmask, arity);
                    } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
                        result = createPartial(func, bitmask, thisArg, partials);
                    } else {
                        result = createHybrid.apply(undefined, newData);
                    }
                    var setter = data ? baseSetData : setData;
                    return setWrapToString(setter(result, newData), func, bitmask);
                }
                function customDefaultsAssignIn(objValue, srcValue, key, object) {
                    if (objValue === undefined || eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key)) {
                        return srcValue;
                    }
                    return objValue;
                }
                function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
                    if (isObject(objValue) && isObject(srcValue)) {
                        stack.set(srcValue, objValue);
                        baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
                        stack["delete"](srcValue);
                    }
                    return objValue;
                }
                function customOmitClone(value) {
                    return isPlainObject(value) ? undefined : value;
                }
                function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
                    var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
                    if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
                        return false;
                    }
                    var arrStacked = stack.get(array);
                    var othStacked = stack.get(other);
                    if (arrStacked && othStacked) {
                        return arrStacked == other && othStacked == array;
                    }
                    var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache : undefined;
                    stack.set(array, other);
                    stack.set(other, array);
                    while (++index < arrLength) {
                        var arrValue = array[index], othValue = other[index];
                        if (customizer) {
                            var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
                        }
                        if (compared !== undefined) {
                            if (compared) {
                                continue;
                            }
                            result = false;
                            break;
                        }
                        if (seen) {
                            if (!arraySome(other, (function(othValue, othIndex) {
                                if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
                                    return seen.push(othIndex);
                                }
                            }))) {
                                result = false;
                                break;
                            }
                        } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
                            result = false;
                            break;
                        }
                    }
                    stack["delete"](array);
                    stack["delete"](other);
                    return result;
                }
                function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
                    switch (tag) {
                      case dataViewTag:
                        if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
                            return false;
                        }
                        object = object.buffer;
                        other = other.buffer;

                      case arrayBufferTag:
                        if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
                            return false;
                        }
                        return true;

                      case boolTag:
                      case dateTag:
                      case numberTag:
                        return eq(+object, +other);

                      case errorTag:
                        return object.name == other.name && object.message == other.message;

                      case regexpTag:
                      case stringTag:
                        return object == other + "";

                      case mapTag:
                        var convert = mapToArray;

                      case setTag:
                        var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
                        convert || (convert = setToArray);
                        if (object.size != other.size && !isPartial) {
                            return false;
                        }
                        var stacked = stack.get(object);
                        if (stacked) {
                            return stacked == other;
                        }
                        bitmask |= COMPARE_UNORDERED_FLAG;
                        stack.set(object, other);
                        var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
                        stack["delete"](object);
                        return result;

                      case symbolTag:
                        if (symbolValueOf) {
                            return symbolValueOf.call(object) == symbolValueOf.call(other);
                        }
                    }
                    return false;
                }
                function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
                    var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
                    if (objLength != othLength && !isPartial) {
                        return false;
                    }
                    var index = objLength;
                    while (index--) {
                        var key = objProps[index];
                        if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
                            return false;
                        }
                    }
                    var objStacked = stack.get(object);
                    var othStacked = stack.get(other);
                    if (objStacked && othStacked) {
                        return objStacked == other && othStacked == object;
                    }
                    var result = true;
                    stack.set(object, other);
                    stack.set(other, object);
                    var skipCtor = isPartial;
                    while (++index < objLength) {
                        key = objProps[index];
                        var objValue = object[key], othValue = other[key];
                        if (customizer) {
                            var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
                        }
                        if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
                            result = false;
                            break;
                        }
                        skipCtor || (skipCtor = key == "constructor");
                    }
                    if (result && !skipCtor) {
                        var objCtor = object.constructor, othCtor = other.constructor;
                        if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
                            result = false;
                        }
                    }
                    stack["delete"](object);
                    stack["delete"](other);
                    return result;
                }
                function flatRest(func) {
                    return setToString(overRest(func, undefined, flatten), func + "");
                }
                function getAllKeys(object) {
                    return baseGetAllKeys(object, keys, getSymbols);
                }
                function getAllKeysIn(object) {
                    return baseGetAllKeys(object, keysIn, getSymbolsIn);
                }
                var getData = !metaMap ? noop : function(func) {
                    return metaMap.get(func);
                };
                function getFuncName(func) {
                    var result = func.name + "", array = realNames[result], length = hasOwnProperty.call(realNames, result) ? array.length : 0;
                    while (length--) {
                        var data = array[length], otherFunc = data.func;
                        if (otherFunc == null || otherFunc == func) {
                            return data.name;
                        }
                    }
                    return result;
                }
                function getHolder(func) {
                    var object = hasOwnProperty.call(lodash, "placeholder") ? lodash : func;
                    return object.placeholder;
                }
                function getIteratee() {
                    var result = lodash.iteratee || iteratee;
                    result = result === iteratee ? baseIteratee : result;
                    return arguments.length ? result(arguments[0], arguments[1]) : result;
                }
                function getMapData(map, key) {
                    var data = map.__data__;
                    return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
                }
                function getMatchData(object) {
                    var result = keys(object), length = result.length;
                    while (length--) {
                        var key = result[length], value = object[key];
                        result[length] = [ key, value, isStrictComparable(value) ];
                    }
                    return result;
                }
                function getNative(object, key) {
                    var value = getValue(object, key);
                    return baseIsNative(value) ? value : undefined;
                }
                function getRawTag(value) {
                    var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
                    try {
                        value[symToStringTag] = undefined;
                        var unmasked = true;
                    } catch (e) {}
                    var result = nativeObjectToString.call(value);
                    if (unmasked) {
                        if (isOwn) {
                            value[symToStringTag] = tag;
                        } else {
                            delete value[symToStringTag];
                        }
                    }
                    return result;
                }
                var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
                    if (object == null) {
                        return [];
                    }
                    object = Object(object);
                    return arrayFilter(nativeGetSymbols(object), (function(symbol) {
                        return propertyIsEnumerable.call(object, symbol);
                    }));
                };
                var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
                    var result = [];
                    while (object) {
                        arrayPush(result, getSymbols(object));
                        object = getPrototype(object);
                    }
                    return result;
                };
                var getTag = baseGetTag;
                if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map) != mapTag || Promise && getTag(Promise.resolve()) != promiseTag || Set && getTag(new Set) != setTag || WeakMap && getTag(new WeakMap) != weakMapTag) {
                    getTag = function(value) {
                        var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : undefined, ctorString = Ctor ? toSource(Ctor) : "";
                        if (ctorString) {
                            switch (ctorString) {
                              case dataViewCtorString:
                                return dataViewTag;

                              case mapCtorString:
                                return mapTag;

                              case promiseCtorString:
                                return promiseTag;

                              case setCtorString:
                                return setTag;

                              case weakMapCtorString:
                                return weakMapTag;
                            }
                        }
                        return result;
                    };
                }
                function getView(start, end, transforms) {
                    var index = -1, length = transforms.length;
                    while (++index < length) {
                        var data = transforms[index], size = data.size;
                        switch (data.type) {
                          case "drop":
                            start += size;
                            break;

                          case "dropRight":
                            end -= size;
                            break;

                          case "take":
                            end = nativeMin(end, start + size);
                            break;

                          case "takeRight":
                            start = nativeMax(start, end - size);
                            break;
                        }
                    }
                    return {
                        start,
                        end
                    };
                }
                function getWrapDetails(source) {
                    var match = source.match(reWrapDetails);
                    return match ? match[1].split(reSplitDetails) : [];
                }
                function hasPath(object, path, hasFunc) {
                    path = castPath(path, object);
                    var index = -1, length = path.length, result = false;
                    while (++index < length) {
                        var key = toKey(path[index]);
                        if (!(result = object != null && hasFunc(object, key))) {
                            break;
                        }
                        object = object[key];
                    }
                    if (result || ++index != length) {
                        return result;
                    }
                    length = object == null ? 0 : object.length;
                    return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
                }
                function initCloneArray(array) {
                    var length = array.length, result = new array.constructor(length);
                    if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) {
                        result.index = array.index;
                        result.input = array.input;
                    }
                    return result;
                }
                function initCloneObject(object) {
                    return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
                }
                function initCloneByTag(object, tag, isDeep) {
                    var Ctor = object.constructor;
                    switch (tag) {
                      case arrayBufferTag:
                        return cloneArrayBuffer(object);

                      case boolTag:
                      case dateTag:
                        return new Ctor(+object);

                      case dataViewTag:
                        return cloneDataView(object, isDeep);

                      case float32Tag:
                      case float64Tag:
                      case int8Tag:
                      case int16Tag:
                      case int32Tag:
                      case uint8Tag:
                      case uint8ClampedTag:
                      case uint16Tag:
                      case uint32Tag:
                        return cloneTypedArray(object, isDeep);

                      case mapTag:
                        return new Ctor;

                      case numberTag:
                      case stringTag:
                        return new Ctor(object);

                      case regexpTag:
                        return cloneRegExp(object);

                      case setTag:
                        return new Ctor;

                      case symbolTag:
                        return cloneSymbol(object);
                    }
                }
                function insertWrapDetails(source, details) {
                    var length = details.length;
                    if (!length) {
                        return source;
                    }
                    var lastIndex = length - 1;
                    details[lastIndex] = (length > 1 ? "& " : "") + details[lastIndex];
                    details = details.join(length > 2 ? ", " : " ");
                    return source.replace(reWrapComment, "{\n/* [wrapped with " + details + "] */\n");
                }
                function isFlattenable(value) {
                    return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
                }
                function isIndex(value, length) {
                    var type = typeof value;
                    length = length == null ? MAX_SAFE_INTEGER : length;
                    return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
                }
                function isIterateeCall(value, index, object) {
                    if (!isObject(object)) {
                        return false;
                    }
                    var type = typeof index;
                    if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) {
                        return eq(object[index], value);
                    }
                    return false;
                }
                function isKey(value, object) {
                    if (isArray(value)) {
                        return false;
                    }
                    var type = typeof value;
                    if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
                        return true;
                    }
                    return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
                }
                function isKeyable(value) {
                    var type = typeof value;
                    return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
                }
                function isLaziable(func) {
                    var funcName = getFuncName(func), other = lodash[funcName];
                    if (typeof other != "function" || !(funcName in LazyWrapper.prototype)) {
                        return false;
                    }
                    if (func === other) {
                        return true;
                    }
                    var data = getData(other);
                    return !!data && func === data[0];
                }
                function isMasked(func) {
                    return !!maskSrcKey && maskSrcKey in func;
                }
                var isMaskable = coreJsData ? isFunction : stubFalse;
                function isPrototype(value) {
                    var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
                    return value === proto;
                }
                function isStrictComparable(value) {
                    return value === value && !isObject(value);
                }
                function matchesStrictComparable(key, srcValue) {
                    return function(object) {
                        if (object == null) {
                            return false;
                        }
                        return object[key] === srcValue && (srcValue !== undefined || key in Object(object));
                    };
                }
                function memoizeCapped(func) {
                    var result = memoize(func, (function(key) {
                        if (cache.size === MAX_MEMOIZE_SIZE) {
                            cache.clear();
                        }
                        return key;
                    }));
                    var cache = result.cache;
                    return result;
                }
                function mergeData(data, source) {
                    var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
                    var isCombo = srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_CURRY_FLAG || srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_REARG_FLAG && data[7].length <= source[8] || srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG) && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG;
                    if (!(isCommon || isCombo)) {
                        return data;
                    }
                    if (srcBitmask & WRAP_BIND_FLAG) {
                        data[2] = source[2];
                        newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
                    }
                    var value = source[3];
                    if (value) {
                        var partials = data[3];
                        data[3] = partials ? composeArgs(partials, value, source[4]) : value;
                        data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
                    }
                    value = source[5];
                    if (value) {
                        partials = data[5];
                        data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
                        data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
                    }
                    value = source[7];
                    if (value) {
                        data[7] = value;
                    }
                    if (srcBitmask & WRAP_ARY_FLAG) {
                        data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
                    }
                    if (data[9] == null) {
                        data[9] = source[9];
                    }
                    data[0] = source[0];
                    data[1] = newBitmask;
                    return data;
                }
                function nativeKeysIn(object) {
                    var result = [];
                    if (object != null) {
                        for (var key in Object(object)) {
                            result.push(key);
                        }
                    }
                    return result;
                }
                function objectToString(value) {
                    return nativeObjectToString.call(value);
                }
                function overRest(func, start, transform) {
                    start = nativeMax(start === undefined ? func.length - 1 : start, 0);
                    return function() {
                        var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
                        while (++index < length) {
                            array[index] = args[start + index];
                        }
                        index = -1;
                        var otherArgs = Array(start + 1);
                        while (++index < start) {
                            otherArgs[index] = args[index];
                        }
                        otherArgs[start] = transform(array);
                        return apply(func, this, otherArgs);
                    };
                }
                function parent(object, path) {
                    return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
                }
                function reorder(array, indexes) {
                    var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array);
                    while (length--) {
                        var index = indexes[length];
                        array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
                    }
                    return array;
                }
                function safeGet(object, key) {
                    if (key === "constructor" && typeof object[key] === "function") {
                        return;
                    }
                    if (key == "__proto__") {
                        return;
                    }
                    return object[key];
                }
                var setData = shortOut(baseSetData);
                var setTimeout = ctxSetTimeout || function(func, wait) {
                    return root.setTimeout(func, wait);
                };
                var setToString = shortOut(baseSetToString);
                function setWrapToString(wrapper, reference, bitmask) {
                    var source = reference + "";
                    return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
                }
                function shortOut(func) {
                    var count = 0, lastCalled = 0;
                    return function() {
                        var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
                        lastCalled = stamp;
                        if (remaining > 0) {
                            if (++count >= HOT_COUNT) {
                                return arguments[0];
                            }
                        } else {
                            count = 0;
                        }
                        return func.apply(undefined, arguments);
                    };
                }
                function shuffleSelf(array, size) {
                    var index = -1, length = array.length, lastIndex = length - 1;
                    size = size === undefined ? length : size;
                    while (++index < size) {
                        var rand = baseRandom(index, lastIndex), value = array[rand];
                        array[rand] = array[index];
                        array[index] = value;
                    }
                    array.length = size;
                    return array;
                }
                var stringToPath = memoizeCapped((function(string) {
                    var result = [];
                    if (string.charCodeAt(0) === 46) {
                        result.push("");
                    }
                    string.replace(rePropName, (function(match, number, quote, subString) {
                        result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
                    }));
                    return result;
                }));
                function toKey(value) {
                    if (typeof value == "string" || isSymbol(value)) {
                        return value;
                    }
                    var result = value + "";
                    return result == "0" && 1 / value == -INFINITY ? "-0" : result;
                }
                function toSource(func) {
                    if (func != null) {
                        try {
                            return funcToString.call(func);
                        } catch (e) {}
                        try {
                            return func + "";
                        } catch (e) {}
                    }
                    return "";
                }
                function updateWrapDetails(details, bitmask) {
                    arrayEach(wrapFlags, (function(pair) {
                        var value = "_." + pair[0];
                        if (bitmask & pair[1] && !arrayIncludes(details, value)) {
                            details.push(value);
                        }
                    }));
                    return details.sort();
                }
                function wrapperClone(wrapper) {
                    if (wrapper instanceof LazyWrapper) {
                        return wrapper.clone();
                    }
                    var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
                    result.__actions__ = copyArray(wrapper.__actions__);
                    result.__index__ = wrapper.__index__;
                    result.__values__ = wrapper.__values__;
                    return result;
                }
                function chunk(array, size, guard) {
                    if (guard ? isIterateeCall(array, size, guard) : size === undefined) {
                        size = 1;
                    } else {
                        size = nativeMax(toInteger(size), 0);
                    }
                    var length = array == null ? 0 : array.length;
                    if (!length || size < 1) {
                        return [];
                    }
                    var index = 0, resIndex = 0, result = Array(nativeCeil(length / size));
                    while (index < length) {
                        result[resIndex++] = baseSlice(array, index, index += size);
                    }
                    return result;
                }
                function compact(array) {
                    var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
                    while (++index < length) {
                        var value = array[index];
                        if (value) {
                            result[resIndex++] = value;
                        }
                    }
                    return result;
                }
                function concat() {
                    var length = arguments.length;
                    if (!length) {
                        return [];
                    }
                    var args = Array(length - 1), array = arguments[0], index = length;
                    while (index--) {
                        args[index - 1] = arguments[index];
                    }
                    return arrayPush(isArray(array) ? copyArray(array) : [ array ], baseFlatten(args, 1));
                }
                var difference = baseRest((function(array, values) {
                    return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) : [];
                }));
                var differenceBy = baseRest((function(array, values) {
                    var iteratee = last(values);
                    if (isArrayLikeObject(iteratee)) {
                        iteratee = undefined;
                    }
                    return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) : [];
                }));
                var differenceWith = baseRest((function(array, values) {
                    var comparator = last(values);
                    if (isArrayLikeObject(comparator)) {
                        comparator = undefined;
                    }
                    return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) : [];
                }));
                function drop(array, n, guard) {
                    var length = array == null ? 0 : array.length;
                    if (!length) {
                        return [];
                    }
                    n = guard || n === undefined ? 1 : toInteger(n);
                    return baseSlice(array, n < 0 ? 0 : n, length);
                }
                function dropRight(array, n, guard) {
                    var length = array == null ? 0 : array.length;
                    if (!length) {
                        return [];
                    }
                    n = guard || n === undefined ? 1 : toInteger(n);
                    n = length - n;
                    return baseSlice(array, 0, n < 0 ? 0 : n);
                }
                function dropRightWhile(array, predicate) {
                    return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true, true) : [];
                }
                function dropWhile(array, predicate) {
                    return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true) : [];
                }
                function fill(array, value, start, end) {
                    var length = array == null ? 0 : array.length;
                    if (!length) {
                        return [];
                    }
                    if (start && typeof start != "number" && isIterateeCall(array, value, start)) {
                        start = 0;
                        end = length;
                    }
                    return baseFill(array, value, start, end);
                }
                function findIndex(array, predicate, fromIndex) {
                    var length = array == null ? 0 : array.length;
                    if (!length) {
                        return -1;
                    }
                    var index = fromIndex == null ? 0 : toInteger(fromIndex);
                    if (index < 0) {
                        index = nativeMax(length + index, 0);
                    }
                    return baseFindIndex(array, getIteratee(predicate, 3), index);
                }
                function findLastIndex(array, predicate, fromIndex) {
                    var length = array == null ? 0 : array.length;
                    if (!length) {
                        return -1;
                    }
                    var index = length - 1;
                    if (fromIndex !== undefined) {
                        index = toInteger(fromIndex);
                        index = fromIndex < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
                    }
                    return baseFindIndex(array, getIteratee(predicate, 3), index, true);
                }
                function flatten(array) {
                    var length = array == null ? 0 : array.length;
                    return length ? baseFlatten(array, 1) : [];
                }
                function flattenDeep(array) {
                    var length = array == null ? 0 : array.length;
                    return length ? baseFlatten(array, INFINITY) : [];
                }
                function flattenDepth(array, depth) {
                    var length = array == null ? 0 : array.length;
                    if (!length) {
                        return [];
                    }
                    depth = depth === undefined ? 1 : toInteger(depth);
                    return baseFlatten(array, depth);
                }
                function fromPairs(pairs) {
                    var index = -1, length = pairs == null ? 0 : pairs.length, result = {};
                    while (++index < length) {
                        var pair = pairs[index];
                        result[pair[0]] = pair[1];
                    }
                    return result;
                }
                function head(array) {
                    return array && array.length ? array[0] : undefined;
                }
                function indexOf(array, value, fromIndex) {
                    var length = array == null ? 0 : array.length;
                    if (!length) {
                        return -1;
                    }
                    var index = fromIndex == null ? 0 : toInteger(fromIndex);
                    if (index < 0) {
                        index = nativeMax(length + index, 0);
                    }
                    return baseIndexOf(array, value, index);
                }
                function initial(array) {
                    var length = array == null ? 0 : array.length;
                    return length ? baseSlice(array, 0, -1) : [];
                }
                var intersection = baseRest((function(arrays) {
                    var mapped = arrayMap(arrays, castArrayLikeObject);
                    return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : [];
                }));
                var intersectionBy = baseRest((function(arrays) {
                    var iteratee = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
                    if (iteratee === last(mapped)) {
                        iteratee = undefined;
                    } else {
                        mapped.pop();
                    }
                    return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, getIteratee(iteratee, 2)) : [];
                }));
                var intersectionWith = baseRest((function(arrays) {
                    var comparator = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
                    comparator = typeof comparator == "function" ? comparator : undefined;
                    if (comparator) {
                        mapped.pop();
                    }
                    return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined, comparator) : [];
                }));
                function join(array, separator) {
                    return array == null ? "" : nativeJoin.call(array, separator);
                }
                function last(array) {
                    var length = array == null ? 0 : array.length;
                    return length ? array[length - 1] : undefined;
                }
                function lastIndexOf(array, value, fromIndex) {
                    var length = array == null ? 0 : array.length;
                    if (!length) {
                        return -1;
                    }
                    var index = length;
                    if (fromIndex !== undefined) {
                        index = toInteger(fromIndex);
                        index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
                    }
                    return value === value ? strictLastIndexOf(array, value, index) : baseFindIndex(array, baseIsNaN, index, true);
                }
                function nth(array, n) {
                    return array && array.length ? baseNth(array, toInteger(n)) : undefined;
                }
                var pull = baseRest(pullAll);
                function pullAll(array, values) {
                    return array && array.length && values && values.length ? basePullAll(array, values) : array;
                }
                function pullAllBy(array, values, iteratee) {
                    return array && array.length && values && values.length ? basePullAll(array, values, getIteratee(iteratee, 2)) : array;
                }
                function pullAllWith(array, values, comparator) {
                    return array && array.length && values && values.length ? basePullAll(array, values, undefined, comparator) : array;
                }
                var pullAt = flatRest((function(array, indexes) {
                    var length = array == null ? 0 : array.length, result = baseAt(array, indexes);
                    basePullAt(array, arrayMap(indexes, (function(index) {
                        return isIndex(index, length) ? +index : index;
                    })).sort(compareAscending));
                    return result;
                }));
                function remove(array, predicate) {
                    var result = [];
                    if (!(array && array.length)) {
                        return result;
                    }
                    var index = -1, indexes = [], length = array.length;
                    predicate = getIteratee(predicate, 3);
                    while (++index < length) {
                        var value = array[index];
                        if (predicate(value, index, array)) {
                            result.push(value);
                            indexes.push(index);
                        }
                    }
                    basePullAt(array, indexes);
                    return result;
                }
                function reverse(array) {
                    return array == null ? array : nativeReverse.call(array);
                }
                function slice(array, start, end) {
                    var length = array == null ? 0 : array.length;
                    if (!length) {
                        return [];
                    }
                    if (end && typeof end != "number" && isIterateeCall(array, start, end)) {
                        start = 0;
                        end = length;
                    } else {
                        start = start == null ? 0 : toInteger(start);
                        end = end === undefined ? length : toInteger(end);
                    }
                    return baseSlice(array, start, end);
                }
                function sortedIndex(array, value) {
                    return baseSortedIndex(array, value);
                }
                function sortedIndexBy(array, value, iteratee) {
                    return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
                }
                function sortedIndexOf(array, value) {
                    var length = array == null ? 0 : array.length;
                    if (length) {
                        var index = baseSortedIndex(array, value);
                        if (index < length && eq(array[index], value)) {
                            return index;
                        }
                    }
                    return -1;
                }
                function sortedLastIndex(array, value) {
                    return baseSortedIndex(array, value, true);
                }
                function sortedLastIndexBy(array, value, iteratee) {
                    return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
                }
                function sortedLastIndexOf(array, value) {
                    var length = array == null ? 0 : array.length;
                    if (length) {
                        var index = baseSortedIndex(array, value, true) - 1;
                        if (eq(array[index], value)) {
                            return index;
                        }
                    }
                    return -1;
                }
                function sortedUniq(array) {
                    return array && array.length ? baseSortedUniq(array) : [];
                }
                function sortedUniqBy(array, iteratee) {
                    return array && array.length ? baseSortedUniq(array, getIteratee(iteratee, 2)) : [];
                }
                function tail(array) {
                    var length = array == null ? 0 : array.length;
                    return length ? baseSlice(array, 1, length) : [];
                }
                function take(array, n, guard) {
                    if (!(array && array.length)) {
                        return [];
                    }
                    n = guard || n === undefined ? 1 : toInteger(n);
                    return baseSlice(array, 0, n < 0 ? 0 : n);
                }
                function takeRight(array, n, guard) {
                    var length = array == null ? 0 : array.length;
                    if (!length) {
                        return [];
                    }
                    n = guard || n === undefined ? 1 : toInteger(n);
                    n = length - n;
                    return baseSlice(array, n < 0 ? 0 : n, length);
                }
                function takeRightWhile(array, predicate) {
                    return array && array.length ? baseWhile(array, getIteratee(predicate, 3), false, true) : [];
                }
                function takeWhile(array, predicate) {
                    return array && array.length ? baseWhile(array, getIteratee(predicate, 3)) : [];
                }
                var union = baseRest((function(arrays) {
                    return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
                }));
                var unionBy = baseRest((function(arrays) {
                    var iteratee = last(arrays);
                    if (isArrayLikeObject(iteratee)) {
                        iteratee = undefined;
                    }
                    return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
                }));
                var unionWith = baseRest((function(arrays) {
                    var comparator = last(arrays);
                    comparator = typeof comparator == "function" ? comparator : undefined;
                    return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
                }));
                function uniq(array) {
                    return array && array.length ? baseUniq(array) : [];
                }
                function uniqBy(array, iteratee) {
                    return array && array.length ? baseUniq(array, getIteratee(iteratee, 2)) : [];
                }
                function uniqWith(array, comparator) {
                    comparator = typeof comparator == "function" ? comparator : undefined;
                    return array && array.length ? baseUniq(array, undefined, comparator) : [];
                }
                function unzip(array) {
                    if (!(array && array.length)) {
                        return [];
                    }
                    var length = 0;
                    array = arrayFilter(array, (function(group) {
                        if (isArrayLikeObject(group)) {
                            length = nativeMax(group.length, length);
                            return true;
                        }
                    }));
                    return baseTimes(length, (function(index) {
                        return arrayMap(array, baseProperty(index));
                    }));
                }
                function unzipWith(array, iteratee) {
                    if (!(array && array.length)) {
                        return [];
                    }
                    var result = unzip(array);
                    if (iteratee == null) {
                        return result;
                    }
                    return arrayMap(result, (function(group) {
                        return apply(iteratee, undefined, group);
                    }));
                }
                var without = baseRest((function(array, values) {
                    return isArrayLikeObject(array) ? baseDifference(array, values) : [];
                }));
                var xor = baseRest((function(arrays) {
                    return baseXor(arrayFilter(arrays, isArrayLikeObject));
                }));
                var xorBy = baseRest((function(arrays) {
                    var iteratee = last(arrays);
                    if (isArrayLikeObject(iteratee)) {
                        iteratee = undefined;
                    }
                    return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
                }));
                var xorWith = baseRest((function(arrays) {
                    var comparator = last(arrays);
                    comparator = typeof comparator == "function" ? comparator : undefined;
                    return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
                }));
                var zip = baseRest(unzip);
                function zipObject(props, values) {
                    return baseZipObject(props || [], values || [], assignValue);
                }
                function zipObjectDeep(props, values) {
                    return baseZipObject(props || [], values || [], baseSet);
                }
                var zipWith = baseRest((function(arrays) {
                    var length = arrays.length, iteratee = length > 1 ? arrays[length - 1] : undefined;
                    iteratee = typeof iteratee == "function" ? (arrays.pop(), iteratee) : undefined;
                    return unzipWith(arrays, iteratee);
                }));
                function chain(value) {
                    var result = lodash(value);
                    result.__chain__ = true;
                    return result;
                }
                function tap(value, interceptor) {
                    interceptor(value);
                    return value;
                }
                function thru(value, interceptor) {
                    return interceptor(value);
                }
                var wrapperAt = flatRest((function(paths) {
                    var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object) {
                        return baseAt(object, paths);
                    };
                    if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) {
                        return this.thru(interceptor);
                    }
                    value = value.slice(start, +start + (length ? 1 : 0));
                    value.__actions__.push({
                        func: thru,
                        args: [ interceptor ],
                        thisArg: undefined
                    });
                    return new LodashWrapper(value, this.__chain__).thru((function(array) {
                        if (length && !array.length) {
                            array.push(undefined);
                        }
                        return array;
                    }));
                }));
                function wrapperChain() {
                    return chain(this);
                }
                function wrapperCommit() {
                    return new LodashWrapper(this.value(), this.__chain__);
                }
                function wrapperNext() {
                    if (this.__values__ === undefined) {
                        this.__values__ = toArray(this.value());
                    }
                    var done = this.__index__ >= this.__values__.length, value = done ? undefined : this.__values__[this.__index__++];
                    return {
                        done,
                        value
                    };
                }
                function wrapperToIterator() {
                    return this;
                }
                function wrapperPlant(value) {
                    var result, parent = this;
                    while (parent instanceof baseLodash) {
                        var clone = wrapperClone(parent);
                        clone.__index__ = 0;
                        clone.__values__ = undefined;
                        if (result) {
                            previous.__wrapped__ = clone;
                        } else {
                            result = clone;
                        }
                        var previous = clone;
                        parent = parent.__wrapped__;
                    }
                    previous.__wrapped__ = value;
                    return result;
                }
                function wrapperReverse() {
                    var value = this.__wrapped__;
                    if (value instanceof LazyWrapper) {
                        var wrapped = value;
                        if (this.__actions__.length) {
                            wrapped = new LazyWrapper(this);
                        }
                        wrapped = wrapped.reverse();
                        wrapped.__actions__.push({
                            func: thru,
                            args: [ reverse ],
                            thisArg: undefined
                        });
                        return new LodashWrapper(wrapped, this.__chain__);
                    }
                    return this.thru(reverse);
                }
                function wrapperValue() {
                    return baseWrapperValue(this.__wrapped__, this.__actions__);
                }
                var countBy = createAggregator((function(result, value, key) {
                    if (hasOwnProperty.call(result, key)) {
                        ++result[key];
                    } else {
                        baseAssignValue(result, key, 1);
                    }
                }));
                function every(collection, predicate, guard) {
                    var func = isArray(collection) ? arrayEvery : baseEvery;
                    if (guard && isIterateeCall(collection, predicate, guard)) {
                        predicate = undefined;
                    }
                    return func(collection, getIteratee(predicate, 3));
                }
                function filter(collection, predicate) {
                    var func = isArray(collection) ? arrayFilter : baseFilter;
                    return func(collection, getIteratee(predicate, 3));
                }
                var find = createFind(findIndex);
                var findLast = createFind(findLastIndex);
                function flatMap(collection, iteratee) {
                    return baseFlatten(map(collection, iteratee), 1);
                }
                function flatMapDeep(collection, iteratee) {
                    return baseFlatten(map(collection, iteratee), INFINITY);
                }
                function flatMapDepth(collection, iteratee, depth) {
                    depth = depth === undefined ? 1 : toInteger(depth);
                    return baseFlatten(map(collection, iteratee), depth);
                }
                function forEach(collection, iteratee) {
                    var func = isArray(collection) ? arrayEach : baseEach;
                    return func(collection, getIteratee(iteratee, 3));
                }
                function forEachRight(collection, iteratee) {
                    var func = isArray(collection) ? arrayEachRight : baseEachRight;
                    return func(collection, getIteratee(iteratee, 3));
                }
                var groupBy = createAggregator((function(result, value, key) {
                    if (hasOwnProperty.call(result, key)) {
                        result[key].push(value);
                    } else {
                        baseAssignValue(result, key, [ value ]);
                    }
                }));
                function includes(collection, value, fromIndex, guard) {
                    collection = isArrayLike(collection) ? collection : values(collection);
                    fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0;
                    var length = collection.length;
                    if (fromIndex < 0) {
                        fromIndex = nativeMax(length + fromIndex, 0);
                    }
                    return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
                }
                var invokeMap = baseRest((function(collection, path, args) {
                    var index = -1, isFunc = typeof path == "function", result = isArrayLike(collection) ? Array(collection.length) : [];
                    baseEach(collection, (function(value) {
                        result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
                    }));
                    return result;
                }));
                var keyBy = createAggregator((function(result, value, key) {
                    baseAssignValue(result, key, value);
                }));
                function map(collection, iteratee) {
                    var func = isArray(collection) ? arrayMap : baseMap;
                    return func(collection, getIteratee(iteratee, 3));
                }
                function orderBy(collection, iteratees, orders, guard) {
                    if (collection == null) {
                        return [];
                    }
                    if (!isArray(iteratees)) {
                        iteratees = iteratees == null ? [] : [ iteratees ];
                    }
                    orders = guard ? undefined : orders;
                    if (!isArray(orders)) {
                        orders = orders == null ? [] : [ orders ];
                    }
                    return baseOrderBy(collection, iteratees, orders);
                }
                var partition = createAggregator((function(result, value, key) {
                    result[key ? 0 : 1].push(value);
                }), (function() {
                    return [ [], [] ];
                }));
                function reduce(collection, iteratee, accumulator) {
                    var func = isArray(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3;
                    return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
                }
                function reduceRight(collection, iteratee, accumulator) {
                    var func = isArray(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3;
                    return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
                }
                function reject(collection, predicate) {
                    var func = isArray(collection) ? arrayFilter : baseFilter;
                    return func(collection, negate(getIteratee(predicate, 3)));
                }
                function sample(collection) {
                    var func = isArray(collection) ? arraySample : baseSample;
                    return func(collection);
                }
                function sampleSize(collection, n, guard) {
                    if (guard ? isIterateeCall(collection, n, guard) : n === undefined) {
                        n = 1;
                    } else {
                        n = toInteger(n);
                    }
                    var func = isArray(collection) ? arraySampleSize : baseSampleSize;
                    return func(collection, n);
                }
                function shuffle(collection) {
                    var func = isArray(collection) ? arrayShuffle : baseShuffle;
                    return func(collection);
                }
                function size(collection) {
                    if (collection == null) {
                        return 0;
                    }
                    if (isArrayLike(collection)) {
                        return isString(collection) ? stringSize(collection) : collection.length;
                    }
                    var tag = getTag(collection);
                    if (tag == mapTag || tag == setTag) {
                        return collection.size;
                    }
                    return baseKeys(collection).length;
                }
                function some(collection, predicate, guard) {
                    var func = isArray(collection) ? arraySome : baseSome;
                    if (guard && isIterateeCall(collection, predicate, guard)) {
                        predicate = undefined;
                    }
                    return func(collection, getIteratee(predicate, 3));
                }
                var sortBy = baseRest((function(collection, iteratees) {
                    if (collection == null) {
                        return [];
                    }
                    var length = iteratees.length;
                    if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
                        iteratees = [];
                    } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
                        iteratees = [ iteratees[0] ];
                    }
                    return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
                }));
                var now = ctxNow || function() {
                    return root.Date.now();
                };
                function after(n, func) {
                    if (typeof func != "function") {
                        throw new TypeError(FUNC_ERROR_TEXT);
                    }
                    n = toInteger(n);
                    return function() {
                        if (--n < 1) {
                            return func.apply(this, arguments);
                        }
                    };
                }
                function ary(func, n, guard) {
                    n = guard ? undefined : n;
                    n = func && n == null ? func.length : n;
                    return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
                }
                function before(n, func) {
                    var result;
                    if (typeof func != "function") {
                        throw new TypeError(FUNC_ERROR_TEXT);
                    }
                    n = toInteger(n);
                    return function() {
                        if (--n > 0) {
                            result = func.apply(this, arguments);
                        }
                        if (n <= 1) {
                            func = undefined;
                        }
                        return result;
                    };
                }
                var bind = baseRest((function(func, thisArg, partials) {
                    var bitmask = WRAP_BIND_FLAG;
                    if (partials.length) {
                        var holders = replaceHolders(partials, getHolder(bind));
                        bitmask |= WRAP_PARTIAL_FLAG;
                    }
                    return createWrap(func, bitmask, thisArg, partials, holders);
                }));
                var bindKey = baseRest((function(object, key, partials) {
                    var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
                    if (partials.length) {
                        var holders = replaceHolders(partials, getHolder(bindKey));
                        bitmask |= WRAP_PARTIAL_FLAG;
                    }
                    return createWrap(key, bitmask, object, partials, holders);
                }));
                function curry(func, arity, guard) {
                    arity = guard ? undefined : arity;
                    var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
                    result.placeholder = curry.placeholder;
                    return result;
                }
                function curryRight(func, arity, guard) {
                    arity = guard ? undefined : arity;
                    var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
                    result.placeholder = curryRight.placeholder;
                    return result;
                }
                function debounce(func, wait, options) {
                    var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
                    if (typeof func != "function") {
                        throw new TypeError(FUNC_ERROR_TEXT);
                    }
                    wait = toNumber(wait) || 0;
                    if (isObject(options)) {
                        leading = !!options.leading;
                        maxing = "maxWait" in options;
                        maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
                        trailing = "trailing" in options ? !!options.trailing : trailing;
                    }
                    function invokeFunc(time) {
                        var args = lastArgs, thisArg = lastThis;
                        lastArgs = lastThis = undefined;
                        lastInvokeTime = time;
                        result = func.apply(thisArg, args);
                        return result;
                    }
                    function leadingEdge(time) {
                        lastInvokeTime = time;
                        timerId = setTimeout(timerExpired, wait);
                        return leading ? invokeFunc(time) : result;
                    }
                    function remainingWait(time) {
                        var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
                        return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
                    }
                    function shouldInvoke(time) {
                        var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
                        return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
                    }
                    function timerExpired() {
                        var time = now();
                        if (shouldInvoke(time)) {
                            return trailingEdge(time);
                        }
                        timerId = setTimeout(timerExpired, remainingWait(time));
                    }
                    function trailingEdge(time) {
                        timerId = undefined;
                        if (trailing && lastArgs) {
                            return invokeFunc(time);
                        }
                        lastArgs = lastThis = undefined;
                        return result;
                    }
                    function cancel() {
                        if (timerId !== undefined) {
                            clearTimeout(timerId);
                        }
                        lastInvokeTime = 0;
                        lastArgs = lastCallTime = lastThis = timerId = undefined;
                    }
                    function flush() {
                        return timerId === undefined ? result : trailingEdge(now());
                    }
                    function debounced() {
                        var time = now(), isInvoking = shouldInvoke(time);
                        lastArgs = arguments;
                        lastThis = this;
                        lastCallTime = time;
                        if (isInvoking) {
                            if (timerId === undefined) {
                                return leadingEdge(lastCallTime);
                            }
                            if (maxing) {
                                clearTimeout(timerId);
                                timerId = setTimeout(timerExpired, wait);
                                return invokeFunc(lastCallTime);
                            }
                        }
                        if (timerId === undefined) {
                            timerId = setTimeout(timerExpired, wait);
                        }
                        return result;
                    }
                    debounced.cancel = cancel;
                    debounced.flush = flush;
                    return debounced;
                }
                var defer = baseRest((function(func, args) {
                    return baseDelay(func, 1, args);
                }));
                var delay = baseRest((function(func, wait, args) {
                    return baseDelay(func, toNumber(wait) || 0, args);
                }));
                function flip(func) {
                    return createWrap(func, WRAP_FLIP_FLAG);
                }
                function memoize(func, resolver) {
                    if (typeof func != "function" || resolver != null && typeof resolver != "function") {
                        throw new TypeError(FUNC_ERROR_TEXT);
                    }
                    var memoized = function() {
                        var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
                        if (cache.has(key)) {
                            return cache.get(key);
                        }
                        var result = func.apply(this, args);
                        memoized.cache = cache.set(key, result) || cache;
                        return result;
                    };
                    memoized.cache = new (memoize.Cache || MapCache);
                    return memoized;
                }
                memoize.Cache = MapCache;
                function negate(predicate) {
                    if (typeof predicate != "function") {
                        throw new TypeError(FUNC_ERROR_TEXT);
                    }
                    return function() {
                        var args = arguments;
                        switch (args.length) {
                          case 0:
                            return !predicate.call(this);

                          case 1:
                            return !predicate.call(this, args[0]);

                          case 2:
                            return !predicate.call(this, args[0], args[1]);

                          case 3:
                            return !predicate.call(this, args[0], args[1], args[2]);
                        }
                        return !predicate.apply(this, args);
                    };
                }
                function once(func) {
                    return before(2, func);
                }
                var overArgs = castRest((function(func, transforms) {
                    transforms = transforms.length == 1 && isArray(transforms[0]) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
                    var funcsLength = transforms.length;
                    return baseRest((function(args) {
                        var index = -1, length = nativeMin(args.length, funcsLength);
                        while (++index < length) {
                            args[index] = transforms[index].call(this, args[index]);
                        }
                        return apply(func, this, args);
                    }));
                }));
                var partial = baseRest((function(func, partials) {
                    var holders = replaceHolders(partials, getHolder(partial));
                    return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
                }));
                var partialRight = baseRest((function(func, partials) {
                    var holders = replaceHolders(partials, getHolder(partialRight));
                    return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
                }));
                var rearg = flatRest((function(func, indexes) {
                    return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
                }));
                function rest(func, start) {
                    if (typeof func != "function") {
                        throw new TypeError(FUNC_ERROR_TEXT);
                    }
                    start = start === undefined ? start : toInteger(start);
                    return baseRest(func, start);
                }
                function spread(func, start) {
                    if (typeof func != "function") {
                        throw new TypeError(FUNC_ERROR_TEXT);
                    }
                    start = start == null ? 0 : nativeMax(toInteger(start), 0);
                    return baseRest((function(args) {
                        var array = args[start], otherArgs = castSlice(args, 0, start);
                        if (array) {
                            arrayPush(otherArgs, array);
                        }
                        return apply(func, this, otherArgs);
                    }));
                }
                function throttle(func, wait, options) {
                    var leading = true, trailing = true;
                    if (typeof func != "function") {
                        throw new TypeError(FUNC_ERROR_TEXT);
                    }
                    if (isObject(options)) {
                        leading = "leading" in options ? !!options.leading : leading;
                        trailing = "trailing" in options ? !!options.trailing : trailing;
                    }
                    return debounce(func, wait, {
                        leading,
                        maxWait: wait,
                        trailing
                    });
                }
                function unary(func) {
                    return ary(func, 1);
                }
                function wrap(value, wrapper) {
                    return partial(castFunction(wrapper), value);
                }
                function castArray() {
                    if (!arguments.length) {
                        return [];
                    }
                    var value = arguments[0];
                    return isArray(value) ? value : [ value ];
                }
                function clone(value) {
                    return baseClone(value, CLONE_SYMBOLS_FLAG);
                }
                function cloneWith(value, customizer) {
                    customizer = typeof customizer == "function" ? customizer : undefined;
                    return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
                }
                function cloneDeep(value) {
                    return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
                }
                function cloneDeepWith(value, customizer) {
                    customizer = typeof customizer == "function" ? customizer : undefined;
                    return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
                }
                function conformsTo(object, source) {
                    return source == null || baseConformsTo(object, source, keys(source));
                }
                function eq(value, other) {
                    return value === other || value !== value && other !== other;
                }
                var gt = createRelationalOperation(baseGt);
                var gte = createRelationalOperation((function(value, other) {
                    return value >= other;
                }));
                var isArguments = baseIsArguments(function() {
                    return arguments;
                }()) ? baseIsArguments : function(value) {
                    return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
                };
                var isArray = Array.isArray;
                var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
                function isArrayLike(value) {
                    return value != null && isLength(value.length) && !isFunction(value);
                }
                function isArrayLikeObject(value) {
                    return isObjectLike(value) && isArrayLike(value);
                }
                function isBoolean(value) {
                    return value === true || value === false || isObjectLike(value) && baseGetTag(value) == boolTag;
                }
                var isBuffer = nativeIsBuffer || stubFalse;
                var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
                function isElement(value) {
                    return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
                }
                function isEmpty(value) {
                    if (value == null) {
                        return true;
                    }
                    if (isArrayLike(value) && (isArray(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isTypedArray(value) || isArguments(value))) {
                        return !value.length;
                    }
                    var tag = getTag(value);
                    if (tag == mapTag || tag == setTag) {
                        return !value.size;
                    }
                    if (isPrototype(value)) {
                        return !baseKeys(value).length;
                    }
                    for (var key in value) {
                        if (hasOwnProperty.call(value, key)) {
                            return false;
                        }
                    }
                    return true;
                }
                function isEqual(value, other) {
                    return baseIsEqual(value, other);
                }
                function isEqualWith(value, other, customizer) {
                    customizer = typeof customizer == "function" ? customizer : undefined;
                    var result = customizer ? customizer(value, other) : undefined;
                    return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
                }
                function isError(value) {
                    if (!isObjectLike(value)) {
                        return false;
                    }
                    var tag = baseGetTag(value);
                    return tag == errorTag || tag == domExcTag || typeof value.message == "string" && typeof value.name == "string" && !isPlainObject(value);
                }
                function isFinite(value) {
                    return typeof value == "number" && nativeIsFinite(value);
                }
                function isFunction(value) {
                    if (!isObject(value)) {
                        return false;
                    }
                    var tag = baseGetTag(value);
                    return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
                }
                function isInteger(value) {
                    return typeof value == "number" && value == toInteger(value);
                }
                function isLength(value) {
                    return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
                }
                function isObject(value) {
                    var type = typeof value;
                    return value != null && (type == "object" || type == "function");
                }
                function isObjectLike(value) {
                    return value != null && typeof value == "object";
                }
                var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
                function isMatch(object, source) {
                    return object === source || baseIsMatch(object, source, getMatchData(source));
                }
                function isMatchWith(object, source, customizer) {
                    customizer = typeof customizer == "function" ? customizer : undefined;
                    return baseIsMatch(object, source, getMatchData(source), customizer);
                }
                function isNaN(value) {
                    return isNumber(value) && value != +value;
                }
                function isNative(value) {
                    if (isMaskable(value)) {
                        throw new Error(CORE_ERROR_TEXT);
                    }
                    return baseIsNative(value);
                }
                function isNull(value) {
                    return value === null;
                }
                function isNil(value) {
                    return value == null;
                }
                function isNumber(value) {
                    return typeof value == "number" || isObjectLike(value) && baseGetTag(value) == numberTag;
                }
                function isPlainObject(value) {
                    if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
                        return false;
                    }
                    var proto = getPrototype(value);
                    if (proto === null) {
                        return true;
                    }
                    var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
                    return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
                }
                var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
                function isSafeInteger(value) {
                    return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
                }
                var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
                function isString(value) {
                    return typeof value == "string" || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
                }
                function isSymbol(value) {
                    return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
                }
                var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
                function isUndefined(value) {
                    return value === undefined;
                }
                function isWeakMap(value) {
                    return isObjectLike(value) && getTag(value) == weakMapTag;
                }
                function isWeakSet(value) {
                    return isObjectLike(value) && baseGetTag(value) == weakSetTag;
                }
                var lt = createRelationalOperation(baseLt);
                var lte = createRelationalOperation((function(value, other) {
                    return value <= other;
                }));
                function toArray(value) {
                    if (!value) {
                        return [];
                    }
                    if (isArrayLike(value)) {
                        return isString(value) ? stringToArray(value) : copyArray(value);
                    }
                    if (symIterator && value[symIterator]) {
                        return iteratorToArray(value[symIterator]());
                    }
                    var tag = getTag(value), func = tag == mapTag ? mapToArray : tag == setTag ? setToArray : values;
                    return func(value);
                }
                function toFinite(value) {
                    if (!value) {
                        return value === 0 ? value : 0;
                    }
                    value = toNumber(value);
                    if (value === INFINITY || value === -INFINITY) {
                        var sign = value < 0 ? -1 : 1;
                        return sign * MAX_INTEGER;
                    }
                    return value === value ? value : 0;
                }
                function toInteger(value) {
                    var result = toFinite(value), remainder = result % 1;
                    return result === result ? remainder ? result - remainder : result : 0;
                }
                function toLength(value) {
                    return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
                }
                function toNumber(value) {
                    if (typeof value == "number") {
                        return value;
                    }
                    if (isSymbol(value)) {
                        return NAN;
                    }
                    if (isObject(value)) {
                        var other = typeof value.valueOf == "function" ? value.valueOf() : value;
                        value = isObject(other) ? other + "" : other;
                    }
                    if (typeof value != "string") {
                        return value === 0 ? value : +value;
                    }
                    value = value.replace(reTrim, "");
                    var isBinary = reIsBinary.test(value);
                    return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
                }
                function toPlainObject(value) {
                    return copyObject(value, keysIn(value));
                }
                function toSafeInteger(value) {
                    return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : value === 0 ? value : 0;
                }
                function toString(value) {
                    return value == null ? "" : baseToString(value);
                }
                var assign = createAssigner((function(object, source) {
                    if (isPrototype(source) || isArrayLike(source)) {
                        copyObject(source, keys(source), object);
                        return;
                    }
                    for (var key in source) {
                        if (hasOwnProperty.call(source, key)) {
                            assignValue(object, key, source[key]);
                        }
                    }
                }));
                var assignIn = createAssigner((function(object, source) {
                    copyObject(source, keysIn(source), object);
                }));
                var assignInWith = createAssigner((function(object, source, srcIndex, customizer) {
                    copyObject(source, keysIn(source), object, customizer);
                }));
                var assignWith = createAssigner((function(object, source, srcIndex, customizer) {
                    copyObject(source, keys(source), object, customizer);
                }));
                var at = flatRest(baseAt);
                function create(prototype, properties) {
                    var result = baseCreate(prototype);
                    return properties == null ? result : baseAssign(result, properties);
                }
                var defaults = baseRest((function(object, sources) {
                    object = Object(object);
                    var index = -1;
                    var length = sources.length;
                    var guard = length > 2 ? sources[2] : undefined;
                    if (guard && isIterateeCall(sources[0], sources[1], guard)) {
                        length = 1;
                    }
                    while (++index < length) {
                        var source = sources[index];
                        var props = keysIn(source);
                        var propsIndex = -1;
                        var propsLength = props.length;
                        while (++propsIndex < propsLength) {
                            var key = props[propsIndex];
                            var value = object[key];
                            if (value === undefined || eq(value, objectProto[key]) && !hasOwnProperty.call(object, key)) {
                                object[key] = source[key];
                            }
                        }
                    }
                    return object;
                }));
                var defaultsDeep = baseRest((function(args) {
                    args.push(undefined, customDefaultsMerge);
                    return apply(mergeWith, undefined, args);
                }));
                function findKey(object, predicate) {
                    return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
                }
                function findLastKey(object, predicate) {
                    return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
                }
                function forIn(object, iteratee) {
                    return object == null ? object : baseFor(object, getIteratee(iteratee, 3), keysIn);
                }
                function forInRight(object, iteratee) {
                    return object == null ? object : baseForRight(object, getIteratee(iteratee, 3), keysIn);
                }
                function forOwn(object, iteratee) {
                    return object && baseForOwn(object, getIteratee(iteratee, 3));
                }
                function forOwnRight(object, iteratee) {
                    return object && baseForOwnRight(object, getIteratee(iteratee, 3));
                }
                function functions(object) {
                    return object == null ? [] : baseFunctions(object, keys(object));
                }
                function functionsIn(object) {
                    return object == null ? [] : baseFunctions(object, keysIn(object));
                }
                function get(object, path, defaultValue) {
                    var result = object == null ? undefined : baseGet(object, path);
                    return result === undefined ? defaultValue : result;
                }
                function has(object, path) {
                    return object != null && hasPath(object, path, baseHas);
                }
                function hasIn(object, path) {
                    return object != null && hasPath(object, path, baseHasIn);
                }
                var invert = createInverter((function(result, value, key) {
                    if (value != null && typeof value.toString != "function") {
                        value = nativeObjectToString.call(value);
                    }
                    result[value] = key;
                }), constant(identity));
                var invertBy = createInverter((function(result, value, key) {
                    if (value != null && typeof value.toString != "function") {
                        value = nativeObjectToString.call(value);
                    }
                    if (hasOwnProperty.call(result, value)) {
                        result[value].push(key);
                    } else {
                        result[value] = [ key ];
                    }
                }), getIteratee);
                var invoke = baseRest(baseInvoke);
                function keys(object) {
                    return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
                }
                function keysIn(object) {
                    return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
                }
                function mapKeys(object, iteratee) {
                    var result = {};
                    iteratee = getIteratee(iteratee, 3);
                    baseForOwn(object, (function(value, key, object) {
                        baseAssignValue(result, iteratee(value, key, object), value);
                    }));
                    return result;
                }
                function mapValues(object, iteratee) {
                    var result = {};
                    iteratee = getIteratee(iteratee, 3);
                    baseForOwn(object, (function(value, key, object) {
                        baseAssignValue(result, key, iteratee(value, key, object));
                    }));
                    return result;
                }
                var merge = createAssigner((function(object, source, srcIndex) {
                    baseMerge(object, source, srcIndex);
                }));
                var mergeWith = createAssigner((function(object, source, srcIndex, customizer) {
                    baseMerge(object, source, srcIndex, customizer);
                }));
                var omit = flatRest((function(object, paths) {
                    var result = {};
                    if (object == null) {
                        return result;
                    }
                    var isDeep = false;
                    paths = arrayMap(paths, (function(path) {
                        path = castPath(path, object);
                        isDeep || (isDeep = path.length > 1);
                        return path;
                    }));
                    copyObject(object, getAllKeysIn(object), result);
                    if (isDeep) {
                        result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
                    }
                    var length = paths.length;
                    while (length--) {
                        baseUnset(result, paths[length]);
                    }
                    return result;
                }));
                function omitBy(object, predicate) {
                    return pickBy(object, negate(getIteratee(predicate)));
                }
                var pick = flatRest((function(object, paths) {
                    return object == null ? {} : basePick(object, paths);
                }));
                function pickBy(object, predicate) {
                    if (object == null) {
                        return {};
                    }
                    var props = arrayMap(getAllKeysIn(object), (function(prop) {
                        return [ prop ];
                    }));
                    predicate = getIteratee(predicate);
                    return basePickBy(object, props, (function(value, path) {
                        return predicate(value, path[0]);
                    }));
                }
                function result(object, path, defaultValue) {
                    path = castPath(path, object);
                    var index = -1, length = path.length;
                    if (!length) {
                        length = 1;
                        object = undefined;
                    }
                    while (++index < length) {
                        var value = object == null ? undefined : object[toKey(path[index])];
                        if (value === undefined) {
                            index = length;
                            value = defaultValue;
                        }
                        object = isFunction(value) ? value.call(object) : value;
                    }
                    return object;
                }
                function set(object, path, value) {
                    return object == null ? object : baseSet(object, path, value);
                }
                function setWith(object, path, value, customizer) {
                    customizer = typeof customizer == "function" ? customizer : undefined;
                    return object == null ? object : baseSet(object, path, value, customizer);
                }
                var toPairs = createToPairs(keys);
                var toPairsIn = createToPairs(keysIn);
                function transform(object, iteratee, accumulator) {
                    var isArr = isArray(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object);
                    iteratee = getIteratee(iteratee, 4);
                    if (accumulator == null) {
                        var Ctor = object && object.constructor;
                        if (isArrLike) {
                            accumulator = isArr ? new Ctor : [];
                        } else if (isObject(object)) {
                            accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
                        } else {
                            accumulator = {};
                        }
                    }
                    (isArrLike ? arrayEach : baseForOwn)(object, (function(value, index, object) {
                        return iteratee(accumulator, value, index, object);
                    }));
                    return accumulator;
                }
                function unset(object, path) {
                    return object == null ? true : baseUnset(object, path);
                }
                function update(object, path, updater) {
                    return object == null ? object : baseUpdate(object, path, castFunction(updater));
                }
                function updateWith(object, path, updater, customizer) {
                    customizer = typeof customizer == "function" ? customizer : undefined;
                    return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
                }
                function values(object) {
                    return object == null ? [] : baseValues(object, keys(object));
                }
                function valuesIn(object) {
                    return object == null ? [] : baseValues(object, keysIn(object));
                }
                function clamp(number, lower, upper) {
                    if (upper === undefined) {
                        upper = lower;
                        lower = undefined;
                    }
                    if (upper !== undefined) {
                        upper = toNumber(upper);
                        upper = upper === upper ? upper : 0;
                    }
                    if (lower !== undefined) {
                        lower = toNumber(lower);
                        lower = lower === lower ? lower : 0;
                    }
                    return baseClamp(toNumber(number), lower, upper);
                }
                function inRange(number, start, end) {
                    start = toFinite(start);
                    if (end === undefined) {
                        end = start;
                        start = 0;
                    } else {
                        end = toFinite(end);
                    }
                    number = toNumber(number);
                    return baseInRange(number, start, end);
                }
                function random(lower, upper, floating) {
                    if (floating && typeof floating != "boolean" && isIterateeCall(lower, upper, floating)) {
                        upper = floating = undefined;
                    }
                    if (floating === undefined) {
                        if (typeof upper == "boolean") {
                            floating = upper;
                            upper = undefined;
                        } else if (typeof lower == "boolean") {
                            floating = lower;
                            lower = undefined;
                        }
                    }
                    if (lower === undefined && upper === undefined) {
                        lower = 0;
                        upper = 1;
                    } else {
                        lower = toFinite(lower);
                        if (upper === undefined) {
                            upper = lower;
                            lower = 0;
                        } else {
                            upper = toFinite(upper);
                        }
                    }
                    if (lower > upper) {
                        var temp = lower;
                        lower = upper;
                        upper = temp;
                    }
                    if (floating || lower % 1 || upper % 1) {
                        var rand = nativeRandom();
                        return nativeMin(lower + rand * (upper - lower + freeParseFloat("1e-" + ((rand + "").length - 1))), upper);
                    }
                    return baseRandom(lower, upper);
                }
                var camelCase = createCompounder((function(result, word, index) {
                    word = word.toLowerCase();
                    return result + (index ? capitalize(word) : word);
                }));
                function capitalize(string) {
                    return upperFirst(toString(string).toLowerCase());
                }
                function deburr(string) {
                    string = toString(string);
                    return string && string.replace(reLatin, deburrLetter).replace(reComboMark, "");
                }
                function endsWith(string, target, position) {
                    string = toString(string);
                    target = baseToString(target);
                    var length = string.length;
                    position = position === undefined ? length : baseClamp(toInteger(position), 0, length);
                    var end = position;
                    position -= target.length;
                    return position >= 0 && string.slice(position, end) == target;
                }
                function escape(string) {
                    string = toString(string);
                    return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string;
                }
                function escapeRegExp(string) {
                    string = toString(string);
                    return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, "\\$&") : string;
                }
                var kebabCase = createCompounder((function(result, word, index) {
                    return result + (index ? "-" : "") + word.toLowerCase();
                }));
                var lowerCase = createCompounder((function(result, word, index) {
                    return result + (index ? " " : "") + word.toLowerCase();
                }));
                var lowerFirst = createCaseFirst("toLowerCase");
                function pad(string, length, chars) {
                    string = toString(string);
                    length = toInteger(length);
                    var strLength = length ? stringSize(string) : 0;
                    if (!length || strLength >= length) {
                        return string;
                    }
                    var mid = (length - strLength) / 2;
                    return createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars);
                }
                function padEnd(string, length, chars) {
                    string = toString(string);
                    length = toInteger(length);
                    var strLength = length ? stringSize(string) : 0;
                    return length && strLength < length ? string + createPadding(length - strLength, chars) : string;
                }
                function padStart(string, length, chars) {
                    string = toString(string);
                    length = toInteger(length);
                    var strLength = length ? stringSize(string) : 0;
                    return length && strLength < length ? createPadding(length - strLength, chars) + string : string;
                }
                function parseInt(string, radix, guard) {
                    if (guard || radix == null) {
                        radix = 0;
                    } else if (radix) {
                        radix = +radix;
                    }
                    return nativeParseInt(toString(string).replace(reTrimStart, ""), radix || 0);
                }
                function repeat(string, n, guard) {
                    if (guard ? isIterateeCall(string, n, guard) : n === undefined) {
                        n = 1;
                    } else {
                        n = toInteger(n);
                    }
                    return baseRepeat(toString(string), n);
                }
                function replace() {
                    var args = arguments, string = toString(args[0]);
                    return args.length < 3 ? string : string.replace(args[1], args[2]);
                }
                var snakeCase = createCompounder((function(result, word, index) {
                    return result + (index ? "_" : "") + word.toLowerCase();
                }));
                function split(string, separator, limit) {
                    if (limit && typeof limit != "number" && isIterateeCall(string, separator, limit)) {
                        separator = limit = undefined;
                    }
                    limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
                    if (!limit) {
                        return [];
                    }
                    string = toString(string);
                    if (string && (typeof separator == "string" || separator != null && !isRegExp(separator))) {
                        separator = baseToString(separator);
                        if (!separator && hasUnicode(string)) {
                            return castSlice(stringToArray(string), 0, limit);
                        }
                    }
                    return string.split(separator, limit);
                }
                var startCase = createCompounder((function(result, word, index) {
                    return result + (index ? " " : "") + upperFirst(word);
                }));
                function startsWith(string, target, position) {
                    string = toString(string);
                    position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length);
                    target = baseToString(target);
                    return string.slice(position, position + target.length) == target;
                }
                function template(string, options, guard) {
                    var settings = lodash.templateSettings;
                    if (guard && isIterateeCall(string, options, guard)) {
                        options = undefined;
                    }
                    string = toString(string);
                    options = assignInWith({}, options, settings, customDefaultsAssignIn);
                    var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys);
                    var isEscaping, isEvaluating, index = 0, interpolate = options.interpolate || reNoMatch, source = "__p += '";
                    var reDelimiters = RegExp((options.escape || reNoMatch).source + "|" + interpolate.source + "|" + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + "|" + (options.evaluate || reNoMatch).source + "|$", "g");
                    var sourceURL = "//# sourceURL=" + (hasOwnProperty.call(options, "sourceURL") ? (options.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++templateCounter + "]") + "\n";
                    string.replace(reDelimiters, (function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
                        interpolateValue || (interpolateValue = esTemplateValue);
                        source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
                        if (escapeValue) {
                            isEscaping = true;
                            source += "' +\n__e(" + escapeValue + ") +\n'";
                        }
                        if (evaluateValue) {
                            isEvaluating = true;
                            source += "';\n" + evaluateValue + ";\n__p += '";
                        }
                        if (interpolateValue) {
                            source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
                        }
                        index = offset + match.length;
                        return match;
                    }));
                    source += "';\n";
                    var variable = hasOwnProperty.call(options, "variable") && options.variable;
                    if (!variable) {
                        source = "with (obj) {\n" + source + "\n}\n";
                    }
                    source = (isEvaluating ? source.replace(reEmptyStringLeading, "") : source).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;");
                    source = "function(" + (variable || "obj") + ") {\n" + (variable ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (isEscaping ? ", __e = _.escape" : "") + (isEvaluating ? ", __j = Array.prototype.join;\n" + "function print() { __p += __j.call(arguments, '') }\n" : ";\n") + source + "return __p\n}";
                    var result = attempt((function() {
                        return Function(importsKeys, sourceURL + "return " + source).apply(undefined, importsValues);
                    }));
                    result.source = source;
                    if (isError(result)) {
                        throw result;
                    }
                    return result;
                }
                function toLower(value) {
                    return toString(value).toLowerCase();
                }
                function toUpper(value) {
                    return toString(value).toUpperCase();
                }
                function trim(string, chars, guard) {
                    string = toString(string);
                    if (string && (guard || chars === undefined)) {
                        return string.replace(reTrim, "");
                    }
                    if (!string || !(chars = baseToString(chars))) {
                        return string;
                    }
                    var strSymbols = stringToArray(string), chrSymbols = stringToArray(chars), start = charsStartIndex(strSymbols, chrSymbols), end = charsEndIndex(strSymbols, chrSymbols) + 1;
                    return castSlice(strSymbols, start, end).join("");
                }
                function trimEnd(string, chars, guard) {
                    string = toString(string);
                    if (string && (guard || chars === undefined)) {
                        return string.replace(reTrimEnd, "");
                    }
                    if (!string || !(chars = baseToString(chars))) {
                        return string;
                    }
                    var strSymbols = stringToArray(string), end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
                    return castSlice(strSymbols, 0, end).join("");
                }
                function trimStart(string, chars, guard) {
                    string = toString(string);
                    if (string && (guard || chars === undefined)) {
                        return string.replace(reTrimStart, "");
                    }
                    if (!string || !(chars = baseToString(chars))) {
                        return string;
                    }
                    var strSymbols = stringToArray(string), start = charsStartIndex(strSymbols, stringToArray(chars));
                    return castSlice(strSymbols, start).join("");
                }
                function truncate(string, options) {
                    var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION;
                    if (isObject(options)) {
                        var separator = "separator" in options ? options.separator : separator;
                        length = "length" in options ? toInteger(options.length) : length;
                        omission = "omission" in options ? baseToString(options.omission) : omission;
                    }
                    string = toString(string);
                    var strLength = string.length;
                    if (hasUnicode(string)) {
                        var strSymbols = stringToArray(string);
                        strLength = strSymbols.length;
                    }
                    if (length >= strLength) {
                        return string;
                    }
                    var end = length - stringSize(omission);
                    if (end < 1) {
                        return omission;
                    }
                    var result = strSymbols ? castSlice(strSymbols, 0, end).join("") : string.slice(0, end);
                    if (separator === undefined) {
                        return result + omission;
                    }
                    if (strSymbols) {
                        end += result.length - end;
                    }
                    if (isRegExp(separator)) {
                        if (string.slice(end).search(separator)) {
                            var match, substring = result;
                            if (!separator.global) {
                                separator = RegExp(separator.source, toString(reFlags.exec(separator)) + "g");
                            }
                            separator.lastIndex = 0;
                            while (match = separator.exec(substring)) {
                                var newEnd = match.index;
                            }
                            result = result.slice(0, newEnd === undefined ? end : newEnd);
                        }
                    } else if (string.indexOf(baseToString(separator), end) != end) {
                        var index = result.lastIndexOf(separator);
                        if (index > -1) {
                            result = result.slice(0, index);
                        }
                    }
                    return result + omission;
                }
                function unescape(string) {
                    string = toString(string);
                    return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string;
                }
                var upperCase = createCompounder((function(result, word, index) {
                    return result + (index ? " " : "") + word.toUpperCase();
                }));
                var upperFirst = createCaseFirst("toUpperCase");
                function words(string, pattern, guard) {
                    string = toString(string);
                    pattern = guard ? undefined : pattern;
                    if (pattern === undefined) {
                        return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
                    }
                    return string.match(pattern) || [];
                }
                var attempt = baseRest((function(func, args) {
                    try {
                        return apply(func, undefined, args);
                    } catch (e) {
                        return isError(e) ? e : new Error(e);
                    }
                }));
                var bindAll = flatRest((function(object, methodNames) {
                    arrayEach(methodNames, (function(key) {
                        key = toKey(key);
                        baseAssignValue(object, key, bind(object[key], object));
                    }));
                    return object;
                }));
                function cond(pairs) {
                    var length = pairs == null ? 0 : pairs.length, toIteratee = getIteratee();
                    pairs = !length ? [] : arrayMap(pairs, (function(pair) {
                        if (typeof pair[1] != "function") {
                            throw new TypeError(FUNC_ERROR_TEXT);
                        }
                        return [ toIteratee(pair[0]), pair[1] ];
                    }));
                    return baseRest((function(args) {
                        var index = -1;
                        while (++index < length) {
                            var pair = pairs[index];
                            if (apply(pair[0], this, args)) {
                                return apply(pair[1], this, args);
                            }
                        }
                    }));
                }
                function conforms(source) {
                    return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
                }
                function constant(value) {
                    return function() {
                        return value;
                    };
                }
                function defaultTo(value, defaultValue) {
                    return value == null || value !== value ? defaultValue : value;
                }
                var flow = createFlow();
                var flowRight = createFlow(true);
                function identity(value) {
                    return value;
                }
                function iteratee(func) {
                    return baseIteratee(typeof func == "function" ? func : baseClone(func, CLONE_DEEP_FLAG));
                }
                function matches(source) {
                    return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
                }
                function matchesProperty(path, srcValue) {
                    return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
                }
                var method = baseRest((function(path, args) {
                    return function(object) {
                        return baseInvoke(object, path, args);
                    };
                }));
                var methodOf = baseRest((function(object, args) {
                    return function(path) {
                        return baseInvoke(object, path, args);
                    };
                }));
                function mixin(object, source, options) {
                    var props = keys(source), methodNames = baseFunctions(source, props);
                    if (options == null && !(isObject(source) && (methodNames.length || !props.length))) {
                        options = source;
                        source = object;
                        object = this;
                        methodNames = baseFunctions(source, keys(source));
                    }
                    var chain = !(isObject(options) && "chain" in options) || !!options.chain, isFunc = isFunction(object);
                    arrayEach(methodNames, (function(methodName) {
                        var func = source[methodName];
                        object[methodName] = func;
                        if (isFunc) {
                            object.prototype[methodName] = function() {
                                var chainAll = this.__chain__;
                                if (chain || chainAll) {
                                    var result = object(this.__wrapped__), actions = result.__actions__ = copyArray(this.__actions__);
                                    actions.push({
                                        func,
                                        args: arguments,
                                        thisArg: object
                                    });
                                    result.__chain__ = chainAll;
                                    return result;
                                }
                                return func.apply(object, arrayPush([ this.value() ], arguments));
                            };
                        }
                    }));
                    return object;
                }
                function noConflict() {
                    if (root._ === this) {
                        root._ = oldDash;
                    }
                    return this;
                }
                function noop() {}
                function nthArg(n) {
                    n = toInteger(n);
                    return baseRest((function(args) {
                        return baseNth(args, n);
                    }));
                }
                var over = createOver(arrayMap);
                var overEvery = createOver(arrayEvery);
                var overSome = createOver(arraySome);
                function property(path) {
                    return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
                }
                function propertyOf(object) {
                    return function(path) {
                        return object == null ? undefined : baseGet(object, path);
                    };
                }
                var range = createRange();
                var rangeRight = createRange(true);
                function stubArray() {
                    return [];
                }
                function stubFalse() {
                    return false;
                }
                function stubObject() {
                    return {};
                }
                function stubString() {
                    return "";
                }
                function stubTrue() {
                    return true;
                }
                function times(n, iteratee) {
                    n = toInteger(n);
                    if (n < 1 || n > MAX_SAFE_INTEGER) {
                        return [];
                    }
                    var index = MAX_ARRAY_LENGTH, length = nativeMin(n, MAX_ARRAY_LENGTH);
                    iteratee = getIteratee(iteratee);
                    n -= MAX_ARRAY_LENGTH;
                    var result = baseTimes(length, iteratee);
                    while (++index < n) {
                        iteratee(index);
                    }
                    return result;
                }
                function toPath(value) {
                    if (isArray(value)) {
                        return arrayMap(value, toKey);
                    }
                    return isSymbol(value) ? [ value ] : copyArray(stringToPath(toString(value)));
                }
                function uniqueId(prefix) {
                    var id = ++idCounter;
                    return toString(prefix) + id;
                }
                var add = createMathOperation((function(augend, addend) {
                    return augend + addend;
                }), 0);
                var ceil = createRound("ceil");
                var divide = createMathOperation((function(dividend, divisor) {
                    return dividend / divisor;
                }), 1);
                var floor = createRound("floor");
                function max(array) {
                    return array && array.length ? baseExtremum(array, identity, baseGt) : undefined;
                }
                function maxBy(array, iteratee) {
                    return array && array.length ? baseExtremum(array, getIteratee(iteratee, 2), baseGt) : undefined;
                }
                function mean(array) {
                    return baseMean(array, identity);
                }
                function meanBy(array, iteratee) {
                    return baseMean(array, getIteratee(iteratee, 2));
                }
                function min(array) {
                    return array && array.length ? baseExtremum(array, identity, baseLt) : undefined;
                }
                function minBy(array, iteratee) {
                    return array && array.length ? baseExtremum(array, getIteratee(iteratee, 2), baseLt) : undefined;
                }
                var multiply = createMathOperation((function(multiplier, multiplicand) {
                    return multiplier * multiplicand;
                }), 1);
                var round = createRound("round");
                var subtract = createMathOperation((function(minuend, subtrahend) {
                    return minuend - subtrahend;
                }), 0);
                function sum(array) {
                    return array && array.length ? baseSum(array, identity) : 0;
                }
                function sumBy(array, iteratee) {
                    return array && array.length ? baseSum(array, getIteratee(iteratee, 2)) : 0;
                }
                lodash.after = after;
                lodash.ary = ary;
                lodash.assign = assign;
                lodash.assignIn = assignIn;
                lodash.assignInWith = assignInWith;
                lodash.assignWith = assignWith;
                lodash.at = at;
                lodash.before = before;
                lodash.bind = bind;
                lodash.bindAll = bindAll;
                lodash.bindKey = bindKey;
                lodash.castArray = castArray;
                lodash.chain = chain;
                lodash.chunk = chunk;
                lodash.compact = compact;
                lodash.concat = concat;
                lodash.cond = cond;
                lodash.conforms = conforms;
                lodash.constant = constant;
                lodash.countBy = countBy;
                lodash.create = create;
                lodash.curry = curry;
                lodash.curryRight = curryRight;
                lodash.debounce = debounce;
                lodash.defaults = defaults;
                lodash.defaultsDeep = defaultsDeep;
                lodash.defer = defer;
                lodash.delay = delay;
                lodash.difference = difference;
                lodash.differenceBy = differenceBy;
                lodash.differenceWith = differenceWith;
                lodash.drop = drop;
                lodash.dropRight = dropRight;
                lodash.dropRightWhile = dropRightWhile;
                lodash.dropWhile = dropWhile;
                lodash.fill = fill;
                lodash.filter = filter;
                lodash.flatMap = flatMap;
                lodash.flatMapDeep = flatMapDeep;
                lodash.flatMapDepth = flatMapDepth;
                lodash.flatten = flatten;
                lodash.flattenDeep = flattenDeep;
                lodash.flattenDepth = flattenDepth;
                lodash.flip = flip;
                lodash.flow = flow;
                lodash.flowRight = flowRight;
                lodash.fromPairs = fromPairs;
                lodash.functions = functions;
                lodash.functionsIn = functionsIn;
                lodash.groupBy = groupBy;
                lodash.initial = initial;
                lodash.intersection = intersection;
                lodash.intersectionBy = intersectionBy;
                lodash.intersectionWith = intersectionWith;
                lodash.invert = invert;
                lodash.invertBy = invertBy;
                lodash.invokeMap = invokeMap;
                lodash.iteratee = iteratee;
                lodash.keyBy = keyBy;
                lodash.keys = keys;
                lodash.keysIn = keysIn;
                lodash.map = map;
                lodash.mapKeys = mapKeys;
                lodash.mapValues = mapValues;
                lodash.matches = matches;
                lodash.matchesProperty = matchesProperty;
                lodash.memoize = memoize;
                lodash.merge = merge;
                lodash.mergeWith = mergeWith;
                lodash.method = method;
                lodash.methodOf = methodOf;
                lodash.mixin = mixin;
                lodash.negate = negate;
                lodash.nthArg = nthArg;
                lodash.omit = omit;
                lodash.omitBy = omitBy;
                lodash.once = once;
                lodash.orderBy = orderBy;
                lodash.over = over;
                lodash.overArgs = overArgs;
                lodash.overEvery = overEvery;
                lodash.overSome = overSome;
                lodash.partial = partial;
                lodash.partialRight = partialRight;
                lodash.partition = partition;
                lodash.pick = pick;
                lodash.pickBy = pickBy;
                lodash.property = property;
                lodash.propertyOf = propertyOf;
                lodash.pull = pull;
                lodash.pullAll = pullAll;
                lodash.pullAllBy = pullAllBy;
                lodash.pullAllWith = pullAllWith;
                lodash.pullAt = pullAt;
                lodash.range = range;
                lodash.rangeRight = rangeRight;
                lodash.rearg = rearg;
                lodash.reject = reject;
                lodash.remove = remove;
                lodash.rest = rest;
                lodash.reverse = reverse;
                lodash.sampleSize = sampleSize;
                lodash.set = set;
                lodash.setWith = setWith;
                lodash.shuffle = shuffle;
                lodash.slice = slice;
                lodash.sortBy = sortBy;
                lodash.sortedUniq = sortedUniq;
                lodash.sortedUniqBy = sortedUniqBy;
                lodash.split = split;
                lodash.spread = spread;
                lodash.tail = tail;
                lodash.take = take;
                lodash.takeRight = takeRight;
                lodash.takeRightWhile = takeRightWhile;
                lodash.takeWhile = takeWhile;
                lodash.tap = tap;
                lodash.throttle = throttle;
                lodash.thru = thru;
                lodash.toArray = toArray;
                lodash.toPairs = toPairs;
                lodash.toPairsIn = toPairsIn;
                lodash.toPath = toPath;
                lodash.toPlainObject = toPlainObject;
                lodash.transform = transform;
                lodash.unary = unary;
                lodash.union = union;
                lodash.unionBy = unionBy;
                lodash.unionWith = unionWith;
                lodash.uniq = uniq;
                lodash.uniqBy = uniqBy;
                lodash.uniqWith = uniqWith;
                lodash.unset = unset;
                lodash.unzip = unzip;
                lodash.unzipWith = unzipWith;
                lodash.update = update;
                lodash.updateWith = updateWith;
                lodash.values = values;
                lodash.valuesIn = valuesIn;
                lodash.without = without;
                lodash.words = words;
                lodash.wrap = wrap;
                lodash.xor = xor;
                lodash.xorBy = xorBy;
                lodash.xorWith = xorWith;
                lodash.zip = zip;
                lodash.zipObject = zipObject;
                lodash.zipObjectDeep = zipObjectDeep;
                lodash.zipWith = zipWith;
                lodash.entries = toPairs;
                lodash.entriesIn = toPairsIn;
                lodash.extend = assignIn;
                lodash.extendWith = assignInWith;
                mixin(lodash, lodash);
                lodash.add = add;
                lodash.attempt = attempt;
                lodash.camelCase = camelCase;
                lodash.capitalize = capitalize;
                lodash.ceil = ceil;
                lodash.clamp = clamp;
                lodash.clone = clone;
                lodash.cloneDeep = cloneDeep;
                lodash.cloneDeepWith = cloneDeepWith;
                lodash.cloneWith = cloneWith;
                lodash.conformsTo = conformsTo;
                lodash.deburr = deburr;
                lodash.defaultTo = defaultTo;
                lodash.divide = divide;
                lodash.endsWith = endsWith;
                lodash.eq = eq;
                lodash.escape = escape;
                lodash.escapeRegExp = escapeRegExp;
                lodash.every = every;
                lodash.find = find;
                lodash.findIndex = findIndex;
                lodash.findKey = findKey;
                lodash.findLast = findLast;
                lodash.findLastIndex = findLastIndex;
                lodash.findLastKey = findLastKey;
                lodash.floor = floor;
                lodash.forEach = forEach;
                lodash.forEachRight = forEachRight;
                lodash.forIn = forIn;
                lodash.forInRight = forInRight;
                lodash.forOwn = forOwn;
                lodash.forOwnRight = forOwnRight;
                lodash.get = get;
                lodash.gt = gt;
                lodash.gte = gte;
                lodash.has = has;
                lodash.hasIn = hasIn;
                lodash.head = head;
                lodash.identity = identity;
                lodash.includes = includes;
                lodash.indexOf = indexOf;
                lodash.inRange = inRange;
                lodash.invoke = invoke;
                lodash.isArguments = isArguments;
                lodash.isArray = isArray;
                lodash.isArrayBuffer = isArrayBuffer;
                lodash.isArrayLike = isArrayLike;
                lodash.isArrayLikeObject = isArrayLikeObject;
                lodash.isBoolean = isBoolean;
                lodash.isBuffer = isBuffer;
                lodash.isDate = isDate;
                lodash.isElement = isElement;
                lodash.isEmpty = isEmpty;
                lodash.isEqual = isEqual;
                lodash.isEqualWith = isEqualWith;
                lodash.isError = isError;
                lodash.isFinite = isFinite;
                lodash.isFunction = isFunction;
                lodash.isInteger = isInteger;
                lodash.isLength = isLength;
                lodash.isMap = isMap;
                lodash.isMatch = isMatch;
                lodash.isMatchWith = isMatchWith;
                lodash.isNaN = isNaN;
                lodash.isNative = isNative;
                lodash.isNil = isNil;
                lodash.isNull = isNull;
                lodash.isNumber = isNumber;
                lodash.isObject = isObject;
                lodash.isObjectLike = isObjectLike;
                lodash.isPlainObject = isPlainObject;
                lodash.isRegExp = isRegExp;
                lodash.isSafeInteger = isSafeInteger;
                lodash.isSet = isSet;
                lodash.isString = isString;
                lodash.isSymbol = isSymbol;
                lodash.isTypedArray = isTypedArray;
                lodash.isUndefined = isUndefined;
                lodash.isWeakMap = isWeakMap;
                lodash.isWeakSet = isWeakSet;
                lodash.join = join;
                lodash.kebabCase = kebabCase;
                lodash.last = last;
                lodash.lastIndexOf = lastIndexOf;
                lodash.lowerCase = lowerCase;
                lodash.lowerFirst = lowerFirst;
                lodash.lt = lt;
                lodash.lte = lte;
                lodash.max = max;
                lodash.maxBy = maxBy;
                lodash.mean = mean;
                lodash.meanBy = meanBy;
                lodash.min = min;
                lodash.minBy = minBy;
                lodash.stubArray = stubArray;
                lodash.stubFalse = stubFalse;
                lodash.stubObject = stubObject;
                lodash.stubString = stubString;
                lodash.stubTrue = stubTrue;
                lodash.multiply = multiply;
                lodash.nth = nth;
                lodash.noConflict = noConflict;
                lodash.noop = noop;
                lodash.now = now;
                lodash.pad = pad;
                lodash.padEnd = padEnd;
                lodash.padStart = padStart;
                lodash.parseInt = parseInt;
                lodash.random = random;
                lodash.reduce = reduce;
                lodash.reduceRight = reduceRight;
                lodash.repeat = repeat;
                lodash.replace = replace;
                lodash.result = result;
                lodash.round = round;
                lodash.runInContext = runInContext;
                lodash.sample = sample;
                lodash.size = size;
                lodash.snakeCase = snakeCase;
                lodash.some = some;
                lodash.sortedIndex = sortedIndex;
                lodash.sortedIndexBy = sortedIndexBy;
                lodash.sortedIndexOf = sortedIndexOf;
                lodash.sortedLastIndex = sortedLastIndex;
                lodash.sortedLastIndexBy = sortedLastIndexBy;
                lodash.sortedLastIndexOf = sortedLastIndexOf;
                lodash.startCase = startCase;
                lodash.startsWith = startsWith;
                lodash.subtract = subtract;
                lodash.sum = sum;
                lodash.sumBy = sumBy;
                lodash.template = template;
                lodash.times = times;
                lodash.toFinite = toFinite;
                lodash.toInteger = toInteger;
                lodash.toLength = toLength;
                lodash.toLower = toLower;
                lodash.toNumber = toNumber;
                lodash.toSafeInteger = toSafeInteger;
                lodash.toString = toString;
                lodash.toUpper = toUpper;
                lodash.trim = trim;
                lodash.trimEnd = trimEnd;
                lodash.trimStart = trimStart;
                lodash.truncate = truncate;
                lodash.unescape = unescape;
                lodash.uniqueId = uniqueId;
                lodash.upperCase = upperCase;
                lodash.upperFirst = upperFirst;
                lodash.each = forEach;
                lodash.eachRight = forEachRight;
                lodash.first = head;
                mixin(lodash, function() {
                    var source = {};
                    baseForOwn(lodash, (function(func, methodName) {
                        if (!hasOwnProperty.call(lodash.prototype, methodName)) {
                            source[methodName] = func;
                        }
                    }));
                    return source;
                }(), {
                    chain: false
                });
                lodash.VERSION = VERSION;
                arrayEach([ "bind", "bindKey", "curry", "curryRight", "partial", "partialRight" ], (function(methodName) {
                    lodash[methodName].placeholder = lodash;
                }));
                arrayEach([ "drop", "take" ], (function(methodName, index) {
                    LazyWrapper.prototype[methodName] = function(n) {
                        n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
                        var result = this.__filtered__ && !index ? new LazyWrapper(this) : this.clone();
                        if (result.__filtered__) {
                            result.__takeCount__ = nativeMin(n, result.__takeCount__);
                        } else {
                            result.__views__.push({
                                size: nativeMin(n, MAX_ARRAY_LENGTH),
                                type: methodName + (result.__dir__ < 0 ? "Right" : "")
                            });
                        }
                        return result;
                    };
                    LazyWrapper.prototype[methodName + "Right"] = function(n) {
                        return this.reverse()[methodName](n).reverse();
                    };
                }));
                arrayEach([ "filter", "map", "takeWhile" ], (function(methodName, index) {
                    var type = index + 1, isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
                    LazyWrapper.prototype[methodName] = function(iteratee) {
                        var result = this.clone();
                        result.__iteratees__.push({
                            iteratee: getIteratee(iteratee, 3),
                            type
                        });
                        result.__filtered__ = result.__filtered__ || isFilter;
                        return result;
                    };
                }));
                arrayEach([ "head", "last" ], (function(methodName, index) {
                    var takeName = "take" + (index ? "Right" : "");
                    LazyWrapper.prototype[methodName] = function() {
                        return this[takeName](1).value()[0];
                    };
                }));
                arrayEach([ "initial", "tail" ], (function(methodName, index) {
                    var dropName = "drop" + (index ? "" : "Right");
                    LazyWrapper.prototype[methodName] = function() {
                        return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
                    };
                }));
                LazyWrapper.prototype.compact = function() {
                    return this.filter(identity);
                };
                LazyWrapper.prototype.find = function(predicate) {
                    return this.filter(predicate).head();
                };
                LazyWrapper.prototype.findLast = function(predicate) {
                    return this.reverse().find(predicate);
                };
                LazyWrapper.prototype.invokeMap = baseRest((function(path, args) {
                    if (typeof path == "function") {
                        return new LazyWrapper(this);
                    }
                    return this.map((function(value) {
                        return baseInvoke(value, path, args);
                    }));
                }));
                LazyWrapper.prototype.reject = function(predicate) {
                    return this.filter(negate(getIteratee(predicate)));
                };
                LazyWrapper.prototype.slice = function(start, end) {
                    start = toInteger(start);
                    var result = this;
                    if (result.__filtered__ && (start > 0 || end < 0)) {
                        return new LazyWrapper(result);
                    }
                    if (start < 0) {
                        result = result.takeRight(-start);
                    } else if (start) {
                        result = result.drop(start);
                    }
                    if (end !== undefined) {
                        end = toInteger(end);
                        result = end < 0 ? result.dropRight(-end) : result.take(end - start);
                    }
                    return result;
                };
                LazyWrapper.prototype.takeRightWhile = function(predicate) {
                    return this.reverse().takeWhile(predicate).reverse();
                };
                LazyWrapper.prototype.toArray = function() {
                    return this.take(MAX_ARRAY_LENGTH);
                };
                baseForOwn(LazyWrapper.prototype, (function(func, methodName) {
                    var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), isTaker = /^(?:head|last)$/.test(methodName), lodashFunc = lodash[isTaker ? "take" + (methodName == "last" ? "Right" : "") : methodName], retUnwrapped = isTaker || /^find/.test(methodName);
                    if (!lodashFunc) {
                        return;
                    }
                    lodash.prototype[methodName] = function() {
                        var value = this.__wrapped__, args = isTaker ? [ 1 ] : arguments, isLazy = value instanceof LazyWrapper, iteratee = args[0], useLazy = isLazy || isArray(value);
                        var interceptor = function(value) {
                            var result = lodashFunc.apply(lodash, arrayPush([ value ], args));
                            return isTaker && chainAll ? result[0] : result;
                        };
                        if (useLazy && checkIteratee && typeof iteratee == "function" && iteratee.length != 1) {
                            isLazy = useLazy = false;
                        }
                        var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid;
                        if (!retUnwrapped && useLazy) {
                            value = onlyLazy ? value : new LazyWrapper(this);
                            var result = func.apply(value, args);
                            result.__actions__.push({
                                func: thru,
                                args: [ interceptor ],
                                thisArg: undefined
                            });
                            return new LodashWrapper(result, chainAll);
                        }
                        if (isUnwrapped && onlyLazy) {
                            return func.apply(this, args);
                        }
                        result = this.thru(interceptor);
                        return isUnwrapped ? isTaker ? result.value()[0] : result.value() : result;
                    };
                }));
                arrayEach([ "pop", "push", "shift", "sort", "splice", "unshift" ], (function(methodName) {
                    var func = arrayProto[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? "tap" : "thru", retUnwrapped = /^(?:pop|shift)$/.test(methodName);
                    lodash.prototype[methodName] = function() {
                        var args = arguments;
                        if (retUnwrapped && !this.__chain__) {
                            var value = this.value();
                            return func.apply(isArray(value) ? value : [], args);
                        }
                        return this[chainName]((function(value) {
                            return func.apply(isArray(value) ? value : [], args);
                        }));
                    };
                }));
                baseForOwn(LazyWrapper.prototype, (function(func, methodName) {
                    var lodashFunc = lodash[methodName];
                    if (lodashFunc) {
                        var key = lodashFunc.name + "";
                        if (!hasOwnProperty.call(realNames, key)) {
                            realNames[key] = [];
                        }
                        realNames[key].push({
                            name: methodName,
                            func: lodashFunc
                        });
                    }
                }));
                realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [ {
                    name: "wrapper",
                    func: undefined
                } ];
                LazyWrapper.prototype.clone = lazyClone;
                LazyWrapper.prototype.reverse = lazyReverse;
                LazyWrapper.prototype.value = lazyValue;
                lodash.prototype.at = wrapperAt;
                lodash.prototype.chain = wrapperChain;
                lodash.prototype.commit = wrapperCommit;
                lodash.prototype.next = wrapperNext;
                lodash.prototype.plant = wrapperPlant;
                lodash.prototype.reverse = wrapperReverse;
                lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
                lodash.prototype.first = lodash.prototype.head;
                if (symIterator) {
                    lodash.prototype[symIterator] = wrapperToIterator;
                }
                return lodash;
            };
            var _ = runInContext();
            if (true) {
                root._ = _;
                !(__WEBPACK_AMD_DEFINE_RESULT__ = function() {
                    return _;
                }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
            } else {}
        }).call(this);
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        if (true) {
            module.exports = __webpack_require__(286);
        } else {}
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        var l = __webpack_require__(287), n = "function" === typeof Symbol && Symbol.for, p = n ? Symbol.for("react.element") : 60103, q = n ? Symbol.for("react.portal") : 60106, r = n ? Symbol.for("react.fragment") : 60107, t = n ? Symbol.for("react.strict_mode") : 60108, u = n ? Symbol.for("react.profiler") : 60114, v = n ? Symbol.for("react.provider") : 60109, w = n ? Symbol.for("react.context") : 60110, x = n ? Symbol.for("react.forward_ref") : 60112, y = n ? Symbol.for("react.suspense") : 60113, z = n ? Symbol.for("react.memo") : 60115, A = n ? Symbol.for("react.lazy") : 60116, B = "function" === typeof Symbol && Symbol.iterator;
        function C(a) {
            for (var b = "https://reactjs.org/docs/error-decoder.html?invariant=" + a, c = 1; c < arguments.length; c++) b += "&args[]=" + encodeURIComponent(arguments[c]);
            return "Minified React error #" + a + "; visit " + b + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
        }
        var D = {
            isMounted: function() {
                return !1;
            },
            enqueueForceUpdate: function() {},
            enqueueReplaceState: function() {},
            enqueueSetState: function() {}
        }, E = {};
        function F(a, b, c) {
            this.props = a;
            this.context = b;
            this.refs = E;
            this.updater = c || D;
        }
        F.prototype.isReactComponent = {};
        F.prototype.setState = function(a, b) {
            if ("object" !== typeof a && "function" !== typeof a && null != a) throw Error(C(85));
            this.updater.enqueueSetState(this, a, b, "setState");
        };
        F.prototype.forceUpdate = function(a) {
            this.updater.enqueueForceUpdate(this, a, "forceUpdate");
        };
        function G() {}
        G.prototype = F.prototype;
        function H(a, b, c) {
            this.props = a;
            this.context = b;
            this.refs = E;
            this.updater = c || D;
        }
        var I = H.prototype = new G;
        I.constructor = H;
        l(I, F.prototype);
        I.isPureReactComponent = !0;
        var J = {
            current: null
        }, K = Object.prototype.hasOwnProperty, L = {
            key: !0,
            ref: !0,
            __self: !0,
            __source: !0
        };
        function M(a, b, c) {
            var e, d = {}, g = null, k = null;
            if (null != b) for (e in void 0 !== b.ref && (k = b.ref), void 0 !== b.key && (g = "" + b.key), 
            b) K.call(b, e) && !L.hasOwnProperty(e) && (d[e] = b[e]);
            var f = arguments.length - 2;
            if (1 === f) d.children = c; else if (1 < f) {
                for (var h = Array(f), m = 0; m < f; m++) h[m] = arguments[m + 2];
                d.children = h;
            }
            if (a && a.defaultProps) for (e in f = a.defaultProps, f) void 0 === d[e] && (d[e] = f[e]);
            return {
                $$typeof: p,
                type: a,
                key: g,
                ref: k,
                props: d,
                _owner: J.current
            };
        }
        function N(a, b) {
            return {
                $$typeof: p,
                type: a.type,
                key: b,
                ref: a.ref,
                props: a.props,
                _owner: a._owner
            };
        }
        function O(a) {
            return "object" === typeof a && null !== a && a.$$typeof === p;
        }
        function escape(a) {
            var b = {
                "=": "=0",
                ":": "=2"
            };
            return "$" + ("" + a).replace(/[=:]/g, (function(a) {
                return b[a];
            }));
        }
        var P = /\/+/g, Q = [];
        function R(a, b, c, e) {
            if (Q.length) {
                var d = Q.pop();
                d.result = a;
                d.keyPrefix = b;
                d.func = c;
                d.context = e;
                d.count = 0;
                return d;
            }
            return {
                result: a,
                keyPrefix: b,
                func: c,
                context: e,
                count: 0
            };
        }
        function S(a) {
            a.result = null;
            a.keyPrefix = null;
            a.func = null;
            a.context = null;
            a.count = 0;
            10 > Q.length && Q.push(a);
        }
        function T(a, b, c, e) {
            var d = typeof a;
            if ("undefined" === d || "boolean" === d) a = null;
            var g = !1;
            if (null === a) g = !0; else switch (d) {
              case "string":
              case "number":
                g = !0;
                break;

              case "object":
                switch (a.$$typeof) {
                  case p:
                  case q:
                    g = !0;
                }
            }
            if (g) return c(e, a, "" === b ? "." + U(a, 0) : b), 1;
            g = 0;
            b = "" === b ? "." : b + ":";
            if (Array.isArray(a)) for (var k = 0; k < a.length; k++) {
                d = a[k];
                var f = b + U(d, k);
                g += T(d, f, c, e);
            } else if (null === a || "object" !== typeof a ? f = null : (f = B && a[B] || a["@@iterator"], 
            f = "function" === typeof f ? f : null), "function" === typeof f) for (a = f.call(a), 
            k = 0; !(d = a.next()).done; ) d = d.value, f = b + U(d, k++), g += T(d, f, c, e); else if ("object" === d) throw c = "" + a, 
            Error(C(31, "[object Object]" === c ? "object with keys {" + Object.keys(a).join(", ") + "}" : c, ""));
            return g;
        }
        function V(a, b, c) {
            return null == a ? 0 : T(a, "", b, c);
        }
        function U(a, b) {
            return "object" === typeof a && null !== a && null != a.key ? escape(a.key) : b.toString(36);
        }
        function W(a, b) {
            a.func.call(a.context, b, a.count++);
        }
        function aa(a, b, c) {
            var e = a.result, d = a.keyPrefix;
            a = a.func.call(a.context, b, a.count++);
            Array.isArray(a) ? X(a, e, c, (function(a) {
                return a;
            })) : null != a && (O(a) && (a = N(a, d + (!a.key || b && b.key === a.key ? "" : ("" + a.key).replace(P, "$&/") + "/") + c)), 
            e.push(a));
        }
        function X(a, b, c, e, d) {
            var g = "";
            null != c && (g = ("" + c).replace(P, "$&/") + "/");
            b = R(b, g, e, d);
            V(a, aa, b);
            S(b);
        }
        var Y = {
            current: null
        };
        function Z() {
            var a = Y.current;
            if (null === a) throw Error(C(321));
            return a;
        }
        var ba = {
            ReactCurrentDispatcher: Y,
            ReactCurrentBatchConfig: {
                suspense: null
            },
            ReactCurrentOwner: J,
            IsSomeRendererActing: {
                current: !1
            },
            assign: l
        };
        exports.Children = {
            map: function(a, b, c) {
                if (null == a) return a;
                var e = [];
                X(a, e, null, b, c);
                return e;
            },
            forEach: function(a, b, c) {
                if (null == a) return a;
                b = R(null, null, b, c);
                V(a, W, b);
                S(b);
            },
            count: function(a) {
                return V(a, (function() {
                    return null;
                }), null);
            },
            toArray: function(a) {
                var b = [];
                X(a, b, null, (function(a) {
                    return a;
                }));
                return b;
            },
            only: function(a) {
                if (!O(a)) throw Error(C(143));
                return a;
            }
        };
        exports.Component = F;
        exports.Fragment = r;
        exports.Profiler = u;
        exports.PureComponent = H;
        exports.StrictMode = t;
        exports.Suspense = y;
        exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ba;
        exports.cloneElement = function(a, b, c) {
            if (null === a || void 0 === a) throw Error(C(267, a));
            var e = l({}, a.props), d = a.key, g = a.ref, k = a._owner;
            if (null != b) {
                void 0 !== b.ref && (g = b.ref, k = J.current);
                void 0 !== b.key && (d = "" + b.key);
                if (a.type && a.type.defaultProps) var f = a.type.defaultProps;
                for (h in b) K.call(b, h) && !L.hasOwnProperty(h) && (e[h] = void 0 === b[h] && void 0 !== f ? f[h] : b[h]);
            }
            var h = arguments.length - 2;
            if (1 === h) e.children = c; else if (1 < h) {
                f = Array(h);
                for (var m = 0; m < h; m++) f[m] = arguments[m + 2];
                e.children = f;
            }
            return {
                $$typeof: p,
                type: a.type,
                key: d,
                ref: g,
                props: e,
                _owner: k
            };
        };
        exports.createContext = function(a, b) {
            void 0 === b && (b = null);
            a = {
                $$typeof: w,
                _calculateChangedBits: b,
                _currentValue: a,
                _currentValue2: a,
                _threadCount: 0,
                Provider: null,
                Consumer: null
            };
            a.Provider = {
                $$typeof: v,
                _context: a
            };
            return a.Consumer = a;
        };
        exports.createElement = M;
        exports.createFactory = function(a) {
            var b = M.bind(null, a);
            b.type = a;
            return b;
        };
        exports.createRef = function() {
            return {
                current: null
            };
        };
        exports.forwardRef = function(a) {
            return {
                $$typeof: x,
                render: a
            };
        };
        exports.isValidElement = O;
        exports.lazy = function(a) {
            return {
                $$typeof: A,
                _ctor: a,
                _status: -1,
                _result: null
            };
        };
        exports.memo = function(a, b) {
            return {
                $$typeof: z,
                type: a,
                compare: void 0 === b ? null : b
            };
        };
        exports.useCallback = function(a, b) {
            return Z().useCallback(a, b);
        };
        exports.useContext = function(a, b) {
            return Z().useContext(a, b);
        };
        exports.useDebugValue = function() {};
        exports.useEffect = function(a, b) {
            return Z().useEffect(a, b);
        };
        exports.useImperativeHandle = function(a, b, c) {
            return Z().useImperativeHandle(a, b, c);
        };
        exports.useLayoutEffect = function(a, b) {
            return Z().useLayoutEffect(a, b);
        };
        exports.useMemo = function(a, b) {
            return Z().useMemo(a, b);
        };
        exports.useReducer = function(a, b, c) {
            return Z().useReducer(a, b, c);
        };
        exports.useRef = function(a) {
            return Z().useRef(a);
        };
        exports.useState = function(a) {
            return Z().useState(a);
        };
        exports.version = "16.14.0";
    }, module => {
        "use strict";
        var getOwnPropertySymbols = Object.getOwnPropertySymbols;
        var hasOwnProperty = Object.prototype.hasOwnProperty;
        var propIsEnumerable = Object.prototype.propertyIsEnumerable;
        function toObject(val) {
            if (val === null || val === undefined) {
                throw new TypeError("Object.assign cannot be called with null or undefined");
            }
            return Object(val);
        }
        function shouldUseNative() {
            try {
                if (!Object.assign) {
                    return false;
                }
                var test1 = new String("abc");
                test1[5] = "de";
                if (Object.getOwnPropertyNames(test1)[0] === "5") {
                    return false;
                }
                var test2 = {};
                for (var i = 0; i < 10; i++) {
                    test2["_" + String.fromCharCode(i)] = i;
                }
                var order2 = Object.getOwnPropertyNames(test2).map((function(n) {
                    return test2[n];
                }));
                if (order2.join("") !== "0123456789") {
                    return false;
                }
                var test3 = {};
                "abcdefghijklmnopqrst".split("").forEach((function(letter) {
                    test3[letter] = letter;
                }));
                if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
                    return false;
                }
                return true;
            } catch (err) {
                return false;
            }
        }
        module.exports = shouldUseNative() ? Object.assign : function(target, source) {
            var from;
            var to = toObject(target);
            var symbols;
            for (var s = 1; s < arguments.length; s++) {
                from = Object(arguments[s]);
                for (var key in from) {
                    if (hasOwnProperty.call(from, key)) {
                        to[key] = from[key];
                    }
                }
                if (getOwnPropertySymbols) {
                    symbols = getOwnPropertySymbols(from);
                    for (var i = 0; i < symbols.length; i++) {
                        if (propIsEnumerable.call(from, symbols[i])) {
                            to[symbols[i]] = from[symbols[i]];
                        }
                    }
                }
            }
            return to;
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        function checkDCE() {
            if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") {
                return;
            }
            if (false) {}
            try {
                __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
            } catch (err) {
                console.error(err);
            }
        }
        if (true) {
            checkDCE();
            module.exports = __webpack_require__(289);
        } else {}
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        var __webpack_unused_export__;
        var aa = __webpack_require__(285), n = __webpack_require__(287), r = __webpack_require__(290);
        function u(a) {
            for (var b = "https://reactjs.org/docs/error-decoder.html?invariant=" + a, c = 1; c < arguments.length; c++) b += "&args[]=" + encodeURIComponent(arguments[c]);
            return "Minified React error #" + a + "; visit " + b + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
        }
        if (!aa) throw Error(u(227));
        function ba(a, b, c, d, e, f, g, h, k) {
            var l = Array.prototype.slice.call(arguments, 3);
            try {
                b.apply(c, l);
            } catch (m) {
                this.onError(m);
            }
        }
        var da = !1, ea = null, fa = !1, ha = null, ia = {
            onError: function(a) {
                da = !0;
                ea = a;
            }
        };
        function ja(a, b, c, d, e, f, g, h, k) {
            da = !1;
            ea = null;
            ba.apply(ia, arguments);
        }
        function ka(a, b, c, d, e, f, g, h, k) {
            ja.apply(this, arguments);
            if (da) {
                if (da) {
                    var l = ea;
                    da = !1;
                    ea = null;
                } else throw Error(u(198));
                fa || (fa = !0, ha = l);
            }
        }
        var la = null, ma = null, na = null;
        function oa(a, b, c) {
            var d = a.type || "unknown-event";
            a.currentTarget = na(c);
            ka(d, b, void 0, a);
            a.currentTarget = null;
        }
        var pa = null, qa = {};
        function ra() {
            if (pa) for (var a in qa) {
                var b = qa[a], c = pa.indexOf(a);
                if (!(-1 < c)) throw Error(u(96, a));
                if (!sa[c]) {
                    if (!b.extractEvents) throw Error(u(97, a));
                    sa[c] = b;
                    c = b.eventTypes;
                    for (var d in c) {
                        var e = void 0;
                        var f = c[d], g = b, h = d;
                        if (ta.hasOwnProperty(h)) throw Error(u(99, h));
                        ta[h] = f;
                        var k = f.phasedRegistrationNames;
                        if (k) {
                            for (e in k) k.hasOwnProperty(e) && ua(k[e], g, h);
                            e = !0;
                        } else f.registrationName ? (ua(f.registrationName, g, h), e = !0) : e = !1;
                        if (!e) throw Error(u(98, d, a));
                    }
                }
            }
        }
        function ua(a, b, c) {
            if (va[a]) throw Error(u(100, a));
            va[a] = b;
            wa[a] = b.eventTypes[c].dependencies;
        }
        var sa = [], ta = {}, va = {}, wa = {};
        function xa(a) {
            var b = !1, c;
            for (c in a) if (a.hasOwnProperty(c)) {
                var d = a[c];
                if (!qa.hasOwnProperty(c) || qa[c] !== d) {
                    if (qa[c]) throw Error(u(102, c));
                    qa[c] = d;
                    b = !0;
                }
            }
            b && ra();
        }
        var ya = !("undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement), za = null, Aa = null, Ba = null;
        function Ca(a) {
            if (a = ma(a)) {
                if ("function" !== typeof za) throw Error(u(280));
                var b = a.stateNode;
                b && (b = la(b), za(a.stateNode, a.type, b));
            }
        }
        function Da(a) {
            Aa ? Ba ? Ba.push(a) : Ba = [ a ] : Aa = a;
        }
        function Ea() {
            if (Aa) {
                var a = Aa, b = Ba;
                Ba = Aa = null;
                Ca(a);
                if (b) for (a = 0; a < b.length; a++) Ca(b[a]);
            }
        }
        function Fa(a, b) {
            return a(b);
        }
        function Ga(a, b, c, d, e) {
            return a(b, c, d, e);
        }
        function Ha() {}
        var Ia = Fa, Ja = !1, Ka = !1;
        function La() {
            if (null !== Aa || null !== Ba) Ha(), Ea();
        }
        function Ma(a, b, c) {
            if (Ka) return a(b, c);
            Ka = !0;
            try {
                return Ia(a, b, c);
            } finally {
                Ka = !1, La();
            }
        }
        var Na = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, Oa = Object.prototype.hasOwnProperty, Pa = {}, Qa = {};
        function Ra(a) {
            if (Oa.call(Qa, a)) return !0;
            if (Oa.call(Pa, a)) return !1;
            if (Na.test(a)) return Qa[a] = !0;
            Pa[a] = !0;
            return !1;
        }
        function Sa(a, b, c, d) {
            if (null !== c && 0 === c.type) return !1;
            switch (typeof b) {
              case "function":
              case "symbol":
                return !0;

              case "boolean":
                if (d) return !1;
                if (null !== c) return !c.acceptsBooleans;
                a = a.toLowerCase().slice(0, 5);
                return "data-" !== a && "aria-" !== a;

              default:
                return !1;
            }
        }
        function Ta(a, b, c, d) {
            if (null === b || "undefined" === typeof b || Sa(a, b, c, d)) return !0;
            if (d) return !1;
            if (null !== c) switch (c.type) {
              case 3:
                return !b;

              case 4:
                return !1 === b;

              case 5:
                return isNaN(b);

              case 6:
                return isNaN(b) || 1 > b;
            }
            return !1;
        }
        function v(a, b, c, d, e, f) {
            this.acceptsBooleans = 2 === b || 3 === b || 4 === b;
            this.attributeName = d;
            this.attributeNamespace = e;
            this.mustUseProperty = c;
            this.propertyName = a;
            this.type = b;
            this.sanitizeURL = f;
        }
        var C = {};
        "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(a) {
            C[a] = new v(a, 0, !1, a, null, !1);
        }));
        [ [ "acceptCharset", "accept-charset" ], [ "className", "class" ], [ "htmlFor", "for" ], [ "httpEquiv", "http-equiv" ] ].forEach((function(a) {
            var b = a[0];
            C[b] = new v(b, 1, !1, a[1], null, !1);
        }));
        [ "contentEditable", "draggable", "spellCheck", "value" ].forEach((function(a) {
            C[a] = new v(a, 2, !1, a.toLowerCase(), null, !1);
        }));
        [ "autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha" ].forEach((function(a) {
            C[a] = new v(a, 2, !1, a, null, !1);
        }));
        "allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(a) {
            C[a] = new v(a, 3, !1, a.toLowerCase(), null, !1);
        }));
        [ "checked", "multiple", "muted", "selected" ].forEach((function(a) {
            C[a] = new v(a, 3, !0, a, null, !1);
        }));
        [ "capture", "download" ].forEach((function(a) {
            C[a] = new v(a, 4, !1, a, null, !1);
        }));
        [ "cols", "rows", "size", "span" ].forEach((function(a) {
            C[a] = new v(a, 6, !1, a, null, !1);
        }));
        [ "rowSpan", "start" ].forEach((function(a) {
            C[a] = new v(a, 5, !1, a.toLowerCase(), null, !1);
        }));
        var Ua = /[\-:]([a-z])/g;
        function Va(a) {
            return a[1].toUpperCase();
        }
        "accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(a) {
            var b = a.replace(Ua, Va);
            C[b] = new v(b, 1, !1, a, null, !1);
        }));
        "xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(a) {
            var b = a.replace(Ua, Va);
            C[b] = new v(b, 1, !1, a, "http://www.w3.org/1999/xlink", !1);
        }));
        [ "xml:base", "xml:lang", "xml:space" ].forEach((function(a) {
            var b = a.replace(Ua, Va);
            C[b] = new v(b, 1, !1, a, "http://www.w3.org/XML/1998/namespace", !1);
        }));
        [ "tabIndex", "crossOrigin" ].forEach((function(a) {
            C[a] = new v(a, 1, !1, a.toLowerCase(), null, !1);
        }));
        C.xlinkHref = new v("xlinkHref", 1, !1, "xlink:href", "http://www.w3.org/1999/xlink", !0);
        [ "src", "href", "action", "formAction" ].forEach((function(a) {
            C[a] = new v(a, 1, !1, a.toLowerCase(), null, !0);
        }));
        var Wa = aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
        Wa.hasOwnProperty("ReactCurrentDispatcher") || (Wa.ReactCurrentDispatcher = {
            current: null
        });
        Wa.hasOwnProperty("ReactCurrentBatchConfig") || (Wa.ReactCurrentBatchConfig = {
            suspense: null
        });
        function Xa(a, b, c, d) {
            var e = C.hasOwnProperty(b) ? C[b] : null;
            var f = null !== e ? 0 === e.type : d ? !1 : !(2 < b.length) || "o" !== b[0] && "O" !== b[0] || "n" !== b[1] && "N" !== b[1] ? !1 : !0;
            f || (Ta(b, c, e, d) && (c = null), d || null === e ? Ra(b) && (null === c ? a.removeAttribute(b) : a.setAttribute(b, "" + c)) : e.mustUseProperty ? a[e.propertyName] = null === c ? 3 === e.type ? !1 : "" : c : (b = e.attributeName, 
            d = e.attributeNamespace, null === c ? a.removeAttribute(b) : (e = e.type, c = 3 === e || 4 === e && !0 === c ? "" : "" + c, 
            d ? a.setAttributeNS(d, b, c) : a.setAttribute(b, c))));
        }
        var Ya = /^(.*)[\\\/]/, E = "function" === typeof Symbol && Symbol.for, Za = E ? Symbol.for("react.element") : 60103, $a = E ? Symbol.for("react.portal") : 60106, ab = E ? Symbol.for("react.fragment") : 60107, bb = E ? Symbol.for("react.strict_mode") : 60108, cb = E ? Symbol.for("react.profiler") : 60114, db = E ? Symbol.for("react.provider") : 60109, eb = E ? Symbol.for("react.context") : 60110, fb = E ? Symbol.for("react.concurrent_mode") : 60111, gb = E ? Symbol.for("react.forward_ref") : 60112, hb = E ? Symbol.for("react.suspense") : 60113, ib = E ? Symbol.for("react.suspense_list") : 60120, jb = E ? Symbol.for("react.memo") : 60115, kb = E ? Symbol.for("react.lazy") : 60116, lb = E ? Symbol.for("react.block") : 60121, mb = "function" === typeof Symbol && Symbol.iterator;
        function nb(a) {
            if (null === a || "object" !== typeof a) return null;
            a = mb && a[mb] || a["@@iterator"];
            return "function" === typeof a ? a : null;
        }
        function ob(a) {
            if (-1 === a._status) {
                a._status = 0;
                var b = a._ctor;
                b = b();
                a._result = b;
                b.then((function(b) {
                    0 === a._status && (b = b.default, a._status = 1, a._result = b);
                }), (function(b) {
                    0 === a._status && (a._status = 2, a._result = b);
                }));
            }
        }
        function pb(a) {
            if (null == a) return null;
            if ("function" === typeof a) return a.displayName || a.name || null;
            if ("string" === typeof a) return a;
            switch (a) {
              case ab:
                return "Fragment";

              case $a:
                return "Portal";

              case cb:
                return "Profiler";

              case bb:
                return "StrictMode";

              case hb:
                return "Suspense";

              case ib:
                return "SuspenseList";
            }
            if ("object" === typeof a) switch (a.$$typeof) {
              case eb:
                return "Context.Consumer";

              case db:
                return "Context.Provider";

              case gb:
                var b = a.render;
                b = b.displayName || b.name || "";
                return a.displayName || ("" !== b ? "ForwardRef(" + b + ")" : "ForwardRef");

              case jb:
                return pb(a.type);

              case lb:
                return pb(a.render);

              case kb:
                if (a = 1 === a._status ? a._result : null) return pb(a);
            }
            return null;
        }
        function qb(a) {
            var b = "";
            do {
                a: switch (a.tag) {
                  case 3:
                  case 4:
                  case 6:
                  case 7:
                  case 10:
                  case 9:
                    var c = "";
                    break a;

                  default:
                    var d = a._debugOwner, e = a._debugSource, f = pb(a.type);
                    c = null;
                    d && (c = pb(d.type));
                    d = f;
                    f = "";
                    e ? f = " (at " + e.fileName.replace(Ya, "") + ":" + e.lineNumber + ")" : c && (f = " (created by " + c + ")");
                    c = "\n    in " + (d || "Unknown") + f;
                }
                b += c;
                a = a.return;
            } while (a);
            return b;
        }
        function rb(a) {
            switch (typeof a) {
              case "boolean":
              case "number":
              case "object":
              case "string":
              case "undefined":
                return a;

              default:
                return "";
            }
        }
        function sb(a) {
            var b = a.type;
            return (a = a.nodeName) && "input" === a.toLowerCase() && ("checkbox" === b || "radio" === b);
        }
        function tb(a) {
            var b = sb(a) ? "checked" : "value", c = Object.getOwnPropertyDescriptor(a.constructor.prototype, b), d = "" + a[b];
            if (!a.hasOwnProperty(b) && "undefined" !== typeof c && "function" === typeof c.get && "function" === typeof c.set) {
                var e = c.get, f = c.set;
                Object.defineProperty(a, b, {
                    configurable: !0,
                    get: function() {
                        return e.call(this);
                    },
                    set: function(a) {
                        d = "" + a;
                        f.call(this, a);
                    }
                });
                Object.defineProperty(a, b, {
                    enumerable: c.enumerable
                });
                return {
                    getValue: function() {
                        return d;
                    },
                    setValue: function(a) {
                        d = "" + a;
                    },
                    stopTracking: function() {
                        a._valueTracker = null;
                        delete a[b];
                    }
                };
            }
        }
        function xb(a) {
            a._valueTracker || (a._valueTracker = tb(a));
        }
        function yb(a) {
            if (!a) return !1;
            var b = a._valueTracker;
            if (!b) return !0;
            var c = b.getValue();
            var d = "";
            a && (d = sb(a) ? a.checked ? "true" : "false" : a.value);
            a = d;
            return a !== c ? (b.setValue(a), !0) : !1;
        }
        function zb(a, b) {
            var c = b.checked;
            return n({}, b, {
                defaultChecked: void 0,
                defaultValue: void 0,
                value: void 0,
                checked: null != c ? c : a._wrapperState.initialChecked
            });
        }
        function Ab(a, b) {
            var c = null == b.defaultValue ? "" : b.defaultValue, d = null != b.checked ? b.checked : b.defaultChecked;
            c = rb(null != b.value ? b.value : c);
            a._wrapperState = {
                initialChecked: d,
                initialValue: c,
                controlled: "checkbox" === b.type || "radio" === b.type ? null != b.checked : null != b.value
            };
        }
        function Bb(a, b) {
            b = b.checked;
            null != b && Xa(a, "checked", b, !1);
        }
        function Cb(a, b) {
            Bb(a, b);
            var c = rb(b.value), d = b.type;
            if (null != c) if ("number" === d) {
                if (0 === c && "" === a.value || a.value != c) a.value = "" + c;
            } else a.value !== "" + c && (a.value = "" + c); else if ("submit" === d || "reset" === d) {
                a.removeAttribute("value");
                return;
            }
            b.hasOwnProperty("value") ? Db(a, b.type, c) : b.hasOwnProperty("defaultValue") && Db(a, b.type, rb(b.defaultValue));
            null == b.checked && null != b.defaultChecked && (a.defaultChecked = !!b.defaultChecked);
        }
        function Eb(a, b, c) {
            if (b.hasOwnProperty("value") || b.hasOwnProperty("defaultValue")) {
                var d = b.type;
                if (!("submit" !== d && "reset" !== d || void 0 !== b.value && null !== b.value)) return;
                b = "" + a._wrapperState.initialValue;
                c || b === a.value || (a.value = b);
                a.defaultValue = b;
            }
            c = a.name;
            "" !== c && (a.name = "");
            a.defaultChecked = !!a._wrapperState.initialChecked;
            "" !== c && (a.name = c);
        }
        function Db(a, b, c) {
            if ("number" !== b || a.ownerDocument.activeElement !== a) null == c ? a.defaultValue = "" + a._wrapperState.initialValue : a.defaultValue !== "" + c && (a.defaultValue = "" + c);
        }
        function Fb(a) {
            var b = "";
            aa.Children.forEach(a, (function(a) {
                null != a && (b += a);
            }));
            return b;
        }
        function Gb(a, b) {
            a = n({
                children: void 0
            }, b);
            if (b = Fb(b.children)) a.children = b;
            return a;
        }
        function Hb(a, b, c, d) {
            a = a.options;
            if (b) {
                b = {};
                for (var e = 0; e < c.length; e++) b["$" + c[e]] = !0;
                for (c = 0; c < a.length; c++) e = b.hasOwnProperty("$" + a[c].value), a[c].selected !== e && (a[c].selected = e), 
                e && d && (a[c].defaultSelected = !0);
            } else {
                c = "" + rb(c);
                b = null;
                for (e = 0; e < a.length; e++) {
                    if (a[e].value === c) {
                        a[e].selected = !0;
                        d && (a[e].defaultSelected = !0);
                        return;
                    }
                    null !== b || a[e].disabled || (b = a[e]);
                }
                null !== b && (b.selected = !0);
            }
        }
        function Ib(a, b) {
            if (null != b.dangerouslySetInnerHTML) throw Error(u(91));
            return n({}, b, {
                value: void 0,
                defaultValue: void 0,
                children: "" + a._wrapperState.initialValue
            });
        }
        function Jb(a, b) {
            var c = b.value;
            if (null == c) {
                c = b.children;
                b = b.defaultValue;
                if (null != c) {
                    if (null != b) throw Error(u(92));
                    if (Array.isArray(c)) {
                        if (!(1 >= c.length)) throw Error(u(93));
                        c = c[0];
                    }
                    b = c;
                }
                null == b && (b = "");
                c = b;
            }
            a._wrapperState = {
                initialValue: rb(c)
            };
        }
        function Kb(a, b) {
            var c = rb(b.value), d = rb(b.defaultValue);
            null != c && (c = "" + c, c !== a.value && (a.value = c), null == b.defaultValue && a.defaultValue !== c && (a.defaultValue = c));
            null != d && (a.defaultValue = "" + d);
        }
        function Lb(a) {
            var b = a.textContent;
            b === a._wrapperState.initialValue && "" !== b && null !== b && (a.value = b);
        }
        var Mb = {
            html: "http://www.w3.org/1999/xhtml",
            mathml: "http://www.w3.org/1998/Math/MathML",
            svg: "http://www.w3.org/2000/svg"
        };
        function Nb(a) {
            switch (a) {
              case "svg":
                return "http://www.w3.org/2000/svg";

              case "math":
                return "http://www.w3.org/1998/Math/MathML";

              default:
                return "http://www.w3.org/1999/xhtml";
            }
        }
        function Ob(a, b) {
            return null == a || "http://www.w3.org/1999/xhtml" === a ? Nb(b) : "http://www.w3.org/2000/svg" === a && "foreignObject" === b ? "http://www.w3.org/1999/xhtml" : a;
        }
        var Pb, Qb = function(a) {
            return "undefined" !== typeof MSApp && MSApp.execUnsafeLocalFunction ? function(b, c, d, e) {
                MSApp.execUnsafeLocalFunction((function() {
                    return a(b, c, d, e);
                }));
            } : a;
        }((function(a, b) {
            if (a.namespaceURI !== Mb.svg || "innerHTML" in a) a.innerHTML = b; else {
                Pb = Pb || document.createElement("div");
                Pb.innerHTML = "<svg>" + b.valueOf().toString() + "</svg>";
                for (b = Pb.firstChild; a.firstChild; ) a.removeChild(a.firstChild);
                for (;b.firstChild; ) a.appendChild(b.firstChild);
            }
        }));
        function Rb(a, b) {
            if (b) {
                var c = a.firstChild;
                if (c && c === a.lastChild && 3 === c.nodeType) {
                    c.nodeValue = b;
                    return;
                }
            }
            a.textContent = b;
        }
        function Sb(a, b) {
            var c = {};
            c[a.toLowerCase()] = b.toLowerCase();
            c["Webkit" + a] = "webkit" + b;
            c["Moz" + a] = "moz" + b;
            return c;
        }
        var Tb = {
            animationend: Sb("Animation", "AnimationEnd"),
            animationiteration: Sb("Animation", "AnimationIteration"),
            animationstart: Sb("Animation", "AnimationStart"),
            transitionend: Sb("Transition", "TransitionEnd")
        }, Ub = {}, Vb = {};
        ya && (Vb = document.createElement("div").style, "AnimationEvent" in window || (delete Tb.animationend.animation, 
        delete Tb.animationiteration.animation, delete Tb.animationstart.animation), "TransitionEvent" in window || delete Tb.transitionend.transition);
        function Wb(a) {
            if (Ub[a]) return Ub[a];
            if (!Tb[a]) return a;
            var b = Tb[a], c;
            for (c in b) if (b.hasOwnProperty(c) && c in Vb) return Ub[a] = b[c];
            return a;
        }
        var Xb = Wb("animationend"), Yb = Wb("animationiteration"), Zb = Wb("animationstart"), $b = Wb("transitionend"), ac = "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "), bc = new ("function" === typeof WeakMap ? WeakMap : Map);
        function cc(a) {
            var b = bc.get(a);
            void 0 === b && (b = new Map, bc.set(a, b));
            return b;
        }
        function dc(a) {
            var b = a, c = a;
            if (a.alternate) for (;b.return; ) b = b.return; else {
                a = b;
                do {
                    b = a, 0 !== (b.effectTag & 1026) && (c = b.return), a = b.return;
                } while (a);
            }
            return 3 === b.tag ? c : null;
        }
        function ec(a) {
            if (13 === a.tag) {
                var b = a.memoizedState;
                null === b && (a = a.alternate, null !== a && (b = a.memoizedState));
                if (null !== b) return b.dehydrated;
            }
            return null;
        }
        function fc(a) {
            if (dc(a) !== a) throw Error(u(188));
        }
        function gc(a) {
            var b = a.alternate;
            if (!b) {
                b = dc(a);
                if (null === b) throw Error(u(188));
                return b !== a ? null : a;
            }
            for (var c = a, d = b; ;) {
                var e = c.return;
                if (null === e) break;
                var f = e.alternate;
                if (null === f) {
                    d = e.return;
                    if (null !== d) {
                        c = d;
                        continue;
                    }
                    break;
                }
                if (e.child === f.child) {
                    for (f = e.child; f; ) {
                        if (f === c) return fc(e), a;
                        if (f === d) return fc(e), b;
                        f = f.sibling;
                    }
                    throw Error(u(188));
                }
                if (c.return !== d.return) c = e, d = f; else {
                    for (var g = !1, h = e.child; h; ) {
                        if (h === c) {
                            g = !0;
                            c = e;
                            d = f;
                            break;
                        }
                        if (h === d) {
                            g = !0;
                            d = e;
                            c = f;
                            break;
                        }
                        h = h.sibling;
                    }
                    if (!g) {
                        for (h = f.child; h; ) {
                            if (h === c) {
                                g = !0;
                                c = f;
                                d = e;
                                break;
                            }
                            if (h === d) {
                                g = !0;
                                d = f;
                                c = e;
                                break;
                            }
                            h = h.sibling;
                        }
                        if (!g) throw Error(u(189));
                    }
                }
                if (c.alternate !== d) throw Error(u(190));
            }
            if (3 !== c.tag) throw Error(u(188));
            return c.stateNode.current === c ? a : b;
        }
        function hc(a) {
            a = gc(a);
            if (!a) return null;
            for (var b = a; ;) {
                if (5 === b.tag || 6 === b.tag) return b;
                if (b.child) b.child.return = b, b = b.child; else {
                    if (b === a) break;
                    for (;!b.sibling; ) {
                        if (!b.return || b.return === a) return null;
                        b = b.return;
                    }
                    b.sibling.return = b.return;
                    b = b.sibling;
                }
            }
            return null;
        }
        function ic(a, b) {
            if (null == b) throw Error(u(30));
            if (null == a) return b;
            if (Array.isArray(a)) {
                if (Array.isArray(b)) return a.push.apply(a, b), a;
                a.push(b);
                return a;
            }
            return Array.isArray(b) ? [ a ].concat(b) : [ a, b ];
        }
        function jc(a, b, c) {
            Array.isArray(a) ? a.forEach(b, c) : a && b.call(c, a);
        }
        var kc = null;
        function lc(a) {
            if (a) {
                var b = a._dispatchListeners, c = a._dispatchInstances;
                if (Array.isArray(b)) for (var d = 0; d < b.length && !a.isPropagationStopped(); d++) oa(a, b[d], c[d]); else b && oa(a, b, c);
                a._dispatchListeners = null;
                a._dispatchInstances = null;
                a.isPersistent() || a.constructor.release(a);
            }
        }
        function mc(a) {
            null !== a && (kc = ic(kc, a));
            a = kc;
            kc = null;
            if (a) {
                jc(a, lc);
                if (kc) throw Error(u(95));
                if (fa) throw a = ha, fa = !1, ha = null, a;
            }
        }
        function nc(a) {
            a = a.target || a.srcElement || window;
            a.correspondingUseElement && (a = a.correspondingUseElement);
            return 3 === a.nodeType ? a.parentNode : a;
        }
        function oc(a) {
            if (!ya) return !1;
            a = "on" + a;
            var b = a in document;
            b || (b = document.createElement("div"), b.setAttribute(a, "return;"), b = "function" === typeof b[a]);
            return b;
        }
        var pc = [];
        function qc(a) {
            a.topLevelType = null;
            a.nativeEvent = null;
            a.targetInst = null;
            a.ancestors.length = 0;
            10 > pc.length && pc.push(a);
        }
        function rc(a, b, c, d) {
            if (pc.length) {
                var e = pc.pop();
                e.topLevelType = a;
                e.eventSystemFlags = d;
                e.nativeEvent = b;
                e.targetInst = c;
                return e;
            }
            return {
                topLevelType: a,
                eventSystemFlags: d,
                nativeEvent: b,
                targetInst: c,
                ancestors: []
            };
        }
        function sc(a) {
            var b = a.targetInst, c = b;
            do {
                if (!c) {
                    a.ancestors.push(c);
                    break;
                }
                var d = c;
                if (3 === d.tag) d = d.stateNode.containerInfo; else {
                    for (;d.return; ) d = d.return;
                    d = 3 !== d.tag ? null : d.stateNode.containerInfo;
                }
                if (!d) break;
                b = c.tag;
                5 !== b && 6 !== b || a.ancestors.push(c);
                c = tc(d);
            } while (c);
            for (c = 0; c < a.ancestors.length; c++) {
                b = a.ancestors[c];
                var e = nc(a.nativeEvent);
                d = a.topLevelType;
                var f = a.nativeEvent, g = a.eventSystemFlags;
                0 === c && (g |= 64);
                for (var h = null, k = 0; k < sa.length; k++) {
                    var l = sa[k];
                    l && (l = l.extractEvents(d, b, f, e, g)) && (h = ic(h, l));
                }
                mc(h);
            }
        }
        function uc(a, b, c) {
            if (!c.has(a)) {
                switch (a) {
                  case "scroll":
                    vc(b, "scroll", !0);
                    break;

                  case "focus":
                  case "blur":
                    vc(b, "focus", !0);
                    vc(b, "blur", !0);
                    c.set("blur", null);
                    c.set("focus", null);
                    break;

                  case "cancel":
                  case "close":
                    oc(a) && vc(b, a, !0);
                    break;

                  case "invalid":
                  case "submit":
                  case "reset":
                    break;

                  default:
                    -1 === ac.indexOf(a) && F(a, b);
                }
                c.set(a, null);
            }
        }
        var wc, xc, yc, zc = !1, Ac = [], Bc = null, Cc = null, Dc = null, Ec = new Map, Fc = new Map, Gc = [], Hc = "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput close cancel copy cut paste click change contextmenu reset submit".split(" "), Ic = "focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture".split(" ");
        function Jc(a, b) {
            var c = cc(b);
            Hc.forEach((function(a) {
                uc(a, b, c);
            }));
            Ic.forEach((function(a) {
                uc(a, b, c);
            }));
        }
        function Kc(a, b, c, d, e) {
            return {
                blockedOn: a,
                topLevelType: b,
                eventSystemFlags: c | 32,
                nativeEvent: e,
                container: d
            };
        }
        function Lc(a, b) {
            switch (a) {
              case "focus":
              case "blur":
                Bc = null;
                break;

              case "dragenter":
              case "dragleave":
                Cc = null;
                break;

              case "mouseover":
              case "mouseout":
                Dc = null;
                break;

              case "pointerover":
              case "pointerout":
                Ec.delete(b.pointerId);
                break;

              case "gotpointercapture":
              case "lostpointercapture":
                Fc.delete(b.pointerId);
            }
        }
        function Mc(a, b, c, d, e, f) {
            if (null === a || a.nativeEvent !== f) return a = Kc(b, c, d, e, f), null !== b && (b = Nc(b), 
            null !== b && xc(b)), a;
            a.eventSystemFlags |= d;
            return a;
        }
        function Oc(a, b, c, d, e) {
            switch (b) {
              case "focus":
                return Bc = Mc(Bc, a, b, c, d, e), !0;

              case "dragenter":
                return Cc = Mc(Cc, a, b, c, d, e), !0;

              case "mouseover":
                return Dc = Mc(Dc, a, b, c, d, e), !0;

              case "pointerover":
                var f = e.pointerId;
                Ec.set(f, Mc(Ec.get(f) || null, a, b, c, d, e));
                return !0;

              case "gotpointercapture":
                return f = e.pointerId, Fc.set(f, Mc(Fc.get(f) || null, a, b, c, d, e)), !0;
            }
            return !1;
        }
        function Pc(a) {
            var b = tc(a.target);
            if (null !== b) {
                var c = dc(b);
                if (null !== c) if (b = c.tag, 13 === b) {
                    if (b = ec(c), null !== b) {
                        a.blockedOn = b;
                        r.unstable_runWithPriority(a.priority, (function() {
                            yc(c);
                        }));
                        return;
                    }
                } else if (3 === b && c.stateNode.hydrate) {
                    a.blockedOn = 3 === c.tag ? c.stateNode.containerInfo : null;
                    return;
                }
            }
            a.blockedOn = null;
        }
        function Qc(a) {
            if (null !== a.blockedOn) return !1;
            var b = Rc(a.topLevelType, a.eventSystemFlags, a.container, a.nativeEvent);
            if (null !== b) {
                var c = Nc(b);
                null !== c && xc(c);
                a.blockedOn = b;
                return !1;
            }
            return !0;
        }
        function Sc(a, b, c) {
            Qc(a) && c.delete(b);
        }
        function Tc() {
            for (zc = !1; 0 < Ac.length; ) {
                var a = Ac[0];
                if (null !== a.blockedOn) {
                    a = Nc(a.blockedOn);
                    null !== a && wc(a);
                    break;
                }
                var b = Rc(a.topLevelType, a.eventSystemFlags, a.container, a.nativeEvent);
                null !== b ? a.blockedOn = b : Ac.shift();
            }
            null !== Bc && Qc(Bc) && (Bc = null);
            null !== Cc && Qc(Cc) && (Cc = null);
            null !== Dc && Qc(Dc) && (Dc = null);
            Ec.forEach(Sc);
            Fc.forEach(Sc);
        }
        function Uc(a, b) {
            a.blockedOn === b && (a.blockedOn = null, zc || (zc = !0, r.unstable_scheduleCallback(r.unstable_NormalPriority, Tc)));
        }
        function Vc(a) {
            function b(b) {
                return Uc(b, a);
            }
            if (0 < Ac.length) {
                Uc(Ac[0], a);
                for (var c = 1; c < Ac.length; c++) {
                    var d = Ac[c];
                    d.blockedOn === a && (d.blockedOn = null);
                }
            }
            null !== Bc && Uc(Bc, a);
            null !== Cc && Uc(Cc, a);
            null !== Dc && Uc(Dc, a);
            Ec.forEach(b);
            Fc.forEach(b);
            for (c = 0; c < Gc.length; c++) d = Gc[c], d.blockedOn === a && (d.blockedOn = null);
            for (;0 < Gc.length && (c = Gc[0], null === c.blockedOn); ) Pc(c), null === c.blockedOn && Gc.shift();
        }
        var Wc = {}, Yc = new Map, Zc = new Map, $c = [ "abort", "abort", Xb, "animationEnd", Yb, "animationIteration", Zb, "animationStart", "canplay", "canPlay", "canplaythrough", "canPlayThrough", "durationchange", "durationChange", "emptied", "emptied", "encrypted", "encrypted", "ended", "ended", "error", "error", "gotpointercapture", "gotPointerCapture", "load", "load", "loadeddata", "loadedData", "loadedmetadata", "loadedMetadata", "loadstart", "loadStart", "lostpointercapture", "lostPointerCapture", "playing", "playing", "progress", "progress", "seeking", "seeking", "stalled", "stalled", "suspend", "suspend", "timeupdate", "timeUpdate", $b, "transitionEnd", "waiting", "waiting" ];
        function ad(a, b) {
            for (var c = 0; c < a.length; c += 2) {
                var d = a[c], e = a[c + 1], f = "on" + (e[0].toUpperCase() + e.slice(1));
                f = {
                    phasedRegistrationNames: {
                        bubbled: f,
                        captured: f + "Capture"
                    },
                    dependencies: [ d ],
                    eventPriority: b
                };
                Zc.set(d, b);
                Yc.set(d, f);
                Wc[e] = f;
            }
        }
        ad("blur blur cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focus focus input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "), 0);
        ad("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "), 1);
        ad($c, 2);
        for (var bd = "change selectionchange textInput compositionstart compositionend compositionupdate".split(" "), cd = 0; cd < bd.length; cd++) Zc.set(bd[cd], 0);
        var dd = r.unstable_UserBlockingPriority, ed = r.unstable_runWithPriority, fd = !0;
        function F(a, b) {
            vc(b, a, !1);
        }
        function vc(a, b, c) {
            var d = Zc.get(b);
            switch (void 0 === d ? 2 : d) {
              case 0:
                d = gd.bind(null, b, 1, a);
                break;

              case 1:
                d = hd.bind(null, b, 1, a);
                break;

              default:
                d = id.bind(null, b, 1, a);
            }
            c ? a.addEventListener(b, d, !0) : a.addEventListener(b, d, !1);
        }
        function gd(a, b, c, d) {
            Ja || Ha();
            var e = id, f = Ja;
            Ja = !0;
            try {
                Ga(e, a, b, c, d);
            } finally {
                (Ja = f) || La();
            }
        }
        function hd(a, b, c, d) {
            ed(dd, id.bind(null, a, b, c, d));
        }
        function id(a, b, c, d) {
            if (fd) if (0 < Ac.length && -1 < Hc.indexOf(a)) a = Kc(null, a, b, c, d), Ac.push(a); else {
                var e = Rc(a, b, c, d);
                if (null === e) Lc(a, d); else if (-1 < Hc.indexOf(a)) a = Kc(e, a, b, c, d), Ac.push(a); else if (!Oc(e, a, b, c, d)) {
                    Lc(a, d);
                    a = rc(a, d, null, b);
                    try {
                        Ma(sc, a);
                    } finally {
                        qc(a);
                    }
                }
            }
        }
        function Rc(a, b, c, d) {
            c = nc(d);
            c = tc(c);
            if (null !== c) {
                var e = dc(c);
                if (null === e) c = null; else {
                    var f = e.tag;
                    if (13 === f) {
                        c = ec(e);
                        if (null !== c) return c;
                        c = null;
                    } else if (3 === f) {
                        if (e.stateNode.hydrate) return 3 === e.tag ? e.stateNode.containerInfo : null;
                        c = null;
                    } else e !== c && (c = null);
                }
            }
            a = rc(a, d, c, b);
            try {
                Ma(sc, a);
            } finally {
                qc(a);
            }
            return null;
        }
        var jd = {
            animationIterationCount: !0,
            borderImageOutset: !0,
            borderImageSlice: !0,
            borderImageWidth: !0,
            boxFlex: !0,
            boxFlexGroup: !0,
            boxOrdinalGroup: !0,
            columnCount: !0,
            columns: !0,
            flex: !0,
            flexGrow: !0,
            flexPositive: !0,
            flexShrink: !0,
            flexNegative: !0,
            flexOrder: !0,
            gridArea: !0,
            gridRow: !0,
            gridRowEnd: !0,
            gridRowSpan: !0,
            gridRowStart: !0,
            gridColumn: !0,
            gridColumnEnd: !0,
            gridColumnSpan: !0,
            gridColumnStart: !0,
            fontWeight: !0,
            lineClamp: !0,
            lineHeight: !0,
            opacity: !0,
            order: !0,
            orphans: !0,
            tabSize: !0,
            widows: !0,
            zIndex: !0,
            zoom: !0,
            fillOpacity: !0,
            floodOpacity: !0,
            stopOpacity: !0,
            strokeDasharray: !0,
            strokeDashoffset: !0,
            strokeMiterlimit: !0,
            strokeOpacity: !0,
            strokeWidth: !0
        }, kd = [ "Webkit", "ms", "Moz", "O" ];
        Object.keys(jd).forEach((function(a) {
            kd.forEach((function(b) {
                b = b + a.charAt(0).toUpperCase() + a.substring(1);
                jd[b] = jd[a];
            }));
        }));
        function ld(a, b, c) {
            return null == b || "boolean" === typeof b || "" === b ? "" : c || "number" !== typeof b || 0 === b || jd.hasOwnProperty(a) && jd[a] ? ("" + b).trim() : b + "px";
        }
        function md(a, b) {
            a = a.style;
            for (var c in b) if (b.hasOwnProperty(c)) {
                var d = 0 === c.indexOf("--"), e = ld(c, b[c], d);
                "float" === c && (c = "cssFloat");
                d ? a.setProperty(c, e) : a[c] = e;
            }
        }
        var nd = n({
            menuitem: !0
        }, {
            area: !0,
            base: !0,
            br: !0,
            col: !0,
            embed: !0,
            hr: !0,
            img: !0,
            input: !0,
            keygen: !0,
            link: !0,
            meta: !0,
            param: !0,
            source: !0,
            track: !0,
            wbr: !0
        });
        function od(a, b) {
            if (b) {
                if (nd[a] && (null != b.children || null != b.dangerouslySetInnerHTML)) throw Error(u(137, a, ""));
                if (null != b.dangerouslySetInnerHTML) {
                    if (null != b.children) throw Error(u(60));
                    if (!("object" === typeof b.dangerouslySetInnerHTML && "__html" in b.dangerouslySetInnerHTML)) throw Error(u(61));
                }
                if (null != b.style && "object" !== typeof b.style) throw Error(u(62, ""));
            }
        }
        function pd(a, b) {
            if (-1 === a.indexOf("-")) return "string" === typeof b.is;
            switch (a) {
              case "annotation-xml":
              case "color-profile":
              case "font-face":
              case "font-face-src":
              case "font-face-uri":
              case "font-face-format":
              case "font-face-name":
              case "missing-glyph":
                return !1;

              default:
                return !0;
            }
        }
        var qd = Mb.html;
        function rd(a, b) {
            a = 9 === a.nodeType || 11 === a.nodeType ? a : a.ownerDocument;
            var c = cc(a);
            b = wa[b];
            for (var d = 0; d < b.length; d++) uc(b[d], a, c);
        }
        function sd() {}
        function td(a) {
            a = a || ("undefined" !== typeof document ? document : void 0);
            if ("undefined" === typeof a) return null;
            try {
                return a.activeElement || a.body;
            } catch (b) {
                return a.body;
            }
        }
        function ud(a) {
            for (;a && a.firstChild; ) a = a.firstChild;
            return a;
        }
        function vd(a, b) {
            var c = ud(a);
            a = 0;
            for (var d; c; ) {
                if (3 === c.nodeType) {
                    d = a + c.textContent.length;
                    if (a <= b && d >= b) return {
                        node: c,
                        offset: b - a
                    };
                    a = d;
                }
                a: {
                    for (;c; ) {
                        if (c.nextSibling) {
                            c = c.nextSibling;
                            break a;
                        }
                        c = c.parentNode;
                    }
                    c = void 0;
                }
                c = ud(c);
            }
        }
        function wd(a, b) {
            return a && b ? a === b ? !0 : a && 3 === a.nodeType ? !1 : b && 3 === b.nodeType ? wd(a, b.parentNode) : "contains" in a ? a.contains(b) : a.compareDocumentPosition ? !!(a.compareDocumentPosition(b) & 16) : !1 : !1;
        }
        function xd() {
            for (var a = window, b = td(); b instanceof a.HTMLIFrameElement; ) {
                try {
                    var c = "string" === typeof b.contentWindow.location.href;
                } catch (d) {
                    c = !1;
                }
                if (c) a = b.contentWindow; else break;
                b = td(a.document);
            }
            return b;
        }
        function yd(a) {
            var b = a && a.nodeName && a.nodeName.toLowerCase();
            return b && ("input" === b && ("text" === a.type || "search" === a.type || "tel" === a.type || "url" === a.type || "password" === a.type) || "textarea" === b || "true" === a.contentEditable);
        }
        var zd = "$", Ad = "/$", Bd = "$?", Cd = "$!", Dd = null, Ed = null;
        function Fd(a, b) {
            switch (a) {
              case "button":
              case "input":
              case "select":
              case "textarea":
                return !!b.autoFocus;
            }
            return !1;
        }
        function Gd(a, b) {
            return "textarea" === a || "option" === a || "noscript" === a || "string" === typeof b.children || "number" === typeof b.children || "object" === typeof b.dangerouslySetInnerHTML && null !== b.dangerouslySetInnerHTML && null != b.dangerouslySetInnerHTML.__html;
        }
        var Hd = "function" === typeof setTimeout ? setTimeout : void 0, Id = "function" === typeof clearTimeout ? clearTimeout : void 0;
        function Jd(a) {
            for (;null != a; a = a.nextSibling) {
                var b = a.nodeType;
                if (1 === b || 3 === b) break;
            }
            return a;
        }
        function Kd(a) {
            a = a.previousSibling;
            for (var b = 0; a; ) {
                if (8 === a.nodeType) {
                    var c = a.data;
                    if (c === zd || c === Cd || c === Bd) {
                        if (0 === b) return a;
                        b--;
                    } else c === Ad && b++;
                }
                a = a.previousSibling;
            }
            return null;
        }
        var Ld = Math.random().toString(36).slice(2), Md = "__reactInternalInstance$" + Ld, Nd = "__reactEventHandlers$" + Ld, Od = "__reactContainere$" + Ld;
        function tc(a) {
            var b = a[Md];
            if (b) return b;
            for (var c = a.parentNode; c; ) {
                if (b = c[Od] || c[Md]) {
                    c = b.alternate;
                    if (null !== b.child || null !== c && null !== c.child) for (a = Kd(a); null !== a; ) {
                        if (c = a[Md]) return c;
                        a = Kd(a);
                    }
                    return b;
                }
                a = c;
                c = a.parentNode;
            }
            return null;
        }
        function Nc(a) {
            a = a[Md] || a[Od];
            return !a || 5 !== a.tag && 6 !== a.tag && 13 !== a.tag && 3 !== a.tag ? null : a;
        }
        function Pd(a) {
            if (5 === a.tag || 6 === a.tag) return a.stateNode;
            throw Error(u(33));
        }
        function Qd(a) {
            return a[Nd] || null;
        }
        function Rd(a) {
            do {
                a = a.return;
            } while (a && 5 !== a.tag);
            return a ? a : null;
        }
        function Sd(a, b) {
            var c = a.stateNode;
            if (!c) return null;
            var d = la(c);
            if (!d) return null;
            c = d[b];
            a: switch (b) {
              case "onClick":
              case "onClickCapture":
              case "onDoubleClick":
              case "onDoubleClickCapture":
              case "onMouseDown":
              case "onMouseDownCapture":
              case "onMouseMove":
              case "onMouseMoveCapture":
              case "onMouseUp":
              case "onMouseUpCapture":
              case "onMouseEnter":
                (d = !d.disabled) || (a = a.type, d = !("button" === a || "input" === a || "select" === a || "textarea" === a));
                a = !d;
                break a;

              default:
                a = !1;
            }
            if (a) return null;
            if (c && "function" !== typeof c) throw Error(u(231, b, typeof c));
            return c;
        }
        function Td(a, b, c) {
            if (b = Sd(a, c.dispatchConfig.phasedRegistrationNames[b])) c._dispatchListeners = ic(c._dispatchListeners, b), 
            c._dispatchInstances = ic(c._dispatchInstances, a);
        }
        function Ud(a) {
            if (a && a.dispatchConfig.phasedRegistrationNames) {
                for (var b = a._targetInst, c = []; b; ) c.push(b), b = Rd(b);
                for (b = c.length; 0 < b--; ) Td(c[b], "captured", a);
                for (b = 0; b < c.length; b++) Td(c[b], "bubbled", a);
            }
        }
        function Vd(a, b, c) {
            a && c && c.dispatchConfig.registrationName && (b = Sd(a, c.dispatchConfig.registrationName)) && (c._dispatchListeners = ic(c._dispatchListeners, b), 
            c._dispatchInstances = ic(c._dispatchInstances, a));
        }
        function Wd(a) {
            a && a.dispatchConfig.registrationName && Vd(a._targetInst, null, a);
        }
        function Xd(a) {
            jc(a, Ud);
        }
        var Yd = null, Zd = null, $d = null;
        function ae() {
            if ($d) return $d;
            var a, b = Zd, c = b.length, d, e = "value" in Yd ? Yd.value : Yd.textContent, f = e.length;
            for (a = 0; a < c && b[a] === e[a]; a++) ;
            var g = c - a;
            for (d = 1; d <= g && b[c - d] === e[f - d]; d++) ;
            return $d = e.slice(a, 1 < d ? 1 - d : void 0);
        }
        function be() {
            return !0;
        }
        function ce() {
            return !1;
        }
        function G(a, b, c, d) {
            this.dispatchConfig = a;
            this._targetInst = b;
            this.nativeEvent = c;
            a = this.constructor.Interface;
            for (var e in a) a.hasOwnProperty(e) && ((b = a[e]) ? this[e] = b(c) : "target" === e ? this.target = d : this[e] = c[e]);
            this.isDefaultPrevented = (null != c.defaultPrevented ? c.defaultPrevented : !1 === c.returnValue) ? be : ce;
            this.isPropagationStopped = ce;
            return this;
        }
        n(G.prototype, {
            preventDefault: function() {
                this.defaultPrevented = !0;
                var a = this.nativeEvent;
                a && (a.preventDefault ? a.preventDefault() : "unknown" !== typeof a.returnValue && (a.returnValue = !1), 
                this.isDefaultPrevented = be);
            },
            stopPropagation: function() {
                var a = this.nativeEvent;
                a && (a.stopPropagation ? a.stopPropagation() : "unknown" !== typeof a.cancelBubble && (a.cancelBubble = !0), 
                this.isPropagationStopped = be);
            },
            persist: function() {
                this.isPersistent = be;
            },
            isPersistent: ce,
            destructor: function() {
                var a = this.constructor.Interface, b;
                for (b in a) this[b] = null;
                this.nativeEvent = this._targetInst = this.dispatchConfig = null;
                this.isPropagationStopped = this.isDefaultPrevented = ce;
                this._dispatchInstances = this._dispatchListeners = null;
            }
        });
        G.Interface = {
            type: null,
            target: null,
            currentTarget: function() {
                return null;
            },
            eventPhase: null,
            bubbles: null,
            cancelable: null,
            timeStamp: function(a) {
                return a.timeStamp || Date.now();
            },
            defaultPrevented: null,
            isTrusted: null
        };
        G.extend = function(a) {
            function b() {}
            function c() {
                return d.apply(this, arguments);
            }
            var d = this;
            b.prototype = d.prototype;
            var e = new b;
            n(e, c.prototype);
            c.prototype = e;
            c.prototype.constructor = c;
            c.Interface = n({}, d.Interface, a);
            c.extend = d.extend;
            de(c);
            return c;
        };
        de(G);
        function ee(a, b, c, d) {
            if (this.eventPool.length) {
                var e = this.eventPool.pop();
                this.call(e, a, b, c, d);
                return e;
            }
            return new this(a, b, c, d);
        }
        function fe(a) {
            if (!(a instanceof this)) throw Error(u(279));
            a.destructor();
            10 > this.eventPool.length && this.eventPool.push(a);
        }
        function de(a) {
            a.eventPool = [];
            a.getPooled = ee;
            a.release = fe;
        }
        var ge = G.extend({
            data: null
        }), he = G.extend({
            data: null
        }), ie = [ 9, 13, 27, 32 ], je = ya && "CompositionEvent" in window, ke = null;
        ya && "documentMode" in document && (ke = document.documentMode);
        var le = ya && "TextEvent" in window && !ke, me = ya && (!je || ke && 8 < ke && 11 >= ke), ne = String.fromCharCode(32), oe = {
            beforeInput: {
                phasedRegistrationNames: {
                    bubbled: "onBeforeInput",
                    captured: "onBeforeInputCapture"
                },
                dependencies: [ "compositionend", "keypress", "textInput", "paste" ]
            },
            compositionEnd: {
                phasedRegistrationNames: {
                    bubbled: "onCompositionEnd",
                    captured: "onCompositionEndCapture"
                },
                dependencies: "blur compositionend keydown keypress keyup mousedown".split(" ")
            },
            compositionStart: {
                phasedRegistrationNames: {
                    bubbled: "onCompositionStart",
                    captured: "onCompositionStartCapture"
                },
                dependencies: "blur compositionstart keydown keypress keyup mousedown".split(" ")
            },
            compositionUpdate: {
                phasedRegistrationNames: {
                    bubbled: "onCompositionUpdate",
                    captured: "onCompositionUpdateCapture"
                },
                dependencies: "blur compositionupdate keydown keypress keyup mousedown".split(" ")
            }
        }, pe = !1;
        function qe(a, b) {
            switch (a) {
              case "keyup":
                return -1 !== ie.indexOf(b.keyCode);

              case "keydown":
                return 229 !== b.keyCode;

              case "keypress":
              case "mousedown":
              case "blur":
                return !0;

              default:
                return !1;
            }
        }
        function re(a) {
            a = a.detail;
            return "object" === typeof a && "data" in a ? a.data : null;
        }
        var se = !1;
        function te(a, b) {
            switch (a) {
              case "compositionend":
                return re(b);

              case "keypress":
                if (32 !== b.which) return null;
                pe = !0;
                return ne;

              case "textInput":
                return a = b.data, a === ne && pe ? null : a;

              default:
                return null;
            }
        }
        function ue(a, b) {
            if (se) return "compositionend" === a || !je && qe(a, b) ? (a = ae(), $d = Zd = Yd = null, 
            se = !1, a) : null;
            switch (a) {
              case "paste":
                return null;

              case "keypress":
                if (!(b.ctrlKey || b.altKey || b.metaKey) || b.ctrlKey && b.altKey) {
                    if (b.char && 1 < b.char.length) return b.char;
                    if (b.which) return String.fromCharCode(b.which);
                }
                return null;

              case "compositionend":
                return me && "ko" !== b.locale ? null : b.data;

              default:
                return null;
            }
        }
        var ve = {
            eventTypes: oe,
            extractEvents: function(a, b, c, d) {
                var e;
                if (je) b: {
                    switch (a) {
                      case "compositionstart":
                        var f = oe.compositionStart;
                        break b;

                      case "compositionend":
                        f = oe.compositionEnd;
                        break b;

                      case "compositionupdate":
                        f = oe.compositionUpdate;
                        break b;
                    }
                    f = void 0;
                } else se ? qe(a, c) && (f = oe.compositionEnd) : "keydown" === a && 229 === c.keyCode && (f = oe.compositionStart);
                f ? (me && "ko" !== c.locale && (se || f !== oe.compositionStart ? f === oe.compositionEnd && se && (e = ae()) : (Yd = d, 
                Zd = "value" in Yd ? Yd.value : Yd.textContent, se = !0)), f = ge.getPooled(f, b, c, d), 
                e ? f.data = e : (e = re(c), null !== e && (f.data = e)), Xd(f), e = f) : e = null;
                (a = le ? te(a, c) : ue(a, c)) ? (b = he.getPooled(oe.beforeInput, b, c, d), b.data = a, 
                Xd(b)) : b = null;
                return null === e ? b : null === b ? e : [ e, b ];
            }
        }, we = {
            color: !0,
            date: !0,
            datetime: !0,
            "datetime-local": !0,
            email: !0,
            month: !0,
            number: !0,
            password: !0,
            range: !0,
            search: !0,
            tel: !0,
            text: !0,
            time: !0,
            url: !0,
            week: !0
        };
        function xe(a) {
            var b = a && a.nodeName && a.nodeName.toLowerCase();
            return "input" === b ? !!we[a.type] : "textarea" === b ? !0 : !1;
        }
        var ye = {
            change: {
                phasedRegistrationNames: {
                    bubbled: "onChange",
                    captured: "onChangeCapture"
                },
                dependencies: "blur change click focus input keydown keyup selectionchange".split(" ")
            }
        };
        function ze(a, b, c) {
            a = G.getPooled(ye.change, a, b, c);
            a.type = "change";
            Da(c);
            Xd(a);
            return a;
        }
        var Ae = null, Be = null;
        function Ce(a) {
            mc(a);
        }
        function De(a) {
            var b = Pd(a);
            if (yb(b)) return a;
        }
        function Ee(a, b) {
            if ("change" === a) return b;
        }
        var Fe = !1;
        ya && (Fe = oc("input") && (!document.documentMode || 9 < document.documentMode));
        function Ge() {
            Ae && (Ae.detachEvent("onpropertychange", He), Be = Ae = null);
        }
        function He(a) {
            if ("value" === a.propertyName && De(Be)) if (a = ze(Be, a, nc(a)), Ja) mc(a); else {
                Ja = !0;
                try {
                    Fa(Ce, a);
                } finally {
                    Ja = !1, La();
                }
            }
        }
        function Ie(a, b, c) {
            "focus" === a ? (Ge(), Ae = b, Be = c, Ae.attachEvent("onpropertychange", He)) : "blur" === a && Ge();
        }
        function Je(a) {
            if ("selectionchange" === a || "keyup" === a || "keydown" === a) return De(Be);
        }
        function Ke(a, b) {
            if ("click" === a) return De(b);
        }
        function Le(a, b) {
            if ("input" === a || "change" === a) return De(b);
        }
        var Me = {
            eventTypes: ye,
            _isInputEventSupported: Fe,
            extractEvents: function(a, b, c, d) {
                var e = b ? Pd(b) : window, f = e.nodeName && e.nodeName.toLowerCase();
                if ("select" === f || "input" === f && "file" === e.type) var g = Ee; else if (xe(e)) if (Fe) g = Le; else {
                    g = Je;
                    var h = Ie;
                } else (f = e.nodeName) && "input" === f.toLowerCase() && ("checkbox" === e.type || "radio" === e.type) && (g = Ke);
                if (g && (g = g(a, b))) return ze(g, c, d);
                h && h(a, e, b);
                "blur" === a && (a = e._wrapperState) && a.controlled && "number" === e.type && Db(e, "number", e.value);
            }
        }, Ne = G.extend({
            view: null,
            detail: null
        }), Oe = {
            Alt: "altKey",
            Control: "ctrlKey",
            Meta: "metaKey",
            Shift: "shiftKey"
        };
        function Pe(a) {
            var b = this.nativeEvent;
            return b.getModifierState ? b.getModifierState(a) : (a = Oe[a]) ? !!b[a] : !1;
        }
        function Qe() {
            return Pe;
        }
        var Re = 0, Se = 0, Te = !1, Ue = !1, Ve = Ne.extend({
            screenX: null,
            screenY: null,
            clientX: null,
            clientY: null,
            pageX: null,
            pageY: null,
            ctrlKey: null,
            shiftKey: null,
            altKey: null,
            metaKey: null,
            getModifierState: Qe,
            button: null,
            buttons: null,
            relatedTarget: function(a) {
                return a.relatedTarget || (a.fromElement === a.srcElement ? a.toElement : a.fromElement);
            },
            movementX: function(a) {
                if ("movementX" in a) return a.movementX;
                var b = Re;
                Re = a.screenX;
                return Te ? "mousemove" === a.type ? a.screenX - b : 0 : (Te = !0, 0);
            },
            movementY: function(a) {
                if ("movementY" in a) return a.movementY;
                var b = Se;
                Se = a.screenY;
                return Ue ? "mousemove" === a.type ? a.screenY - b : 0 : (Ue = !0, 0);
            }
        }), We = Ve.extend({
            pointerId: null,
            width: null,
            height: null,
            pressure: null,
            tangentialPressure: null,
            tiltX: null,
            tiltY: null,
            twist: null,
            pointerType: null,
            isPrimary: null
        }), Xe = {
            mouseEnter: {
                registrationName: "onMouseEnter",
                dependencies: [ "mouseout", "mouseover" ]
            },
            mouseLeave: {
                registrationName: "onMouseLeave",
                dependencies: [ "mouseout", "mouseover" ]
            },
            pointerEnter: {
                registrationName: "onPointerEnter",
                dependencies: [ "pointerout", "pointerover" ]
            },
            pointerLeave: {
                registrationName: "onPointerLeave",
                dependencies: [ "pointerout", "pointerover" ]
            }
        }, Ye = {
            eventTypes: Xe,
            extractEvents: function(a, b, c, d, e) {
                var f = "mouseover" === a || "pointerover" === a, g = "mouseout" === a || "pointerout" === a;
                if (f && 0 === (e & 32) && (c.relatedTarget || c.fromElement) || !g && !f) return null;
                f = d.window === d ? d : (f = d.ownerDocument) ? f.defaultView || f.parentWindow : window;
                if (g) {
                    if (g = b, b = (b = c.relatedTarget || c.toElement) ? tc(b) : null, null !== b) {
                        var h = dc(b);
                        if (b !== h || 5 !== b.tag && 6 !== b.tag) b = null;
                    }
                } else g = null;
                if (g === b) return null;
                if ("mouseout" === a || "mouseover" === a) {
                    var k = Ve;
                    var l = Xe.mouseLeave;
                    var m = Xe.mouseEnter;
                    var p = "mouse";
                } else if ("pointerout" === a || "pointerover" === a) k = We, l = Xe.pointerLeave, 
                m = Xe.pointerEnter, p = "pointer";
                a = null == g ? f : Pd(g);
                f = null == b ? f : Pd(b);
                l = k.getPooled(l, g, c, d);
                l.type = p + "leave";
                l.target = a;
                l.relatedTarget = f;
                c = k.getPooled(m, b, c, d);
                c.type = p + "enter";
                c.target = f;
                c.relatedTarget = a;
                d = g;
                p = b;
                if (d && p) a: {
                    k = d;
                    m = p;
                    g = 0;
                    for (a = k; a; a = Rd(a)) g++;
                    a = 0;
                    for (b = m; b; b = Rd(b)) a++;
                    for (;0 < g - a; ) k = Rd(k), g--;
                    for (;0 < a - g; ) m = Rd(m), a--;
                    for (;g--; ) {
                        if (k === m || k === m.alternate) break a;
                        k = Rd(k);
                        m = Rd(m);
                    }
                    k = null;
                } else k = null;
                m = k;
                for (k = []; d && d !== m; ) {
                    g = d.alternate;
                    if (null !== g && g === m) break;
                    k.push(d);
                    d = Rd(d);
                }
                for (d = []; p && p !== m; ) {
                    g = p.alternate;
                    if (null !== g && g === m) break;
                    d.push(p);
                    p = Rd(p);
                }
                for (p = 0; p < k.length; p++) Vd(k[p], "bubbled", l);
                for (p = d.length; 0 < p--; ) Vd(d[p], "captured", c);
                return 0 === (e & 64) ? [ l ] : [ l, c ];
            }
        };
        function Ze(a, b) {
            return a === b && (0 !== a || 1 / a === 1 / b) || a !== a && b !== b;
        }
        var $e = "function" === typeof Object.is ? Object.is : Ze, af = Object.prototype.hasOwnProperty;
        function bf(a, b) {
            if ($e(a, b)) return !0;
            if ("object" !== typeof a || null === a || "object" !== typeof b || null === b) return !1;
            var c = Object.keys(a), d = Object.keys(b);
            if (c.length !== d.length) return !1;
            for (d = 0; d < c.length; d++) if (!af.call(b, c[d]) || !$e(a[c[d]], b[c[d]])) return !1;
            return !0;
        }
        var cf = ya && "documentMode" in document && 11 >= document.documentMode, df = {
            select: {
                phasedRegistrationNames: {
                    bubbled: "onSelect",
                    captured: "onSelectCapture"
                },
                dependencies: "blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")
            }
        }, ef = null, ff = null, gf = null, hf = !1;
        function jf(a, b) {
            var c = b.window === b ? b.document : 9 === b.nodeType ? b : b.ownerDocument;
            if (hf || null == ef || ef !== td(c)) return null;
            c = ef;
            "selectionStart" in c && yd(c) ? c = {
                start: c.selectionStart,
                end: c.selectionEnd
            } : (c = (c.ownerDocument && c.ownerDocument.defaultView || window).getSelection(), 
            c = {
                anchorNode: c.anchorNode,
                anchorOffset: c.anchorOffset,
                focusNode: c.focusNode,
                focusOffset: c.focusOffset
            });
            return gf && bf(gf, c) ? null : (gf = c, a = G.getPooled(df.select, ff, a, b), a.type = "select", 
            a.target = ef, Xd(a), a);
        }
        var kf = {
            eventTypes: df,
            extractEvents: function(a, b, c, d, e, f) {
                e = f || (d.window === d ? d.document : 9 === d.nodeType ? d : d.ownerDocument);
                if (!(f = !e)) {
                    a: {
                        e = cc(e);
                        f = wa.onSelect;
                        for (var g = 0; g < f.length; g++) if (!e.has(f[g])) {
                            e = !1;
                            break a;
                        }
                        e = !0;
                    }
                    f = !e;
                }
                if (f) return null;
                e = b ? Pd(b) : window;
                switch (a) {
                  case "focus":
                    if (xe(e) || "true" === e.contentEditable) ef = e, ff = b, gf = null;
                    break;

                  case "blur":
                    gf = ff = ef = null;
                    break;

                  case "mousedown":
                    hf = !0;
                    break;

                  case "contextmenu":
                  case "mouseup":
                  case "dragend":
                    return hf = !1, jf(c, d);

                  case "selectionchange":
                    if (cf) break;

                  case "keydown":
                  case "keyup":
                    return jf(c, d);
                }
                return null;
            }
        }, lf = G.extend({
            animationName: null,
            elapsedTime: null,
            pseudoElement: null
        }), mf = G.extend({
            clipboardData: function(a) {
                return "clipboardData" in a ? a.clipboardData : window.clipboardData;
            }
        }), nf = Ne.extend({
            relatedTarget: null
        });
        function of(a) {
            var b = a.keyCode;
            "charCode" in a ? (a = a.charCode, 0 === a && 13 === b && (a = 13)) : a = b;
            10 === a && (a = 13);
            return 32 <= a || 13 === a ? a : 0;
        }
        var pf = {
            Esc: "Escape",
            Spacebar: " ",
            Left: "ArrowLeft",
            Up: "ArrowUp",
            Right: "ArrowRight",
            Down: "ArrowDown",
            Del: "Delete",
            Win: "OS",
            Menu: "ContextMenu",
            Apps: "ContextMenu",
            Scroll: "ScrollLock",
            MozPrintableKey: "Unidentified"
        }, qf = {
            8: "Backspace",
            9: "Tab",
            12: "Clear",
            13: "Enter",
            16: "Shift",
            17: "Control",
            18: "Alt",
            19: "Pause",
            20: "CapsLock",
            27: "Escape",
            32: " ",
            33: "PageUp",
            34: "PageDown",
            35: "End",
            36: "Home",
            37: "ArrowLeft",
            38: "ArrowUp",
            39: "ArrowRight",
            40: "ArrowDown",
            45: "Insert",
            46: "Delete",
            112: "F1",
            113: "F2",
            114: "F3",
            115: "F4",
            116: "F5",
            117: "F6",
            118: "F7",
            119: "F8",
            120: "F9",
            121: "F10",
            122: "F11",
            123: "F12",
            144: "NumLock",
            145: "ScrollLock",
            224: "Meta"
        }, rf = Ne.extend({
            key: function(a) {
                if (a.key) {
                    var b = pf[a.key] || a.key;
                    if ("Unidentified" !== b) return b;
                }
                return "keypress" === a.type ? (a = of(a), 13 === a ? "Enter" : String.fromCharCode(a)) : "keydown" === a.type || "keyup" === a.type ? qf[a.keyCode] || "Unidentified" : "";
            },
            location: null,
            ctrlKey: null,
            shiftKey: null,
            altKey: null,
            metaKey: null,
            repeat: null,
            locale: null,
            getModifierState: Qe,
            charCode: function(a) {
                return "keypress" === a.type ? of(a) : 0;
            },
            keyCode: function(a) {
                return "keydown" === a.type || "keyup" === a.type ? a.keyCode : 0;
            },
            which: function(a) {
                return "keypress" === a.type ? of(a) : "keydown" === a.type || "keyup" === a.type ? a.keyCode : 0;
            }
        }), sf = Ve.extend({
            dataTransfer: null
        }), tf = Ne.extend({
            touches: null,
            targetTouches: null,
            changedTouches: null,
            altKey: null,
            metaKey: null,
            ctrlKey: null,
            shiftKey: null,
            getModifierState: Qe
        }), uf = G.extend({
            propertyName: null,
            elapsedTime: null,
            pseudoElement: null
        }), vf = Ve.extend({
            deltaX: function(a) {
                return "deltaX" in a ? a.deltaX : "wheelDeltaX" in a ? -a.wheelDeltaX : 0;
            },
            deltaY: function(a) {
                return "deltaY" in a ? a.deltaY : "wheelDeltaY" in a ? -a.wheelDeltaY : "wheelDelta" in a ? -a.wheelDelta : 0;
            },
            deltaZ: null,
            deltaMode: null
        }), wf = {
            eventTypes: Wc,
            extractEvents: function(a, b, c, d) {
                var e = Yc.get(a);
                if (!e) return null;
                switch (a) {
                  case "keypress":
                    if (0 === of(c)) return null;

                  case "keydown":
                  case "keyup":
                    a = rf;
                    break;

                  case "blur":
                  case "focus":
                    a = nf;
                    break;

                  case "click":
                    if (2 === c.button) return null;

                  case "auxclick":
                  case "dblclick":
                  case "mousedown":
                  case "mousemove":
                  case "mouseup":
                  case "mouseout":
                  case "mouseover":
                  case "contextmenu":
                    a = Ve;
                    break;

                  case "drag":
                  case "dragend":
                  case "dragenter":
                  case "dragexit":
                  case "dragleave":
                  case "dragover":
                  case "dragstart":
                  case "drop":
                    a = sf;
                    break;

                  case "touchcancel":
                  case "touchend":
                  case "touchmove":
                  case "touchstart":
                    a = tf;
                    break;

                  case Xb:
                  case Yb:
                  case Zb:
                    a = lf;
                    break;

                  case $b:
                    a = uf;
                    break;

                  case "scroll":
                    a = Ne;
                    break;

                  case "wheel":
                    a = vf;
                    break;

                  case "copy":
                  case "cut":
                  case "paste":
                    a = mf;
                    break;

                  case "gotpointercapture":
                  case "lostpointercapture":
                  case "pointercancel":
                  case "pointerdown":
                  case "pointermove":
                  case "pointerout":
                  case "pointerover":
                  case "pointerup":
                    a = We;
                    break;

                  default:
                    a = G;
                }
                b = a.getPooled(e, b, c, d);
                Xd(b);
                return b;
            }
        };
        if (pa) throw Error(u(101));
        pa = Array.prototype.slice.call("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" "));
        ra();
        var xf = Nc;
        la = Qd;
        ma = xf;
        na = Pd;
        xa({
            SimpleEventPlugin: wf,
            EnterLeaveEventPlugin: Ye,
            ChangeEventPlugin: Me,
            SelectEventPlugin: kf,
            BeforeInputEventPlugin: ve
        });
        var yf = [], zf = -1;
        function H(a) {
            0 > zf || (a.current = yf[zf], yf[zf] = null, zf--);
        }
        function I(a, b) {
            zf++;
            yf[zf] = a.current;
            a.current = b;
        }
        var Af = {}, J = {
            current: Af
        }, K = {
            current: !1
        }, Bf = Af;
        function Cf(a, b) {
            var c = a.type.contextTypes;
            if (!c) return Af;
            var d = a.stateNode;
            if (d && d.__reactInternalMemoizedUnmaskedChildContext === b) return d.__reactInternalMemoizedMaskedChildContext;
            var e = {}, f;
            for (f in c) e[f] = b[f];
            d && (a = a.stateNode, a.__reactInternalMemoizedUnmaskedChildContext = b, a.__reactInternalMemoizedMaskedChildContext = e);
            return e;
        }
        function L(a) {
            a = a.childContextTypes;
            return null !== a && void 0 !== a;
        }
        function Df() {
            H(K);
            H(J);
        }
        function Ef(a, b, c) {
            if (J.current !== Af) throw Error(u(168));
            I(J, b);
            I(K, c);
        }
        function Ff(a, b, c) {
            var d = a.stateNode;
            a = b.childContextTypes;
            if ("function" !== typeof d.getChildContext) return c;
            d = d.getChildContext();
            for (var e in d) if (!(e in a)) throw Error(u(108, pb(b) || "Unknown", e));
            return n({}, c, {}, d);
        }
        function Gf(a) {
            a = (a = a.stateNode) && a.__reactInternalMemoizedMergedChildContext || Af;
            Bf = J.current;
            I(J, a);
            I(K, K.current);
            return !0;
        }
        function Hf(a, b, c) {
            var d = a.stateNode;
            if (!d) throw Error(u(169));
            c ? (a = Ff(a, b, Bf), d.__reactInternalMemoizedMergedChildContext = a, H(K), H(J), 
            I(J, a)) : H(K);
            I(K, c);
        }
        var If = r.unstable_runWithPriority, Jf = r.unstable_scheduleCallback, Kf = r.unstable_cancelCallback, Lf = r.unstable_requestPaint, Mf = r.unstable_now, Nf = r.unstable_getCurrentPriorityLevel, Of = r.unstable_ImmediatePriority, Pf = r.unstable_UserBlockingPriority, Qf = r.unstable_NormalPriority, Rf = r.unstable_LowPriority, Sf = r.unstable_IdlePriority, Tf = {}, Uf = r.unstable_shouldYield, Vf = void 0 !== Lf ? Lf : function() {}, Wf = null, Xf = null, Yf = !1, Zf = Mf(), $f = 1e4 > Zf ? Mf : function() {
            return Mf() - Zf;
        };
        function ag() {
            switch (Nf()) {
              case Of:
                return 99;

              case Pf:
                return 98;

              case Qf:
                return 97;

              case Rf:
                return 96;

              case Sf:
                return 95;

              default:
                throw Error(u(332));
            }
        }
        function bg(a) {
            switch (a) {
              case 99:
                return Of;

              case 98:
                return Pf;

              case 97:
                return Qf;

              case 96:
                return Rf;

              case 95:
                return Sf;

              default:
                throw Error(u(332));
            }
        }
        function cg(a, b) {
            a = bg(a);
            return If(a, b);
        }
        function dg(a, b, c) {
            a = bg(a);
            return Jf(a, b, c);
        }
        function eg(a) {
            null === Wf ? (Wf = [ a ], Xf = Jf(Of, fg)) : Wf.push(a);
            return Tf;
        }
        function gg() {
            if (null !== Xf) {
                var a = Xf;
                Xf = null;
                Kf(a);
            }
            fg();
        }
        function fg() {
            if (!Yf && null !== Wf) {
                Yf = !0;
                var a = 0;
                try {
                    var b = Wf;
                    cg(99, (function() {
                        for (;a < b.length; a++) {
                            var c = b[a];
                            do {
                                c = c(!0);
                            } while (null !== c);
                        }
                    }));
                    Wf = null;
                } catch (c) {
                    throw null !== Wf && (Wf = Wf.slice(a + 1)), Jf(Of, gg), c;
                } finally {
                    Yf = !1;
                }
            }
        }
        function hg(a, b, c) {
            c /= 10;
            return 1073741821 - (((1073741821 - a + b / 10) / c | 0) + 1) * c;
        }
        function ig(a, b) {
            if (a && a.defaultProps) {
                b = n({}, b);
                a = a.defaultProps;
                for (var c in a) void 0 === b[c] && (b[c] = a[c]);
            }
            return b;
        }
        var jg = {
            current: null
        }, kg = null, lg = null, mg = null;
        function ng() {
            mg = lg = kg = null;
        }
        function og(a) {
            var b = jg.current;
            H(jg);
            a.type._context._currentValue = b;
        }
        function pg(a, b) {
            for (;null !== a; ) {
                var c = a.alternate;
                if (a.childExpirationTime < b) a.childExpirationTime = b, null !== c && c.childExpirationTime < b && (c.childExpirationTime = b); else if (null !== c && c.childExpirationTime < b) c.childExpirationTime = b; else break;
                a = a.return;
            }
        }
        function qg(a, b) {
            kg = a;
            mg = lg = null;
            a = a.dependencies;
            null !== a && null !== a.firstContext && (a.expirationTime >= b && (rg = !0), a.firstContext = null);
        }
        function sg(a, b) {
            if (mg !== a && !1 !== b && 0 !== b) {
                if ("number" !== typeof b || 1073741823 === b) mg = a, b = 1073741823;
                b = {
                    context: a,
                    observedBits: b,
                    next: null
                };
                if (null === lg) {
                    if (null === kg) throw Error(u(308));
                    lg = b;
                    kg.dependencies = {
                        expirationTime: 0,
                        firstContext: b,
                        responders: null
                    };
                } else lg = lg.next = b;
            }
            return a._currentValue;
        }
        var tg = !1;
        function ug(a) {
            a.updateQueue = {
                baseState: a.memoizedState,
                baseQueue: null,
                shared: {
                    pending: null
                },
                effects: null
            };
        }
        function vg(a, b) {
            a = a.updateQueue;
            b.updateQueue === a && (b.updateQueue = {
                baseState: a.baseState,
                baseQueue: a.baseQueue,
                shared: a.shared,
                effects: a.effects
            });
        }
        function wg(a, b) {
            a = {
                expirationTime: a,
                suspenseConfig: b,
                tag: 0,
                payload: null,
                callback: null,
                next: null
            };
            return a.next = a;
        }
        function xg(a, b) {
            a = a.updateQueue;
            if (null !== a) {
                a = a.shared;
                var c = a.pending;
                null === c ? b.next = b : (b.next = c.next, c.next = b);
                a.pending = b;
            }
        }
        function yg(a, b) {
            var c = a.alternate;
            null !== c && vg(c, a);
            a = a.updateQueue;
            c = a.baseQueue;
            null === c ? (a.baseQueue = b.next = b, b.next = b) : (b.next = c.next, c.next = b);
        }
        function zg(a, b, c, d) {
            var e = a.updateQueue;
            tg = !1;
            var f = e.baseQueue, g = e.shared.pending;
            if (null !== g) {
                if (null !== f) {
                    var h = f.next;
                    f.next = g.next;
                    g.next = h;
                }
                f = g;
                e.shared.pending = null;
                h = a.alternate;
                null !== h && (h = h.updateQueue, null !== h && (h.baseQueue = g));
            }
            if (null !== f) {
                h = f.next;
                var k = e.baseState, l = 0, m = null, p = null, x = null;
                if (null !== h) {
                    var z = h;
                    do {
                        g = z.expirationTime;
                        if (g < d) {
                            var ca = {
                                expirationTime: z.expirationTime,
                                suspenseConfig: z.suspenseConfig,
                                tag: z.tag,
                                payload: z.payload,
                                callback: z.callback,
                                next: null
                            };
                            null === x ? (p = x = ca, m = k) : x = x.next = ca;
                            g > l && (l = g);
                        } else {
                            null !== x && (x = x.next = {
                                expirationTime: 1073741823,
                                suspenseConfig: z.suspenseConfig,
                                tag: z.tag,
                                payload: z.payload,
                                callback: z.callback,
                                next: null
                            });
                            Ag(g, z.suspenseConfig);
                            a: {
                                var D = a, t = z;
                                g = b;
                                ca = c;
                                switch (t.tag) {
                                  case 1:
                                    D = t.payload;
                                    if ("function" === typeof D) {
                                        k = D.call(ca, k, g);
                                        break a;
                                    }
                                    k = D;
                                    break a;

                                  case 3:
                                    D.effectTag = D.effectTag & -4097 | 64;

                                  case 0:
                                    D = t.payload;
                                    g = "function" === typeof D ? D.call(ca, k, g) : D;
                                    if (null === g || void 0 === g) break a;
                                    k = n({}, k, g);
                                    break a;

                                  case 2:
                                    tg = !0;
                                }
                            }
                            null !== z.callback && (a.effectTag |= 32, g = e.effects, null === g ? e.effects = [ z ] : g.push(z));
                        }
                        z = z.next;
                        if (null === z || z === h) if (g = e.shared.pending, null === g) break; else z = f.next = g.next, 
                        g.next = h, e.baseQueue = f = g, e.shared.pending = null;
                    } while (1);
                }
                null === x ? m = k : x.next = p;
                e.baseState = m;
                e.baseQueue = x;
                Bg(l);
                a.expirationTime = l;
                a.memoizedState = k;
            }
        }
        function Cg(a, b, c) {
            a = b.effects;
            b.effects = null;
            if (null !== a) for (b = 0; b < a.length; b++) {
                var d = a[b], e = d.callback;
                if (null !== e) {
                    d.callback = null;
                    d = e;
                    e = c;
                    if ("function" !== typeof d) throw Error(u(191, d));
                    d.call(e);
                }
            }
        }
        var Dg = Wa.ReactCurrentBatchConfig, Eg = (new aa.Component).refs;
        function Fg(a, b, c, d) {
            b = a.memoizedState;
            c = c(d, b);
            c = null === c || void 0 === c ? b : n({}, b, c);
            a.memoizedState = c;
            0 === a.expirationTime && (a.updateQueue.baseState = c);
        }
        var Jg = {
            isMounted: function(a) {
                return (a = a._reactInternalFiber) ? dc(a) === a : !1;
            },
            enqueueSetState: function(a, b, c) {
                a = a._reactInternalFiber;
                var d = Gg(), e = Dg.suspense;
                d = Hg(d, a, e);
                e = wg(d, e);
                e.payload = b;
                void 0 !== c && null !== c && (e.callback = c);
                xg(a, e);
                Ig(a, d);
            },
            enqueueReplaceState: function(a, b, c) {
                a = a._reactInternalFiber;
                var d = Gg(), e = Dg.suspense;
                d = Hg(d, a, e);
                e = wg(d, e);
                e.tag = 1;
                e.payload = b;
                void 0 !== c && null !== c && (e.callback = c);
                xg(a, e);
                Ig(a, d);
            },
            enqueueForceUpdate: function(a, b) {
                a = a._reactInternalFiber;
                var c = Gg(), d = Dg.suspense;
                c = Hg(c, a, d);
                d = wg(c, d);
                d.tag = 2;
                void 0 !== b && null !== b && (d.callback = b);
                xg(a, d);
                Ig(a, c);
            }
        };
        function Kg(a, b, c, d, e, f, g) {
            a = a.stateNode;
            return "function" === typeof a.shouldComponentUpdate ? a.shouldComponentUpdate(d, f, g) : b.prototype && b.prototype.isPureReactComponent ? !bf(c, d) || !bf(e, f) : !0;
        }
        function Lg(a, b, c) {
            var d = !1, e = Af;
            var f = b.contextType;
            "object" === typeof f && null !== f ? f = sg(f) : (e = L(b) ? Bf : J.current, d = b.contextTypes, 
            f = (d = null !== d && void 0 !== d) ? Cf(a, e) : Af);
            b = new b(c, f);
            a.memoizedState = null !== b.state && void 0 !== b.state ? b.state : null;
            b.updater = Jg;
            a.stateNode = b;
            b._reactInternalFiber = a;
            d && (a = a.stateNode, a.__reactInternalMemoizedUnmaskedChildContext = e, a.__reactInternalMemoizedMaskedChildContext = f);
            return b;
        }
        function Mg(a, b, c, d) {
            a = b.state;
            "function" === typeof b.componentWillReceiveProps && b.componentWillReceiveProps(c, d);
            "function" === typeof b.UNSAFE_componentWillReceiveProps && b.UNSAFE_componentWillReceiveProps(c, d);
            b.state !== a && Jg.enqueueReplaceState(b, b.state, null);
        }
        function Ng(a, b, c, d) {
            var e = a.stateNode;
            e.props = c;
            e.state = a.memoizedState;
            e.refs = Eg;
            ug(a);
            var f = b.contextType;
            "object" === typeof f && null !== f ? e.context = sg(f) : (f = L(b) ? Bf : J.current, 
            e.context = Cf(a, f));
            zg(a, c, e, d);
            e.state = a.memoizedState;
            f = b.getDerivedStateFromProps;
            "function" === typeof f && (Fg(a, b, f, c), e.state = a.memoizedState);
            "function" === typeof b.getDerivedStateFromProps || "function" === typeof e.getSnapshotBeforeUpdate || "function" !== typeof e.UNSAFE_componentWillMount && "function" !== typeof e.componentWillMount || (b = e.state, 
            "function" === typeof e.componentWillMount && e.componentWillMount(), "function" === typeof e.UNSAFE_componentWillMount && e.UNSAFE_componentWillMount(), 
            b !== e.state && Jg.enqueueReplaceState(e, e.state, null), zg(a, c, e, d), e.state = a.memoizedState);
            "function" === typeof e.componentDidMount && (a.effectTag |= 4);
        }
        var Og = Array.isArray;
        function Pg(a, b, c) {
            a = c.ref;
            if (null !== a && "function" !== typeof a && "object" !== typeof a) {
                if (c._owner) {
                    c = c._owner;
                    if (c) {
                        if (1 !== c.tag) throw Error(u(309));
                        var d = c.stateNode;
                    }
                    if (!d) throw Error(u(147, a));
                    var e = "" + a;
                    if (null !== b && null !== b.ref && "function" === typeof b.ref && b.ref._stringRef === e) return b.ref;
                    b = function(a) {
                        var b = d.refs;
                        b === Eg && (b = d.refs = {});
                        null === a ? delete b[e] : b[e] = a;
                    };
                    b._stringRef = e;
                    return b;
                }
                if ("string" !== typeof a) throw Error(u(284));
                if (!c._owner) throw Error(u(290, a));
            }
            return a;
        }
        function Qg(a, b) {
            if ("textarea" !== a.type) throw Error(u(31, "[object Object]" === Object.prototype.toString.call(b) ? "object with keys {" + Object.keys(b).join(", ") + "}" : b, ""));
        }
        function Rg(a) {
            function b(b, c) {
                if (a) {
                    var d = b.lastEffect;
                    null !== d ? (d.nextEffect = c, b.lastEffect = c) : b.firstEffect = b.lastEffect = c;
                    c.nextEffect = null;
                    c.effectTag = 8;
                }
            }
            function c(c, d) {
                if (!a) return null;
                for (;null !== d; ) b(c, d), d = d.sibling;
                return null;
            }
            function d(a, b) {
                for (a = new Map; null !== b; ) null !== b.key ? a.set(b.key, b) : a.set(b.index, b), 
                b = b.sibling;
                return a;
            }
            function e(a, b) {
                a = Sg(a, b);
                a.index = 0;
                a.sibling = null;
                return a;
            }
            function f(b, c, d) {
                b.index = d;
                if (!a) return c;
                d = b.alternate;
                if (null !== d) return d = d.index, d < c ? (b.effectTag = 2, c) : d;
                b.effectTag = 2;
                return c;
            }
            function g(b) {
                a && null === b.alternate && (b.effectTag = 2);
                return b;
            }
            function h(a, b, c, d) {
                if (null === b || 6 !== b.tag) return b = Tg(c, a.mode, d), b.return = a, b;
                b = e(b, c);
                b.return = a;
                return b;
            }
            function k(a, b, c, d) {
                if (null !== b && b.elementType === c.type) return d = e(b, c.props), d.ref = Pg(a, b, c), 
                d.return = a, d;
                d = Ug(c.type, c.key, c.props, null, a.mode, d);
                d.ref = Pg(a, b, c);
                d.return = a;
                return d;
            }
            function l(a, b, c, d) {
                if (null === b || 4 !== b.tag || b.stateNode.containerInfo !== c.containerInfo || b.stateNode.implementation !== c.implementation) return b = Vg(c, a.mode, d), 
                b.return = a, b;
                b = e(b, c.children || []);
                b.return = a;
                return b;
            }
            function m(a, b, c, d, f) {
                if (null === b || 7 !== b.tag) return b = Wg(c, a.mode, d, f), b.return = a, b;
                b = e(b, c);
                b.return = a;
                return b;
            }
            function p(a, b, c) {
                if ("string" === typeof b || "number" === typeof b) return b = Tg("" + b, a.mode, c), 
                b.return = a, b;
                if ("object" === typeof b && null !== b) {
                    switch (b.$$typeof) {
                      case Za:
                        return c = Ug(b.type, b.key, b.props, null, a.mode, c), c.ref = Pg(a, null, b), 
                        c.return = a, c;

                      case $a:
                        return b = Vg(b, a.mode, c), b.return = a, b;
                    }
                    if (Og(b) || nb(b)) return b = Wg(b, a.mode, c, null), b.return = a, b;
                    Qg(a, b);
                }
                return null;
            }
            function x(a, b, c, d) {
                var e = null !== b ? b.key : null;
                if ("string" === typeof c || "number" === typeof c) return null !== e ? null : h(a, b, "" + c, d);
                if ("object" === typeof c && null !== c) {
                    switch (c.$$typeof) {
                      case Za:
                        return c.key === e ? c.type === ab ? m(a, b, c.props.children, d, e) : k(a, b, c, d) : null;

                      case $a:
                        return c.key === e ? l(a, b, c, d) : null;
                    }
                    if (Og(c) || nb(c)) return null !== e ? null : m(a, b, c, d, null);
                    Qg(a, c);
                }
                return null;
            }
            function z(a, b, c, d, e) {
                if ("string" === typeof d || "number" === typeof d) return a = a.get(c) || null, 
                h(b, a, "" + d, e);
                if ("object" === typeof d && null !== d) {
                    switch (d.$$typeof) {
                      case Za:
                        return a = a.get(null === d.key ? c : d.key) || null, d.type === ab ? m(b, a, d.props.children, e, d.key) : k(b, a, d, e);

                      case $a:
                        return a = a.get(null === d.key ? c : d.key) || null, l(b, a, d, e);
                    }
                    if (Og(d) || nb(d)) return a = a.get(c) || null, m(b, a, d, e, null);
                    Qg(b, d);
                }
                return null;
            }
            function ca(e, g, h, k) {
                for (var l = null, t = null, m = g, y = g = 0, A = null; null !== m && y < h.length; y++) {
                    m.index > y ? (A = m, m = null) : A = m.sibling;
                    var q = x(e, m, h[y], k);
                    if (null === q) {
                        null === m && (m = A);
                        break;
                    }
                    a && m && null === q.alternate && b(e, m);
                    g = f(q, g, y);
                    null === t ? l = q : t.sibling = q;
                    t = q;
                    m = A;
                }
                if (y === h.length) return c(e, m), l;
                if (null === m) {
                    for (;y < h.length; y++) m = p(e, h[y], k), null !== m && (g = f(m, g, y), null === t ? l = m : t.sibling = m, 
                    t = m);
                    return l;
                }
                for (m = d(e, m); y < h.length; y++) A = z(m, e, y, h[y], k), null !== A && (a && null !== A.alternate && m.delete(null === A.key ? y : A.key), 
                g = f(A, g, y), null === t ? l = A : t.sibling = A, t = A);
                a && m.forEach((function(a) {
                    return b(e, a);
                }));
                return l;
            }
            function D(e, g, h, l) {
                var k = nb(h);
                if ("function" !== typeof k) throw Error(u(150));
                h = k.call(h);
                if (null == h) throw Error(u(151));
                for (var m = k = null, t = g, y = g = 0, A = null, q = h.next(); null !== t && !q.done; y++, 
                q = h.next()) {
                    t.index > y ? (A = t, t = null) : A = t.sibling;
                    var D = x(e, t, q.value, l);
                    if (null === D) {
                        null === t && (t = A);
                        break;
                    }
                    a && t && null === D.alternate && b(e, t);
                    g = f(D, g, y);
                    null === m ? k = D : m.sibling = D;
                    m = D;
                    t = A;
                }
                if (q.done) return c(e, t), k;
                if (null === t) {
                    for (;!q.done; y++, q = h.next()) q = p(e, q.value, l), null !== q && (g = f(q, g, y), 
                    null === m ? k = q : m.sibling = q, m = q);
                    return k;
                }
                for (t = d(e, t); !q.done; y++, q = h.next()) q = z(t, e, y, q.value, l), null !== q && (a && null !== q.alternate && t.delete(null === q.key ? y : q.key), 
                g = f(q, g, y), null === m ? k = q : m.sibling = q, m = q);
                a && t.forEach((function(a) {
                    return b(e, a);
                }));
                return k;
            }
            return function(a, d, f, h) {
                var k = "object" === typeof f && null !== f && f.type === ab && null === f.key;
                k && (f = f.props.children);
                var l = "object" === typeof f && null !== f;
                if (l) switch (f.$$typeof) {
                  case Za:
                    a: {
                        l = f.key;
                        for (k = d; null !== k; ) {
                            if (k.key === l) {
                                switch (k.tag) {
                                  case 7:
                                    if (f.type === ab) {
                                        c(a, k.sibling);
                                        d = e(k, f.props.children);
                                        d.return = a;
                                        a = d;
                                        break a;
                                    }
                                    break;

                                  default:
                                    if (k.elementType === f.type) {
                                        c(a, k.sibling);
                                        d = e(k, f.props);
                                        d.ref = Pg(a, k, f);
                                        d.return = a;
                                        a = d;
                                        break a;
                                    }
                                }
                                c(a, k);
                                break;
                            } else b(a, k);
                            k = k.sibling;
                        }
                        f.type === ab ? (d = Wg(f.props.children, a.mode, h, f.key), d.return = a, a = d) : (h = Ug(f.type, f.key, f.props, null, a.mode, h), 
                        h.ref = Pg(a, d, f), h.return = a, a = h);
                    }
                    return g(a);

                  case $a:
                    a: {
                        for (k = f.key; null !== d; ) {
                            if (d.key === k) if (4 === d.tag && d.stateNode.containerInfo === f.containerInfo && d.stateNode.implementation === f.implementation) {
                                c(a, d.sibling);
                                d = e(d, f.children || []);
                                d.return = a;
                                a = d;
                                break a;
                            } else {
                                c(a, d);
                                break;
                            } else b(a, d);
                            d = d.sibling;
                        }
                        d = Vg(f, a.mode, h);
                        d.return = a;
                        a = d;
                    }
                    return g(a);
                }
                if ("string" === typeof f || "number" === typeof f) return f = "" + f, null !== d && 6 === d.tag ? (c(a, d.sibling), 
                d = e(d, f), d.return = a, a = d) : (c(a, d), d = Tg(f, a.mode, h), d.return = a, 
                a = d), g(a);
                if (Og(f)) return ca(a, d, f, h);
                if (nb(f)) return D(a, d, f, h);
                l && Qg(a, f);
                if ("undefined" === typeof f && !k) switch (a.tag) {
                  case 1:
                  case 0:
                    throw a = a.type, Error(u(152, a.displayName || a.name || "Component"));
                }
                return c(a, d);
            };
        }
        var Xg = Rg(!0), Yg = Rg(!1), Zg = {}, $g = {
            current: Zg
        }, ah = {
            current: Zg
        }, bh = {
            current: Zg
        };
        function ch(a) {
            if (a === Zg) throw Error(u(174));
            return a;
        }
        function dh(a, b) {
            I(bh, b);
            I(ah, a);
            I($g, Zg);
            a = b.nodeType;
            switch (a) {
              case 9:
              case 11:
                b = (b = b.documentElement) ? b.namespaceURI : Ob(null, "");
                break;

              default:
                a = 8 === a ? b.parentNode : b, b = a.namespaceURI || null, a = a.tagName, b = Ob(b, a);
            }
            H($g);
            I($g, b);
        }
        function eh() {
            H($g);
            H(ah);
            H(bh);
        }
        function fh(a) {
            ch(bh.current);
            var b = ch($g.current);
            var c = Ob(b, a.type);
            b !== c && (I(ah, a), I($g, c));
        }
        function gh(a) {
            ah.current === a && (H($g), H(ah));
        }
        var M = {
            current: 0
        };
        function hh(a) {
            for (var b = a; null !== b; ) {
                if (13 === b.tag) {
                    var c = b.memoizedState;
                    if (null !== c && (c = c.dehydrated, null === c || c.data === Bd || c.data === Cd)) return b;
                } else if (19 === b.tag && void 0 !== b.memoizedProps.revealOrder) {
                    if (0 !== (b.effectTag & 64)) return b;
                } else if (null !== b.child) {
                    b.child.return = b;
                    b = b.child;
                    continue;
                }
                if (b === a) break;
                for (;null === b.sibling; ) {
                    if (null === b.return || b.return === a) return null;
                    b = b.return;
                }
                b.sibling.return = b.return;
                b = b.sibling;
            }
            return null;
        }
        function ih(a, b) {
            return {
                responder: a,
                props: b
            };
        }
        var jh = Wa.ReactCurrentDispatcher, kh = Wa.ReactCurrentBatchConfig, lh = 0, N = null, O = null, P = null, mh = !1;
        function Q() {
            throw Error(u(321));
        }
        function nh(a, b) {
            if (null === b) return !1;
            for (var c = 0; c < b.length && c < a.length; c++) if (!$e(a[c], b[c])) return !1;
            return !0;
        }
        function oh(a, b, c, d, e, f) {
            lh = f;
            N = b;
            b.memoizedState = null;
            b.updateQueue = null;
            b.expirationTime = 0;
            jh.current = null === a || null === a.memoizedState ? ph : qh;
            a = c(d, e);
            if (b.expirationTime === lh) {
                f = 0;
                do {
                    b.expirationTime = 0;
                    if (!(25 > f)) throw Error(u(301));
                    f += 1;
                    P = O = null;
                    b.updateQueue = null;
                    jh.current = rh;
                    a = c(d, e);
                } while (b.expirationTime === lh);
            }
            jh.current = sh;
            b = null !== O && null !== O.next;
            lh = 0;
            P = O = N = null;
            mh = !1;
            if (b) throw Error(u(300));
            return a;
        }
        function th() {
            var a = {
                memoizedState: null,
                baseState: null,
                baseQueue: null,
                queue: null,
                next: null
            };
            null === P ? N.memoizedState = P = a : P = P.next = a;
            return P;
        }
        function uh() {
            if (null === O) {
                var a = N.alternate;
                a = null !== a ? a.memoizedState : null;
            } else a = O.next;
            var b = null === P ? N.memoizedState : P.next;
            if (null !== b) P = b, O = a; else {
                if (null === a) throw Error(u(310));
                O = a;
                a = {
                    memoizedState: O.memoizedState,
                    baseState: O.baseState,
                    baseQueue: O.baseQueue,
                    queue: O.queue,
                    next: null
                };
                null === P ? N.memoizedState = P = a : P = P.next = a;
            }
            return P;
        }
        function vh(a, b) {
            return "function" === typeof b ? b(a) : b;
        }
        function wh(a) {
            var b = uh(), c = b.queue;
            if (null === c) throw Error(u(311));
            c.lastRenderedReducer = a;
            var d = O, e = d.baseQueue, f = c.pending;
            if (null !== f) {
                if (null !== e) {
                    var g = e.next;
                    e.next = f.next;
                    f.next = g;
                }
                d.baseQueue = e = f;
                c.pending = null;
            }
            if (null !== e) {
                e = e.next;
                d = d.baseState;
                var h = g = f = null, k = e;
                do {
                    var l = k.expirationTime;
                    if (l < lh) {
                        var m = {
                            expirationTime: k.expirationTime,
                            suspenseConfig: k.suspenseConfig,
                            action: k.action,
                            eagerReducer: k.eagerReducer,
                            eagerState: k.eagerState,
                            next: null
                        };
                        null === h ? (g = h = m, f = d) : h = h.next = m;
                        l > N.expirationTime && (N.expirationTime = l, Bg(l));
                    } else null !== h && (h = h.next = {
                        expirationTime: 1073741823,
                        suspenseConfig: k.suspenseConfig,
                        action: k.action,
                        eagerReducer: k.eagerReducer,
                        eagerState: k.eagerState,
                        next: null
                    }), Ag(l, k.suspenseConfig), d = k.eagerReducer === a ? k.eagerState : a(d, k.action);
                    k = k.next;
                } while (null !== k && k !== e);
                null === h ? f = d : h.next = g;
                $e(d, b.memoizedState) || (rg = !0);
                b.memoizedState = d;
                b.baseState = f;
                b.baseQueue = h;
                c.lastRenderedState = d;
            }
            return [ b.memoizedState, c.dispatch ];
        }
        function xh(a) {
            var b = uh(), c = b.queue;
            if (null === c) throw Error(u(311));
            c.lastRenderedReducer = a;
            var d = c.dispatch, e = c.pending, f = b.memoizedState;
            if (null !== e) {
                c.pending = null;
                var g = e = e.next;
                do {
                    f = a(f, g.action), g = g.next;
                } while (g !== e);
                $e(f, b.memoizedState) || (rg = !0);
                b.memoizedState = f;
                null === b.baseQueue && (b.baseState = f);
                c.lastRenderedState = f;
            }
            return [ f, d ];
        }
        function yh(a) {
            var b = th();
            "function" === typeof a && (a = a());
            b.memoizedState = b.baseState = a;
            a = b.queue = {
                pending: null,
                dispatch: null,
                lastRenderedReducer: vh,
                lastRenderedState: a
            };
            a = a.dispatch = zh.bind(null, N, a);
            return [ b.memoizedState, a ];
        }
        function Ah(a, b, c, d) {
            a = {
                tag: a,
                create: b,
                destroy: c,
                deps: d,
                next: null
            };
            b = N.updateQueue;
            null === b ? (b = {
                lastEffect: null
            }, N.updateQueue = b, b.lastEffect = a.next = a) : (c = b.lastEffect, null === c ? b.lastEffect = a.next = a : (d = c.next, 
            c.next = a, a.next = d, b.lastEffect = a));
            return a;
        }
        function Bh() {
            return uh().memoizedState;
        }
        function Ch(a, b, c, d) {
            var e = th();
            N.effectTag |= a;
            e.memoizedState = Ah(1 | b, c, void 0, void 0 === d ? null : d);
        }
        function Dh(a, b, c, d) {
            var e = uh();
            d = void 0 === d ? null : d;
            var f = void 0;
            if (null !== O) {
                var g = O.memoizedState;
                f = g.destroy;
                if (null !== d && nh(d, g.deps)) {
                    Ah(b, c, f, d);
                    return;
                }
            }
            N.effectTag |= a;
            e.memoizedState = Ah(1 | b, c, f, d);
        }
        function Eh(a, b) {
            return Ch(516, 4, a, b);
        }
        function Fh(a, b) {
            return Dh(516, 4, a, b);
        }
        function Gh(a, b) {
            return Dh(4, 2, a, b);
        }
        function Hh(a, b) {
            if ("function" === typeof b) return a = a(), b(a), function() {
                b(null);
            };
            if (null !== b && void 0 !== b) return a = a(), b.current = a, function() {
                b.current = null;
            };
        }
        function Ih(a, b, c) {
            c = null !== c && void 0 !== c ? c.concat([ a ]) : null;
            return Dh(4, 2, Hh.bind(null, b, a), c);
        }
        function Jh() {}
        function Kh(a, b) {
            th().memoizedState = [ a, void 0 === b ? null : b ];
            return a;
        }
        function Lh(a, b) {
            var c = uh();
            b = void 0 === b ? null : b;
            var d = c.memoizedState;
            if (null !== d && null !== b && nh(b, d[1])) return d[0];
            c.memoizedState = [ a, b ];
            return a;
        }
        function Mh(a, b) {
            var c = uh();
            b = void 0 === b ? null : b;
            var d = c.memoizedState;
            if (null !== d && null !== b && nh(b, d[1])) return d[0];
            a = a();
            c.memoizedState = [ a, b ];
            return a;
        }
        function Nh(a, b, c) {
            var d = ag();
            cg(98 > d ? 98 : d, (function() {
                a(!0);
            }));
            cg(97 < d ? 97 : d, (function() {
                var d = kh.suspense;
                kh.suspense = void 0 === b ? null : b;
                try {
                    a(!1), c();
                } finally {
                    kh.suspense = d;
                }
            }));
        }
        function zh(a, b, c) {
            var d = Gg(), e = Dg.suspense;
            d = Hg(d, a, e);
            e = {
                expirationTime: d,
                suspenseConfig: e,
                action: c,
                eagerReducer: null,
                eagerState: null,
                next: null
            };
            var f = b.pending;
            null === f ? e.next = e : (e.next = f.next, f.next = e);
            b.pending = e;
            f = a.alternate;
            if (a === N || null !== f && f === N) mh = !0, e.expirationTime = lh, N.expirationTime = lh; else {
                if (0 === a.expirationTime && (null === f || 0 === f.expirationTime) && (f = b.lastRenderedReducer, 
                null !== f)) try {
                    var g = b.lastRenderedState, h = f(g, c);
                    e.eagerReducer = f;
                    e.eagerState = h;
                    if ($e(h, g)) return;
                } catch (k) {} finally {}
                Ig(a, d);
            }
        }
        var sh = {
            readContext: sg,
            useCallback: Q,
            useContext: Q,
            useEffect: Q,
            useImperativeHandle: Q,
            useLayoutEffect: Q,
            useMemo: Q,
            useReducer: Q,
            useRef: Q,
            useState: Q,
            useDebugValue: Q,
            useResponder: Q,
            useDeferredValue: Q,
            useTransition: Q
        }, ph = {
            readContext: sg,
            useCallback: Kh,
            useContext: sg,
            useEffect: Eh,
            useImperativeHandle: function(a, b, c) {
                c = null !== c && void 0 !== c ? c.concat([ a ]) : null;
                return Ch(4, 2, Hh.bind(null, b, a), c);
            },
            useLayoutEffect: function(a, b) {
                return Ch(4, 2, a, b);
            },
            useMemo: function(a, b) {
                var c = th();
                b = void 0 === b ? null : b;
                a = a();
                c.memoizedState = [ a, b ];
                return a;
            },
            useReducer: function(a, b, c) {
                var d = th();
                b = void 0 !== c ? c(b) : b;
                d.memoizedState = d.baseState = b;
                a = d.queue = {
                    pending: null,
                    dispatch: null,
                    lastRenderedReducer: a,
                    lastRenderedState: b
                };
                a = a.dispatch = zh.bind(null, N, a);
                return [ d.memoizedState, a ];
            },
            useRef: function(a) {
                var b = th();
                a = {
                    current: a
                };
                return b.memoizedState = a;
            },
            useState: yh,
            useDebugValue: Jh,
            useResponder: ih,
            useDeferredValue: function(a, b) {
                var c = yh(a), d = c[0], e = c[1];
                Eh((function() {
                    var c = kh.suspense;
                    kh.suspense = void 0 === b ? null : b;
                    try {
                        e(a);
                    } finally {
                        kh.suspense = c;
                    }
                }), [ a, b ]);
                return d;
            },
            useTransition: function(a) {
                var b = yh(!1), c = b[0];
                b = b[1];
                return [ Kh(Nh.bind(null, b, a), [ b, a ]), c ];
            }
        }, qh = {
            readContext: sg,
            useCallback: Lh,
            useContext: sg,
            useEffect: Fh,
            useImperativeHandle: Ih,
            useLayoutEffect: Gh,
            useMemo: Mh,
            useReducer: wh,
            useRef: Bh,
            useState: function() {
                return wh(vh);
            },
            useDebugValue: Jh,
            useResponder: ih,
            useDeferredValue: function(a, b) {
                var c = wh(vh), d = c[0], e = c[1];
                Fh((function() {
                    var c = kh.suspense;
                    kh.suspense = void 0 === b ? null : b;
                    try {
                        e(a);
                    } finally {
                        kh.suspense = c;
                    }
                }), [ a, b ]);
                return d;
            },
            useTransition: function(a) {
                var b = wh(vh), c = b[0];
                b = b[1];
                return [ Lh(Nh.bind(null, b, a), [ b, a ]), c ];
            }
        }, rh = {
            readContext: sg,
            useCallback: Lh,
            useContext: sg,
            useEffect: Fh,
            useImperativeHandle: Ih,
            useLayoutEffect: Gh,
            useMemo: Mh,
            useReducer: xh,
            useRef: Bh,
            useState: function() {
                return xh(vh);
            },
            useDebugValue: Jh,
            useResponder: ih,
            useDeferredValue: function(a, b) {
                var c = xh(vh), d = c[0], e = c[1];
                Fh((function() {
                    var c = kh.suspense;
                    kh.suspense = void 0 === b ? null : b;
                    try {
                        e(a);
                    } finally {
                        kh.suspense = c;
                    }
                }), [ a, b ]);
                return d;
            },
            useTransition: function(a) {
                var b = xh(vh), c = b[0];
                b = b[1];
                return [ Lh(Nh.bind(null, b, a), [ b, a ]), c ];
            }
        }, Oh = null, Ph = null, Qh = !1;
        function Rh(a, b) {
            var c = Sh(5, null, null, 0);
            c.elementType = "DELETED";
            c.type = "DELETED";
            c.stateNode = b;
            c.return = a;
            c.effectTag = 8;
            null !== a.lastEffect ? (a.lastEffect.nextEffect = c, a.lastEffect = c) : a.firstEffect = a.lastEffect = c;
        }
        function Th(a, b) {
            switch (a.tag) {
              case 5:
                var c = a.type;
                b = 1 !== b.nodeType || c.toLowerCase() !== b.nodeName.toLowerCase() ? null : b;
                return null !== b ? (a.stateNode = b, !0) : !1;

              case 6:
                return b = "" === a.pendingProps || 3 !== b.nodeType ? null : b, null !== b ? (a.stateNode = b, 
                !0) : !1;

              case 13:
                return !1;

              default:
                return !1;
            }
        }
        function Uh(a) {
            if (Qh) {
                var b = Ph;
                if (b) {
                    var c = b;
                    if (!Th(a, b)) {
                        b = Jd(c.nextSibling);
                        if (!b || !Th(a, b)) {
                            a.effectTag = a.effectTag & -1025 | 2;
                            Qh = !1;
                            Oh = a;
                            return;
                        }
                        Rh(Oh, c);
                    }
                    Oh = a;
                    Ph = Jd(b.firstChild);
                } else a.effectTag = a.effectTag & -1025 | 2, Qh = !1, Oh = a;
            }
        }
        function Vh(a) {
            for (a = a.return; null !== a && 5 !== a.tag && 3 !== a.tag && 13 !== a.tag; ) a = a.return;
            Oh = a;
        }
        function Wh(a) {
            if (a !== Oh) return !1;
            if (!Qh) return Vh(a), Qh = !0, !1;
            var b = a.type;
            if (5 !== a.tag || "head" !== b && "body" !== b && !Gd(b, a.memoizedProps)) for (b = Ph; b; ) Rh(a, b), 
            b = Jd(b.nextSibling);
            Vh(a);
            if (13 === a.tag) {
                a = a.memoizedState;
                a = null !== a ? a.dehydrated : null;
                if (!a) throw Error(u(317));
                a: {
                    a = a.nextSibling;
                    for (b = 0; a; ) {
                        if (8 === a.nodeType) {
                            var c = a.data;
                            if (c === Ad) {
                                if (0 === b) {
                                    Ph = Jd(a.nextSibling);
                                    break a;
                                }
                                b--;
                            } else c !== zd && c !== Cd && c !== Bd || b++;
                        }
                        a = a.nextSibling;
                    }
                    Ph = null;
                }
            } else Ph = Oh ? Jd(a.stateNode.nextSibling) : null;
            return !0;
        }
        function Xh() {
            Ph = Oh = null;
            Qh = !1;
        }
        var Yh = Wa.ReactCurrentOwner, rg = !1;
        function R(a, b, c, d) {
            b.child = null === a ? Yg(b, null, c, d) : Xg(b, a.child, c, d);
        }
        function Zh(a, b, c, d, e) {
            c = c.render;
            var f = b.ref;
            qg(b, e);
            d = oh(a, b, c, d, f, e);
            if (null !== a && !rg) return b.updateQueue = a.updateQueue, b.effectTag &= -517, 
            a.expirationTime <= e && (a.expirationTime = 0), $h(a, b, e);
            b.effectTag |= 1;
            R(a, b, d, e);
            return b.child;
        }
        function ai(a, b, c, d, e, f) {
            if (null === a) {
                var g = c.type;
                if ("function" === typeof g && !bi(g) && void 0 === g.defaultProps && null === c.compare && void 0 === c.defaultProps) return b.tag = 15, 
                b.type = g, ci(a, b, g, d, e, f);
                a = Ug(c.type, null, d, null, b.mode, f);
                a.ref = b.ref;
                a.return = b;
                return b.child = a;
            }
            g = a.child;
            if (e < f && (e = g.memoizedProps, c = c.compare, c = null !== c ? c : bf, c(e, d) && a.ref === b.ref)) return $h(a, b, f);
            b.effectTag |= 1;
            a = Sg(g, d);
            a.ref = b.ref;
            a.return = b;
            return b.child = a;
        }
        function ci(a, b, c, d, e, f) {
            return null !== a && bf(a.memoizedProps, d) && a.ref === b.ref && (rg = !1, e < f) ? (b.expirationTime = a.expirationTime, 
            $h(a, b, f)) : di(a, b, c, d, f);
        }
        function ei(a, b) {
            var c = b.ref;
            if (null === a && null !== c || null !== a && a.ref !== c) b.effectTag |= 128;
        }
        function di(a, b, c, d, e) {
            var f = L(c) ? Bf : J.current;
            f = Cf(b, f);
            qg(b, e);
            c = oh(a, b, c, d, f, e);
            if (null !== a && !rg) return b.updateQueue = a.updateQueue, b.effectTag &= -517, 
            a.expirationTime <= e && (a.expirationTime = 0), $h(a, b, e);
            b.effectTag |= 1;
            R(a, b, c, e);
            return b.child;
        }
        function fi(a, b, c, d, e) {
            if (L(c)) {
                var f = !0;
                Gf(b);
            } else f = !1;
            qg(b, e);
            if (null === b.stateNode) null !== a && (a.alternate = null, b.alternate = null, 
            b.effectTag |= 2), Lg(b, c, d), Ng(b, c, d, e), d = !0; else if (null === a) {
                var g = b.stateNode, h = b.memoizedProps;
                g.props = h;
                var k = g.context, l = c.contextType;
                "object" === typeof l && null !== l ? l = sg(l) : (l = L(c) ? Bf : J.current, l = Cf(b, l));
                var m = c.getDerivedStateFromProps, p = "function" === typeof m || "function" === typeof g.getSnapshotBeforeUpdate;
                p || "function" !== typeof g.UNSAFE_componentWillReceiveProps && "function" !== typeof g.componentWillReceiveProps || (h !== d || k !== l) && Mg(b, g, d, l);
                tg = !1;
                var x = b.memoizedState;
                g.state = x;
                zg(b, d, g, e);
                k = b.memoizedState;
                h !== d || x !== k || K.current || tg ? ("function" === typeof m && (Fg(b, c, m, d), 
                k = b.memoizedState), (h = tg || Kg(b, c, h, d, x, k, l)) ? (p || "function" !== typeof g.UNSAFE_componentWillMount && "function" !== typeof g.componentWillMount || ("function" === typeof g.componentWillMount && g.componentWillMount(), 
                "function" === typeof g.UNSAFE_componentWillMount && g.UNSAFE_componentWillMount()), 
                "function" === typeof g.componentDidMount && (b.effectTag |= 4)) : ("function" === typeof g.componentDidMount && (b.effectTag |= 4), 
                b.memoizedProps = d, b.memoizedState = k), g.props = d, g.state = k, g.context = l, 
                d = h) : ("function" === typeof g.componentDidMount && (b.effectTag |= 4), d = !1);
            } else g = b.stateNode, vg(a, b), h = b.memoizedProps, g.props = b.type === b.elementType ? h : ig(b.type, h), 
            k = g.context, l = c.contextType, "object" === typeof l && null !== l ? l = sg(l) : (l = L(c) ? Bf : J.current, 
            l = Cf(b, l)), m = c.getDerivedStateFromProps, (p = "function" === typeof m || "function" === typeof g.getSnapshotBeforeUpdate) || "function" !== typeof g.UNSAFE_componentWillReceiveProps && "function" !== typeof g.componentWillReceiveProps || (h !== d || k !== l) && Mg(b, g, d, l), 
            tg = !1, k = b.memoizedState, g.state = k, zg(b, d, g, e), x = b.memoizedState, 
            h !== d || k !== x || K.current || tg ? ("function" === typeof m && (Fg(b, c, m, d), 
            x = b.memoizedState), (m = tg || Kg(b, c, h, d, k, x, l)) ? (p || "function" !== typeof g.UNSAFE_componentWillUpdate && "function" !== typeof g.componentWillUpdate || ("function" === typeof g.componentWillUpdate && g.componentWillUpdate(d, x, l), 
            "function" === typeof g.UNSAFE_componentWillUpdate && g.UNSAFE_componentWillUpdate(d, x, l)), 
            "function" === typeof g.componentDidUpdate && (b.effectTag |= 4), "function" === typeof g.getSnapshotBeforeUpdate && (b.effectTag |= 256)) : ("function" !== typeof g.componentDidUpdate || h === a.memoizedProps && k === a.memoizedState || (b.effectTag |= 4), 
            "function" !== typeof g.getSnapshotBeforeUpdate || h === a.memoizedProps && k === a.memoizedState || (b.effectTag |= 256), 
            b.memoizedProps = d, b.memoizedState = x), g.props = d, g.state = x, g.context = l, 
            d = m) : ("function" !== typeof g.componentDidUpdate || h === a.memoizedProps && k === a.memoizedState || (b.effectTag |= 4), 
            "function" !== typeof g.getSnapshotBeforeUpdate || h === a.memoizedProps && k === a.memoizedState || (b.effectTag |= 256), 
            d = !1);
            return gi(a, b, c, d, f, e);
        }
        function gi(a, b, c, d, e, f) {
            ei(a, b);
            var g = 0 !== (b.effectTag & 64);
            if (!d && !g) return e && Hf(b, c, !1), $h(a, b, f);
            d = b.stateNode;
            Yh.current = b;
            var h = g && "function" !== typeof c.getDerivedStateFromError ? null : d.render();
            b.effectTag |= 1;
            null !== a && g ? (b.child = Xg(b, a.child, null, f), b.child = Xg(b, null, h, f)) : R(a, b, h, f);
            b.memoizedState = d.state;
            e && Hf(b, c, !0);
            return b.child;
        }
        function hi(a) {
            var b = a.stateNode;
            b.pendingContext ? Ef(a, b.pendingContext, b.pendingContext !== b.context) : b.context && Ef(a, b.context, !1);
            dh(a, b.containerInfo);
        }
        var ii = {
            dehydrated: null,
            retryTime: 0
        };
        function ji(a, b, c) {
            var d = b.mode, e = b.pendingProps, f = M.current, g = !1, h;
            (h = 0 !== (b.effectTag & 64)) || (h = 0 !== (f & 2) && (null === a || null !== a.memoizedState));
            h ? (g = !0, b.effectTag &= -65) : null !== a && null === a.memoizedState || void 0 === e.fallback || !0 === e.unstable_avoidThisFallback || (f |= 1);
            I(M, f & 1);
            if (null === a) {
                void 0 !== e.fallback && Uh(b);
                if (g) {
                    g = e.fallback;
                    e = Wg(null, d, 0, null);
                    e.return = b;
                    if (0 === (b.mode & 2)) for (a = null !== b.memoizedState ? b.child.child : b.child, 
                    e.child = a; null !== a; ) a.return = e, a = a.sibling;
                    c = Wg(g, d, c, null);
                    c.return = b;
                    e.sibling = c;
                    b.memoizedState = ii;
                    b.child = e;
                    return c;
                }
                d = e.children;
                b.memoizedState = null;
                return b.child = Yg(b, null, d, c);
            }
            if (null !== a.memoizedState) {
                a = a.child;
                d = a.sibling;
                if (g) {
                    e = e.fallback;
                    c = Sg(a, a.pendingProps);
                    c.return = b;
                    if (0 === (b.mode & 2) && (g = null !== b.memoizedState ? b.child.child : b.child, 
                    g !== a.child)) for (c.child = g; null !== g; ) g.return = c, g = g.sibling;
                    d = Sg(d, e);
                    d.return = b;
                    c.sibling = d;
                    c.childExpirationTime = 0;
                    b.memoizedState = ii;
                    b.child = c;
                    return d;
                }
                c = Xg(b, a.child, e.children, c);
                b.memoizedState = null;
                return b.child = c;
            }
            a = a.child;
            if (g) {
                g = e.fallback;
                e = Wg(null, d, 0, null);
                e.return = b;
                e.child = a;
                null !== a && (a.return = e);
                if (0 === (b.mode & 2)) for (a = null !== b.memoizedState ? b.child.child : b.child, 
                e.child = a; null !== a; ) a.return = e, a = a.sibling;
                c = Wg(g, d, c, null);
                c.return = b;
                e.sibling = c;
                c.effectTag |= 2;
                e.childExpirationTime = 0;
                b.memoizedState = ii;
                b.child = e;
                return c;
            }
            b.memoizedState = null;
            return b.child = Xg(b, a, e.children, c);
        }
        function ki(a, b) {
            a.expirationTime < b && (a.expirationTime = b);
            var c = a.alternate;
            null !== c && c.expirationTime < b && (c.expirationTime = b);
            pg(a.return, b);
        }
        function li(a, b, c, d, e, f) {
            var g = a.memoizedState;
            null === g ? a.memoizedState = {
                isBackwards: b,
                rendering: null,
                renderingStartTime: 0,
                last: d,
                tail: c,
                tailExpiration: 0,
                tailMode: e,
                lastEffect: f
            } : (g.isBackwards = b, g.rendering = null, g.renderingStartTime = 0, g.last = d, 
            g.tail = c, g.tailExpiration = 0, g.tailMode = e, g.lastEffect = f);
        }
        function mi(a, b, c) {
            var d = b.pendingProps, e = d.revealOrder, f = d.tail;
            R(a, b, d.children, c);
            d = M.current;
            if (0 !== (d & 2)) d = d & 1 | 2, b.effectTag |= 64; else {
                if (null !== a && 0 !== (a.effectTag & 64)) a: for (a = b.child; null !== a; ) {
                    if (13 === a.tag) null !== a.memoizedState && ki(a, c); else if (19 === a.tag) ki(a, c); else if (null !== a.child) {
                        a.child.return = a;
                        a = a.child;
                        continue;
                    }
                    if (a === b) break a;
                    for (;null === a.sibling; ) {
                        if (null === a.return || a.return === b) break a;
                        a = a.return;
                    }
                    a.sibling.return = a.return;
                    a = a.sibling;
                }
                d &= 1;
            }
            I(M, d);
            if (0 === (b.mode & 2)) b.memoizedState = null; else switch (e) {
              case "forwards":
                c = b.child;
                for (e = null; null !== c; ) a = c.alternate, null !== a && null === hh(a) && (e = c), 
                c = c.sibling;
                c = e;
                null === c ? (e = b.child, b.child = null) : (e = c.sibling, c.sibling = null);
                li(b, !1, e, c, f, b.lastEffect);
                break;

              case "backwards":
                c = null;
                e = b.child;
                for (b.child = null; null !== e; ) {
                    a = e.alternate;
                    if (null !== a && null === hh(a)) {
                        b.child = e;
                        break;
                    }
                    a = e.sibling;
                    e.sibling = c;
                    c = e;
                    e = a;
                }
                li(b, !0, c, null, f, b.lastEffect);
                break;

              case "together":
                li(b, !1, null, null, void 0, b.lastEffect);
                break;

              default:
                b.memoizedState = null;
            }
            return b.child;
        }
        function $h(a, b, c) {
            null !== a && (b.dependencies = a.dependencies);
            var d = b.expirationTime;
            0 !== d && Bg(d);
            if (b.childExpirationTime < c) return null;
            if (null !== a && b.child !== a.child) throw Error(u(153));
            if (null !== b.child) {
                a = b.child;
                c = Sg(a, a.pendingProps);
                b.child = c;
                for (c.return = b; null !== a.sibling; ) a = a.sibling, c = c.sibling = Sg(a, a.pendingProps), 
                c.return = b;
                c.sibling = null;
            }
            return b.child;
        }
        var ni, oi, pi, qi;
        ni = function(a, b) {
            for (var c = b.child; null !== c; ) {
                if (5 === c.tag || 6 === c.tag) a.appendChild(c.stateNode); else if (4 !== c.tag && null !== c.child) {
                    c.child.return = c;
                    c = c.child;
                    continue;
                }
                if (c === b) break;
                for (;null === c.sibling; ) {
                    if (null === c.return || c.return === b) return;
                    c = c.return;
                }
                c.sibling.return = c.return;
                c = c.sibling;
            }
        };
        oi = function() {};
        pi = function(a, b, c, d, e) {
            var f = a.memoizedProps;
            if (f !== d) {
                var g = b.stateNode;
                ch($g.current);
                a = null;
                switch (c) {
                  case "input":
                    f = zb(g, f);
                    d = zb(g, d);
                    a = [];
                    break;

                  case "option":
                    f = Gb(g, f);
                    d = Gb(g, d);
                    a = [];
                    break;

                  case "select":
                    f = n({}, f, {
                        value: void 0
                    });
                    d = n({}, d, {
                        value: void 0
                    });
                    a = [];
                    break;

                  case "textarea":
                    f = Ib(g, f);
                    d = Ib(g, d);
                    a = [];
                    break;

                  default:
                    "function" !== typeof f.onClick && "function" === typeof d.onClick && (g.onclick = sd);
                }
                od(c, d);
                var h, k;
                c = null;
                for (h in f) if (!d.hasOwnProperty(h) && f.hasOwnProperty(h) && null != f[h]) if ("style" === h) for (k in g = f[h], 
                g) g.hasOwnProperty(k) && (c || (c = {}), c[k] = ""); else "dangerouslySetInnerHTML" !== h && "children" !== h && "suppressContentEditableWarning" !== h && "suppressHydrationWarning" !== h && "autoFocus" !== h && (va.hasOwnProperty(h) ? a || (a = []) : (a = a || []).push(h, null));
                for (h in d) {
                    var l = d[h];
                    g = null != f ? f[h] : void 0;
                    if (d.hasOwnProperty(h) && l !== g && (null != l || null != g)) if ("style" === h) if (g) {
                        for (k in g) !g.hasOwnProperty(k) || l && l.hasOwnProperty(k) || (c || (c = {}), 
                        c[k] = "");
                        for (k in l) l.hasOwnProperty(k) && g[k] !== l[k] && (c || (c = {}), c[k] = l[k]);
                    } else c || (a || (a = []), a.push(h, c)), c = l; else "dangerouslySetInnerHTML" === h ? (l = l ? l.__html : void 0, 
                    g = g ? g.__html : void 0, null != l && g !== l && (a = a || []).push(h, l)) : "children" === h ? g === l || "string" !== typeof l && "number" !== typeof l || (a = a || []).push(h, "" + l) : "suppressContentEditableWarning" !== h && "suppressHydrationWarning" !== h && (va.hasOwnProperty(h) ? (null != l && rd(e, h), 
                    a || g === l || (a = [])) : (a = a || []).push(h, l));
                }
                c && (a = a || []).push("style", c);
                e = a;
                if (b.updateQueue = e) b.effectTag |= 4;
            }
        };
        qi = function(a, b, c, d) {
            c !== d && (b.effectTag |= 4);
        };
        function ri(a, b) {
            switch (a.tailMode) {
              case "hidden":
                b = a.tail;
                for (var c = null; null !== b; ) null !== b.alternate && (c = b), b = b.sibling;
                null === c ? a.tail = null : c.sibling = null;
                break;

              case "collapsed":
                c = a.tail;
                for (var d = null; null !== c; ) null !== c.alternate && (d = c), c = c.sibling;
                null === d ? b || null === a.tail ? a.tail = null : a.tail.sibling = null : d.sibling = null;
            }
        }
        function si(a, b, c) {
            var d = b.pendingProps;
            switch (b.tag) {
              case 2:
              case 16:
              case 15:
              case 0:
              case 11:
              case 7:
              case 8:
              case 12:
              case 9:
              case 14:
                return null;

              case 1:
                return L(b.type) && Df(), null;

              case 3:
                return eh(), H(K), H(J), c = b.stateNode, c.pendingContext && (c.context = c.pendingContext, 
                c.pendingContext = null), null !== a && null !== a.child || !Wh(b) || (b.effectTag |= 4), 
                oi(b), null;

              case 5:
                gh(b);
                c = ch(bh.current);
                var e = b.type;
                if (null !== a && null != b.stateNode) pi(a, b, e, d, c), a.ref !== b.ref && (b.effectTag |= 128); else {
                    if (!d) {
                        if (null === b.stateNode) throw Error(u(166));
                        return null;
                    }
                    a = ch($g.current);
                    if (Wh(b)) {
                        d = b.stateNode;
                        e = b.type;
                        var f = b.memoizedProps;
                        d[Md] = b;
                        d[Nd] = f;
                        switch (e) {
                          case "iframe":
                          case "object":
                          case "embed":
                            F("load", d);
                            break;

                          case "video":
                          case "audio":
                            for (a = 0; a < ac.length; a++) F(ac[a], d);
                            break;

                          case "source":
                            F("error", d);
                            break;

                          case "img":
                          case "image":
                          case "link":
                            F("error", d);
                            F("load", d);
                            break;

                          case "form":
                            F("reset", d);
                            F("submit", d);
                            break;

                          case "details":
                            F("toggle", d);
                            break;

                          case "input":
                            Ab(d, f);
                            F("invalid", d);
                            rd(c, "onChange");
                            break;

                          case "select":
                            d._wrapperState = {
                                wasMultiple: !!f.multiple
                            };
                            F("invalid", d);
                            rd(c, "onChange");
                            break;

                          case "textarea":
                            Jb(d, f), F("invalid", d), rd(c, "onChange");
                        }
                        od(e, f);
                        a = null;
                        for (var g in f) if (f.hasOwnProperty(g)) {
                            var h = f[g];
                            "children" === g ? "string" === typeof h ? d.textContent !== h && (a = [ "children", h ]) : "number" === typeof h && d.textContent !== "" + h && (a = [ "children", "" + h ]) : va.hasOwnProperty(g) && null != h && rd(c, g);
                        }
                        switch (e) {
                          case "input":
                            xb(d);
                            Eb(d, f, !0);
                            break;

                          case "textarea":
                            xb(d);
                            Lb(d);
                            break;

                          case "select":
                          case "option":
                            break;

                          default:
                            "function" === typeof f.onClick && (d.onclick = sd);
                        }
                        c = a;
                        b.updateQueue = c;
                        null !== c && (b.effectTag |= 4);
                    } else {
                        g = 9 === c.nodeType ? c : c.ownerDocument;
                        a === qd && (a = Nb(e));
                        a === qd ? "script" === e ? (a = g.createElement("div"), a.innerHTML = "<script><\/script>", 
                        a = a.removeChild(a.firstChild)) : "string" === typeof d.is ? a = g.createElement(e, {
                            is: d.is
                        }) : (a = g.createElement(e), "select" === e && (g = a, d.multiple ? g.multiple = !0 : d.size && (g.size = d.size))) : a = g.createElementNS(a, e);
                        a[Md] = b;
                        a[Nd] = d;
                        ni(a, b, !1, !1);
                        b.stateNode = a;
                        g = pd(e, d);
                        switch (e) {
                          case "iframe":
                          case "object":
                          case "embed":
                            F("load", a);
                            h = d;
                            break;

                          case "video":
                          case "audio":
                            for (h = 0; h < ac.length; h++) F(ac[h], a);
                            h = d;
                            break;

                          case "source":
                            F("error", a);
                            h = d;
                            break;

                          case "img":
                          case "image":
                          case "link":
                            F("error", a);
                            F("load", a);
                            h = d;
                            break;

                          case "form":
                            F("reset", a);
                            F("submit", a);
                            h = d;
                            break;

                          case "details":
                            F("toggle", a);
                            h = d;
                            break;

                          case "input":
                            Ab(a, d);
                            h = zb(a, d);
                            F("invalid", a);
                            rd(c, "onChange");
                            break;

                          case "option":
                            h = Gb(a, d);
                            break;

                          case "select":
                            a._wrapperState = {
                                wasMultiple: !!d.multiple
                            };
                            h = n({}, d, {
                                value: void 0
                            });
                            F("invalid", a);
                            rd(c, "onChange");
                            break;

                          case "textarea":
                            Jb(a, d);
                            h = Ib(a, d);
                            F("invalid", a);
                            rd(c, "onChange");
                            break;

                          default:
                            h = d;
                        }
                        od(e, h);
                        var k = h;
                        for (f in k) if (k.hasOwnProperty(f)) {
                            var l = k[f];
                            "style" === f ? md(a, l) : "dangerouslySetInnerHTML" === f ? (l = l ? l.__html : void 0, 
                            null != l && Qb(a, l)) : "children" === f ? "string" === typeof l ? ("textarea" !== e || "" !== l) && Rb(a, l) : "number" === typeof l && Rb(a, "" + l) : "suppressContentEditableWarning" !== f && "suppressHydrationWarning" !== f && "autoFocus" !== f && (va.hasOwnProperty(f) ? null != l && rd(c, f) : null != l && Xa(a, f, l, g));
                        }
                        switch (e) {
                          case "input":
                            xb(a);
                            Eb(a, d, !1);
                            break;

                          case "textarea":
                            xb(a);
                            Lb(a);
                            break;

                          case "option":
                            null != d.value && a.setAttribute("value", "" + rb(d.value));
                            break;

                          case "select":
                            a.multiple = !!d.multiple;
                            c = d.value;
                            null != c ? Hb(a, !!d.multiple, c, !1) : null != d.defaultValue && Hb(a, !!d.multiple, d.defaultValue, !0);
                            break;

                          default:
                            "function" === typeof h.onClick && (a.onclick = sd);
                        }
                        Fd(e, d) && (b.effectTag |= 4);
                    }
                    null !== b.ref && (b.effectTag |= 128);
                }
                return null;

              case 6:
                if (a && null != b.stateNode) qi(a, b, a.memoizedProps, d); else {
                    if ("string" !== typeof d && null === b.stateNode) throw Error(u(166));
                    c = ch(bh.current);
                    ch($g.current);
                    Wh(b) ? (c = b.stateNode, d = b.memoizedProps, c[Md] = b, c.nodeValue !== d && (b.effectTag |= 4)) : (c = (9 === c.nodeType ? c : c.ownerDocument).createTextNode(d), 
                    c[Md] = b, b.stateNode = c);
                }
                return null;

              case 13:
                H(M);
                d = b.memoizedState;
                if (0 !== (b.effectTag & 64)) return b.expirationTime = c, b;
                c = null !== d;
                d = !1;
                null === a ? void 0 !== b.memoizedProps.fallback && Wh(b) : (e = a.memoizedState, 
                d = null !== e, c || null === e || (e = a.child.sibling, null !== e && (f = b.firstEffect, 
                null !== f ? (b.firstEffect = e, e.nextEffect = f) : (b.firstEffect = b.lastEffect = e, 
                e.nextEffect = null), e.effectTag = 8)));
                if (c && !d && 0 !== (b.mode & 2)) if (null === a && !0 !== b.memoizedProps.unstable_avoidThisFallback || 0 !== (M.current & 1)) S === ti && (S = ui); else {
                    if (S === ti || S === ui) S = vi;
                    0 !== wi && null !== T && (xi(T, U), yi(T, wi));
                }
                if (c || d) b.effectTag |= 4;
                return null;

              case 4:
                return eh(), oi(b), null;

              case 10:
                return og(b), null;

              case 17:
                return L(b.type) && Df(), null;

              case 19:
                H(M);
                d = b.memoizedState;
                if (null === d) return null;
                e = 0 !== (b.effectTag & 64);
                f = d.rendering;
                if (null === f) if (e) ri(d, !1); else {
                    if (S !== ti || null !== a && 0 !== (a.effectTag & 64)) for (f = b.child; null !== f; ) {
                        a = hh(f);
                        if (null !== a) {
                            b.effectTag |= 64;
                            ri(d, !1);
                            e = a.updateQueue;
                            null !== e && (b.updateQueue = e, b.effectTag |= 4);
                            null === d.lastEffect && (b.firstEffect = null);
                            b.lastEffect = d.lastEffect;
                            for (d = b.child; null !== d; ) e = d, f = c, e.effectTag &= 2, e.nextEffect = null, 
                            e.firstEffect = null, e.lastEffect = null, a = e.alternate, null === a ? (e.childExpirationTime = 0, 
                            e.expirationTime = f, e.child = null, e.memoizedProps = null, e.memoizedState = null, 
                            e.updateQueue = null, e.dependencies = null) : (e.childExpirationTime = a.childExpirationTime, 
                            e.expirationTime = a.expirationTime, e.child = a.child, e.memoizedProps = a.memoizedProps, 
                            e.memoizedState = a.memoizedState, e.updateQueue = a.updateQueue, f = a.dependencies, 
                            e.dependencies = null === f ? null : {
                                expirationTime: f.expirationTime,
                                firstContext: f.firstContext,
                                responders: f.responders
                            }), d = d.sibling;
                            I(M, M.current & 1 | 2);
                            return b.child;
                        }
                        f = f.sibling;
                    }
                } else {
                    if (!e) if (a = hh(f), null !== a) {
                        if (b.effectTag |= 64, e = !0, c = a.updateQueue, null !== c && (b.updateQueue = c, 
                        b.effectTag |= 4), ri(d, !0), null === d.tail && "hidden" === d.tailMode && !f.alternate) return b = b.lastEffect = d.lastEffect, 
                        null !== b && (b.nextEffect = null), null;
                    } else 2 * $f() - d.renderingStartTime > d.tailExpiration && 1 < c && (b.effectTag |= 64, 
                    e = !0, ri(d, !1), b.expirationTime = b.childExpirationTime = c - 1);
                    d.isBackwards ? (f.sibling = b.child, b.child = f) : (c = d.last, null !== c ? c.sibling = f : b.child = f, 
                    d.last = f);
                }
                return null !== d.tail ? (0 === d.tailExpiration && (d.tailExpiration = $f() + 500), 
                c = d.tail, d.rendering = c, d.tail = c.sibling, d.lastEffect = b.lastEffect, d.renderingStartTime = $f(), 
                c.sibling = null, b = M.current, I(M, e ? b & 1 | 2 : b & 1), c) : null;
            }
            throw Error(u(156, b.tag));
        }
        function zi(a) {
            switch (a.tag) {
              case 1:
                L(a.type) && Df();
                var b = a.effectTag;
                return b & 4096 ? (a.effectTag = b & -4097 | 64, a) : null;

              case 3:
                eh();
                H(K);
                H(J);
                b = a.effectTag;
                if (0 !== (b & 64)) throw Error(u(285));
                a.effectTag = b & -4097 | 64;
                return a;

              case 5:
                return gh(a), null;

              case 13:
                return H(M), b = a.effectTag, b & 4096 ? (a.effectTag = b & -4097 | 64, a) : null;

              case 19:
                return H(M), null;

              case 4:
                return eh(), null;

              case 10:
                return og(a), null;

              default:
                return null;
            }
        }
        function Ai(a, b) {
            return {
                value: a,
                source: b,
                stack: qb(b)
            };
        }
        var Bi = "function" === typeof WeakSet ? WeakSet : Set;
        function Ci(a, b) {
            var c = b.source, d = b.stack;
            null === d && null !== c && (d = qb(c));
            null !== c && pb(c.type);
            b = b.value;
            null !== a && 1 === a.tag && pb(a.type);
            try {
                console.error(b);
            } catch (e) {
                setTimeout((function() {
                    throw e;
                }));
            }
        }
        function Di(a, b) {
            try {
                b.props = a.memoizedProps, b.state = a.memoizedState, b.componentWillUnmount();
            } catch (c) {
                Ei(a, c);
            }
        }
        function Fi(a) {
            var b = a.ref;
            if (null !== b) if ("function" === typeof b) try {
                b(null);
            } catch (c) {
                Ei(a, c);
            } else b.current = null;
        }
        function Gi(a, b) {
            switch (b.tag) {
              case 0:
              case 11:
              case 15:
              case 22:
                return;

              case 1:
                if (b.effectTag & 256 && null !== a) {
                    var c = a.memoizedProps, d = a.memoizedState;
                    a = b.stateNode;
                    b = a.getSnapshotBeforeUpdate(b.elementType === b.type ? c : ig(b.type, c), d);
                    a.__reactInternalSnapshotBeforeUpdate = b;
                }
                return;

              case 3:
              case 5:
              case 6:
              case 4:
              case 17:
                return;
            }
            throw Error(u(163));
        }
        function Hi(a, b) {
            b = b.updateQueue;
            b = null !== b ? b.lastEffect : null;
            if (null !== b) {
                var c = b = b.next;
                do {
                    if ((c.tag & a) === a) {
                        var d = c.destroy;
                        c.destroy = void 0;
                        void 0 !== d && d();
                    }
                    c = c.next;
                } while (c !== b);
            }
        }
        function Ii(a, b) {
            b = b.updateQueue;
            b = null !== b ? b.lastEffect : null;
            if (null !== b) {
                var c = b = b.next;
                do {
                    if ((c.tag & a) === a) {
                        var d = c.create;
                        c.destroy = d();
                    }
                    c = c.next;
                } while (c !== b);
            }
        }
        function Ji(a, b, c) {
            switch (c.tag) {
              case 0:
              case 11:
              case 15:
              case 22:
                Ii(3, c);
                return;

              case 1:
                a = c.stateNode;
                if (c.effectTag & 4) if (null === b) a.componentDidMount(); else {
                    var d = c.elementType === c.type ? b.memoizedProps : ig(c.type, b.memoizedProps);
                    a.componentDidUpdate(d, b.memoizedState, a.__reactInternalSnapshotBeforeUpdate);
                }
                b = c.updateQueue;
                null !== b && Cg(c, b, a);
                return;

              case 3:
                b = c.updateQueue;
                if (null !== b) {
                    a = null;
                    if (null !== c.child) switch (c.child.tag) {
                      case 5:
                        a = c.child.stateNode;
                        break;

                      case 1:
                        a = c.child.stateNode;
                    }
                    Cg(c, b, a);
                }
                return;

              case 5:
                a = c.stateNode;
                null === b && c.effectTag & 4 && Fd(c.type, c.memoizedProps) && a.focus();
                return;

              case 6:
                return;

              case 4:
                return;

              case 12:
                return;

              case 13:
                null === c.memoizedState && (c = c.alternate, null !== c && (c = c.memoizedState, 
                null !== c && (c = c.dehydrated, null !== c && Vc(c))));
                return;

              case 19:
              case 17:
              case 20:
              case 21:
                return;
            }
            throw Error(u(163));
        }
        function Ki(a, b, c) {
            "function" === typeof Li && Li(b);
            switch (b.tag) {
              case 0:
              case 11:
              case 14:
              case 15:
              case 22:
                a = b.updateQueue;
                if (null !== a && (a = a.lastEffect, null !== a)) {
                    var d = a.next;
                    cg(97 < c ? 97 : c, (function() {
                        var a = d;
                        do {
                            var c = a.destroy;
                            if (void 0 !== c) {
                                var g = b;
                                try {
                                    c();
                                } catch (h) {
                                    Ei(g, h);
                                }
                            }
                            a = a.next;
                        } while (a !== d);
                    }));
                }
                break;

              case 1:
                Fi(b);
                c = b.stateNode;
                "function" === typeof c.componentWillUnmount && Di(b, c);
                break;

              case 5:
                Fi(b);
                break;

              case 4:
                Mi(a, b, c);
            }
        }
        function Ni(a) {
            var b = a.alternate;
            a.return = null;
            a.child = null;
            a.memoizedState = null;
            a.updateQueue = null;
            a.dependencies = null;
            a.alternate = null;
            a.firstEffect = null;
            a.lastEffect = null;
            a.pendingProps = null;
            a.memoizedProps = null;
            a.stateNode = null;
            null !== b && Ni(b);
        }
        function Oi(a) {
            return 5 === a.tag || 3 === a.tag || 4 === a.tag;
        }
        function Pi(a) {
            a: {
                for (var b = a.return; null !== b; ) {
                    if (Oi(b)) {
                        var c = b;
                        break a;
                    }
                    b = b.return;
                }
                throw Error(u(160));
            }
            b = c.stateNode;
            switch (c.tag) {
              case 5:
                var d = !1;
                break;

              case 3:
                b = b.containerInfo;
                d = !0;
                break;

              case 4:
                b = b.containerInfo;
                d = !0;
                break;

              default:
                throw Error(u(161));
            }
            c.effectTag & 16 && (Rb(b, ""), c.effectTag &= -17);
            a: b: for (c = a; ;) {
                for (;null === c.sibling; ) {
                    if (null === c.return || Oi(c.return)) {
                        c = null;
                        break a;
                    }
                    c = c.return;
                }
                c.sibling.return = c.return;
                for (c = c.sibling; 5 !== c.tag && 6 !== c.tag && 18 !== c.tag; ) {
                    if (c.effectTag & 2) continue b;
                    if (null === c.child || 4 === c.tag) continue b; else c.child.return = c, c = c.child;
                }
                if (!(c.effectTag & 2)) {
                    c = c.stateNode;
                    break a;
                }
            }
            d ? Qi(a, c, b) : Ri(a, c, b);
        }
        function Qi(a, b, c) {
            var d = a.tag, e = 5 === d || 6 === d;
            if (e) a = e ? a.stateNode : a.stateNode.instance, b ? 8 === c.nodeType ? c.parentNode.insertBefore(a, b) : c.insertBefore(a, b) : (8 === c.nodeType ? (b = c.parentNode, 
            b.insertBefore(a, c)) : (b = c, b.appendChild(a)), c = c._reactRootContainer, null !== c && void 0 !== c || null !== b.onclick || (b.onclick = sd)); else if (4 !== d && (a = a.child, 
            null !== a)) for (Qi(a, b, c), a = a.sibling; null !== a; ) Qi(a, b, c), a = a.sibling;
        }
        function Ri(a, b, c) {
            var d = a.tag, e = 5 === d || 6 === d;
            if (e) a = e ? a.stateNode : a.stateNode.instance, b ? c.insertBefore(a, b) : c.appendChild(a); else if (4 !== d && (a = a.child, 
            null !== a)) for (Ri(a, b, c), a = a.sibling; null !== a; ) Ri(a, b, c), a = a.sibling;
        }
        function Mi(a, b, c) {
            for (var d = b, e = !1, f, g; ;) {
                if (!e) {
                    e = d.return;
                    a: for (;;) {
                        if (null === e) throw Error(u(160));
                        f = e.stateNode;
                        switch (e.tag) {
                          case 5:
                            g = !1;
                            break a;

                          case 3:
                            f = f.containerInfo;
                            g = !0;
                            break a;

                          case 4:
                            f = f.containerInfo;
                            g = !0;
                            break a;
                        }
                        e = e.return;
                    }
                    e = !0;
                }
                if (5 === d.tag || 6 === d.tag) {
                    a: for (var h = a, k = d, l = c, m = k; ;) if (Ki(h, m, l), null !== m.child && 4 !== m.tag) m.child.return = m, 
                    m = m.child; else {
                        if (m === k) break a;
                        for (;null === m.sibling; ) {
                            if (null === m.return || m.return === k) break a;
                            m = m.return;
                        }
                        m.sibling.return = m.return;
                        m = m.sibling;
                    }
                    g ? (h = f, k = d.stateNode, 8 === h.nodeType ? h.parentNode.removeChild(k) : h.removeChild(k)) : f.removeChild(d.stateNode);
                } else if (4 === d.tag) {
                    if (null !== d.child) {
                        f = d.stateNode.containerInfo;
                        g = !0;
                        d.child.return = d;
                        d = d.child;
                        continue;
                    }
                } else if (Ki(a, d, c), null !== d.child) {
                    d.child.return = d;
                    d = d.child;
                    continue;
                }
                if (d === b) break;
                for (;null === d.sibling; ) {
                    if (null === d.return || d.return === b) return;
                    d = d.return;
                    4 === d.tag && (e = !1);
                }
                d.sibling.return = d.return;
                d = d.sibling;
            }
        }
        function Si(a, b) {
            switch (b.tag) {
              case 0:
              case 11:
              case 14:
              case 15:
              case 22:
                Hi(3, b);
                return;

              case 1:
                return;

              case 5:
                var c = b.stateNode;
                if (null != c) {
                    var d = b.memoizedProps, e = null !== a ? a.memoizedProps : d;
                    a = b.type;
                    var f = b.updateQueue;
                    b.updateQueue = null;
                    if (null !== f) {
                        c[Nd] = d;
                        "input" === a && "radio" === d.type && null != d.name && Bb(c, d);
                        pd(a, e);
                        b = pd(a, d);
                        for (e = 0; e < f.length; e += 2) {
                            var g = f[e], h = f[e + 1];
                            "style" === g ? md(c, h) : "dangerouslySetInnerHTML" === g ? Qb(c, h) : "children" === g ? Rb(c, h) : Xa(c, g, h, b);
                        }
                        switch (a) {
                          case "input":
                            Cb(c, d);
                            break;

                          case "textarea":
                            Kb(c, d);
                            break;

                          case "select":
                            b = c._wrapperState.wasMultiple, c._wrapperState.wasMultiple = !!d.multiple, a = d.value, 
                            null != a ? Hb(c, !!d.multiple, a, !1) : b !== !!d.multiple && (null != d.defaultValue ? Hb(c, !!d.multiple, d.defaultValue, !0) : Hb(c, !!d.multiple, d.multiple ? [] : "", !1));
                        }
                    }
                }
                return;

              case 6:
                if (null === b.stateNode) throw Error(u(162));
                b.stateNode.nodeValue = b.memoizedProps;
                return;

              case 3:
                b = b.stateNode;
                b.hydrate && (b.hydrate = !1, Vc(b.containerInfo));
                return;

              case 12:
                return;

              case 13:
                c = b;
                null === b.memoizedState ? d = !1 : (d = !0, c = b.child, Ti = $f());
                if (null !== c) a: for (a = c; ;) {
                    if (5 === a.tag) f = a.stateNode, d ? (f = f.style, "function" === typeof f.setProperty ? f.setProperty("display", "none", "important") : f.display = "none") : (f = a.stateNode, 
                    e = a.memoizedProps.style, e = void 0 !== e && null !== e && e.hasOwnProperty("display") ? e.display : null, 
                    f.style.display = ld("display", e)); else if (6 === a.tag) a.stateNode.nodeValue = d ? "" : a.memoizedProps; else if (13 === a.tag && null !== a.memoizedState && null === a.memoizedState.dehydrated) {
                        f = a.child.sibling;
                        f.return = a;
                        a = f;
                        continue;
                    } else if (null !== a.child) {
                        a.child.return = a;
                        a = a.child;
                        continue;
                    }
                    if (a === c) break;
                    for (;null === a.sibling; ) {
                        if (null === a.return || a.return === c) break a;
                        a = a.return;
                    }
                    a.sibling.return = a.return;
                    a = a.sibling;
                }
                Ui(b);
                return;

              case 19:
                Ui(b);
                return;

              case 17:
                return;
            }
            throw Error(u(163));
        }
        function Ui(a) {
            var b = a.updateQueue;
            if (null !== b) {
                a.updateQueue = null;
                var c = a.stateNode;
                null === c && (c = a.stateNode = new Bi);
                b.forEach((function(b) {
                    var d = Vi.bind(null, a, b);
                    c.has(b) || (c.add(b), b.then(d, d));
                }));
            }
        }
        var Wi = "function" === typeof WeakMap ? WeakMap : Map;
        function Xi(a, b, c) {
            c = wg(c, null);
            c.tag = 3;
            c.payload = {
                element: null
            };
            var d = b.value;
            c.callback = function() {
                Yi || (Yi = !0, Zi = d);
                Ci(a, b);
            };
            return c;
        }
        function $i(a, b, c) {
            c = wg(c, null);
            c.tag = 3;
            var d = a.type.getDerivedStateFromError;
            if ("function" === typeof d) {
                var e = b.value;
                c.payload = function() {
                    Ci(a, b);
                    return d(e);
                };
            }
            var f = a.stateNode;
            null !== f && "function" === typeof f.componentDidCatch && (c.callback = function() {
                "function" !== typeof d && (null === aj ? aj = new Set([ this ]) : aj.add(this), 
                Ci(a, b));
                var c = b.stack;
                this.componentDidCatch(b.value, {
                    componentStack: null !== c ? c : ""
                });
            });
            return c;
        }
        var bj = Math.ceil, cj = Wa.ReactCurrentDispatcher, dj = Wa.ReactCurrentOwner, V = 0, ej = 8, fj = 16, gj = 32, ti = 0, hj = 1, ij = 2, ui = 3, vi = 4, jj = 5, W = V, T = null, X = null, U = 0, S = ti, kj = null, lj = 1073741823, mj = 1073741823, nj = null, wi = 0, oj = !1, Ti = 0, pj = 500, Y = null, Yi = !1, Zi = null, aj = null, qj = !1, rj = null, sj = 90, tj = null, uj = 0, vj = null, wj = 0;
        function Gg() {
            return (W & (fj | gj)) !== V ? 1073741821 - ($f() / 10 | 0) : 0 !== wj ? wj : wj = 1073741821 - ($f() / 10 | 0);
        }
        function Hg(a, b, c) {
            b = b.mode;
            if (0 === (b & 2)) return 1073741823;
            var d = ag();
            if (0 === (b & 4)) return 99 === d ? 1073741823 : 1073741822;
            if ((W & fj) !== V) return U;
            if (null !== c) a = hg(a, c.timeoutMs | 0 || 5e3, 250); else switch (d) {
              case 99:
                a = 1073741823;
                break;

              case 98:
                a = hg(a, 150, 100);
                break;

              case 97:
              case 96:
                a = hg(a, 5e3, 250);
                break;

              case 95:
                a = 2;
                break;

              default:
                throw Error(u(326));
            }
            null !== T && a === U && --a;
            return a;
        }
        function Ig(a, b) {
            if (50 < uj) throw uj = 0, vj = null, Error(u(185));
            a = xj(a, b);
            if (null !== a) {
                var c = ag();
                1073741823 === b ? (W & ej) !== V && (W & (fj | gj)) === V ? yj(a) : (Z(a), W === V && gg()) : Z(a);
                (W & 4) === V || 98 !== c && 99 !== c || (null === tj ? tj = new Map([ [ a, b ] ]) : (c = tj.get(a), 
                (void 0 === c || c > b) && tj.set(a, b)));
            }
        }
        function xj(a, b) {
            a.expirationTime < b && (a.expirationTime = b);
            var c = a.alternate;
            null !== c && c.expirationTime < b && (c.expirationTime = b);
            var d = a.return, e = null;
            if (null === d && 3 === a.tag) e = a.stateNode; else for (;null !== d; ) {
                c = d.alternate;
                d.childExpirationTime < b && (d.childExpirationTime = b);
                null !== c && c.childExpirationTime < b && (c.childExpirationTime = b);
                if (null === d.return && 3 === d.tag) {
                    e = d.stateNode;
                    break;
                }
                d = d.return;
            }
            null !== e && (T === e && (Bg(b), S === vi && xi(e, U)), yi(e, b));
            return e;
        }
        function zj(a) {
            var b = a.lastExpiredTime;
            if (0 !== b) return b;
            b = a.firstPendingTime;
            if (!Aj(a, b)) return b;
            var c = a.lastPingedTime;
            a = a.nextKnownPendingLevel;
            a = c > a ? c : a;
            return 2 >= a && b !== a ? 0 : a;
        }
        function Z(a) {
            if (0 !== a.lastExpiredTime) a.callbackExpirationTime = 1073741823, a.callbackPriority = 99, 
            a.callbackNode = eg(yj.bind(null, a)); else {
                var b = zj(a), c = a.callbackNode;
                if (0 === b) null !== c && (a.callbackNode = null, a.callbackExpirationTime = 0, 
                a.callbackPriority = 90); else {
                    var d = Gg();
                    1073741823 === b ? d = 99 : 1 === b || 2 === b ? d = 95 : (d = 10 * (1073741821 - b) - 10 * (1073741821 - d), 
                    d = 0 >= d ? 99 : 250 >= d ? 98 : 5250 >= d ? 97 : 95);
                    if (null !== c) {
                        var e = a.callbackPriority;
                        if (a.callbackExpirationTime === b && e >= d) return;
                        c !== Tf && Kf(c);
                    }
                    a.callbackExpirationTime = b;
                    a.callbackPriority = d;
                    b = 1073741823 === b ? eg(yj.bind(null, a)) : dg(d, Bj.bind(null, a), {
                        timeout: 10 * (1073741821 - b) - $f()
                    });
                    a.callbackNode = b;
                }
            }
        }
        function Bj(a, b) {
            wj = 0;
            if (b) return b = Gg(), Cj(a, b), Z(a), null;
            var c = zj(a);
            if (0 !== c) {
                b = a.callbackNode;
                if ((W & (fj | gj)) !== V) throw Error(u(327));
                Dj();
                a === T && c === U || Ej(a, c);
                if (null !== X) {
                    var d = W;
                    W |= fj;
                    var e = Fj();
                    do {
                        try {
                            Gj();
                            break;
                        } catch (h) {
                            Hj(a, h);
                        }
                    } while (1);
                    ng();
                    W = d;
                    cj.current = e;
                    if (S === hj) throw b = kj, Ej(a, c), xi(a, c), Z(a), b;
                    if (null === X) switch (e = a.finishedWork = a.current.alternate, a.finishedExpirationTime = c, 
                    d = S, T = null, d) {
                      case ti:
                      case hj:
                        throw Error(u(345));

                      case ij:
                        Cj(a, 2 < c ? 2 : c);
                        break;

                      case ui:
                        xi(a, c);
                        d = a.lastSuspendedTime;
                        c === d && (a.nextKnownPendingLevel = Ij(e));
                        if (1073741823 === lj && (e = Ti + pj - $f(), 10 < e)) {
                            if (oj) {
                                var f = a.lastPingedTime;
                                if (0 === f || f >= c) {
                                    a.lastPingedTime = c;
                                    Ej(a, c);
                                    break;
                                }
                            }
                            f = zj(a);
                            if (0 !== f && f !== c) break;
                            if (0 !== d && d !== c) {
                                a.lastPingedTime = d;
                                break;
                            }
                            a.timeoutHandle = Hd(Jj.bind(null, a), e);
                            break;
                        }
                        Jj(a);
                        break;

                      case vi:
                        xi(a, c);
                        d = a.lastSuspendedTime;
                        c === d && (a.nextKnownPendingLevel = Ij(e));
                        if (oj && (e = a.lastPingedTime, 0 === e || e >= c)) {
                            a.lastPingedTime = c;
                            Ej(a, c);
                            break;
                        }
                        e = zj(a);
                        if (0 !== e && e !== c) break;
                        if (0 !== d && d !== c) {
                            a.lastPingedTime = d;
                            break;
                        }
                        1073741823 !== mj ? d = 10 * (1073741821 - mj) - $f() : 1073741823 === lj ? d = 0 : (d = 10 * (1073741821 - lj) - 5e3, 
                        e = $f(), c = 10 * (1073741821 - c) - e, d = e - d, 0 > d && (d = 0), d = (120 > d ? 120 : 480 > d ? 480 : 1080 > d ? 1080 : 1920 > d ? 1920 : 3e3 > d ? 3e3 : 4320 > d ? 4320 : 1960 * bj(d / 1960)) - d, 
                        c < d && (d = c));
                        if (10 < d) {
                            a.timeoutHandle = Hd(Jj.bind(null, a), d);
                            break;
                        }
                        Jj(a);
                        break;

                      case jj:
                        if (1073741823 !== lj && null !== nj) {
                            f = lj;
                            var g = nj;
                            d = g.busyMinDurationMs | 0;
                            0 >= d ? d = 0 : (e = g.busyDelayMs | 0, f = $f() - (10 * (1073741821 - f) - (g.timeoutMs | 0 || 5e3)), 
                            d = f <= e ? 0 : e + d - f);
                            if (10 < d) {
                                xi(a, c);
                                a.timeoutHandle = Hd(Jj.bind(null, a), d);
                                break;
                            }
                        }
                        Jj(a);
                        break;

                      default:
                        throw Error(u(329));
                    }
                    Z(a);
                    if (a.callbackNode === b) return Bj.bind(null, a);
                }
            }
            return null;
        }
        function yj(a) {
            var b = a.lastExpiredTime;
            b = 0 !== b ? b : 1073741823;
            if ((W & (fj | gj)) !== V) throw Error(u(327));
            Dj();
            a === T && b === U || Ej(a, b);
            if (null !== X) {
                var c = W;
                W |= fj;
                var d = Fj();
                do {
                    try {
                        Kj();
                        break;
                    } catch (e) {
                        Hj(a, e);
                    }
                } while (1);
                ng();
                W = c;
                cj.current = d;
                if (S === hj) throw c = kj, Ej(a, b), xi(a, b), Z(a), c;
                if (null !== X) throw Error(u(261));
                a.finishedWork = a.current.alternate;
                a.finishedExpirationTime = b;
                T = null;
                Jj(a);
                Z(a);
            }
            return null;
        }
        function Lj() {
            if (null !== tj) {
                var a = tj;
                tj = null;
                a.forEach((function(a, c) {
                    Cj(c, a);
                    Z(c);
                }));
                gg();
            }
        }
        function Mj(a, b) {
            var c = W;
            W |= 1;
            try {
                return a(b);
            } finally {
                W = c, W === V && gg();
            }
        }
        function Nj(a, b) {
            var c = W;
            W &= -2;
            W |= ej;
            try {
                return a(b);
            } finally {
                W = c, W === V && gg();
            }
        }
        function Ej(a, b) {
            a.finishedWork = null;
            a.finishedExpirationTime = 0;
            var c = a.timeoutHandle;
            -1 !== c && (a.timeoutHandle = -1, Id(c));
            if (null !== X) for (c = X.return; null !== c; ) {
                var d = c;
                switch (d.tag) {
                  case 1:
                    d = d.type.childContextTypes;
                    null !== d && void 0 !== d && Df();
                    break;

                  case 3:
                    eh();
                    H(K);
                    H(J);
                    break;

                  case 5:
                    gh(d);
                    break;

                  case 4:
                    eh();
                    break;

                  case 13:
                    H(M);
                    break;

                  case 19:
                    H(M);
                    break;

                  case 10:
                    og(d);
                }
                c = c.return;
            }
            T = a;
            X = Sg(a.current, null);
            U = b;
            S = ti;
            kj = null;
            mj = lj = 1073741823;
            nj = null;
            wi = 0;
            oj = !1;
        }
        function Hj(a, b) {
            do {
                try {
                    ng();
                    jh.current = sh;
                    if (mh) for (var c = N.memoizedState; null !== c; ) {
                        var d = c.queue;
                        null !== d && (d.pending = null);
                        c = c.next;
                    }
                    lh = 0;
                    P = O = N = null;
                    mh = !1;
                    if (null === X || null === X.return) return S = hj, kj = b, X = null;
                    a: {
                        var e = a, f = X.return, g = X, h = b;
                        b = U;
                        g.effectTag |= 2048;
                        g.firstEffect = g.lastEffect = null;
                        if (null !== h && "object" === typeof h && "function" === typeof h.then) {
                            var k = h;
                            if (0 === (g.mode & 2)) {
                                var l = g.alternate;
                                l ? (g.updateQueue = l.updateQueue, g.memoizedState = l.memoizedState, g.expirationTime = l.expirationTime) : (g.updateQueue = null, 
                                g.memoizedState = null);
                            }
                            var m = 0 !== (M.current & 1), p = f;
                            do {
                                var x;
                                if (x = 13 === p.tag) {
                                    var z = p.memoizedState;
                                    if (null !== z) x = null !== z.dehydrated ? !0 : !1; else {
                                        var ca = p.memoizedProps;
                                        x = void 0 === ca.fallback ? !1 : !0 !== ca.unstable_avoidThisFallback ? !0 : m ? !1 : !0;
                                    }
                                }
                                if (x) {
                                    var D = p.updateQueue;
                                    if (null === D) {
                                        var t = new Set;
                                        t.add(k);
                                        p.updateQueue = t;
                                    } else D.add(k);
                                    if (0 === (p.mode & 2)) {
                                        p.effectTag |= 64;
                                        g.effectTag &= -2981;
                                        if (1 === g.tag) if (null === g.alternate) g.tag = 17; else {
                                            var y = wg(1073741823, null);
                                            y.tag = 2;
                                            xg(g, y);
                                        }
                                        g.expirationTime = 1073741823;
                                        break a;
                                    }
                                    h = void 0;
                                    g = b;
                                    var A = e.pingCache;
                                    null === A ? (A = e.pingCache = new Wi, h = new Set, A.set(k, h)) : (h = A.get(k), 
                                    void 0 === h && (h = new Set, A.set(k, h)));
                                    if (!h.has(g)) {
                                        h.add(g);
                                        var q = Oj.bind(null, e, k, g);
                                        k.then(q, q);
                                    }
                                    p.effectTag |= 4096;
                                    p.expirationTime = b;
                                    break a;
                                }
                                p = p.return;
                            } while (null !== p);
                            h = Error((pb(g.type) || "A React component") + " suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display." + qb(g));
                        }
                        S !== jj && (S = ij);
                        h = Ai(h, g);
                        p = f;
                        do {
                            switch (p.tag) {
                              case 3:
                                k = h;
                                p.effectTag |= 4096;
                                p.expirationTime = b;
                                var B = Xi(p, k, b);
                                yg(p, B);
                                break a;

                              case 1:
                                k = h;
                                var w = p.type, ub = p.stateNode;
                                if (0 === (p.effectTag & 64) && ("function" === typeof w.getDerivedStateFromError || null !== ub && "function" === typeof ub.componentDidCatch && (null === aj || !aj.has(ub)))) {
                                    p.effectTag |= 4096;
                                    p.expirationTime = b;
                                    var vb = $i(p, k, b);
                                    yg(p, vb);
                                    break a;
                                }
                            }
                            p = p.return;
                        } while (null !== p);
                    }
                    X = Pj(X);
                } catch (Xc) {
                    b = Xc;
                    continue;
                }
                break;
            } while (1);
        }
        function Fj() {
            var a = cj.current;
            cj.current = sh;
            return null === a ? sh : a;
        }
        function Ag(a, b) {
            a < lj && 2 < a && (lj = a);
            null !== b && a < mj && 2 < a && (mj = a, nj = b);
        }
        function Bg(a) {
            a > wi && (wi = a);
        }
        function Kj() {
            for (;null !== X; ) X = Qj(X);
        }
        function Gj() {
            for (;null !== X && !Uf(); ) X = Qj(X);
        }
        function Qj(a) {
            var b = Rj(a.alternate, a, U);
            a.memoizedProps = a.pendingProps;
            null === b && (b = Pj(a));
            dj.current = null;
            return b;
        }
        function Pj(a) {
            X = a;
            do {
                var b = X.alternate;
                a = X.return;
                if (0 === (X.effectTag & 2048)) {
                    b = si(b, X, U);
                    if (1 === U || 1 !== X.childExpirationTime) {
                        for (var c = 0, d = X.child; null !== d; ) {
                            var e = d.expirationTime, f = d.childExpirationTime;
                            e > c && (c = e);
                            f > c && (c = f);
                            d = d.sibling;
                        }
                        X.childExpirationTime = c;
                    }
                    if (null !== b) return b;
                    null !== a && 0 === (a.effectTag & 2048) && (null === a.firstEffect && (a.firstEffect = X.firstEffect), 
                    null !== X.lastEffect && (null !== a.lastEffect && (a.lastEffect.nextEffect = X.firstEffect), 
                    a.lastEffect = X.lastEffect), 1 < X.effectTag && (null !== a.lastEffect ? a.lastEffect.nextEffect = X : a.firstEffect = X, 
                    a.lastEffect = X));
                } else {
                    b = zi(X);
                    if (null !== b) return b.effectTag &= 2047, b;
                    null !== a && (a.firstEffect = a.lastEffect = null, a.effectTag |= 2048);
                }
                b = X.sibling;
                if (null !== b) return b;
                X = a;
            } while (null !== X);
            S === ti && (S = jj);
            return null;
        }
        function Ij(a) {
            var b = a.expirationTime;
            a = a.childExpirationTime;
            return b > a ? b : a;
        }
        function Jj(a) {
            var b = ag();
            cg(99, Sj.bind(null, a, b));
            return null;
        }
        function Sj(a, b) {
            do {
                Dj();
            } while (null !== rj);
            if ((W & (fj | gj)) !== V) throw Error(u(327));
            var c = a.finishedWork, d = a.finishedExpirationTime;
            if (null === c) return null;
            a.finishedWork = null;
            a.finishedExpirationTime = 0;
            if (c === a.current) throw Error(u(177));
            a.callbackNode = null;
            a.callbackExpirationTime = 0;
            a.callbackPriority = 90;
            a.nextKnownPendingLevel = 0;
            var e = Ij(c);
            a.firstPendingTime = e;
            d <= a.lastSuspendedTime ? a.firstSuspendedTime = a.lastSuspendedTime = a.nextKnownPendingLevel = 0 : d <= a.firstSuspendedTime && (a.firstSuspendedTime = d - 1);
            d <= a.lastPingedTime && (a.lastPingedTime = 0);
            d <= a.lastExpiredTime && (a.lastExpiredTime = 0);
            a === T && (X = T = null, U = 0);
            1 < c.effectTag ? null !== c.lastEffect ? (c.lastEffect.nextEffect = c, e = c.firstEffect) : e = c : e = c.firstEffect;
            if (null !== e) {
                var f = W;
                W |= gj;
                dj.current = null;
                Dd = fd;
                var g = xd();
                if (yd(g)) {
                    if ("selectionStart" in g) var h = {
                        start: g.selectionStart,
                        end: g.selectionEnd
                    }; else a: {
                        h = (h = g.ownerDocument) && h.defaultView || window;
                        var k = h.getSelection && h.getSelection();
                        if (k && 0 !== k.rangeCount) {
                            h = k.anchorNode;
                            var l = k.anchorOffset, m = k.focusNode;
                            k = k.focusOffset;
                            try {
                                h.nodeType, m.nodeType;
                            } catch (wb) {
                                h = null;
                                break a;
                            }
                            var p = 0, x = -1, z = -1, ca = 0, D = 0, t = g, y = null;
                            b: for (;;) {
                                for (var A; ;) {
                                    t !== h || 0 !== l && 3 !== t.nodeType || (x = p + l);
                                    t !== m || 0 !== k && 3 !== t.nodeType || (z = p + k);
                                    3 === t.nodeType && (p += t.nodeValue.length);
                                    if (null === (A = t.firstChild)) break;
                                    y = t;
                                    t = A;
                                }
                                for (;;) {
                                    if (t === g) break b;
                                    y === h && ++ca === l && (x = p);
                                    y === m && ++D === k && (z = p);
                                    if (null !== (A = t.nextSibling)) break;
                                    t = y;
                                    y = t.parentNode;
                                }
                                t = A;
                            }
                            h = -1 === x || -1 === z ? null : {
                                start: x,
                                end: z
                            };
                        } else h = null;
                    }
                    h = h || {
                        start: 0,
                        end: 0
                    };
                } else h = null;
                Ed = {
                    activeElementDetached: null,
                    focusedElem: g,
                    selectionRange: h
                };
                fd = !1;
                Y = e;
                do {
                    try {
                        Tj();
                    } catch (wb) {
                        if (null === Y) throw Error(u(330));
                        Ei(Y, wb);
                        Y = Y.nextEffect;
                    }
                } while (null !== Y);
                Y = e;
                do {
                    try {
                        for (g = a, h = b; null !== Y; ) {
                            var q = Y.effectTag;
                            q & 16 && Rb(Y.stateNode, "");
                            if (q & 128) {
                                var B = Y.alternate;
                                if (null !== B) {
                                    var w = B.ref;
                                    null !== w && ("function" === typeof w ? w(null) : w.current = null);
                                }
                            }
                            switch (q & 1038) {
                              case 2:
                                Pi(Y);
                                Y.effectTag &= -3;
                                break;

                              case 6:
                                Pi(Y);
                                Y.effectTag &= -3;
                                Si(Y.alternate, Y);
                                break;

                              case 1024:
                                Y.effectTag &= -1025;
                                break;

                              case 1028:
                                Y.effectTag &= -1025;
                                Si(Y.alternate, Y);
                                break;

                              case 4:
                                Si(Y.alternate, Y);
                                break;

                              case 8:
                                l = Y, Mi(g, l, h), Ni(l);
                            }
                            Y = Y.nextEffect;
                        }
                    } catch (wb) {
                        if (null === Y) throw Error(u(330));
                        Ei(Y, wb);
                        Y = Y.nextEffect;
                    }
                } while (null !== Y);
                w = Ed;
                B = xd();
                q = w.focusedElem;
                h = w.selectionRange;
                if (B !== q && q && q.ownerDocument && wd(q.ownerDocument.documentElement, q)) {
                    null !== h && yd(q) && (B = h.start, w = h.end, void 0 === w && (w = B), "selectionStart" in q ? (q.selectionStart = B, 
                    q.selectionEnd = Math.min(w, q.value.length)) : (w = (B = q.ownerDocument || document) && B.defaultView || window, 
                    w.getSelection && (w = w.getSelection(), l = q.textContent.length, g = Math.min(h.start, l), 
                    h = void 0 === h.end ? g : Math.min(h.end, l), !w.extend && g > h && (l = h, h = g, 
                    g = l), l = vd(q, g), m = vd(q, h), l && m && (1 !== w.rangeCount || w.anchorNode !== l.node || w.anchorOffset !== l.offset || w.focusNode !== m.node || w.focusOffset !== m.offset) && (B = B.createRange(), 
                    B.setStart(l.node, l.offset), w.removeAllRanges(), g > h ? (w.addRange(B), w.extend(m.node, m.offset)) : (B.setEnd(m.node, m.offset), 
                    w.addRange(B))))));
                    B = [];
                    for (w = q; w = w.parentNode; ) 1 === w.nodeType && B.push({
                        element: w,
                        left: w.scrollLeft,
                        top: w.scrollTop
                    });
                    "function" === typeof q.focus && q.focus();
                    for (q = 0; q < B.length; q++) w = B[q], w.element.scrollLeft = w.left, w.element.scrollTop = w.top;
                }
                fd = !!Dd;
                Ed = Dd = null;
                a.current = c;
                Y = e;
                do {
                    try {
                        for (q = a; null !== Y; ) {
                            var ub = Y.effectTag;
                            ub & 36 && Ji(q, Y.alternate, Y);
                            if (ub & 128) {
                                B = void 0;
                                var vb = Y.ref;
                                if (null !== vb) {
                                    var Xc = Y.stateNode;
                                    switch (Y.tag) {
                                      case 5:
                                        B = Xc;
                                        break;

                                      default:
                                        B = Xc;
                                    }
                                    "function" === typeof vb ? vb(B) : vb.current = B;
                                }
                            }
                            Y = Y.nextEffect;
                        }
                    } catch (wb) {
                        if (null === Y) throw Error(u(330));
                        Ei(Y, wb);
                        Y = Y.nextEffect;
                    }
                } while (null !== Y);
                Y = null;
                Vf();
                W = f;
            } else a.current = c;
            if (qj) qj = !1, rj = a, sj = b; else for (Y = e; null !== Y; ) b = Y.nextEffect, 
            Y.nextEffect = null, Y = b;
            b = a.firstPendingTime;
            0 === b && (aj = null);
            1073741823 === b ? a === vj ? uj++ : (uj = 0, vj = a) : uj = 0;
            "function" === typeof Uj && Uj(c.stateNode, d);
            Z(a);
            if (Yi) throw Yi = !1, a = Zi, Zi = null, a;
            if ((W & ej) !== V) return null;
            gg();
            return null;
        }
        function Tj() {
            for (;null !== Y; ) {
                var a = Y.effectTag;
                0 !== (a & 256) && Gi(Y.alternate, Y);
                0 === (a & 512) || qj || (qj = !0, dg(97, (function() {
                    Dj();
                    return null;
                })));
                Y = Y.nextEffect;
            }
        }
        function Dj() {
            if (90 !== sj) {
                var a = 97 < sj ? 97 : sj;
                sj = 90;
                return cg(a, Vj);
            }
        }
        function Vj() {
            if (null === rj) return !1;
            var a = rj;
            rj = null;
            if ((W & (fj | gj)) !== V) throw Error(u(331));
            var b = W;
            W |= gj;
            for (a = a.current.firstEffect; null !== a; ) {
                try {
                    var c = a;
                    if (0 !== (c.effectTag & 512)) switch (c.tag) {
                      case 0:
                      case 11:
                      case 15:
                      case 22:
                        Hi(5, c), Ii(5, c);
                    }
                } catch (d) {
                    if (null === a) throw Error(u(330));
                    Ei(a, d);
                }
                c = a.nextEffect;
                a.nextEffect = null;
                a = c;
            }
            W = b;
            gg();
            return !0;
        }
        function Wj(a, b, c) {
            b = Ai(c, b);
            b = Xi(a, b, 1073741823);
            xg(a, b);
            a = xj(a, 1073741823);
            null !== a && Z(a);
        }
        function Ei(a, b) {
            if (3 === a.tag) Wj(a, a, b); else for (var c = a.return; null !== c; ) {
                if (3 === c.tag) {
                    Wj(c, a, b);
                    break;
                } else if (1 === c.tag) {
                    var d = c.stateNode;
                    if ("function" === typeof c.type.getDerivedStateFromError || "function" === typeof d.componentDidCatch && (null === aj || !aj.has(d))) {
                        a = Ai(b, a);
                        a = $i(c, a, 1073741823);
                        xg(c, a);
                        c = xj(c, 1073741823);
                        null !== c && Z(c);
                        break;
                    }
                }
                c = c.return;
            }
        }
        function Oj(a, b, c) {
            var d = a.pingCache;
            null !== d && d.delete(b);
            T === a && U === c ? S === vi || S === ui && 1073741823 === lj && $f() - Ti < pj ? Ej(a, U) : oj = !0 : Aj(a, c) && (b = a.lastPingedTime, 
            0 !== b && b < c || (a.lastPingedTime = c, Z(a)));
        }
        function Vi(a, b) {
            var c = a.stateNode;
            null !== c && c.delete(b);
            b = 0;
            0 === b && (b = Gg(), b = Hg(b, a, null));
            a = xj(a, b);
            null !== a && Z(a);
        }
        var Rj;
        Rj = function(a, b, c) {
            var d = b.expirationTime;
            if (null !== a) {
                var e = b.pendingProps;
                if (a.memoizedProps !== e || K.current) rg = !0; else {
                    if (d < c) {
                        rg = !1;
                        switch (b.tag) {
                          case 3:
                            hi(b);
                            Xh();
                            break;

                          case 5:
                            fh(b);
                            if (b.mode & 4 && 1 !== c && e.hidden) return b.expirationTime = b.childExpirationTime = 1, 
                            null;
                            break;

                          case 1:
                            L(b.type) && Gf(b);
                            break;

                          case 4:
                            dh(b, b.stateNode.containerInfo);
                            break;

                          case 10:
                            d = b.memoizedProps.value;
                            e = b.type._context;
                            I(jg, e._currentValue);
                            e._currentValue = d;
                            break;

                          case 13:
                            if (null !== b.memoizedState) {
                                d = b.child.childExpirationTime;
                                if (0 !== d && d >= c) return ji(a, b, c);
                                I(M, M.current & 1);
                                b = $h(a, b, c);
                                return null !== b ? b.sibling : null;
                            }
                            I(M, M.current & 1);
                            break;

                          case 19:
                            d = b.childExpirationTime >= c;
                            if (0 !== (a.effectTag & 64)) {
                                if (d) return mi(a, b, c);
                                b.effectTag |= 64;
                            }
                            e = b.memoizedState;
                            null !== e && (e.rendering = null, e.tail = null);
                            I(M, M.current);
                            if (!d) return null;
                        }
                        return $h(a, b, c);
                    }
                    rg = !1;
                }
            } else rg = !1;
            b.expirationTime = 0;
            switch (b.tag) {
              case 2:
                d = b.type;
                null !== a && (a.alternate = null, b.alternate = null, b.effectTag |= 2);
                a = b.pendingProps;
                e = Cf(b, J.current);
                qg(b, c);
                e = oh(null, b, d, a, e, c);
                b.effectTag |= 1;
                if ("object" === typeof e && null !== e && "function" === typeof e.render && void 0 === e.$$typeof) {
                    b.tag = 1;
                    b.memoizedState = null;
                    b.updateQueue = null;
                    if (L(d)) {
                        var f = !0;
                        Gf(b);
                    } else f = !1;
                    b.memoizedState = null !== e.state && void 0 !== e.state ? e.state : null;
                    ug(b);
                    var g = d.getDerivedStateFromProps;
                    "function" === typeof g && Fg(b, d, g, a);
                    e.updater = Jg;
                    b.stateNode = e;
                    e._reactInternalFiber = b;
                    Ng(b, d, a, c);
                    b = gi(null, b, d, !0, f, c);
                } else b.tag = 0, R(null, b, e, c), b = b.child;
                return b;

              case 16:
                a: {
                    e = b.elementType;
                    null !== a && (a.alternate = null, b.alternate = null, b.effectTag |= 2);
                    a = b.pendingProps;
                    ob(e);
                    if (1 !== e._status) throw e._result;
                    e = e._result;
                    b.type = e;
                    f = b.tag = Xj(e);
                    a = ig(e, a);
                    switch (f) {
                      case 0:
                        b = di(null, b, e, a, c);
                        break a;

                      case 1:
                        b = fi(null, b, e, a, c);
                        break a;

                      case 11:
                        b = Zh(null, b, e, a, c);
                        break a;

                      case 14:
                        b = ai(null, b, e, ig(e.type, a), d, c);
                        break a;
                    }
                    throw Error(u(306, e, ""));
                }
                return b;

              case 0:
                return d = b.type, e = b.pendingProps, e = b.elementType === d ? e : ig(d, e), di(a, b, d, e, c);

              case 1:
                return d = b.type, e = b.pendingProps, e = b.elementType === d ? e : ig(d, e), fi(a, b, d, e, c);

              case 3:
                hi(b);
                d = b.updateQueue;
                if (null === a || null === d) throw Error(u(282));
                d = b.pendingProps;
                e = b.memoizedState;
                e = null !== e ? e.element : null;
                vg(a, b);
                zg(b, d, null, c);
                d = b.memoizedState.element;
                if (d === e) Xh(), b = $h(a, b, c); else {
                    if (e = b.stateNode.hydrate) Ph = Jd(b.stateNode.containerInfo.firstChild), Oh = b, 
                    e = Qh = !0;
                    if (e) for (c = Yg(b, null, d, c), b.child = c; c; ) c.effectTag = c.effectTag & -3 | 1024, 
                    c = c.sibling; else R(a, b, d, c), Xh();
                    b = b.child;
                }
                return b;

              case 5:
                return fh(b), null === a && Uh(b), d = b.type, e = b.pendingProps, f = null !== a ? a.memoizedProps : null, 
                g = e.children, Gd(d, e) ? g = null : null !== f && Gd(d, f) && (b.effectTag |= 16), 
                ei(a, b), b.mode & 4 && 1 !== c && e.hidden ? (b.expirationTime = b.childExpirationTime = 1, 
                b = null) : (R(a, b, g, c), b = b.child), b;

              case 6:
                return null === a && Uh(b), null;

              case 13:
                return ji(a, b, c);

              case 4:
                return dh(b, b.stateNode.containerInfo), d = b.pendingProps, null === a ? b.child = Xg(b, null, d, c) : R(a, b, d, c), 
                b.child;

              case 11:
                return d = b.type, e = b.pendingProps, e = b.elementType === d ? e : ig(d, e), Zh(a, b, d, e, c);

              case 7:
                return R(a, b, b.pendingProps, c), b.child;

              case 8:
                return R(a, b, b.pendingProps.children, c), b.child;

              case 12:
                return R(a, b, b.pendingProps.children, c), b.child;

              case 10:
                a: {
                    d = b.type._context;
                    e = b.pendingProps;
                    g = b.memoizedProps;
                    f = e.value;
                    var h = b.type._context;
                    I(jg, h._currentValue);
                    h._currentValue = f;
                    if (null !== g) if (h = g.value, f = $e(h, f) ? 0 : ("function" === typeof d._calculateChangedBits ? d._calculateChangedBits(h, f) : 1073741823) | 0, 
                    0 === f) {
                        if (g.children === e.children && !K.current) {
                            b = $h(a, b, c);
                            break a;
                        }
                    } else for (h = b.child, null !== h && (h.return = b); null !== h; ) {
                        var k = h.dependencies;
                        if (null !== k) {
                            g = h.child;
                            for (var l = k.firstContext; null !== l; ) {
                                if (l.context === d && 0 !== (l.observedBits & f)) {
                                    1 === h.tag && (l = wg(c, null), l.tag = 2, xg(h, l));
                                    h.expirationTime < c && (h.expirationTime = c);
                                    l = h.alternate;
                                    null !== l && l.expirationTime < c && (l.expirationTime = c);
                                    pg(h.return, c);
                                    k.expirationTime < c && (k.expirationTime = c);
                                    break;
                                }
                                l = l.next;
                            }
                        } else g = 10 === h.tag ? h.type === b.type ? null : h.child : h.child;
                        if (null !== g) g.return = h; else for (g = h; null !== g; ) {
                            if (g === b) {
                                g = null;
                                break;
                            }
                            h = g.sibling;
                            if (null !== h) {
                                h.return = g.return;
                                g = h;
                                break;
                            }
                            g = g.return;
                        }
                        h = g;
                    }
                    R(a, b, e.children, c);
                    b = b.child;
                }
                return b;

              case 9:
                return e = b.type, f = b.pendingProps, d = f.children, qg(b, c), e = sg(e, f.unstable_observedBits), 
                d = d(e), b.effectTag |= 1, R(a, b, d, c), b.child;

              case 14:
                return e = b.type, f = ig(e, b.pendingProps), f = ig(e.type, f), ai(a, b, e, f, d, c);

              case 15:
                return ci(a, b, b.type, b.pendingProps, d, c);

              case 17:
                return d = b.type, e = b.pendingProps, e = b.elementType === d ? e : ig(d, e), null !== a && (a.alternate = null, 
                b.alternate = null, b.effectTag |= 2), b.tag = 1, L(d) ? (a = !0, Gf(b)) : a = !1, 
                qg(b, c), Lg(b, d, e), Ng(b, d, e, c), gi(null, b, d, !0, a, c);

              case 19:
                return mi(a, b, c);
            }
            throw Error(u(156, b.tag));
        };
        var Uj = null, Li = null;
        function Yj(a) {
            if ("undefined" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) return !1;
            var b = __REACT_DEVTOOLS_GLOBAL_HOOK__;
            if (b.isDisabled || !b.supportsFiber) return !0;
            try {
                var c = b.inject(a);
                Uj = function(a) {
                    try {
                        b.onCommitFiberRoot(c, a, void 0, 64 === (a.current.effectTag & 64));
                    } catch (e) {}
                };
                Li = function(a) {
                    try {
                        b.onCommitFiberUnmount(c, a);
                    } catch (e) {}
                };
            } catch (d) {}
            return !0;
        }
        function Zj(a, b, c, d) {
            this.tag = a;
            this.key = c;
            this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null;
            this.index = 0;
            this.ref = null;
            this.pendingProps = b;
            this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null;
            this.mode = d;
            this.effectTag = 0;
            this.lastEffect = this.firstEffect = this.nextEffect = null;
            this.childExpirationTime = this.expirationTime = 0;
            this.alternate = null;
        }
        function Sh(a, b, c, d) {
            return new Zj(a, b, c, d);
        }
        function bi(a) {
            a = a.prototype;
            return !(!a || !a.isReactComponent);
        }
        function Xj(a) {
            if ("function" === typeof a) return bi(a) ? 1 : 0;
            if (void 0 !== a && null !== a) {
                a = a.$$typeof;
                if (a === gb) return 11;
                if (a === jb) return 14;
            }
            return 2;
        }
        function Sg(a, b) {
            var c = a.alternate;
            null === c ? (c = Sh(a.tag, b, a.key, a.mode), c.elementType = a.elementType, c.type = a.type, 
            c.stateNode = a.stateNode, c.alternate = a, a.alternate = c) : (c.pendingProps = b, 
            c.effectTag = 0, c.nextEffect = null, c.firstEffect = null, c.lastEffect = null);
            c.childExpirationTime = a.childExpirationTime;
            c.expirationTime = a.expirationTime;
            c.child = a.child;
            c.memoizedProps = a.memoizedProps;
            c.memoizedState = a.memoizedState;
            c.updateQueue = a.updateQueue;
            b = a.dependencies;
            c.dependencies = null === b ? null : {
                expirationTime: b.expirationTime,
                firstContext: b.firstContext,
                responders: b.responders
            };
            c.sibling = a.sibling;
            c.index = a.index;
            c.ref = a.ref;
            return c;
        }
        function Ug(a, b, c, d, e, f) {
            var g = 2;
            d = a;
            if ("function" === typeof a) bi(a) && (g = 1); else if ("string" === typeof a) g = 5; else a: switch (a) {
              case ab:
                return Wg(c.children, e, f, b);

              case fb:
                g = 8;
                e |= 7;
                break;

              case bb:
                g = 8;
                e |= 1;
                break;

              case cb:
                return a = Sh(12, c, b, e | 8), a.elementType = cb, a.type = cb, a.expirationTime = f, 
                a;

              case hb:
                return a = Sh(13, c, b, e), a.type = hb, a.elementType = hb, a.expirationTime = f, 
                a;

              case ib:
                return a = Sh(19, c, b, e), a.elementType = ib, a.expirationTime = f, a;

              default:
                if ("object" === typeof a && null !== a) switch (a.$$typeof) {
                  case db:
                    g = 10;
                    break a;

                  case eb:
                    g = 9;
                    break a;

                  case gb:
                    g = 11;
                    break a;

                  case jb:
                    g = 14;
                    break a;

                  case kb:
                    g = 16;
                    d = null;
                    break a;

                  case lb:
                    g = 22;
                    break a;
                }
                throw Error(u(130, null == a ? a : typeof a, ""));
            }
            b = Sh(g, c, b, e);
            b.elementType = a;
            b.type = d;
            b.expirationTime = f;
            return b;
        }
        function Wg(a, b, c, d) {
            a = Sh(7, a, d, b);
            a.expirationTime = c;
            return a;
        }
        function Tg(a, b, c) {
            a = Sh(6, a, null, b);
            a.expirationTime = c;
            return a;
        }
        function Vg(a, b, c) {
            b = Sh(4, null !== a.children ? a.children : [], a.key, b);
            b.expirationTime = c;
            b.stateNode = {
                containerInfo: a.containerInfo,
                pendingChildren: null,
                implementation: a.implementation
            };
            return b;
        }
        function ak(a, b, c) {
            this.tag = b;
            this.current = null;
            this.containerInfo = a;
            this.pingCache = this.pendingChildren = null;
            this.finishedExpirationTime = 0;
            this.finishedWork = null;
            this.timeoutHandle = -1;
            this.pendingContext = this.context = null;
            this.hydrate = c;
            this.callbackNode = null;
            this.callbackPriority = 90;
            this.lastExpiredTime = this.lastPingedTime = this.nextKnownPendingLevel = this.lastSuspendedTime = this.firstSuspendedTime = this.firstPendingTime = 0;
        }
        function Aj(a, b) {
            var c = a.firstSuspendedTime;
            a = a.lastSuspendedTime;
            return 0 !== c && c >= b && a <= b;
        }
        function xi(a, b) {
            var c = a.firstSuspendedTime, d = a.lastSuspendedTime;
            c < b && (a.firstSuspendedTime = b);
            if (d > b || 0 === c) a.lastSuspendedTime = b;
            b <= a.lastPingedTime && (a.lastPingedTime = 0);
            b <= a.lastExpiredTime && (a.lastExpiredTime = 0);
        }
        function yi(a, b) {
            b > a.firstPendingTime && (a.firstPendingTime = b);
            var c = a.firstSuspendedTime;
            0 !== c && (b >= c ? a.firstSuspendedTime = a.lastSuspendedTime = a.nextKnownPendingLevel = 0 : b >= a.lastSuspendedTime && (a.lastSuspendedTime = b + 1), 
            b > a.nextKnownPendingLevel && (a.nextKnownPendingLevel = b));
        }
        function Cj(a, b) {
            var c = a.lastExpiredTime;
            if (0 === c || c > b) a.lastExpiredTime = b;
        }
        function bk(a, b, c, d) {
            var e = b.current, f = Gg(), g = Dg.suspense;
            f = Hg(f, e, g);
            a: if (c) {
                c = c._reactInternalFiber;
                b: {
                    if (dc(c) !== c || 1 !== c.tag) throw Error(u(170));
                    var h = c;
                    do {
                        switch (h.tag) {
                          case 3:
                            h = h.stateNode.context;
                            break b;

                          case 1:
                            if (L(h.type)) {
                                h = h.stateNode.__reactInternalMemoizedMergedChildContext;
                                break b;
                            }
                        }
                        h = h.return;
                    } while (null !== h);
                    throw Error(u(171));
                }
                if (1 === c.tag) {
                    var k = c.type;
                    if (L(k)) {
                        c = Ff(c, k, h);
                        break a;
                    }
                }
                c = h;
            } else c = Af;
            null === b.context ? b.context = c : b.pendingContext = c;
            b = wg(f, g);
            b.payload = {
                element: a
            };
            d = void 0 === d ? null : d;
            null !== d && (b.callback = d);
            xg(e, b);
            Ig(e, f);
            return f;
        }
        function ck(a) {
            a = a.current;
            if (!a.child) return null;
            switch (a.child.tag) {
              case 5:
                return a.child.stateNode;

              default:
                return a.child.stateNode;
            }
        }
        function dk(a, b) {
            a = a.memoizedState;
            null !== a && null !== a.dehydrated && a.retryTime < b && (a.retryTime = b);
        }
        function ek(a, b) {
            dk(a, b);
            (a = a.alternate) && dk(a, b);
        }
        function fk(a, b, c) {
            c = null != c && !0 === c.hydrate;
            var d = new ak(a, b, c), e = Sh(3, null, null, 2 === b ? 7 : 1 === b ? 3 : 0);
            d.current = e;
            e.stateNode = d;
            ug(e);
            a[Od] = d.current;
            c && 0 !== b && Jc(a, 9 === a.nodeType ? a : a.ownerDocument);
            this._internalRoot = d;
        }
        fk.prototype.render = function(a) {
            bk(a, this._internalRoot, null, null);
        };
        fk.prototype.unmount = function() {
            var a = this._internalRoot, b = a.containerInfo;
            bk(null, a, null, (function() {
                b[Od] = null;
            }));
        };
        function gk(a) {
            return !(!a || 1 !== a.nodeType && 9 !== a.nodeType && 11 !== a.nodeType && (8 !== a.nodeType || " react-mount-point-unstable " !== a.nodeValue));
        }
        function hk(a, b) {
            b || (b = a ? 9 === a.nodeType ? a.documentElement : a.firstChild : null, b = !(!b || 1 !== b.nodeType || !b.hasAttribute("data-reactroot")));
            if (!b) for (var c; c = a.lastChild; ) a.removeChild(c);
            return new fk(a, 0, b ? {
                hydrate: !0
            } : void 0);
        }
        function ik(a, b, c, d, e) {
            var f = c._reactRootContainer;
            if (f) {
                var g = f._internalRoot;
                if ("function" === typeof e) {
                    var h = e;
                    e = function() {
                        var a = ck(g);
                        h.call(a);
                    };
                }
                bk(b, g, a, e);
            } else {
                f = c._reactRootContainer = hk(c, d);
                g = f._internalRoot;
                if ("function" === typeof e) {
                    var k = e;
                    e = function() {
                        var a = ck(g);
                        k.call(a);
                    };
                }
                Nj((function() {
                    bk(b, g, a, e);
                }));
            }
            return ck(g);
        }
        function jk(a, b, c) {
            var d = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
            return {
                $$typeof: $a,
                key: null == d ? null : "" + d,
                children: a,
                containerInfo: b,
                implementation: c
            };
        }
        wc = function(a) {
            if (13 === a.tag) {
                var b = hg(Gg(), 150, 100);
                Ig(a, b);
                ek(a, b);
            }
        };
        xc = function(a) {
            13 === a.tag && (Ig(a, 3), ek(a, 3));
        };
        yc = function(a) {
            if (13 === a.tag) {
                var b = Gg();
                b = Hg(b, a, null);
                Ig(a, b);
                ek(a, b);
            }
        };
        za = function(a, b, c) {
            switch (b) {
              case "input":
                Cb(a, c);
                b = c.name;
                if ("radio" === c.type && null != b) {
                    for (c = a; c.parentNode; ) c = c.parentNode;
                    c = c.querySelectorAll("input[name=" + JSON.stringify("" + b) + '][type="radio"]');
                    for (b = 0; b < c.length; b++) {
                        var d = c[b];
                        if (d !== a && d.form === a.form) {
                            var e = Qd(d);
                            if (!e) throw Error(u(90));
                            yb(d);
                            Cb(d, e);
                        }
                    }
                }
                break;

              case "textarea":
                Kb(a, c);
                break;

              case "select":
                b = c.value, null != b && Hb(a, !!c.multiple, b, !1);
            }
        };
        Fa = Mj;
        Ga = function(a, b, c, d, e) {
            var f = W;
            W |= 4;
            try {
                return cg(98, a.bind(null, b, c, d, e));
            } finally {
                W = f, W === V && gg();
            }
        };
        Ha = function() {
            (W & (1 | fj | gj)) === V && (Lj(), Dj());
        };
        Ia = function(a, b) {
            var c = W;
            W |= 2;
            try {
                return a(b);
            } finally {
                W = c, W === V && gg();
            }
        };
        function kk(a, b) {
            var c = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
            if (!gk(b)) throw Error(u(200));
            return jk(a, b, null, c);
        }
        var lk = {
            Events: [ Nc, Pd, Qd, xa, ta, Xd, function(a) {
                jc(a, Wd);
            }, Da, Ea, id, mc, Dj, {
                current: !1
            } ]
        };
        (function(a) {
            var b = a.findFiberByHostInstance;
            return Yj(n({}, a, {
                overrideHookState: null,
                overrideProps: null,
                setSuspenseHandler: null,
                scheduleUpdate: null,
                currentDispatcherRef: Wa.ReactCurrentDispatcher,
                findHostInstanceByFiber: function(a) {
                    a = hc(a);
                    return null === a ? null : a.stateNode;
                },
                findFiberByHostInstance: function(a) {
                    return b ? b(a) : null;
                },
                findHostInstancesForRefresh: null,
                scheduleRefresh: null,
                scheduleRoot: null,
                setRefreshHandler: null,
                getCurrentFiber: null
            }));
        })({
            findFiberByHostInstance: tc,
            bundleType: 0,
            version: "16.14.0",
            rendererPackageName: "react-dom"
        });
        __webpack_unused_export__ = lk;
        exports.createPortal = kk;
        __webpack_unused_export__ = function(a) {
            if (null == a) return null;
            if (1 === a.nodeType) return a;
            var b = a._reactInternalFiber;
            if (void 0 === b) {
                if ("function" === typeof a.render) throw Error(u(188));
                throw Error(u(268, Object.keys(a)));
            }
            a = hc(b);
            a = null === a ? null : a.stateNode;
            return a;
        };
        __webpack_unused_export__ = function(a, b) {
            if ((W & (fj | gj)) !== V) throw Error(u(187));
            var c = W;
            W |= 1;
            try {
                return cg(99, a.bind(null, b));
            } finally {
                W = c, gg();
            }
        };
        __webpack_unused_export__ = function(a, b, c) {
            if (!gk(b)) throw Error(u(200));
            return ik(null, a, b, !0, c);
        };
        exports.render = function(a, b, c) {
            if (!gk(b)) throw Error(u(200));
            return ik(null, a, b, !1, c);
        };
        __webpack_unused_export__ = function(a) {
            if (!gk(a)) throw Error(u(40));
            return a._reactRootContainer ? (Nj((function() {
                ik(null, null, a, !1, (function() {
                    a._reactRootContainer = null;
                    a[Od] = null;
                }));
            })), !0) : !1;
        };
        __webpack_unused_export__ = Mj;
        __webpack_unused_export__ = function(a, b) {
            return kk(a, b, 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null);
        };
        __webpack_unused_export__ = function(a, b, c, d) {
            if (!gk(c)) throw Error(u(200));
            if (null == a || void 0 === a._reactInternalFiber) throw Error(u(38));
            return ik(a, b, c, !1, d);
        };
        __webpack_unused_export__ = "16.14.0";
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        if (true) {
            module.exports = __webpack_require__(291);
        } else {}
    }, (__unused_webpack_module, exports) => {
        "use strict";
        var f, g, h, k, l;
        if ("undefined" === typeof window || "function" !== typeof MessageChannel) {
            var p = null, q = null, t = function() {
                if (null !== p) try {
                    var a = exports.unstable_now();
                    p(!0, a);
                    p = null;
                } catch (b) {
                    throw setTimeout(t, 0), b;
                }
            }, u = Date.now();
            exports.unstable_now = function() {
                return Date.now() - u;
            };
            f = function(a) {
                null !== p ? setTimeout(f, 0, a) : (p = a, setTimeout(t, 0));
            };
            g = function(a, b) {
                q = setTimeout(a, b);
            };
            h = function() {
                clearTimeout(q);
            };
            k = function() {
                return !1;
            };
            l = exports.unstable_forceFrameRate = function() {};
        } else {
            var w = window.performance, x = window.Date, y = window.setTimeout, z = window.clearTimeout;
            if ("undefined" !== typeof console) {
                var A = window.cancelAnimationFrame;
                "function" !== typeof window.requestAnimationFrame && console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills");
                "function" !== typeof A && console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills");
            }
            if ("object" === typeof w && "function" === typeof w.now) exports.unstable_now = function() {
                return w.now();
            }; else {
                var B = x.now();
                exports.unstable_now = function() {
                    return x.now() - B;
                };
            }
            var C = !1, D = null, E = -1, F = 5, G = 0;
            k = function() {
                return exports.unstable_now() >= G;
            };
            l = function() {};
            exports.unstable_forceFrameRate = function(a) {
                0 > a || 125 < a ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported") : F = 0 < a ? Math.floor(1e3 / a) : 5;
            };
            var H = new MessageChannel, I = H.port2;
            H.port1.onmessage = function() {
                if (null !== D) {
                    var a = exports.unstable_now();
                    G = a + F;
                    try {
                        D(!0, a) ? I.postMessage(null) : (C = !1, D = null);
                    } catch (b) {
                        throw I.postMessage(null), b;
                    }
                } else C = !1;
            };
            f = function(a) {
                D = a;
                C || (C = !0, I.postMessage(null));
            };
            g = function(a, b) {
                E = y((function() {
                    a(exports.unstable_now());
                }), b);
            };
            h = function() {
                z(E);
                E = -1;
            };
        }
        function J(a, b) {
            var c = a.length;
            a.push(b);
            a: for (;;) {
                var d = c - 1 >>> 1, e = a[d];
                if (void 0 !== e && 0 < K(e, b)) a[d] = b, a[c] = e, c = d; else break a;
            }
        }
        function L(a) {
            a = a[0];
            return void 0 === a ? null : a;
        }
        function M(a) {
            var b = a[0];
            if (void 0 !== b) {
                var c = a.pop();
                if (c !== b) {
                    a[0] = c;
                    a: for (var d = 0, e = a.length; d < e; ) {
                        var m = 2 * (d + 1) - 1, n = a[m], v = m + 1, r = a[v];
                        if (void 0 !== n && 0 > K(n, c)) void 0 !== r && 0 > K(r, n) ? (a[d] = r, a[v] = c, 
                        d = v) : (a[d] = n, a[m] = c, d = m); else if (void 0 !== r && 0 > K(r, c)) a[d] = r, 
                        a[v] = c, d = v; else break a;
                    }
                }
                return b;
            }
            return null;
        }
        function K(a, b) {
            var c = a.sortIndex - b.sortIndex;
            return 0 !== c ? c : a.id - b.id;
        }
        var N = [], O = [], P = 1, Q = null, R = 3, S = !1, T = !1, U = !1;
        function V(a) {
            for (var b = L(O); null !== b; ) {
                if (null === b.callback) M(O); else if (b.startTime <= a) M(O), b.sortIndex = b.expirationTime, 
                J(N, b); else break;
                b = L(O);
            }
        }
        function W(a) {
            U = !1;
            V(a);
            if (!T) if (null !== L(N)) T = !0, f(X); else {
                var b = L(O);
                null !== b && g(W, b.startTime - a);
            }
        }
        function X(a, b) {
            T = !1;
            U && (U = !1, h());
            S = !0;
            var c = R;
            try {
                V(b);
                for (Q = L(N); null !== Q && (!(Q.expirationTime > b) || a && !k()); ) {
                    var d = Q.callback;
                    if (null !== d) {
                        Q.callback = null;
                        R = Q.priorityLevel;
                        var e = d(Q.expirationTime <= b);
                        b = exports.unstable_now();
                        "function" === typeof e ? Q.callback = e : Q === L(N) && M(N);
                        V(b);
                    } else M(N);
                    Q = L(N);
                }
                if (null !== Q) var m = !0; else {
                    var n = L(O);
                    null !== n && g(W, n.startTime - b);
                    m = !1;
                }
                return m;
            } finally {
                Q = null, R = c, S = !1;
            }
        }
        function Y(a) {
            switch (a) {
              case 1:
                return -1;

              case 2:
                return 250;

              case 5:
                return 1073741823;

              case 4:
                return 1e4;

              default:
                return 5e3;
            }
        }
        var Z = l;
        exports.unstable_IdlePriority = 5;
        exports.unstable_ImmediatePriority = 1;
        exports.unstable_LowPriority = 4;
        exports.unstable_NormalPriority = 3;
        exports.unstable_Profiling = null;
        exports.unstable_UserBlockingPriority = 2;
        exports.unstable_cancelCallback = function(a) {
            a.callback = null;
        };
        exports.unstable_continueExecution = function() {
            T || S || (T = !0, f(X));
        };
        exports.unstable_getCurrentPriorityLevel = function() {
            return R;
        };
        exports.unstable_getFirstCallbackNode = function() {
            return L(N);
        };
        exports.unstable_next = function(a) {
            switch (R) {
              case 1:
              case 2:
              case 3:
                var b = 3;
                break;

              default:
                b = R;
            }
            var c = R;
            R = b;
            try {
                return a();
            } finally {
                R = c;
            }
        };
        exports.unstable_pauseExecution = function() {};
        exports.unstable_requestPaint = Z;
        exports.unstable_runWithPriority = function(a, b) {
            switch (a) {
              case 1:
              case 2:
              case 3:
              case 4:
              case 5:
                break;

              default:
                a = 3;
            }
            var c = R;
            R = a;
            try {
                return b();
            } finally {
                R = c;
            }
        };
        exports.unstable_scheduleCallback = function(a, b, c) {
            var d = exports.unstable_now();
            if ("object" === typeof c && null !== c) {
                var e = c.delay;
                e = "number" === typeof e && 0 < e ? d + e : d;
                c = "number" === typeof c.timeout ? c.timeout : Y(a);
            } else c = Y(a), e = d;
            c = e + c;
            a = {
                id: P++,
                callback: b,
                priorityLevel: a,
                startTime: e,
                expirationTime: c,
                sortIndex: -1
            };
            e > d ? (a.sortIndex = e, J(O, a), null === L(N) && a === L(O) && (U ? h() : U = !0, 
            g(W, e - d))) : (a.sortIndex = c, J(N, a), T || S || (T = !0, f(X)));
            return a;
        };
        exports.unstable_shouldYield = function() {
            var a = exports.unstable_now();
            V(a);
            var b = L(N);
            return b !== Q && null !== Q && null !== b && null !== b.callback && b.startTime <= a && b.expirationTime < Q.expirationTime || k();
        };
        exports.unstable_wrapCallback = function(a) {
            var b = R;
            return function() {
                var c = R;
                R = b;
                try {
                    return a.apply(this, arguments);
                } finally {
                    R = c;
                }
            };
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var path = __webpack_require__(15);
        module.exports = function(thePath, potentialParent) {
            thePath = stripTrailingSep(thePath);
            potentialParent = stripTrailingSep(potentialParent);
            if (process.platform === "win32") {
                thePath = thePath.toLowerCase();
                potentialParent = potentialParent.toLowerCase();
            }
            return thePath.lastIndexOf(potentialParent, 0) === 0 && (thePath[potentialParent.length] === path.sep || thePath[potentialParent.length] === undefined);
        };
        function stripTrailingSep(thePath) {
            if (thePath[thePath.length - 1] === path.sep) {
                return thePath.slice(0, -1);
            }
            return thePath;
        }
    }, module => {
        "use strict";
        const BYTE_UNITS = [ "B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" ];
        const BIBYTE_UNITS = [ "B", "kiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB" ];
        const BIT_UNITS = [ "b", "kbit", "Mbit", "Gbit", "Tbit", "Pbit", "Ebit", "Zbit", "Ybit" ];
        const BIBIT_UNITS = [ "b", "kibit", "Mibit", "Gibit", "Tibit", "Pibit", "Eibit", "Zibit", "Yibit" ];
        const toLocaleString = (number, locale) => {
            let result = number;
            if (typeof locale === "string" || Array.isArray(locale)) {
                result = number.toLocaleString(locale);
            } else if (locale === true) {
                result = number.toLocaleString();
            }
            return result;
        };
        module.exports = (number, options) => {
            if (!Number.isFinite(number)) {
                throw new TypeError(`Expected a finite number, got ${typeof number}: ${number}`);
            }
            options = Object.assign({
                bits: false,
                binary: false
            }, options);
            const UNITS = options.bits ? options.binary ? BIBIT_UNITS : BIT_UNITS : options.binary ? BIBYTE_UNITS : BYTE_UNITS;
            if (options.signed && number === 0) {
                return ` 0 ${UNITS[0]}`;
            }
            const isNegative = number < 0;
            const prefix = isNegative ? "-" : options.signed ? "+" : "";
            if (isNegative) {
                number = -number;
            }
            if (number < 1) {
                const numberString = toLocaleString(number, options.locale);
                return prefix + numberString + " " + UNITS[0];
            }
            const exponent = Math.min(Math.floor(options.binary ? Math.log(number) / Math.log(1024) : Math.log10(number) / 3), UNITS.length - 1);
            number = Number((number / Math.pow(options.binary ? 1024 : 1e3, exponent)).toPrecision(3));
            const numberString = toLocaleString(number, options.locale);
            const unit = UNITS[exponent];
            return prefix + numberString + " " + unit;
        };
    }, function(module) {
        (function(global, factory) {
            true ? module.exports = factory() : 0;
        })(this, (function() {
            "use strict";
            var SLICE$0 = Array.prototype.slice;
            function createClass(ctor, superClass) {
                if (superClass) {
                    ctor.prototype = Object.create(superClass.prototype);
                }
                ctor.prototype.constructor = ctor;
            }
            function Iterable(value) {
                return isIterable(value) ? value : Seq(value);
            }
            createClass(KeyedIterable, Iterable);
            function KeyedIterable(value) {
                return isKeyed(value) ? value : KeyedSeq(value);
            }
            createClass(IndexedIterable, Iterable);
            function IndexedIterable(value) {
                return isIndexed(value) ? value : IndexedSeq(value);
            }
            createClass(SetIterable, Iterable);
            function SetIterable(value) {
                return isIterable(value) && !isAssociative(value) ? value : SetSeq(value);
            }
            function isIterable(maybeIterable) {
                return !!(maybeIterable && maybeIterable[IS_ITERABLE_SENTINEL]);
            }
            function isKeyed(maybeKeyed) {
                return !!(maybeKeyed && maybeKeyed[IS_KEYED_SENTINEL]);
            }
            function isIndexed(maybeIndexed) {
                return !!(maybeIndexed && maybeIndexed[IS_INDEXED_SENTINEL]);
            }
            function isAssociative(maybeAssociative) {
                return isKeyed(maybeAssociative) || isIndexed(maybeAssociative);
            }
            function isOrdered(maybeOrdered) {
                return !!(maybeOrdered && maybeOrdered[IS_ORDERED_SENTINEL]);
            }
            Iterable.isIterable = isIterable;
            Iterable.isKeyed = isKeyed;
            Iterable.isIndexed = isIndexed;
            Iterable.isAssociative = isAssociative;
            Iterable.isOrdered = isOrdered;
            Iterable.Keyed = KeyedIterable;
            Iterable.Indexed = IndexedIterable;
            Iterable.Set = SetIterable;
            var IS_ITERABLE_SENTINEL = "@@__IMMUTABLE_ITERABLE__@@";
            var IS_KEYED_SENTINEL = "@@__IMMUTABLE_KEYED__@@";
            var IS_INDEXED_SENTINEL = "@@__IMMUTABLE_INDEXED__@@";
            var IS_ORDERED_SENTINEL = "@@__IMMUTABLE_ORDERED__@@";
            var DELETE = "delete";
            var SHIFT = 5;
            var SIZE = 1 << SHIFT;
            var MASK = SIZE - 1;
            var NOT_SET = {};
            var CHANGE_LENGTH = {
                value: false
            };
            var DID_ALTER = {
                value: false
            };
            function MakeRef(ref) {
                ref.value = false;
                return ref;
            }
            function SetRef(ref) {
                ref && (ref.value = true);
            }
            function OwnerID() {}
            function arrCopy(arr, offset) {
                offset = offset || 0;
                var len = Math.max(0, arr.length - offset);
                var newArr = new Array(len);
                for (var ii = 0; ii < len; ii++) {
                    newArr[ii] = arr[ii + offset];
                }
                return newArr;
            }
            function ensureSize(iter) {
                if (iter.size === undefined) {
                    iter.size = iter.__iterate(returnTrue);
                }
                return iter.size;
            }
            function wrapIndex(iter, index) {
                if (typeof index !== "number") {
                    var uint32Index = index >>> 0;
                    if ("" + uint32Index !== index || uint32Index === 4294967295) {
                        return NaN;
                    }
                    index = uint32Index;
                }
                return index < 0 ? ensureSize(iter) + index : index;
            }
            function returnTrue() {
                return true;
            }
            function wholeSlice(begin, end, size) {
                return (begin === 0 || size !== undefined && begin <= -size) && (end === undefined || size !== undefined && end >= size);
            }
            function resolveBegin(begin, size) {
                return resolveIndex(begin, size, 0);
            }
            function resolveEnd(end, size) {
                return resolveIndex(end, size, size);
            }
            function resolveIndex(index, size, defaultIndex) {
                return index === undefined ? defaultIndex : index < 0 ? Math.max(0, size + index) : size === undefined ? index : Math.min(size, index);
            }
            var ITERATE_KEYS = 0;
            var ITERATE_VALUES = 1;
            var ITERATE_ENTRIES = 2;
            var REAL_ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
            var FAUX_ITERATOR_SYMBOL = "@@iterator";
            var ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL;
            function Iterator(next) {
                this.next = next;
            }
            Iterator.prototype.toString = function() {
                return "[Iterator]";
            };
            Iterator.KEYS = ITERATE_KEYS;
            Iterator.VALUES = ITERATE_VALUES;
            Iterator.ENTRIES = ITERATE_ENTRIES;
            Iterator.prototype.inspect = Iterator.prototype.toSource = function() {
                return this.toString();
            };
            Iterator.prototype[ITERATOR_SYMBOL] = function() {
                return this;
            };
            function iteratorValue(type, k, v, iteratorResult) {
                var value = type === 0 ? k : type === 1 ? v : [ k, v ];
                iteratorResult ? iteratorResult.value = value : iteratorResult = {
                    value,
                    done: false
                };
                return iteratorResult;
            }
            function iteratorDone() {
                return {
                    value: undefined,
                    done: true
                };
            }
            function hasIterator(maybeIterable) {
                return !!getIteratorFn(maybeIterable);
            }
            function isIterator(maybeIterator) {
                return maybeIterator && typeof maybeIterator.next === "function";
            }
            function getIterator(iterable) {
                var iteratorFn = getIteratorFn(iterable);
                return iteratorFn && iteratorFn.call(iterable);
            }
            function getIteratorFn(iterable) {
                var iteratorFn = iterable && (REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL] || iterable[FAUX_ITERATOR_SYMBOL]);
                if (typeof iteratorFn === "function") {
                    return iteratorFn;
                }
            }
            function isArrayLike(value) {
                return value && typeof value.length === "number";
            }
            createClass(Seq, Iterable);
            function Seq(value) {
                return value === null || value === undefined ? emptySequence() : isIterable(value) ? value.toSeq() : seqFromValue(value);
            }
            Seq.of = function() {
                return Seq(arguments);
            };
            Seq.prototype.toSeq = function() {
                return this;
            };
            Seq.prototype.toString = function() {
                return this.__toString("Seq {", "}");
            };
            Seq.prototype.cacheResult = function() {
                if (!this._cache && this.__iterateUncached) {
                    this._cache = this.entrySeq().toArray();
                    this.size = this._cache.length;
                }
                return this;
            };
            Seq.prototype.__iterate = function(fn, reverse) {
                return seqIterate(this, fn, reverse, true);
            };
            Seq.prototype.__iterator = function(type, reverse) {
                return seqIterator(this, type, reverse, true);
            };
            createClass(KeyedSeq, Seq);
            function KeyedSeq(value) {
                return value === null || value === undefined ? emptySequence().toKeyedSeq() : isIterable(value) ? isKeyed(value) ? value.toSeq() : value.fromEntrySeq() : keyedSeqFromValue(value);
            }
            KeyedSeq.prototype.toKeyedSeq = function() {
                return this;
            };
            createClass(IndexedSeq, Seq);
            function IndexedSeq(value) {
                return value === null || value === undefined ? emptySequence() : !isIterable(value) ? indexedSeqFromValue(value) : isKeyed(value) ? value.entrySeq() : value.toIndexedSeq();
            }
            IndexedSeq.of = function() {
                return IndexedSeq(arguments);
            };
            IndexedSeq.prototype.toIndexedSeq = function() {
                return this;
            };
            IndexedSeq.prototype.toString = function() {
                return this.__toString("Seq [", "]");
            };
            IndexedSeq.prototype.__iterate = function(fn, reverse) {
                return seqIterate(this, fn, reverse, false);
            };
            IndexedSeq.prototype.__iterator = function(type, reverse) {
                return seqIterator(this, type, reverse, false);
            };
            createClass(SetSeq, Seq);
            function SetSeq(value) {
                return (value === null || value === undefined ? emptySequence() : !isIterable(value) ? indexedSeqFromValue(value) : isKeyed(value) ? value.entrySeq() : value).toSetSeq();
            }
            SetSeq.of = function() {
                return SetSeq(arguments);
            };
            SetSeq.prototype.toSetSeq = function() {
                return this;
            };
            Seq.isSeq = isSeq;
            Seq.Keyed = KeyedSeq;
            Seq.Set = SetSeq;
            Seq.Indexed = IndexedSeq;
            var IS_SEQ_SENTINEL = "@@__IMMUTABLE_SEQ__@@";
            Seq.prototype[IS_SEQ_SENTINEL] = true;
            createClass(ArraySeq, IndexedSeq);
            function ArraySeq(array) {
                this._array = array;
                this.size = array.length;
            }
            ArraySeq.prototype.get = function(index, notSetValue) {
                return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue;
            };
            ArraySeq.prototype.__iterate = function(fn, reverse) {
                var array = this._array;
                var maxIndex = array.length - 1;
                for (var ii = 0; ii <= maxIndex; ii++) {
                    if (fn(array[reverse ? maxIndex - ii : ii], ii, this) === false) {
                        return ii + 1;
                    }
                }
                return ii;
            };
            ArraySeq.prototype.__iterator = function(type, reverse) {
                var array = this._array;
                var maxIndex = array.length - 1;
                var ii = 0;
                return new Iterator((function() {
                    return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++]);
                }));
            };
            createClass(ObjectSeq, KeyedSeq);
            function ObjectSeq(object) {
                var keys = Object.keys(object);
                this._object = object;
                this._keys = keys;
                this.size = keys.length;
            }
            ObjectSeq.prototype.get = function(key, notSetValue) {
                if (notSetValue !== undefined && !this.has(key)) {
                    return notSetValue;
                }
                return this._object[key];
            };
            ObjectSeq.prototype.has = function(key) {
                return this._object.hasOwnProperty(key);
            };
            ObjectSeq.prototype.__iterate = function(fn, reverse) {
                var object = this._object;
                var keys = this._keys;
                var maxIndex = keys.length - 1;
                for (var ii = 0; ii <= maxIndex; ii++) {
                    var key = keys[reverse ? maxIndex - ii : ii];
                    if (fn(object[key], key, this) === false) {
                        return ii + 1;
                    }
                }
                return ii;
            };
            ObjectSeq.prototype.__iterator = function(type, reverse) {
                var object = this._object;
                var keys = this._keys;
                var maxIndex = keys.length - 1;
                var ii = 0;
                return new Iterator((function() {
                    var key = keys[reverse ? maxIndex - ii : ii];
                    return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, key, object[key]);
                }));
            };
            ObjectSeq.prototype[IS_ORDERED_SENTINEL] = true;
            createClass(IterableSeq, IndexedSeq);
            function IterableSeq(iterable) {
                this._iterable = iterable;
                this.size = iterable.length || iterable.size;
            }
            IterableSeq.prototype.__iterateUncached = function(fn, reverse) {
                if (reverse) {
                    return this.cacheResult().__iterate(fn, reverse);
                }
                var iterable = this._iterable;
                var iterator = getIterator(iterable);
                var iterations = 0;
                if (isIterator(iterator)) {
                    var step;
                    while (!(step = iterator.next()).done) {
                        if (fn(step.value, iterations++, this) === false) {
                            break;
                        }
                    }
                }
                return iterations;
            };
            IterableSeq.prototype.__iteratorUncached = function(type, reverse) {
                if (reverse) {
                    return this.cacheResult().__iterator(type, reverse);
                }
                var iterable = this._iterable;
                var iterator = getIterator(iterable);
                if (!isIterator(iterator)) {
                    return new Iterator(iteratorDone);
                }
                var iterations = 0;
                return new Iterator((function() {
                    var step = iterator.next();
                    return step.done ? step : iteratorValue(type, iterations++, step.value);
                }));
            };
            createClass(IteratorSeq, IndexedSeq);
            function IteratorSeq(iterator) {
                this._iterator = iterator;
                this._iteratorCache = [];
            }
            IteratorSeq.prototype.__iterateUncached = function(fn, reverse) {
                if (reverse) {
                    return this.cacheResult().__iterate(fn, reverse);
                }
                var iterator = this._iterator;
                var cache = this._iteratorCache;
                var iterations = 0;
                while (iterations < cache.length) {
                    if (fn(cache[iterations], iterations++, this) === false) {
                        return iterations;
                    }
                }
                var step;
                while (!(step = iterator.next()).done) {
                    var val = step.value;
                    cache[iterations] = val;
                    if (fn(val, iterations++, this) === false) {
                        break;
                    }
                }
                return iterations;
            };
            IteratorSeq.prototype.__iteratorUncached = function(type, reverse) {
                if (reverse) {
                    return this.cacheResult().__iterator(type, reverse);
                }
                var iterator = this._iterator;
                var cache = this._iteratorCache;
                var iterations = 0;
                return new Iterator((function() {
                    if (iterations >= cache.length) {
                        var step = iterator.next();
                        if (step.done) {
                            return step;
                        }
                        cache[iterations] = step.value;
                    }
                    return iteratorValue(type, iterations, cache[iterations++]);
                }));
            };
            function isSeq(maybeSeq) {
                return !!(maybeSeq && maybeSeq[IS_SEQ_SENTINEL]);
            }
            var EMPTY_SEQ;
            function emptySequence() {
                return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([]));
            }
            function keyedSeqFromValue(value) {
                var seq = Array.isArray(value) ? new ArraySeq(value).fromEntrySeq() : isIterator(value) ? new IteratorSeq(value).fromEntrySeq() : hasIterator(value) ? new IterableSeq(value).fromEntrySeq() : typeof value === "object" ? new ObjectSeq(value) : undefined;
                if (!seq) {
                    throw new TypeError("Expected Array or iterable object of [k, v] entries, " + "or keyed object: " + value);
                }
                return seq;
            }
            function indexedSeqFromValue(value) {
                var seq = maybeIndexedSeqFromValue(value);
                if (!seq) {
                    throw new TypeError("Expected Array or iterable object of values: " + value);
                }
                return seq;
            }
            function seqFromValue(value) {
                var seq = maybeIndexedSeqFromValue(value) || typeof value === "object" && new ObjectSeq(value);
                if (!seq) {
                    throw new TypeError("Expected Array or iterable object of values, or keyed object: " + value);
                }
                return seq;
            }
            function maybeIndexedSeqFromValue(value) {
                return isArrayLike(value) ? new ArraySeq(value) : isIterator(value) ? new IteratorSeq(value) : hasIterator(value) ? new IterableSeq(value) : undefined;
            }
            function seqIterate(seq, fn, reverse, useKeys) {
                var cache = seq._cache;
                if (cache) {
                    var maxIndex = cache.length - 1;
                    for (var ii = 0; ii <= maxIndex; ii++) {
                        var entry = cache[reverse ? maxIndex - ii : ii];
                        if (fn(entry[1], useKeys ? entry[0] : ii, seq) === false) {
                            return ii + 1;
                        }
                    }
                    return ii;
                }
                return seq.__iterateUncached(fn, reverse);
            }
            function seqIterator(seq, type, reverse, useKeys) {
                var cache = seq._cache;
                if (cache) {
                    var maxIndex = cache.length - 1;
                    var ii = 0;
                    return new Iterator((function() {
                        var entry = cache[reverse ? maxIndex - ii : ii];
                        return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, useKeys ? entry[0] : ii - 1, entry[1]);
                    }));
                }
                return seq.__iteratorUncached(type, reverse);
            }
            function fromJS(json, converter) {
                return converter ? fromJSWith(converter, json, "", {
                    "": json
                }) : fromJSDefault(json);
            }
            function fromJSWith(converter, json, key, parentJSON) {
                if (Array.isArray(json)) {
                    return converter.call(parentJSON, key, IndexedSeq(json).map((function(v, k) {
                        return fromJSWith(converter, v, k, json);
                    })));
                }
                if (isPlainObj(json)) {
                    return converter.call(parentJSON, key, KeyedSeq(json).map((function(v, k) {
                        return fromJSWith(converter, v, k, json);
                    })));
                }
                return json;
            }
            function fromJSDefault(json) {
                if (Array.isArray(json)) {
                    return IndexedSeq(json).map(fromJSDefault).toList();
                }
                if (isPlainObj(json)) {
                    return KeyedSeq(json).map(fromJSDefault).toMap();
                }
                return json;
            }
            function isPlainObj(value) {
                return value && (value.constructor === Object || value.constructor === undefined);
            }
            function is(valueA, valueB) {
                if (valueA === valueB || valueA !== valueA && valueB !== valueB) {
                    return true;
                }
                if (!valueA || !valueB) {
                    return false;
                }
                if (typeof valueA.valueOf === "function" && typeof valueB.valueOf === "function") {
                    valueA = valueA.valueOf();
                    valueB = valueB.valueOf();
                    if (valueA === valueB || valueA !== valueA && valueB !== valueB) {
                        return true;
                    }
                    if (!valueA || !valueB) {
                        return false;
                    }
                }
                if (typeof valueA.equals === "function" && typeof valueB.equals === "function" && valueA.equals(valueB)) {
                    return true;
                }
                return false;
            }
            function deepEqual(a, b) {
                if (a === b) {
                    return true;
                }
                if (!isIterable(b) || a.size !== undefined && b.size !== undefined && a.size !== b.size || a.__hash !== undefined && b.__hash !== undefined && a.__hash !== b.__hash || isKeyed(a) !== isKeyed(b) || isIndexed(a) !== isIndexed(b) || isOrdered(a) !== isOrdered(b)) {
                    return false;
                }
                if (a.size === 0 && b.size === 0) {
                    return true;
                }
                var notAssociative = !isAssociative(a);
                if (isOrdered(a)) {
                    var entries = a.entries();
                    return b.every((function(v, k) {
                        var entry = entries.next().value;
                        return entry && is(entry[1], v) && (notAssociative || is(entry[0], k));
                    })) && entries.next().done;
                }
                var flipped = false;
                if (a.size === undefined) {
                    if (b.size === undefined) {
                        if (typeof a.cacheResult === "function") {
                            a.cacheResult();
                        }
                    } else {
                        flipped = true;
                        var _ = a;
                        a = b;
                        b = _;
                    }
                }
                var allEqual = true;
                var bSize = b.__iterate((function(v, k) {
                    if (notAssociative ? !a.has(v) : flipped ? !is(v, a.get(k, NOT_SET)) : !is(a.get(k, NOT_SET), v)) {
                        allEqual = false;
                        return false;
                    }
                }));
                return allEqual && a.size === bSize;
            }
            createClass(Repeat, IndexedSeq);
            function Repeat(value, times) {
                if (!(this instanceof Repeat)) {
                    return new Repeat(value, times);
                }
                this._value = value;
                this.size = times === undefined ? Infinity : Math.max(0, times);
                if (this.size === 0) {
                    if (EMPTY_REPEAT) {
                        return EMPTY_REPEAT;
                    }
                    EMPTY_REPEAT = this;
                }
            }
            Repeat.prototype.toString = function() {
                if (this.size === 0) {
                    return "Repeat []";
                }
                return "Repeat [ " + this._value + " " + this.size + " times ]";
            };
            Repeat.prototype.get = function(index, notSetValue) {
                return this.has(index) ? this._value : notSetValue;
            };
            Repeat.prototype.includes = function(searchValue) {
                return is(this._value, searchValue);
            };
            Repeat.prototype.slice = function(begin, end) {
                var size = this.size;
                return wholeSlice(begin, end, size) ? this : new Repeat(this._value, resolveEnd(end, size) - resolveBegin(begin, size));
            };
            Repeat.prototype.reverse = function() {
                return this;
            };
            Repeat.prototype.indexOf = function(searchValue) {
                if (is(this._value, searchValue)) {
                    return 0;
                }
                return -1;
            };
            Repeat.prototype.lastIndexOf = function(searchValue) {
                if (is(this._value, searchValue)) {
                    return this.size;
                }
                return -1;
            };
            Repeat.prototype.__iterate = function(fn, reverse) {
                for (var ii = 0; ii < this.size; ii++) {
                    if (fn(this._value, ii, this) === false) {
                        return ii + 1;
                    }
                }
                return ii;
            };
            Repeat.prototype.__iterator = function(type, reverse) {
                var this$0 = this;
                var ii = 0;
                return new Iterator((function() {
                    return ii < this$0.size ? iteratorValue(type, ii++, this$0._value) : iteratorDone();
                }));
            };
            Repeat.prototype.equals = function(other) {
                return other instanceof Repeat ? is(this._value, other._value) : deepEqual(other);
            };
            var EMPTY_REPEAT;
            function invariant(condition, error) {
                if (!condition) throw new Error(error);
            }
            createClass(Range, IndexedSeq);
            function Range(start, end, step) {
                if (!(this instanceof Range)) {
                    return new Range(start, end, step);
                }
                invariant(step !== 0, "Cannot step a Range by 0");
                start = start || 0;
                if (end === undefined) {
                    end = Infinity;
                }
                step = step === undefined ? 1 : Math.abs(step);
                if (end < start) {
                    step = -step;
                }
                this._start = start;
                this._end = end;
                this._step = step;
                this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1);
                if (this.size === 0) {
                    if (EMPTY_RANGE) {
                        return EMPTY_RANGE;
                    }
                    EMPTY_RANGE = this;
                }
            }
            Range.prototype.toString = function() {
                if (this.size === 0) {
                    return "Range []";
                }
                return "Range [ " + this._start + "..." + this._end + (this._step !== 1 ? " by " + this._step : "") + " ]";
            };
            Range.prototype.get = function(index, notSetValue) {
                return this.has(index) ? this._start + wrapIndex(this, index) * this._step : notSetValue;
            };
            Range.prototype.includes = function(searchValue) {
                var possibleIndex = (searchValue - this._start) / this._step;
                return possibleIndex >= 0 && possibleIndex < this.size && possibleIndex === Math.floor(possibleIndex);
            };
            Range.prototype.slice = function(begin, end) {
                if (wholeSlice(begin, end, this.size)) {
                    return this;
                }
                begin = resolveBegin(begin, this.size);
                end = resolveEnd(end, this.size);
                if (end <= begin) {
                    return new Range(0, 0);
                }
                return new Range(this.get(begin, this._end), this.get(end, this._end), this._step);
            };
            Range.prototype.indexOf = function(searchValue) {
                var offsetValue = searchValue - this._start;
                if (offsetValue % this._step === 0) {
                    var index = offsetValue / this._step;
                    if (index >= 0 && index < this.size) {
                        return index;
                    }
                }
                return -1;
            };
            Range.prototype.lastIndexOf = function(searchValue) {
                return this.indexOf(searchValue);
            };
            Range.prototype.__iterate = function(fn, reverse) {
                var maxIndex = this.size - 1;
                var step = this._step;
                var value = reverse ? this._start + maxIndex * step : this._start;
                for (var ii = 0; ii <= maxIndex; ii++) {
                    if (fn(value, ii, this) === false) {
                        return ii + 1;
                    }
                    value += reverse ? -step : step;
                }
                return ii;
            };
            Range.prototype.__iterator = function(type, reverse) {
                var maxIndex = this.size - 1;
                var step = this._step;
                var value = reverse ? this._start + maxIndex * step : this._start;
                var ii = 0;
                return new Iterator((function() {
                    var v = value;
                    value += reverse ? -step : step;
                    return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii++, v);
                }));
            };
            Range.prototype.equals = function(other) {
                return other instanceof Range ? this._start === other._start && this._end === other._end && this._step === other._step : deepEqual(this, other);
            };
            var EMPTY_RANGE;
            createClass(Collection, Iterable);
            function Collection() {
                throw TypeError("Abstract");
            }
            createClass(KeyedCollection, Collection);
            function KeyedCollection() {}
            createClass(IndexedCollection, Collection);
            function IndexedCollection() {}
            createClass(SetCollection, Collection);
            function SetCollection() {}
            Collection.Keyed = KeyedCollection;
            Collection.Indexed = IndexedCollection;
            Collection.Set = SetCollection;
            var imul = typeof Math.imul === "function" && Math.imul(4294967295, 2) === -2 ? Math.imul : function imul(a, b) {
                a = a | 0;
                b = b | 0;
                var c = a & 65535;
                var d = b & 65535;
                return c * d + ((a >>> 16) * d + c * (b >>> 16) << 16 >>> 0) | 0;
            };
            function smi(i32) {
                return i32 >>> 1 & 1073741824 | i32 & 3221225471;
            }
            function hash(o) {
                if (o === false || o === null || o === undefined) {
                    return 0;
                }
                if (typeof o.valueOf === "function") {
                    o = o.valueOf();
                    if (o === false || o === null || o === undefined) {
                        return 0;
                    }
                }
                if (o === true) {
                    return 1;
                }
                var type = typeof o;
                if (type === "number") {
                    if (o !== o || o === Infinity) {
                        return 0;
                    }
                    var h = o | 0;
                    if (h !== o) {
                        h ^= o * 4294967295;
                    }
                    while (o > 4294967295) {
                        o /= 4294967295;
                        h ^= o;
                    }
                    return smi(h);
                }
                if (type === "string") {
                    return o.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(o) : hashString(o);
                }
                if (typeof o.hashCode === "function") {
                    return o.hashCode();
                }
                if (type === "object") {
                    return hashJSObj(o);
                }
                if (typeof o.toString === "function") {
                    return hashString(o.toString());
                }
                throw new Error("Value type " + type + " cannot be hashed.");
            }
            function cachedHashString(string) {
                var hash = stringHashCache[string];
                if (hash === undefined) {
                    hash = hashString(string);
                    if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) {
                        STRING_HASH_CACHE_SIZE = 0;
                        stringHashCache = {};
                    }
                    STRING_HASH_CACHE_SIZE++;
                    stringHashCache[string] = hash;
                }
                return hash;
            }
            function hashString(string) {
                var hash = 0;
                for (var ii = 0; ii < string.length; ii++) {
                    hash = 31 * hash + string.charCodeAt(ii) | 0;
                }
                return smi(hash);
            }
            function hashJSObj(obj) {
                var hash;
                if (usingWeakMap) {
                    hash = weakMap.get(obj);
                    if (hash !== undefined) {
                        return hash;
                    }
                }
                hash = obj[UID_HASH_KEY];
                if (hash !== undefined) {
                    return hash;
                }
                if (!canDefineProperty) {
                    hash = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY];
                    if (hash !== undefined) {
                        return hash;
                    }
                    hash = getIENodeHash(obj);
                    if (hash !== undefined) {
                        return hash;
                    }
                }
                hash = ++objHashUID;
                if (objHashUID & 1073741824) {
                    objHashUID = 0;
                }
                if (usingWeakMap) {
                    weakMap.set(obj, hash);
                } else if (isExtensible !== undefined && isExtensible(obj) === false) {
                    throw new Error("Non-extensible objects are not allowed as keys.");
                } else if (canDefineProperty) {
                    Object.defineProperty(obj, UID_HASH_KEY, {
                        enumerable: false,
                        configurable: false,
                        writable: false,
                        value: hash
                    });
                } else if (obj.propertyIsEnumerable !== undefined && obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) {
                    obj.propertyIsEnumerable = function() {
                        return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments);
                    };
                    obj.propertyIsEnumerable[UID_HASH_KEY] = hash;
                } else if (obj.nodeType !== undefined) {
                    obj[UID_HASH_KEY] = hash;
                } else {
                    throw new Error("Unable to set a non-enumerable property on object.");
                }
                return hash;
            }
            var isExtensible = Object.isExtensible;
            var canDefineProperty = function() {
                try {
                    Object.defineProperty({}, "@", {});
                    return true;
                } catch (e) {
                    return false;
                }
            }();
            function getIENodeHash(node) {
                if (node && node.nodeType > 0) {
                    switch (node.nodeType) {
                      case 1:
                        return node.uniqueID;

                      case 9:
                        return node.documentElement && node.documentElement.uniqueID;
                    }
                }
            }
            var usingWeakMap = typeof WeakMap === "function";
            var weakMap;
            if (usingWeakMap) {
                weakMap = new WeakMap;
            }
            var objHashUID = 0;
            var UID_HASH_KEY = "__immutablehash__";
            if (typeof Symbol === "function") {
                UID_HASH_KEY = Symbol(UID_HASH_KEY);
            }
            var STRING_HASH_CACHE_MIN_STRLEN = 16;
            var STRING_HASH_CACHE_MAX_SIZE = 255;
            var STRING_HASH_CACHE_SIZE = 0;
            var stringHashCache = {};
            function assertNotInfinite(size) {
                invariant(size !== Infinity, "Cannot perform this action with an infinite size.");
            }
            createClass(Map, KeyedCollection);
            function Map(value) {
                return value === null || value === undefined ? emptyMap() : isMap(value) && !isOrdered(value) ? value : emptyMap().withMutations((function(map) {
                    var iter = KeyedIterable(value);
                    assertNotInfinite(iter.size);
                    iter.forEach((function(v, k) {
                        return map.set(k, v);
                    }));
                }));
            }
            Map.of = function() {
                var keyValues = SLICE$0.call(arguments, 0);
                return emptyMap().withMutations((function(map) {
                    for (var i = 0; i < keyValues.length; i += 2) {
                        if (i + 1 >= keyValues.length) {
                            throw new Error("Missing value for key: " + keyValues[i]);
                        }
                        map.set(keyValues[i], keyValues[i + 1]);
                    }
                }));
            };
            Map.prototype.toString = function() {
                return this.__toString("Map {", "}");
            };
            Map.prototype.get = function(k, notSetValue) {
                return this._root ? this._root.get(0, undefined, k, notSetValue) : notSetValue;
            };
            Map.prototype.set = function(k, v) {
                return updateMap(this, k, v);
            };
            Map.prototype.setIn = function(keyPath, v) {
                return this.updateIn(keyPath, NOT_SET, (function() {
                    return v;
                }));
            };
            Map.prototype.remove = function(k) {
                return updateMap(this, k, NOT_SET);
            };
            Map.prototype.deleteIn = function(keyPath) {
                return this.updateIn(keyPath, (function() {
                    return NOT_SET;
                }));
            };
            Map.prototype.update = function(k, notSetValue, updater) {
                return arguments.length === 1 ? k(this) : this.updateIn([ k ], notSetValue, updater);
            };
            Map.prototype.updateIn = function(keyPath, notSetValue, updater) {
                if (!updater) {
                    updater = notSetValue;
                    notSetValue = undefined;
                }
                var updatedValue = updateInDeepMap(this, forceIterator(keyPath), notSetValue, updater);
                return updatedValue === NOT_SET ? undefined : updatedValue;
            };
            Map.prototype.clear = function() {
                if (this.size === 0) {
                    return this;
                }
                if (this.__ownerID) {
                    this.size = 0;
                    this._root = null;
                    this.__hash = undefined;
                    this.__altered = true;
                    return this;
                }
                return emptyMap();
            };
            Map.prototype.merge = function() {
                return mergeIntoMapWith(this, undefined, arguments);
            };
            Map.prototype.mergeWith = function(merger) {
                var iters = SLICE$0.call(arguments, 1);
                return mergeIntoMapWith(this, merger, iters);
            };
            Map.prototype.mergeIn = function(keyPath) {
                var iters = SLICE$0.call(arguments, 1);
                return this.updateIn(keyPath, emptyMap(), (function(m) {
                    return typeof m.merge === "function" ? m.merge.apply(m, iters) : iters[iters.length - 1];
                }));
            };
            Map.prototype.mergeDeep = function() {
                return mergeIntoMapWith(this, deepMerger, arguments);
            };
            Map.prototype.mergeDeepWith = function(merger) {
                var iters = SLICE$0.call(arguments, 1);
                return mergeIntoMapWith(this, deepMergerWith(merger), iters);
            };
            Map.prototype.mergeDeepIn = function(keyPath) {
                var iters = SLICE$0.call(arguments, 1);
                return this.updateIn(keyPath, emptyMap(), (function(m) {
                    return typeof m.mergeDeep === "function" ? m.mergeDeep.apply(m, iters) : iters[iters.length - 1];
                }));
            };
            Map.prototype.sort = function(comparator) {
                return OrderedMap(sortFactory(this, comparator));
            };
            Map.prototype.sortBy = function(mapper, comparator) {
                return OrderedMap(sortFactory(this, comparator, mapper));
            };
            Map.prototype.withMutations = function(fn) {
                var mutable = this.asMutable();
                fn(mutable);
                return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this;
            };
            Map.prototype.asMutable = function() {
                return this.__ownerID ? this : this.__ensureOwner(new OwnerID);
            };
            Map.prototype.asImmutable = function() {
                return this.__ensureOwner();
            };
            Map.prototype.wasAltered = function() {
                return this.__altered;
            };
            Map.prototype.__iterator = function(type, reverse) {
                return new MapIterator(this, type, reverse);
            };
            Map.prototype.__iterate = function(fn, reverse) {
                var this$0 = this;
                var iterations = 0;
                this._root && this._root.iterate((function(entry) {
                    iterations++;
                    return fn(entry[1], entry[0], this$0);
                }), reverse);
                return iterations;
            };
            Map.prototype.__ensureOwner = function(ownerID) {
                if (ownerID === this.__ownerID) {
                    return this;
                }
                if (!ownerID) {
                    this.__ownerID = ownerID;
                    this.__altered = false;
                    return this;
                }
                return makeMap(this.size, this._root, ownerID, this.__hash);
            };
            function isMap(maybeMap) {
                return !!(maybeMap && maybeMap[IS_MAP_SENTINEL]);
            }
            Map.isMap = isMap;
            var IS_MAP_SENTINEL = "@@__IMMUTABLE_MAP__@@";
            var MapPrototype = Map.prototype;
            MapPrototype[IS_MAP_SENTINEL] = true;
            MapPrototype[DELETE] = MapPrototype.remove;
            MapPrototype.removeIn = MapPrototype.deleteIn;
            function ArrayMapNode(ownerID, entries) {
                this.ownerID = ownerID;
                this.entries = entries;
            }
            ArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) {
                var entries = this.entries;
                for (var ii = 0, len = entries.length; ii < len; ii++) {
                    if (is(key, entries[ii][0])) {
                        return entries[ii][1];
                    }
                }
                return notSetValue;
            };
            ArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
                var removed = value === NOT_SET;
                var entries = this.entries;
                var idx = 0;
                for (var len = entries.length; idx < len; idx++) {
                    if (is(key, entries[idx][0])) {
                        break;
                    }
                }
                var exists = idx < len;
                if (exists ? entries[idx][1] === value : removed) {
                    return this;
                }
                SetRef(didAlter);
                (removed || !exists) && SetRef(didChangeSize);
                if (removed && entries.length === 1) {
                    return;
                }
                if (!exists && !removed && entries.length >= MAX_ARRAY_MAP_SIZE) {
                    return createNodes(ownerID, entries, key, value);
                }
                var isEditable = ownerID && ownerID === this.ownerID;
                var newEntries = isEditable ? entries : arrCopy(entries);
                if (exists) {
                    if (removed) {
                        idx === len - 1 ? newEntries.pop() : newEntries[idx] = newEntries.pop();
                    } else {
                        newEntries[idx] = [ key, value ];
                    }
                } else {
                    newEntries.push([ key, value ]);
                }
                if (isEditable) {
                    this.entries = newEntries;
                    return this;
                }
                return new ArrayMapNode(ownerID, newEntries);
            };
            function BitmapIndexedNode(ownerID, bitmap, nodes) {
                this.ownerID = ownerID;
                this.bitmap = bitmap;
                this.nodes = nodes;
            }
            BitmapIndexedNode.prototype.get = function(shift, keyHash, key, notSetValue) {
                if (keyHash === undefined) {
                    keyHash = hash(key);
                }
                var bit = 1 << ((shift === 0 ? keyHash : keyHash >>> shift) & MASK);
                var bitmap = this.bitmap;
                return (bitmap & bit) === 0 ? notSetValue : this.nodes[popCount(bitmap & bit - 1)].get(shift + SHIFT, keyHash, key, notSetValue);
            };
            BitmapIndexedNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
                if (keyHash === undefined) {
                    keyHash = hash(key);
                }
                var keyHashFrag = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;
                var bit = 1 << keyHashFrag;
                var bitmap = this.bitmap;
                var exists = (bitmap & bit) !== 0;
                if (!exists && value === NOT_SET) {
                    return this;
                }
                var idx = popCount(bitmap & bit - 1);
                var nodes = this.nodes;
                var node = exists ? nodes[idx] : undefined;
                var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);
                if (newNode === node) {
                    return this;
                }
                if (!exists && newNode && nodes.length >= MAX_BITMAP_INDEXED_SIZE) {
                    return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode);
                }
                if (exists && !newNode && nodes.length === 2 && isLeafNode(nodes[idx ^ 1])) {
                    return nodes[idx ^ 1];
                }
                if (exists && newNode && nodes.length === 1 && isLeafNode(newNode)) {
                    return newNode;
                }
                var isEditable = ownerID && ownerID === this.ownerID;
                var newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit;
                var newNodes = exists ? newNode ? setIn(nodes, idx, newNode, isEditable) : spliceOut(nodes, idx, isEditable) : spliceIn(nodes, idx, newNode, isEditable);
                if (isEditable) {
                    this.bitmap = newBitmap;
                    this.nodes = newNodes;
                    return this;
                }
                return new BitmapIndexedNode(ownerID, newBitmap, newNodes);
            };
            function HashArrayMapNode(ownerID, count, nodes) {
                this.ownerID = ownerID;
                this.count = count;
                this.nodes = nodes;
            }
            HashArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) {
                if (keyHash === undefined) {
                    keyHash = hash(key);
                }
                var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;
                var node = this.nodes[idx];
                return node ? node.get(shift + SHIFT, keyHash, key, notSetValue) : notSetValue;
            };
            HashArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
                if (keyHash === undefined) {
                    keyHash = hash(key);
                }
                var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;
                var removed = value === NOT_SET;
                var nodes = this.nodes;
                var node = nodes[idx];
                if (removed && !node) {
                    return this;
                }
                var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);
                if (newNode === node) {
                    return this;
                }
                var newCount = this.count;
                if (!node) {
                    newCount++;
                } else if (!newNode) {
                    newCount--;
                    if (newCount < MIN_HASH_ARRAY_MAP_SIZE) {
                        return packNodes(ownerID, nodes, newCount, idx);
                    }
                }
                var isEditable = ownerID && ownerID === this.ownerID;
                var newNodes = setIn(nodes, idx, newNode, isEditable);
                if (isEditable) {
                    this.count = newCount;
                    this.nodes = newNodes;
                    return this;
                }
                return new HashArrayMapNode(ownerID, newCount, newNodes);
            };
            function HashCollisionNode(ownerID, keyHash, entries) {
                this.ownerID = ownerID;
                this.keyHash = keyHash;
                this.entries = entries;
            }
            HashCollisionNode.prototype.get = function(shift, keyHash, key, notSetValue) {
                var entries = this.entries;
                for (var ii = 0, len = entries.length; ii < len; ii++) {
                    if (is(key, entries[ii][0])) {
                        return entries[ii][1];
                    }
                }
                return notSetValue;
            };
            HashCollisionNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
                if (keyHash === undefined) {
                    keyHash = hash(key);
                }
                var removed = value === NOT_SET;
                if (keyHash !== this.keyHash) {
                    if (removed) {
                        return this;
                    }
                    SetRef(didAlter);
                    SetRef(didChangeSize);
                    return mergeIntoNode(this, ownerID, shift, keyHash, [ key, value ]);
                }
                var entries = this.entries;
                var idx = 0;
                for (var len = entries.length; idx < len; idx++) {
                    if (is(key, entries[idx][0])) {
                        break;
                    }
                }
                var exists = idx < len;
                if (exists ? entries[idx][1] === value : removed) {
                    return this;
                }
                SetRef(didAlter);
                (removed || !exists) && SetRef(didChangeSize);
                if (removed && len === 2) {
                    return new ValueNode(ownerID, this.keyHash, entries[idx ^ 1]);
                }
                var isEditable = ownerID && ownerID === this.ownerID;
                var newEntries = isEditable ? entries : arrCopy(entries);
                if (exists) {
                    if (removed) {
                        idx === len - 1 ? newEntries.pop() : newEntries[idx] = newEntries.pop();
                    } else {
                        newEntries[idx] = [ key, value ];
                    }
                } else {
                    newEntries.push([ key, value ]);
                }
                if (isEditable) {
                    this.entries = newEntries;
                    return this;
                }
                return new HashCollisionNode(ownerID, this.keyHash, newEntries);
            };
            function ValueNode(ownerID, keyHash, entry) {
                this.ownerID = ownerID;
                this.keyHash = keyHash;
                this.entry = entry;
            }
            ValueNode.prototype.get = function(shift, keyHash, key, notSetValue) {
                return is(key, this.entry[0]) ? this.entry[1] : notSetValue;
            };
            ValueNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
                var removed = value === NOT_SET;
                var keyMatch = is(key, this.entry[0]);
                if (keyMatch ? value === this.entry[1] : removed) {
                    return this;
                }
                SetRef(didAlter);
                if (removed) {
                    SetRef(didChangeSize);
                    return;
                }
                if (keyMatch) {
                    if (ownerID && ownerID === this.ownerID) {
                        this.entry[1] = value;
                        return this;
                    }
                    return new ValueNode(ownerID, this.keyHash, [ key, value ]);
                }
                SetRef(didChangeSize);
                return mergeIntoNode(this, ownerID, shift, hash(key), [ key, value ]);
            };
            ArrayMapNode.prototype.iterate = HashCollisionNode.prototype.iterate = function(fn, reverse) {
                var entries = this.entries;
                for (var ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) {
                    if (fn(entries[reverse ? maxIndex - ii : ii]) === false) {
                        return false;
                    }
                }
            };
            BitmapIndexedNode.prototype.iterate = HashArrayMapNode.prototype.iterate = function(fn, reverse) {
                var nodes = this.nodes;
                for (var ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) {
                    var node = nodes[reverse ? maxIndex - ii : ii];
                    if (node && node.iterate(fn, reverse) === false) {
                        return false;
                    }
                }
            };
            ValueNode.prototype.iterate = function(fn, reverse) {
                return fn(this.entry);
            };
            createClass(MapIterator, Iterator);
            function MapIterator(map, type, reverse) {
                this._type = type;
                this._reverse = reverse;
                this._stack = map._root && mapIteratorFrame(map._root);
            }
            MapIterator.prototype.next = function() {
                var type = this._type;
                var stack = this._stack;
                while (stack) {
                    var node = stack.node;
                    var index = stack.index++;
                    var maxIndex;
                    if (node.entry) {
                        if (index === 0) {
                            return mapIteratorValue(type, node.entry);
                        }
                    } else if (node.entries) {
                        maxIndex = node.entries.length - 1;
                        if (index <= maxIndex) {
                            return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]);
                        }
                    } else {
                        maxIndex = node.nodes.length - 1;
                        if (index <= maxIndex) {
                            var subNode = node.nodes[this._reverse ? maxIndex - index : index];
                            if (subNode) {
                                if (subNode.entry) {
                                    return mapIteratorValue(type, subNode.entry);
                                }
                                stack = this._stack = mapIteratorFrame(subNode, stack);
                            }
                            continue;
                        }
                    }
                    stack = this._stack = this._stack.__prev;
                }
                return iteratorDone();
            };
            function mapIteratorValue(type, entry) {
                return iteratorValue(type, entry[0], entry[1]);
            }
            function mapIteratorFrame(node, prev) {
                return {
                    node,
                    index: 0,
                    __prev: prev
                };
            }
            function makeMap(size, root, ownerID, hash) {
                var map = Object.create(MapPrototype);
                map.size = size;
                map._root = root;
                map.__ownerID = ownerID;
                map.__hash = hash;
                map.__altered = false;
                return map;
            }
            var EMPTY_MAP;
            function emptyMap() {
                return EMPTY_MAP || (EMPTY_MAP = makeMap(0));
            }
            function updateMap(map, k, v) {
                var newRoot;
                var newSize;
                if (!map._root) {
                    if (v === NOT_SET) {
                        return map;
                    }
                    newSize = 1;
                    newRoot = new ArrayMapNode(map.__ownerID, [ [ k, v ] ]);
                } else {
                    var didChangeSize = MakeRef(CHANGE_LENGTH);
                    var didAlter = MakeRef(DID_ALTER);
                    newRoot = updateNode(map._root, map.__ownerID, 0, undefined, k, v, didChangeSize, didAlter);
                    if (!didAlter.value) {
                        return map;
                    }
                    newSize = map.size + (didChangeSize.value ? v === NOT_SET ? -1 : 1 : 0);
                }
                if (map.__ownerID) {
                    map.size = newSize;
                    map._root = newRoot;
                    map.__hash = undefined;
                    map.__altered = true;
                    return map;
                }
                return newRoot ? makeMap(newSize, newRoot) : emptyMap();
            }
            function updateNode(node, ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
                if (!node) {
                    if (value === NOT_SET) {
                        return node;
                    }
                    SetRef(didAlter);
                    SetRef(didChangeSize);
                    return new ValueNode(ownerID, keyHash, [ key, value ]);
                }
                return node.update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter);
            }
            function isLeafNode(node) {
                return node.constructor === ValueNode || node.constructor === HashCollisionNode;
            }
            function mergeIntoNode(node, ownerID, shift, keyHash, entry) {
                if (node.keyHash === keyHash) {
                    return new HashCollisionNode(ownerID, keyHash, [ node.entry, entry ]);
                }
                var idx1 = (shift === 0 ? node.keyHash : node.keyHash >>> shift) & MASK;
                var idx2 = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;
                var newNode;
                var nodes = idx1 === idx2 ? [ mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry) ] : (newNode = new ValueNode(ownerID, keyHash, entry), 
                idx1 < idx2 ? [ node, newNode ] : [ newNode, node ]);
                return new BitmapIndexedNode(ownerID, 1 << idx1 | 1 << idx2, nodes);
            }
            function createNodes(ownerID, entries, key, value) {
                if (!ownerID) {
                    ownerID = new OwnerID;
                }
                var node = new ValueNode(ownerID, hash(key), [ key, value ]);
                for (var ii = 0; ii < entries.length; ii++) {
                    var entry = entries[ii];
                    node = node.update(ownerID, 0, undefined, entry[0], entry[1]);
                }
                return node;
            }
            function packNodes(ownerID, nodes, count, excluding) {
                var bitmap = 0;
                var packedII = 0;
                var packedNodes = new Array(count);
                for (var ii = 0, bit = 1, len = nodes.length; ii < len; ii++, bit <<= 1) {
                    var node = nodes[ii];
                    if (node !== undefined && ii !== excluding) {
                        bitmap |= bit;
                        packedNodes[packedII++] = node;
                    }
                }
                return new BitmapIndexedNode(ownerID, bitmap, packedNodes);
            }
            function expandNodes(ownerID, nodes, bitmap, including, node) {
                var count = 0;
                var expandedNodes = new Array(SIZE);
                for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) {
                    expandedNodes[ii] = bitmap & 1 ? nodes[count++] : undefined;
                }
                expandedNodes[including] = node;
                return new HashArrayMapNode(ownerID, count + 1, expandedNodes);
            }
            function mergeIntoMapWith(map, merger, iterables) {
                var iters = [];
                for (var ii = 0; ii < iterables.length; ii++) {
                    var value = iterables[ii];
                    var iter = KeyedIterable(value);
                    if (!isIterable(value)) {
                        iter = iter.map((function(v) {
                            return fromJS(v);
                        }));
                    }
                    iters.push(iter);
                }
                return mergeIntoCollectionWith(map, merger, iters);
            }
            function deepMerger(existing, value, key) {
                return existing && existing.mergeDeep && isIterable(value) ? existing.mergeDeep(value) : is(existing, value) ? existing : value;
            }
            function deepMergerWith(merger) {
                return function(existing, value, key) {
                    if (existing && existing.mergeDeepWith && isIterable(value)) {
                        return existing.mergeDeepWith(merger, value);
                    }
                    var nextValue = merger(existing, value, key);
                    return is(existing, nextValue) ? existing : nextValue;
                };
            }
            function mergeIntoCollectionWith(collection, merger, iters) {
                iters = iters.filter((function(x) {
                    return x.size !== 0;
                }));
                if (iters.length === 0) {
                    return collection;
                }
                if (collection.size === 0 && !collection.__ownerID && iters.length === 1) {
                    return collection.constructor(iters[0]);
                }
                return collection.withMutations((function(collection) {
                    var mergeIntoMap = merger ? function(value, key) {
                        collection.update(key, NOT_SET, (function(existing) {
                            return existing === NOT_SET ? value : merger(existing, value, key);
                        }));
                    } : function(value, key) {
                        collection.set(key, value);
                    };
                    for (var ii = 0; ii < iters.length; ii++) {
                        iters[ii].forEach(mergeIntoMap);
                    }
                }));
            }
            function updateInDeepMap(existing, keyPathIter, notSetValue, updater) {
                var isNotSet = existing === NOT_SET;
                var step = keyPathIter.next();
                if (step.done) {
                    var existingValue = isNotSet ? notSetValue : existing;
                    var newValue = updater(existingValue);
                    return newValue === existingValue ? existing : newValue;
                }
                invariant(isNotSet || existing && existing.set, "invalid keyPath");
                var key = step.value;
                var nextExisting = isNotSet ? NOT_SET : existing.get(key, NOT_SET);
                var nextUpdated = updateInDeepMap(nextExisting, keyPathIter, notSetValue, updater);
                return nextUpdated === nextExisting ? existing : nextUpdated === NOT_SET ? existing.remove(key) : (isNotSet ? emptyMap() : existing).set(key, nextUpdated);
            }
            function popCount(x) {
                x = x - (x >> 1 & 1431655765);
                x = (x & 858993459) + (x >> 2 & 858993459);
                x = x + (x >> 4) & 252645135;
                x = x + (x >> 8);
                x = x + (x >> 16);
                return x & 127;
            }
            function setIn(array, idx, val, canEdit) {
                var newArray = canEdit ? array : arrCopy(array);
                newArray[idx] = val;
                return newArray;
            }
            function spliceIn(array, idx, val, canEdit) {
                var newLen = array.length + 1;
                if (canEdit && idx + 1 === newLen) {
                    array[idx] = val;
                    return array;
                }
                var newArray = new Array(newLen);
                var after = 0;
                for (var ii = 0; ii < newLen; ii++) {
                    if (ii === idx) {
                        newArray[ii] = val;
                        after = -1;
                    } else {
                        newArray[ii] = array[ii + after];
                    }
                }
                return newArray;
            }
            function spliceOut(array, idx, canEdit) {
                var newLen = array.length - 1;
                if (canEdit && idx === newLen) {
                    array.pop();
                    return array;
                }
                var newArray = new Array(newLen);
                var after = 0;
                for (var ii = 0; ii < newLen; ii++) {
                    if (ii === idx) {
                        after = 1;
                    }
                    newArray[ii] = array[ii + after];
                }
                return newArray;
            }
            var MAX_ARRAY_MAP_SIZE = SIZE / 4;
            var MAX_BITMAP_INDEXED_SIZE = SIZE / 2;
            var MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4;
            createClass(List, IndexedCollection);
            function List(value) {
                var empty = emptyList();
                if (value === null || value === undefined) {
                    return empty;
                }
                if (isList(value)) {
                    return value;
                }
                var iter = IndexedIterable(value);
                var size = iter.size;
                if (size === 0) {
                    return empty;
                }
                assertNotInfinite(size);
                if (size > 0 && size < SIZE) {
                    return makeList(0, size, SHIFT, null, new VNode(iter.toArray()));
                }
                return empty.withMutations((function(list) {
                    list.setSize(size);
                    iter.forEach((function(v, i) {
                        return list.set(i, v);
                    }));
                }));
            }
            List.of = function() {
                return this(arguments);
            };
            List.prototype.toString = function() {
                return this.__toString("List [", "]");
            };
            List.prototype.get = function(index, notSetValue) {
                index = wrapIndex(this, index);
                if (index >= 0 && index < this.size) {
                    index += this._origin;
                    var node = listNodeFor(this, index);
                    return node && node.array[index & MASK];
                }
                return notSetValue;
            };
            List.prototype.set = function(index, value) {
                return updateList(this, index, value);
            };
            List.prototype.remove = function(index) {
                return !this.has(index) ? this : index === 0 ? this.shift() : index === this.size - 1 ? this.pop() : this.splice(index, 1);
            };
            List.prototype.insert = function(index, value) {
                return this.splice(index, 0, value);
            };
            List.prototype.clear = function() {
                if (this.size === 0) {
                    return this;
                }
                if (this.__ownerID) {
                    this.size = this._origin = this._capacity = 0;
                    this._level = SHIFT;
                    this._root = this._tail = null;
                    this.__hash = undefined;
                    this.__altered = true;
                    return this;
                }
                return emptyList();
            };
            List.prototype.push = function() {
                var values = arguments;
                var oldSize = this.size;
                return this.withMutations((function(list) {
                    setListBounds(list, 0, oldSize + values.length);
                    for (var ii = 0; ii < values.length; ii++) {
                        list.set(oldSize + ii, values[ii]);
                    }
                }));
            };
            List.prototype.pop = function() {
                return setListBounds(this, 0, -1);
            };
            List.prototype.unshift = function() {
                var values = arguments;
                return this.withMutations((function(list) {
                    setListBounds(list, -values.length);
                    for (var ii = 0; ii < values.length; ii++) {
                        list.set(ii, values[ii]);
                    }
                }));
            };
            List.prototype.shift = function() {
                return setListBounds(this, 1);
            };
            List.prototype.merge = function() {
                return mergeIntoListWith(this, undefined, arguments);
            };
            List.prototype.mergeWith = function(merger) {
                var iters = SLICE$0.call(arguments, 1);
                return mergeIntoListWith(this, merger, iters);
            };
            List.prototype.mergeDeep = function() {
                return mergeIntoListWith(this, deepMerger, arguments);
            };
            List.prototype.mergeDeepWith = function(merger) {
                var iters = SLICE$0.call(arguments, 1);
                return mergeIntoListWith(this, deepMergerWith(merger), iters);
            };
            List.prototype.setSize = function(size) {
                return setListBounds(this, 0, size);
            };
            List.prototype.slice = function(begin, end) {
                var size = this.size;
                if (wholeSlice(begin, end, size)) {
                    return this;
                }
                return setListBounds(this, resolveBegin(begin, size), resolveEnd(end, size));
            };
            List.prototype.__iterator = function(type, reverse) {
                var index = 0;
                var values = iterateList(this, reverse);
                return new Iterator((function() {
                    var value = values();
                    return value === DONE ? iteratorDone() : iteratorValue(type, index++, value);
                }));
            };
            List.prototype.__iterate = function(fn, reverse) {
                var index = 0;
                var values = iterateList(this, reverse);
                var value;
                while ((value = values()) !== DONE) {
                    if (fn(value, index++, this) === false) {
                        break;
                    }
                }
                return index;
            };
            List.prototype.__ensureOwner = function(ownerID) {
                if (ownerID === this.__ownerID) {
                    return this;
                }
                if (!ownerID) {
                    this.__ownerID = ownerID;
                    return this;
                }
                return makeList(this._origin, this._capacity, this._level, this._root, this._tail, ownerID, this.__hash);
            };
            function isList(maybeList) {
                return !!(maybeList && maybeList[IS_LIST_SENTINEL]);
            }
            List.isList = isList;
            var IS_LIST_SENTINEL = "@@__IMMUTABLE_LIST__@@";
            var ListPrototype = List.prototype;
            ListPrototype[IS_LIST_SENTINEL] = true;
            ListPrototype[DELETE] = ListPrototype.remove;
            ListPrototype.setIn = MapPrototype.setIn;
            ListPrototype.deleteIn = ListPrototype.removeIn = MapPrototype.removeIn;
            ListPrototype.update = MapPrototype.update;
            ListPrototype.updateIn = MapPrototype.updateIn;
            ListPrototype.mergeIn = MapPrototype.mergeIn;
            ListPrototype.mergeDeepIn = MapPrototype.mergeDeepIn;
            ListPrototype.withMutations = MapPrototype.withMutations;
            ListPrototype.asMutable = MapPrototype.asMutable;
            ListPrototype.asImmutable = MapPrototype.asImmutable;
            ListPrototype.wasAltered = MapPrototype.wasAltered;
            function VNode(array, ownerID) {
                this.array = array;
                this.ownerID = ownerID;
            }
            VNode.prototype.removeBefore = function(ownerID, level, index) {
                if (index === level ? 1 << level : false || this.array.length === 0) {
                    return this;
                }
                var originIndex = index >>> level & MASK;
                if (originIndex >= this.array.length) {
                    return new VNode([], ownerID);
                }
                var removingFirst = originIndex === 0;
                var newChild;
                if (level > 0) {
                    var oldChild = this.array[originIndex];
                    newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index);
                    if (newChild === oldChild && removingFirst) {
                        return this;
                    }
                }
                if (removingFirst && !newChild) {
                    return this;
                }
                var editable = editableVNode(this, ownerID);
                if (!removingFirst) {
                    for (var ii = 0; ii < originIndex; ii++) {
                        editable.array[ii] = undefined;
                    }
                }
                if (newChild) {
                    editable.array[originIndex] = newChild;
                }
                return editable;
            };
            VNode.prototype.removeAfter = function(ownerID, level, index) {
                if (index === (level ? 1 << level : 0) || this.array.length === 0) {
                    return this;
                }
                var sizeIndex = index - 1 >>> level & MASK;
                if (sizeIndex >= this.array.length) {
                    return this;
                }
                var newChild;
                if (level > 0) {
                    var oldChild = this.array[sizeIndex];
                    newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index);
                    if (newChild === oldChild && sizeIndex === this.array.length - 1) {
                        return this;
                    }
                }
                var editable = editableVNode(this, ownerID);
                editable.array.splice(sizeIndex + 1);
                if (newChild) {
                    editable.array[sizeIndex] = newChild;
                }
                return editable;
            };
            var DONE = {};
            function iterateList(list, reverse) {
                var left = list._origin;
                var right = list._capacity;
                var tailPos = getTailOffset(right);
                var tail = list._tail;
                return iterateNodeOrLeaf(list._root, list._level, 0);
                function iterateNodeOrLeaf(node, level, offset) {
                    return level === 0 ? iterateLeaf(node, offset) : iterateNode(node, level, offset);
                }
                function iterateLeaf(node, offset) {
                    var array = offset === tailPos ? tail && tail.array : node && node.array;
                    var from = offset > left ? 0 : left - offset;
                    var to = right - offset;
                    if (to > SIZE) {
                        to = SIZE;
                    }
                    return function() {
                        if (from === to) {
                            return DONE;
                        }
                        var idx = reverse ? --to : from++;
                        return array && array[idx];
                    };
                }
                function iterateNode(node, level, offset) {
                    var values;
                    var array = node && node.array;
                    var from = offset > left ? 0 : left - offset >> level;
                    var to = (right - offset >> level) + 1;
                    if (to > SIZE) {
                        to = SIZE;
                    }
                    return function() {
                        do {
                            if (values) {
                                var value = values();
                                if (value !== DONE) {
                                    return value;
                                }
                                values = null;
                            }
                            if (from === to) {
                                return DONE;
                            }
                            var idx = reverse ? --to : from++;
                            values = iterateNodeOrLeaf(array && array[idx], level - SHIFT, offset + (idx << level));
                        } while (true);
                    };
                }
            }
            function makeList(origin, capacity, level, root, tail, ownerID, hash) {
                var list = Object.create(ListPrototype);
                list.size = capacity - origin;
                list._origin = origin;
                list._capacity = capacity;
                list._level = level;
                list._root = root;
                list._tail = tail;
                list.__ownerID = ownerID;
                list.__hash = hash;
                list.__altered = false;
                return list;
            }
            var EMPTY_LIST;
            function emptyList() {
                return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT));
            }
            function updateList(list, index, value) {
                index = wrapIndex(list, index);
                if (index !== index) {
                    return list;
                }
                if (index >= list.size || index < 0) {
                    return list.withMutations((function(list) {
                        index < 0 ? setListBounds(list, index).set(0, value) : setListBounds(list, 0, index + 1).set(index, value);
                    }));
                }
                index += list._origin;
                var newTail = list._tail;
                var newRoot = list._root;
                var didAlter = MakeRef(DID_ALTER);
                if (index >= getTailOffset(list._capacity)) {
                    newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter);
                } else {
                    newRoot = updateVNode(newRoot, list.__ownerID, list._level, index, value, didAlter);
                }
                if (!didAlter.value) {
                    return list;
                }
                if (list.__ownerID) {
                    list._root = newRoot;
                    list._tail = newTail;
                    list.__hash = undefined;
                    list.__altered = true;
                    return list;
                }
                return makeList(list._origin, list._capacity, list._level, newRoot, newTail);
            }
            function updateVNode(node, ownerID, level, index, value, didAlter) {
                var idx = index >>> level & MASK;
                var nodeHas = node && idx < node.array.length;
                if (!nodeHas && value === undefined) {
                    return node;
                }
                var newNode;
                if (level > 0) {
                    var lowerNode = node && node.array[idx];
                    var newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter);
                    if (newLowerNode === lowerNode) {
                        return node;
                    }
                    newNode = editableVNode(node, ownerID);
                    newNode.array[idx] = newLowerNode;
                    return newNode;
                }
                if (nodeHas && node.array[idx] === value) {
                    return node;
                }
                SetRef(didAlter);
                newNode = editableVNode(node, ownerID);
                if (value === undefined && idx === newNode.array.length - 1) {
                    newNode.array.pop();
                } else {
                    newNode.array[idx] = value;
                }
                return newNode;
            }
            function editableVNode(node, ownerID) {
                if (ownerID && node && ownerID === node.ownerID) {
                    return node;
                }
                return new VNode(node ? node.array.slice() : [], ownerID);
            }
            function listNodeFor(list, rawIndex) {
                if (rawIndex >= getTailOffset(list._capacity)) {
                    return list._tail;
                }
                if (rawIndex < 1 << list._level + SHIFT) {
                    var node = list._root;
                    var level = list._level;
                    while (node && level > 0) {
                        node = node.array[rawIndex >>> level & MASK];
                        level -= SHIFT;
                    }
                    return node;
                }
            }
            function setListBounds(list, begin, end) {
                if (begin !== undefined) {
                    begin = begin | 0;
                }
                if (end !== undefined) {
                    end = end | 0;
                }
                var owner = list.__ownerID || new OwnerID;
                var oldOrigin = list._origin;
                var oldCapacity = list._capacity;
                var newOrigin = oldOrigin + begin;
                var newCapacity = end === undefined ? oldCapacity : end < 0 ? oldCapacity + end : oldOrigin + end;
                if (newOrigin === oldOrigin && newCapacity === oldCapacity) {
                    return list;
                }
                if (newOrigin >= newCapacity) {
                    return list.clear();
                }
                var newLevel = list._level;
                var newRoot = list._root;
                var offsetShift = 0;
                while (newOrigin + offsetShift < 0) {
                    newRoot = new VNode(newRoot && newRoot.array.length ? [ undefined, newRoot ] : [], owner);
                    newLevel += SHIFT;
                    offsetShift += 1 << newLevel;
                }
                if (offsetShift) {
                    newOrigin += offsetShift;
                    oldOrigin += offsetShift;
                    newCapacity += offsetShift;
                    oldCapacity += offsetShift;
                }
                var oldTailOffset = getTailOffset(oldCapacity);
                var newTailOffset = getTailOffset(newCapacity);
                while (newTailOffset >= 1 << newLevel + SHIFT) {
                    newRoot = new VNode(newRoot && newRoot.array.length ? [ newRoot ] : [], owner);
                    newLevel += SHIFT;
                }
                var oldTail = list._tail;
                var newTail = newTailOffset < oldTailOffset ? listNodeFor(list, newCapacity - 1) : newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail;
                if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldCapacity && oldTail.array.length) {
                    newRoot = editableVNode(newRoot, owner);
                    var node = newRoot;
                    for (var level = newLevel; level > SHIFT; level -= SHIFT) {
                        var idx = oldTailOffset >>> level & MASK;
                        node = node.array[idx] = editableVNode(node.array[idx], owner);
                    }
                    node.array[oldTailOffset >>> SHIFT & MASK] = oldTail;
                }
                if (newCapacity < oldCapacity) {
                    newTail = newTail && newTail.removeAfter(owner, 0, newCapacity);
                }
                if (newOrigin >= newTailOffset) {
                    newOrigin -= newTailOffset;
                    newCapacity -= newTailOffset;
                    newLevel = SHIFT;
                    newRoot = null;
                    newTail = newTail && newTail.removeBefore(owner, 0, newOrigin);
                } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) {
                    offsetShift = 0;
                    while (newRoot) {
                        var beginIndex = newOrigin >>> newLevel & MASK;
                        if (beginIndex !== newTailOffset >>> newLevel & MASK) {
                            break;
                        }
                        if (beginIndex) {
                            offsetShift += (1 << newLevel) * beginIndex;
                        }
                        newLevel -= SHIFT;
                        newRoot = newRoot.array[beginIndex];
                    }
                    if (newRoot && newOrigin > oldOrigin) {
                        newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift);
                    }
                    if (newRoot && newTailOffset < oldTailOffset) {
                        newRoot = newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift);
                    }
                    if (offsetShift) {
                        newOrigin -= offsetShift;
                        newCapacity -= offsetShift;
                    }
                }
                if (list.__ownerID) {
                    list.size = newCapacity - newOrigin;
                    list._origin = newOrigin;
                    list._capacity = newCapacity;
                    list._level = newLevel;
                    list._root = newRoot;
                    list._tail = newTail;
                    list.__hash = undefined;
                    list.__altered = true;
                    return list;
                }
                return makeList(newOrigin, newCapacity, newLevel, newRoot, newTail);
            }
            function mergeIntoListWith(list, merger, iterables) {
                var iters = [];
                var maxSize = 0;
                for (var ii = 0; ii < iterables.length; ii++) {
                    var value = iterables[ii];
                    var iter = IndexedIterable(value);
                    if (iter.size > maxSize) {
                        maxSize = iter.size;
                    }
                    if (!isIterable(value)) {
                        iter = iter.map((function(v) {
                            return fromJS(v);
                        }));
                    }
                    iters.push(iter);
                }
                if (maxSize > list.size) {
                    list = list.setSize(maxSize);
                }
                return mergeIntoCollectionWith(list, merger, iters);
            }
            function getTailOffset(size) {
                return size < SIZE ? 0 : size - 1 >>> SHIFT << SHIFT;
            }
            createClass(OrderedMap, Map);
            function OrderedMap(value) {
                return value === null || value === undefined ? emptyOrderedMap() : isOrderedMap(value) ? value : emptyOrderedMap().withMutations((function(map) {
                    var iter = KeyedIterable(value);
                    assertNotInfinite(iter.size);
                    iter.forEach((function(v, k) {
                        return map.set(k, v);
                    }));
                }));
            }
            OrderedMap.of = function() {
                return this(arguments);
            };
            OrderedMap.prototype.toString = function() {
                return this.__toString("OrderedMap {", "}");
            };
            OrderedMap.prototype.get = function(k, notSetValue) {
                var index = this._map.get(k);
                return index !== undefined ? this._list.get(index)[1] : notSetValue;
            };
            OrderedMap.prototype.clear = function() {
                if (this.size === 0) {
                    return this;
                }
                if (this.__ownerID) {
                    this.size = 0;
                    this._map.clear();
                    this._list.clear();
                    return this;
                }
                return emptyOrderedMap();
            };
            OrderedMap.prototype.set = function(k, v) {
                return updateOrderedMap(this, k, v);
            };
            OrderedMap.prototype.remove = function(k) {
                return updateOrderedMap(this, k, NOT_SET);
            };
            OrderedMap.prototype.wasAltered = function() {
                return this._map.wasAltered() || this._list.wasAltered();
            };
            OrderedMap.prototype.__iterate = function(fn, reverse) {
                var this$0 = this;
                return this._list.__iterate((function(entry) {
                    return entry && fn(entry[1], entry[0], this$0);
                }), reverse);
            };
            OrderedMap.prototype.__iterator = function(type, reverse) {
                return this._list.fromEntrySeq().__iterator(type, reverse);
            };
            OrderedMap.prototype.__ensureOwner = function(ownerID) {
                if (ownerID === this.__ownerID) {
                    return this;
                }
                var newMap = this._map.__ensureOwner(ownerID);
                var newList = this._list.__ensureOwner(ownerID);
                if (!ownerID) {
                    this.__ownerID = ownerID;
                    this._map = newMap;
                    this._list = newList;
                    return this;
                }
                return makeOrderedMap(newMap, newList, ownerID, this.__hash);
            };
            function isOrderedMap(maybeOrderedMap) {
                return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap);
            }
            OrderedMap.isOrderedMap = isOrderedMap;
            OrderedMap.prototype[IS_ORDERED_SENTINEL] = true;
            OrderedMap.prototype[DELETE] = OrderedMap.prototype.remove;
            function makeOrderedMap(map, list, ownerID, hash) {
                var omap = Object.create(OrderedMap.prototype);
                omap.size = map ? map.size : 0;
                omap._map = map;
                omap._list = list;
                omap.__ownerID = ownerID;
                omap.__hash = hash;
                return omap;
            }
            var EMPTY_ORDERED_MAP;
            function emptyOrderedMap() {
                return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList()));
            }
            function updateOrderedMap(omap, k, v) {
                var map = omap._map;
                var list = omap._list;
                var i = map.get(k);
                var has = i !== undefined;
                var newMap;
                var newList;
                if (v === NOT_SET) {
                    if (!has) {
                        return omap;
                    }
                    if (list.size >= SIZE && list.size >= map.size * 2) {
                        newList = list.filter((function(entry, idx) {
                            return entry !== undefined && i !== idx;
                        }));
                        newMap = newList.toKeyedSeq().map((function(entry) {
                            return entry[0];
                        })).flip().toMap();
                        if (omap.__ownerID) {
                            newMap.__ownerID = newList.__ownerID = omap.__ownerID;
                        }
                    } else {
                        newMap = map.remove(k);
                        newList = i === list.size - 1 ? list.pop() : list.set(i, undefined);
                    }
                } else {
                    if (has) {
                        if (v === list.get(i)[1]) {
                            return omap;
                        }
                        newMap = map;
                        newList = list.set(i, [ k, v ]);
                    } else {
                        newMap = map.set(k, list.size);
                        newList = list.set(list.size, [ k, v ]);
                    }
                }
                if (omap.__ownerID) {
                    omap.size = newMap.size;
                    omap._map = newMap;
                    omap._list = newList;
                    omap.__hash = undefined;
                    return omap;
                }
                return makeOrderedMap(newMap, newList);
            }
            createClass(ToKeyedSequence, KeyedSeq);
            function ToKeyedSequence(indexed, useKeys) {
                this._iter = indexed;
                this._useKeys = useKeys;
                this.size = indexed.size;
            }
            ToKeyedSequence.prototype.get = function(key, notSetValue) {
                return this._iter.get(key, notSetValue);
            };
            ToKeyedSequence.prototype.has = function(key) {
                return this._iter.has(key);
            };
            ToKeyedSequence.prototype.valueSeq = function() {
                return this._iter.valueSeq();
            };
            ToKeyedSequence.prototype.reverse = function() {
                var this$0 = this;
                var reversedSequence = reverseFactory(this, true);
                if (!this._useKeys) {
                    reversedSequence.valueSeq = function() {
                        return this$0._iter.toSeq().reverse();
                    };
                }
                return reversedSequence;
            };
            ToKeyedSequence.prototype.map = function(mapper, context) {
                var this$0 = this;
                var mappedSequence = mapFactory(this, mapper, context);
                if (!this._useKeys) {
                    mappedSequence.valueSeq = function() {
                        return this$0._iter.toSeq().map(mapper, context);
                    };
                }
                return mappedSequence;
            };
            ToKeyedSequence.prototype.__iterate = function(fn, reverse) {
                var this$0 = this;
                var ii;
                return this._iter.__iterate(this._useKeys ? function(v, k) {
                    return fn(v, k, this$0);
                } : (ii = reverse ? resolveSize(this) : 0, function(v) {
                    return fn(v, reverse ? --ii : ii++, this$0);
                }), reverse);
            };
            ToKeyedSequence.prototype.__iterator = function(type, reverse) {
                if (this._useKeys) {
                    return this._iter.__iterator(type, reverse);
                }
                var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
                var ii = reverse ? resolveSize(this) : 0;
                return new Iterator((function() {
                    var step = iterator.next();
                    return step.done ? step : iteratorValue(type, reverse ? --ii : ii++, step.value, step);
                }));
            };
            ToKeyedSequence.prototype[IS_ORDERED_SENTINEL] = true;
            createClass(ToIndexedSequence, IndexedSeq);
            function ToIndexedSequence(iter) {
                this._iter = iter;
                this.size = iter.size;
            }
            ToIndexedSequence.prototype.includes = function(value) {
                return this._iter.includes(value);
            };
            ToIndexedSequence.prototype.__iterate = function(fn, reverse) {
                var this$0 = this;
                var iterations = 0;
                return this._iter.__iterate((function(v) {
                    return fn(v, iterations++, this$0);
                }), reverse);
            };
            ToIndexedSequence.prototype.__iterator = function(type, reverse) {
                var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
                var iterations = 0;
                return new Iterator((function() {
                    var step = iterator.next();
                    return step.done ? step : iteratorValue(type, iterations++, step.value, step);
                }));
            };
            createClass(ToSetSequence, SetSeq);
            function ToSetSequence(iter) {
                this._iter = iter;
                this.size = iter.size;
            }
            ToSetSequence.prototype.has = function(key) {
                return this._iter.includes(key);
            };
            ToSetSequence.prototype.__iterate = function(fn, reverse) {
                var this$0 = this;
                return this._iter.__iterate((function(v) {
                    return fn(v, v, this$0);
                }), reverse);
            };
            ToSetSequence.prototype.__iterator = function(type, reverse) {
                var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
                return new Iterator((function() {
                    var step = iterator.next();
                    return step.done ? step : iteratorValue(type, step.value, step.value, step);
                }));
            };
            createClass(FromEntriesSequence, KeyedSeq);
            function FromEntriesSequence(entries) {
                this._iter = entries;
                this.size = entries.size;
            }
            FromEntriesSequence.prototype.entrySeq = function() {
                return this._iter.toSeq();
            };
            FromEntriesSequence.prototype.__iterate = function(fn, reverse) {
                var this$0 = this;
                return this._iter.__iterate((function(entry) {
                    if (entry) {
                        validateEntry(entry);
                        var indexedIterable = isIterable(entry);
                        return fn(indexedIterable ? entry.get(1) : entry[1], indexedIterable ? entry.get(0) : entry[0], this$0);
                    }
                }), reverse);
            };
            FromEntriesSequence.prototype.__iterator = function(type, reverse) {
                var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
                return new Iterator((function() {
                    while (true) {
                        var step = iterator.next();
                        if (step.done) {
                            return step;
                        }
                        var entry = step.value;
                        if (entry) {
                            validateEntry(entry);
                            var indexedIterable = isIterable(entry);
                            return iteratorValue(type, indexedIterable ? entry.get(0) : entry[0], indexedIterable ? entry.get(1) : entry[1], step);
                        }
                    }
                }));
            };
            ToIndexedSequence.prototype.cacheResult = ToKeyedSequence.prototype.cacheResult = ToSetSequence.prototype.cacheResult = FromEntriesSequence.prototype.cacheResult = cacheResultThrough;
            function flipFactory(iterable) {
                var flipSequence = makeSequence(iterable);
                flipSequence._iter = iterable;
                flipSequence.size = iterable.size;
                flipSequence.flip = function() {
                    return iterable;
                };
                flipSequence.reverse = function() {
                    var reversedSequence = iterable.reverse.apply(this);
                    reversedSequence.flip = function() {
                        return iterable.reverse();
                    };
                    return reversedSequence;
                };
                flipSequence.has = function(key) {
                    return iterable.includes(key);
                };
                flipSequence.includes = function(key) {
                    return iterable.has(key);
                };
                flipSequence.cacheResult = cacheResultThrough;
                flipSequence.__iterateUncached = function(fn, reverse) {
                    var this$0 = this;
                    return iterable.__iterate((function(v, k) {
                        return fn(k, v, this$0) !== false;
                    }), reverse);
                };
                flipSequence.__iteratorUncached = function(type, reverse) {
                    if (type === ITERATE_ENTRIES) {
                        var iterator = iterable.__iterator(type, reverse);
                        return new Iterator((function() {
                            var step = iterator.next();
                            if (!step.done) {
                                var k = step.value[0];
                                step.value[0] = step.value[1];
                                step.value[1] = k;
                            }
                            return step;
                        }));
                    }
                    return iterable.__iterator(type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES, reverse);
                };
                return flipSequence;
            }
            function mapFactory(iterable, mapper, context) {
                var mappedSequence = makeSequence(iterable);
                mappedSequence.size = iterable.size;
                mappedSequence.has = function(key) {
                    return iterable.has(key);
                };
                mappedSequence.get = function(key, notSetValue) {
                    var v = iterable.get(key, NOT_SET);
                    return v === NOT_SET ? notSetValue : mapper.call(context, v, key, iterable);
                };
                mappedSequence.__iterateUncached = function(fn, reverse) {
                    var this$0 = this;
                    return iterable.__iterate((function(v, k, c) {
                        return fn(mapper.call(context, v, k, c), k, this$0) !== false;
                    }), reverse);
                };
                mappedSequence.__iteratorUncached = function(type, reverse) {
                    var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
                    return new Iterator((function() {
                        var step = iterator.next();
                        if (step.done) {
                            return step;
                        }
                        var entry = step.value;
                        var key = entry[0];
                        return iteratorValue(type, key, mapper.call(context, entry[1], key, iterable), step);
                    }));
                };
                return mappedSequence;
            }
            function reverseFactory(iterable, useKeys) {
                var reversedSequence = makeSequence(iterable);
                reversedSequence._iter = iterable;
                reversedSequence.size = iterable.size;
                reversedSequence.reverse = function() {
                    return iterable;
                };
                if (iterable.flip) {
                    reversedSequence.flip = function() {
                        var flipSequence = flipFactory(iterable);
                        flipSequence.reverse = function() {
                            return iterable.flip();
                        };
                        return flipSequence;
                    };
                }
                reversedSequence.get = function(key, notSetValue) {
                    return iterable.get(useKeys ? key : -1 - key, notSetValue);
                };
                reversedSequence.has = function(key) {
                    return iterable.has(useKeys ? key : -1 - key);
                };
                reversedSequence.includes = function(value) {
                    return iterable.includes(value);
                };
                reversedSequence.cacheResult = cacheResultThrough;
                reversedSequence.__iterate = function(fn, reverse) {
                    var this$0 = this;
                    return iterable.__iterate((function(v, k) {
                        return fn(v, k, this$0);
                    }), !reverse);
                };
                reversedSequence.__iterator = function(type, reverse) {
                    return iterable.__iterator(type, !reverse);
                };
                return reversedSequence;
            }
            function filterFactory(iterable, predicate, context, useKeys) {
                var filterSequence = makeSequence(iterable);
                if (useKeys) {
                    filterSequence.has = function(key) {
                        var v = iterable.get(key, NOT_SET);
                        return v !== NOT_SET && !!predicate.call(context, v, key, iterable);
                    };
                    filterSequence.get = function(key, notSetValue) {
                        var v = iterable.get(key, NOT_SET);
                        return v !== NOT_SET && predicate.call(context, v, key, iterable) ? v : notSetValue;
                    };
                }
                filterSequence.__iterateUncached = function(fn, reverse) {
                    var this$0 = this;
                    var iterations = 0;
                    iterable.__iterate((function(v, k, c) {
                        if (predicate.call(context, v, k, c)) {
                            iterations++;
                            return fn(v, useKeys ? k : iterations - 1, this$0);
                        }
                    }), reverse);
                    return iterations;
                };
                filterSequence.__iteratorUncached = function(type, reverse) {
                    var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
                    var iterations = 0;
                    return new Iterator((function() {
                        while (true) {
                            var step = iterator.next();
                            if (step.done) {
                                return step;
                            }
                            var entry = step.value;
                            var key = entry[0];
                            var value = entry[1];
                            if (predicate.call(context, value, key, iterable)) {
                                return iteratorValue(type, useKeys ? key : iterations++, value, step);
                            }
                        }
                    }));
                };
                return filterSequence;
            }
            function countByFactory(iterable, grouper, context) {
                var groups = Map().asMutable();
                iterable.__iterate((function(v, k) {
                    groups.update(grouper.call(context, v, k, iterable), 0, (function(a) {
                        return a + 1;
                    }));
                }));
                return groups.asImmutable();
            }
            function groupByFactory(iterable, grouper, context) {
                var isKeyedIter = isKeyed(iterable);
                var groups = (isOrdered(iterable) ? OrderedMap() : Map()).asMutable();
                iterable.__iterate((function(v, k) {
                    groups.update(grouper.call(context, v, k, iterable), (function(a) {
                        return a = a || [], a.push(isKeyedIter ? [ k, v ] : v), a;
                    }));
                }));
                var coerce = iterableClass(iterable);
                return groups.map((function(arr) {
                    return reify(iterable, coerce(arr));
                }));
            }
            function sliceFactory(iterable, begin, end, useKeys) {
                var originalSize = iterable.size;
                if (begin !== undefined) {
                    begin = begin | 0;
                }
                if (end !== undefined) {
                    if (end === Infinity) {
                        end = originalSize;
                    } else {
                        end = end | 0;
                    }
                }
                if (wholeSlice(begin, end, originalSize)) {
                    return iterable;
                }
                var resolvedBegin = resolveBegin(begin, originalSize);
                var resolvedEnd = resolveEnd(end, originalSize);
                if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) {
                    return sliceFactory(iterable.toSeq().cacheResult(), begin, end, useKeys);
                }
                var resolvedSize = resolvedEnd - resolvedBegin;
                var sliceSize;
                if (resolvedSize === resolvedSize) {
                    sliceSize = resolvedSize < 0 ? 0 : resolvedSize;
                }
                var sliceSeq = makeSequence(iterable);
                sliceSeq.size = sliceSize === 0 ? sliceSize : iterable.size && sliceSize || undefined;
                if (!useKeys && isSeq(iterable) && sliceSize >= 0) {
                    sliceSeq.get = function(index, notSetValue) {
                        index = wrapIndex(this, index);
                        return index >= 0 && index < sliceSize ? iterable.get(index + resolvedBegin, notSetValue) : notSetValue;
                    };
                }
                sliceSeq.__iterateUncached = function(fn, reverse) {
                    var this$0 = this;
                    if (sliceSize === 0) {
                        return 0;
                    }
                    if (reverse) {
                        return this.cacheResult().__iterate(fn, reverse);
                    }
                    var skipped = 0;
                    var isSkipping = true;
                    var iterations = 0;
                    iterable.__iterate((function(v, k) {
                        if (!(isSkipping && (isSkipping = skipped++ < resolvedBegin))) {
                            iterations++;
                            return fn(v, useKeys ? k : iterations - 1, this$0) !== false && iterations !== sliceSize;
                        }
                    }));
                    return iterations;
                };
                sliceSeq.__iteratorUncached = function(type, reverse) {
                    if (sliceSize !== 0 && reverse) {
                        return this.cacheResult().__iterator(type, reverse);
                    }
                    var iterator = sliceSize !== 0 && iterable.__iterator(type, reverse);
                    var skipped = 0;
                    var iterations = 0;
                    return new Iterator((function() {
                        while (skipped++ < resolvedBegin) {
                            iterator.next();
                        }
                        if (++iterations > sliceSize) {
                            return iteratorDone();
                        }
                        var step = iterator.next();
                        if (useKeys || type === ITERATE_VALUES) {
                            return step;
                        } else if (type === ITERATE_KEYS) {
                            return iteratorValue(type, iterations - 1, undefined, step);
                        } else {
                            return iteratorValue(type, iterations - 1, step.value[1], step);
                        }
                    }));
                };
                return sliceSeq;
            }
            function takeWhileFactory(iterable, predicate, context) {
                var takeSequence = makeSequence(iterable);
                takeSequence.__iterateUncached = function(fn, reverse) {
                    var this$0 = this;
                    if (reverse) {
                        return this.cacheResult().__iterate(fn, reverse);
                    }
                    var iterations = 0;
                    iterable.__iterate((function(v, k, c) {
                        return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$0);
                    }));
                    return iterations;
                };
                takeSequence.__iteratorUncached = function(type, reverse) {
                    var this$0 = this;
                    if (reverse) {
                        return this.cacheResult().__iterator(type, reverse);
                    }
                    var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
                    var iterating = true;
                    return new Iterator((function() {
                        if (!iterating) {
                            return iteratorDone();
                        }
                        var step = iterator.next();
                        if (step.done) {
                            return step;
                        }
                        var entry = step.value;
                        var k = entry[0];
                        var v = entry[1];
                        if (!predicate.call(context, v, k, this$0)) {
                            iterating = false;
                            return iteratorDone();
                        }
                        return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step);
                    }));
                };
                return takeSequence;
            }
            function skipWhileFactory(iterable, predicate, context, useKeys) {
                var skipSequence = makeSequence(iterable);
                skipSequence.__iterateUncached = function(fn, reverse) {
                    var this$0 = this;
                    if (reverse) {
                        return this.cacheResult().__iterate(fn, reverse);
                    }
                    var isSkipping = true;
                    var iterations = 0;
                    iterable.__iterate((function(v, k, c) {
                        if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) {
                            iterations++;
                            return fn(v, useKeys ? k : iterations - 1, this$0);
                        }
                    }));
                    return iterations;
                };
                skipSequence.__iteratorUncached = function(type, reverse) {
                    var this$0 = this;
                    if (reverse) {
                        return this.cacheResult().__iterator(type, reverse);
                    }
                    var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
                    var skipping = true;
                    var iterations = 0;
                    return new Iterator((function() {
                        var step, k, v;
                        do {
                            step = iterator.next();
                            if (step.done) {
                                if (useKeys || type === ITERATE_VALUES) {
                                    return step;
                                } else if (type === ITERATE_KEYS) {
                                    return iteratorValue(type, iterations++, undefined, step);
                                } else {
                                    return iteratorValue(type, iterations++, step.value[1], step);
                                }
                            }
                            var entry = step.value;
                            k = entry[0];
                            v = entry[1];
                            skipping && (skipping = predicate.call(context, v, k, this$0));
                        } while (skipping);
                        return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step);
                    }));
                };
                return skipSequence;
            }
            function concatFactory(iterable, values) {
                var isKeyedIterable = isKeyed(iterable);
                var iters = [ iterable ].concat(values).map((function(v) {
                    if (!isIterable(v)) {
                        v = isKeyedIterable ? keyedSeqFromValue(v) : indexedSeqFromValue(Array.isArray(v) ? v : [ v ]);
                    } else if (isKeyedIterable) {
                        v = KeyedIterable(v);
                    }
                    return v;
                })).filter((function(v) {
                    return v.size !== 0;
                }));
                if (iters.length === 0) {
                    return iterable;
                }
                if (iters.length === 1) {
                    var singleton = iters[0];
                    if (singleton === iterable || isKeyedIterable && isKeyed(singleton) || isIndexed(iterable) && isIndexed(singleton)) {
                        return singleton;
                    }
                }
                var concatSeq = new ArraySeq(iters);
                if (isKeyedIterable) {
                    concatSeq = concatSeq.toKeyedSeq();
                } else if (!isIndexed(iterable)) {
                    concatSeq = concatSeq.toSetSeq();
                }
                concatSeq = concatSeq.flatten(true);
                concatSeq.size = iters.reduce((function(sum, seq) {
                    if (sum !== undefined) {
                        var size = seq.size;
                        if (size !== undefined) {
                            return sum + size;
                        }
                    }
                }), 0);
                return concatSeq;
            }
            function flattenFactory(iterable, depth, useKeys) {
                var flatSequence = makeSequence(iterable);
                flatSequence.__iterateUncached = function(fn, reverse) {
                    var iterations = 0;
                    var stopped = false;
                    function flatDeep(iter, currentDepth) {
                        var this$0 = this;
                        iter.__iterate((function(v, k) {
                            if ((!depth || currentDepth < depth) && isIterable(v)) {
                                flatDeep(v, currentDepth + 1);
                            } else if (fn(v, useKeys ? k : iterations++, this$0) === false) {
                                stopped = true;
                            }
                            return !stopped;
                        }), reverse);
                    }
                    flatDeep(iterable, 0);
                    return iterations;
                };
                flatSequence.__iteratorUncached = function(type, reverse) {
                    var iterator = iterable.__iterator(type, reverse);
                    var stack = [];
                    var iterations = 0;
                    return new Iterator((function() {
                        while (iterator) {
                            var step = iterator.next();
                            if (step.done !== false) {
                                iterator = stack.pop();
                                continue;
                            }
                            var v = step.value;
                            if (type === ITERATE_ENTRIES) {
                                v = v[1];
                            }
                            if ((!depth || stack.length < depth) && isIterable(v)) {
                                stack.push(iterator);
                                iterator = v.__iterator(type, reverse);
                            } else {
                                return useKeys ? step : iteratorValue(type, iterations++, v, step);
                            }
                        }
                        return iteratorDone();
                    }));
                };
                return flatSequence;
            }
            function flatMapFactory(iterable, mapper, context) {
                var coerce = iterableClass(iterable);
                return iterable.toSeq().map((function(v, k) {
                    return coerce(mapper.call(context, v, k, iterable));
                })).flatten(true);
            }
            function interposeFactory(iterable, separator) {
                var interposedSequence = makeSequence(iterable);
                interposedSequence.size = iterable.size && iterable.size * 2 - 1;
                interposedSequence.__iterateUncached = function(fn, reverse) {
                    var this$0 = this;
                    var iterations = 0;
                    iterable.__iterate((function(v, k) {
                        return (!iterations || fn(separator, iterations++, this$0) !== false) && fn(v, iterations++, this$0) !== false;
                    }), reverse);
                    return iterations;
                };
                interposedSequence.__iteratorUncached = function(type, reverse) {
                    var iterator = iterable.__iterator(ITERATE_VALUES, reverse);
                    var iterations = 0;
                    var step;
                    return new Iterator((function() {
                        if (!step || iterations % 2) {
                            step = iterator.next();
                            if (step.done) {
                                return step;
                            }
                        }
                        return iterations % 2 ? iteratorValue(type, iterations++, separator) : iteratorValue(type, iterations++, step.value, step);
                    }));
                };
                return interposedSequence;
            }
            function sortFactory(iterable, comparator, mapper) {
                if (!comparator) {
                    comparator = defaultComparator;
                }
                var isKeyedIterable = isKeyed(iterable);
                var index = 0;
                var entries = iterable.toSeq().map((function(v, k) {
                    return [ k, v, index++, mapper ? mapper(v, k, iterable) : v ];
                })).toArray();
                entries.sort((function(a, b) {
                    return comparator(a[3], b[3]) || a[2] - b[2];
                })).forEach(isKeyedIterable ? function(v, i) {
                    entries[i].length = 2;
                } : function(v, i) {
                    entries[i] = v[1];
                });
                return isKeyedIterable ? KeyedSeq(entries) : isIndexed(iterable) ? IndexedSeq(entries) : SetSeq(entries);
            }
            function maxFactory(iterable, comparator, mapper) {
                if (!comparator) {
                    comparator = defaultComparator;
                }
                if (mapper) {
                    var entry = iterable.toSeq().map((function(v, k) {
                        return [ v, mapper(v, k, iterable) ];
                    })).reduce((function(a, b) {
                        return maxCompare(comparator, a[1], b[1]) ? b : a;
                    }));
                    return entry && entry[0];
                } else {
                    return iterable.reduce((function(a, b) {
                        return maxCompare(comparator, a, b) ? b : a;
                    }));
                }
            }
            function maxCompare(comparator, a, b) {
                var comp = comparator(b, a);
                return comp === 0 && b !== a && (b === undefined || b === null || b !== b) || comp > 0;
            }
            function zipWithFactory(keyIter, zipper, iters) {
                var zipSequence = makeSequence(keyIter);
                zipSequence.size = new ArraySeq(iters).map((function(i) {
                    return i.size;
                })).min();
                zipSequence.__iterate = function(fn, reverse) {
                    var iterator = this.__iterator(ITERATE_VALUES, reverse);
                    var step;
                    var iterations = 0;
                    while (!(step = iterator.next()).done) {
                        if (fn(step.value, iterations++, this) === false) {
                            break;
                        }
                    }
                    return iterations;
                };
                zipSequence.__iteratorUncached = function(type, reverse) {
                    var iterators = iters.map((function(i) {
                        return i = Iterable(i), getIterator(reverse ? i.reverse() : i);
                    }));
                    var iterations = 0;
                    var isDone = false;
                    return new Iterator((function() {
                        var steps;
                        if (!isDone) {
                            steps = iterators.map((function(i) {
                                return i.next();
                            }));
                            isDone = steps.some((function(s) {
                                return s.done;
                            }));
                        }
                        if (isDone) {
                            return iteratorDone();
                        }
                        return iteratorValue(type, iterations++, zipper.apply(null, steps.map((function(s) {
                            return s.value;
                        }))));
                    }));
                };
                return zipSequence;
            }
            function reify(iter, seq) {
                return isSeq(iter) ? seq : iter.constructor(seq);
            }
            function validateEntry(entry) {
                if (entry !== Object(entry)) {
                    throw new TypeError("Expected [K, V] tuple: " + entry);
                }
            }
            function resolveSize(iter) {
                assertNotInfinite(iter.size);
                return ensureSize(iter);
            }
            function iterableClass(iterable) {
                return isKeyed(iterable) ? KeyedIterable : isIndexed(iterable) ? IndexedIterable : SetIterable;
            }
            function makeSequence(iterable) {
                return Object.create((isKeyed(iterable) ? KeyedSeq : isIndexed(iterable) ? IndexedSeq : SetSeq).prototype);
            }
            function cacheResultThrough() {
                if (this._iter.cacheResult) {
                    this._iter.cacheResult();
                    this.size = this._iter.size;
                    return this;
                } else {
                    return Seq.prototype.cacheResult.call(this);
                }
            }
            function defaultComparator(a, b) {
                return a > b ? 1 : a < b ? -1 : 0;
            }
            function forceIterator(keyPath) {
                var iter = getIterator(keyPath);
                if (!iter) {
                    if (!isArrayLike(keyPath)) {
                        throw new TypeError("Expected iterable or array-like: " + keyPath);
                    }
                    iter = getIterator(Iterable(keyPath));
                }
                return iter;
            }
            createClass(Record, KeyedCollection);
            function Record(defaultValues, name) {
                var hasInitialized;
                var RecordType = function Record(values) {
                    if (values instanceof RecordType) {
                        return values;
                    }
                    if (!(this instanceof RecordType)) {
                        return new RecordType(values);
                    }
                    if (!hasInitialized) {
                        hasInitialized = true;
                        var keys = Object.keys(defaultValues);
                        setProps(RecordTypePrototype, keys);
                        RecordTypePrototype.size = keys.length;
                        RecordTypePrototype._name = name;
                        RecordTypePrototype._keys = keys;
                        RecordTypePrototype._defaultValues = defaultValues;
                    }
                    this._map = Map(values);
                };
                var RecordTypePrototype = RecordType.prototype = Object.create(RecordPrototype);
                RecordTypePrototype.constructor = RecordType;
                return RecordType;
            }
            Record.prototype.toString = function() {
                return this.__toString(recordName(this) + " {", "}");
            };
            Record.prototype.has = function(k) {
                return this._defaultValues.hasOwnProperty(k);
            };
            Record.prototype.get = function(k, notSetValue) {
                if (!this.has(k)) {
                    return notSetValue;
                }
                var defaultVal = this._defaultValues[k];
                return this._map ? this._map.get(k, defaultVal) : defaultVal;
            };
            Record.prototype.clear = function() {
                if (this.__ownerID) {
                    this._map && this._map.clear();
                    return this;
                }
                var RecordType = this.constructor;
                return RecordType._empty || (RecordType._empty = makeRecord(this, emptyMap()));
            };
            Record.prototype.set = function(k, v) {
                if (!this.has(k)) {
                    throw new Error('Cannot set unknown key "' + k + '" on ' + recordName(this));
                }
                if (this._map && !this._map.has(k)) {
                    var defaultVal = this._defaultValues[k];
                    if (v === defaultVal) {
                        return this;
                    }
                }
                var newMap = this._map && this._map.set(k, v);
                if (this.__ownerID || newMap === this._map) {
                    return this;
                }
                return makeRecord(this, newMap);
            };
            Record.prototype.remove = function(k) {
                if (!this.has(k)) {
                    return this;
                }
                var newMap = this._map && this._map.remove(k);
                if (this.__ownerID || newMap === this._map) {
                    return this;
                }
                return makeRecord(this, newMap);
            };
            Record.prototype.wasAltered = function() {
                return this._map.wasAltered();
            };
            Record.prototype.__iterator = function(type, reverse) {
                var this$0 = this;
                return KeyedIterable(this._defaultValues).map((function(_, k) {
                    return this$0.get(k);
                })).__iterator(type, reverse);
            };
            Record.prototype.__iterate = function(fn, reverse) {
                var this$0 = this;
                return KeyedIterable(this._defaultValues).map((function(_, k) {
                    return this$0.get(k);
                })).__iterate(fn, reverse);
            };
            Record.prototype.__ensureOwner = function(ownerID) {
                if (ownerID === this.__ownerID) {
                    return this;
                }
                var newMap = this._map && this._map.__ensureOwner(ownerID);
                if (!ownerID) {
                    this.__ownerID = ownerID;
                    this._map = newMap;
                    return this;
                }
                return makeRecord(this, newMap, ownerID);
            };
            var RecordPrototype = Record.prototype;
            RecordPrototype[DELETE] = RecordPrototype.remove;
            RecordPrototype.deleteIn = RecordPrototype.removeIn = MapPrototype.removeIn;
            RecordPrototype.merge = MapPrototype.merge;
            RecordPrototype.mergeWith = MapPrototype.mergeWith;
            RecordPrototype.mergeIn = MapPrototype.mergeIn;
            RecordPrototype.mergeDeep = MapPrototype.mergeDeep;
            RecordPrototype.mergeDeepWith = MapPrototype.mergeDeepWith;
            RecordPrototype.mergeDeepIn = MapPrototype.mergeDeepIn;
            RecordPrototype.setIn = MapPrototype.setIn;
            RecordPrototype.update = MapPrototype.update;
            RecordPrototype.updateIn = MapPrototype.updateIn;
            RecordPrototype.withMutations = MapPrototype.withMutations;
            RecordPrototype.asMutable = MapPrototype.asMutable;
            RecordPrototype.asImmutable = MapPrototype.asImmutable;
            function makeRecord(likeRecord, map, ownerID) {
                var record = Object.create(Object.getPrototypeOf(likeRecord));
                record._map = map;
                record.__ownerID = ownerID;
                return record;
            }
            function recordName(record) {
                return record._name || record.constructor.name || "Record";
            }
            function setProps(prototype, names) {
                try {
                    names.forEach(setProp.bind(undefined, prototype));
                } catch (error) {}
            }
            function setProp(prototype, name) {
                Object.defineProperty(prototype, name, {
                    get: function() {
                        return this.get(name);
                    },
                    set: function(value) {
                        invariant(this.__ownerID, "Cannot set on an immutable record.");
                        this.set(name, value);
                    }
                });
            }
            createClass(Set, SetCollection);
            function Set(value) {
                return value === null || value === undefined ? emptySet() : isSet(value) && !isOrdered(value) ? value : emptySet().withMutations((function(set) {
                    var iter = SetIterable(value);
                    assertNotInfinite(iter.size);
                    iter.forEach((function(v) {
                        return set.add(v);
                    }));
                }));
            }
            Set.of = function() {
                return this(arguments);
            };
            Set.fromKeys = function(value) {
                return this(KeyedIterable(value).keySeq());
            };
            Set.prototype.toString = function() {
                return this.__toString("Set {", "}");
            };
            Set.prototype.has = function(value) {
                return this._map.has(value);
            };
            Set.prototype.add = function(value) {
                return updateSet(this, this._map.set(value, true));
            };
            Set.prototype.remove = function(value) {
                return updateSet(this, this._map.remove(value));
            };
            Set.prototype.clear = function() {
                return updateSet(this, this._map.clear());
            };
            Set.prototype.union = function() {
                var iters = SLICE$0.call(arguments, 0);
                iters = iters.filter((function(x) {
                    return x.size !== 0;
                }));
                if (iters.length === 0) {
                    return this;
                }
                if (this.size === 0 && !this.__ownerID && iters.length === 1) {
                    return this.constructor(iters[0]);
                }
                return this.withMutations((function(set) {
                    for (var ii = 0; ii < iters.length; ii++) {
                        SetIterable(iters[ii]).forEach((function(value) {
                            return set.add(value);
                        }));
                    }
                }));
            };
            Set.prototype.intersect = function() {
                var iters = SLICE$0.call(arguments, 0);
                if (iters.length === 0) {
                    return this;
                }
                iters = iters.map((function(iter) {
                    return SetIterable(iter);
                }));
                var originalSet = this;
                return this.withMutations((function(set) {
                    originalSet.forEach((function(value) {
                        if (!iters.every((function(iter) {
                            return iter.includes(value);
                        }))) {
                            set.remove(value);
                        }
                    }));
                }));
            };
            Set.prototype.subtract = function() {
                var iters = SLICE$0.call(arguments, 0);
                if (iters.length === 0) {
                    return this;
                }
                iters = iters.map((function(iter) {
                    return SetIterable(iter);
                }));
                var originalSet = this;
                return this.withMutations((function(set) {
                    originalSet.forEach((function(value) {
                        if (iters.some((function(iter) {
                            return iter.includes(value);
                        }))) {
                            set.remove(value);
                        }
                    }));
                }));
            };
            Set.prototype.merge = function() {
                return this.union.apply(this, arguments);
            };
            Set.prototype.mergeWith = function(merger) {
                var iters = SLICE$0.call(arguments, 1);
                return this.union.apply(this, iters);
            };
            Set.prototype.sort = function(comparator) {
                return OrderedSet(sortFactory(this, comparator));
            };
            Set.prototype.sortBy = function(mapper, comparator) {
                return OrderedSet(sortFactory(this, comparator, mapper));
            };
            Set.prototype.wasAltered = function() {
                return this._map.wasAltered();
            };
            Set.prototype.__iterate = function(fn, reverse) {
                var this$0 = this;
                return this._map.__iterate((function(_, k) {
                    return fn(k, k, this$0);
                }), reverse);
            };
            Set.prototype.__iterator = function(type, reverse) {
                return this._map.map((function(_, k) {
                    return k;
                })).__iterator(type, reverse);
            };
            Set.prototype.__ensureOwner = function(ownerID) {
                if (ownerID === this.__ownerID) {
                    return this;
                }
                var newMap = this._map.__ensureOwner(ownerID);
                if (!ownerID) {
                    this.__ownerID = ownerID;
                    this._map = newMap;
                    return this;
                }
                return this.__make(newMap, ownerID);
            };
            function isSet(maybeSet) {
                return !!(maybeSet && maybeSet[IS_SET_SENTINEL]);
            }
            Set.isSet = isSet;
            var IS_SET_SENTINEL = "@@__IMMUTABLE_SET__@@";
            var SetPrototype = Set.prototype;
            SetPrototype[IS_SET_SENTINEL] = true;
            SetPrototype[DELETE] = SetPrototype.remove;
            SetPrototype.mergeDeep = SetPrototype.merge;
            SetPrototype.mergeDeepWith = SetPrototype.mergeWith;
            SetPrototype.withMutations = MapPrototype.withMutations;
            SetPrototype.asMutable = MapPrototype.asMutable;
            SetPrototype.asImmutable = MapPrototype.asImmutable;
            SetPrototype.__empty = emptySet;
            SetPrototype.__make = makeSet;
            function updateSet(set, newMap) {
                if (set.__ownerID) {
                    set.size = newMap.size;
                    set._map = newMap;
                    return set;
                }
                return newMap === set._map ? set : newMap.size === 0 ? set.__empty() : set.__make(newMap);
            }
            function makeSet(map, ownerID) {
                var set = Object.create(SetPrototype);
                set.size = map ? map.size : 0;
                set._map = map;
                set.__ownerID = ownerID;
                return set;
            }
            var EMPTY_SET;
            function emptySet() {
                return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap()));
            }
            createClass(OrderedSet, Set);
            function OrderedSet(value) {
                return value === null || value === undefined ? emptyOrderedSet() : isOrderedSet(value) ? value : emptyOrderedSet().withMutations((function(set) {
                    var iter = SetIterable(value);
                    assertNotInfinite(iter.size);
                    iter.forEach((function(v) {
                        return set.add(v);
                    }));
                }));
            }
            OrderedSet.of = function() {
                return this(arguments);
            };
            OrderedSet.fromKeys = function(value) {
                return this(KeyedIterable(value).keySeq());
            };
            OrderedSet.prototype.toString = function() {
                return this.__toString("OrderedSet {", "}");
            };
            function isOrderedSet(maybeOrderedSet) {
                return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet);
            }
            OrderedSet.isOrderedSet = isOrderedSet;
            var OrderedSetPrototype = OrderedSet.prototype;
            OrderedSetPrototype[IS_ORDERED_SENTINEL] = true;
            OrderedSetPrototype.__empty = emptyOrderedSet;
            OrderedSetPrototype.__make = makeOrderedSet;
            function makeOrderedSet(map, ownerID) {
                var set = Object.create(OrderedSetPrototype);
                set.size = map ? map.size : 0;
                set._map = map;
                set.__ownerID = ownerID;
                return set;
            }
            var EMPTY_ORDERED_SET;
            function emptyOrderedSet() {
                return EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap()));
            }
            createClass(Stack, IndexedCollection);
            function Stack(value) {
                return value === null || value === undefined ? emptyStack() : isStack(value) ? value : emptyStack().unshiftAll(value);
            }
            Stack.of = function() {
                return this(arguments);
            };
            Stack.prototype.toString = function() {
                return this.__toString("Stack [", "]");
            };
            Stack.prototype.get = function(index, notSetValue) {
                var head = this._head;
                index = wrapIndex(this, index);
                while (head && index--) {
                    head = head.next;
                }
                return head ? head.value : notSetValue;
            };
            Stack.prototype.peek = function() {
                return this._head && this._head.value;
            };
            Stack.prototype.push = function() {
                if (arguments.length === 0) {
                    return this;
                }
                var newSize = this.size + arguments.length;
                var head = this._head;
                for (var ii = arguments.length - 1; ii >= 0; ii--) {
                    head = {
                        value: arguments[ii],
                        next: head
                    };
                }
                if (this.__ownerID) {
                    this.size = newSize;
                    this._head = head;
                    this.__hash = undefined;
                    this.__altered = true;
                    return this;
                }
                return makeStack(newSize, head);
            };
            Stack.prototype.pushAll = function(iter) {
                iter = IndexedIterable(iter);
                if (iter.size === 0) {
                    return this;
                }
                assertNotInfinite(iter.size);
                var newSize = this.size;
                var head = this._head;
                iter.reverse().forEach((function(value) {
                    newSize++;
                    head = {
                        value,
                        next: head
                    };
                }));
                if (this.__ownerID) {
                    this.size = newSize;
                    this._head = head;
                    this.__hash = undefined;
                    this.__altered = true;
                    return this;
                }
                return makeStack(newSize, head);
            };
            Stack.prototype.pop = function() {
                return this.slice(1);
            };
            Stack.prototype.unshift = function() {
                return this.push.apply(this, arguments);
            };
            Stack.prototype.unshiftAll = function(iter) {
                return this.pushAll(iter);
            };
            Stack.prototype.shift = function() {
                return this.pop.apply(this, arguments);
            };
            Stack.prototype.clear = function() {
                if (this.size === 0) {
                    return this;
                }
                if (this.__ownerID) {
                    this.size = 0;
                    this._head = undefined;
                    this.__hash = undefined;
                    this.__altered = true;
                    return this;
                }
                return emptyStack();
            };
            Stack.prototype.slice = function(begin, end) {
                if (wholeSlice(begin, end, this.size)) {
                    return this;
                }
                var resolvedBegin = resolveBegin(begin, this.size);
                var resolvedEnd = resolveEnd(end, this.size);
                if (resolvedEnd !== this.size) {
                    return IndexedCollection.prototype.slice.call(this, begin, end);
                }
                var newSize = this.size - resolvedBegin;
                var head = this._head;
                while (resolvedBegin--) {
                    head = head.next;
                }
                if (this.__ownerID) {
                    this.size = newSize;
                    this._head = head;
                    this.__hash = undefined;
                    this.__altered = true;
                    return this;
                }
                return makeStack(newSize, head);
            };
            Stack.prototype.__ensureOwner = function(ownerID) {
                if (ownerID === this.__ownerID) {
                    return this;
                }
                if (!ownerID) {
                    this.__ownerID = ownerID;
                    this.__altered = false;
                    return this;
                }
                return makeStack(this.size, this._head, ownerID, this.__hash);
            };
            Stack.prototype.__iterate = function(fn, reverse) {
                if (reverse) {
                    return this.reverse().__iterate(fn);
                }
                var iterations = 0;
                var node = this._head;
                while (node) {
                    if (fn(node.value, iterations++, this) === false) {
                        break;
                    }
                    node = node.next;
                }
                return iterations;
            };
            Stack.prototype.__iterator = function(type, reverse) {
                if (reverse) {
                    return this.reverse().__iterator(type);
                }
                var iterations = 0;
                var node = this._head;
                return new Iterator((function() {
                    if (node) {
                        var value = node.value;
                        node = node.next;
                        return iteratorValue(type, iterations++, value);
                    }
                    return iteratorDone();
                }));
            };
            function isStack(maybeStack) {
                return !!(maybeStack && maybeStack[IS_STACK_SENTINEL]);
            }
            Stack.isStack = isStack;
            var IS_STACK_SENTINEL = "@@__IMMUTABLE_STACK__@@";
            var StackPrototype = Stack.prototype;
            StackPrototype[IS_STACK_SENTINEL] = true;
            StackPrototype.withMutations = MapPrototype.withMutations;
            StackPrototype.asMutable = MapPrototype.asMutable;
            StackPrototype.asImmutable = MapPrototype.asImmutable;
            StackPrototype.wasAltered = MapPrototype.wasAltered;
            function makeStack(size, head, ownerID, hash) {
                var map = Object.create(StackPrototype);
                map.size = size;
                map._head = head;
                map.__ownerID = ownerID;
                map.__hash = hash;
                map.__altered = false;
                return map;
            }
            var EMPTY_STACK;
            function emptyStack() {
                return EMPTY_STACK || (EMPTY_STACK = makeStack(0));
            }
            function mixin(ctor, methods) {
                var keyCopier = function(key) {
                    ctor.prototype[key] = methods[key];
                };
                Object.keys(methods).forEach(keyCopier);
                Object.getOwnPropertySymbols && Object.getOwnPropertySymbols(methods).forEach(keyCopier);
                return ctor;
            }
            Iterable.Iterator = Iterator;
            mixin(Iterable, {
                toArray: function() {
                    assertNotInfinite(this.size);
                    var array = new Array(this.size || 0);
                    this.valueSeq().__iterate((function(v, i) {
                        array[i] = v;
                    }));
                    return array;
                },
                toIndexedSeq: function() {
                    return new ToIndexedSequence(this);
                },
                toJS: function() {
                    return this.toSeq().map((function(value) {
                        return value && typeof value.toJS === "function" ? value.toJS() : value;
                    })).__toJS();
                },
                toJSON: function() {
                    return this.toSeq().map((function(value) {
                        return value && typeof value.toJSON === "function" ? value.toJSON() : value;
                    })).__toJS();
                },
                toKeyedSeq: function() {
                    return new ToKeyedSequence(this, true);
                },
                toMap: function() {
                    return Map(this.toKeyedSeq());
                },
                toObject: function() {
                    assertNotInfinite(this.size);
                    var object = {};
                    this.__iterate((function(v, k) {
                        object[k] = v;
                    }));
                    return object;
                },
                toOrderedMap: function() {
                    return OrderedMap(this.toKeyedSeq());
                },
                toOrderedSet: function() {
                    return OrderedSet(isKeyed(this) ? this.valueSeq() : this);
                },
                toSet: function() {
                    return Set(isKeyed(this) ? this.valueSeq() : this);
                },
                toSetSeq: function() {
                    return new ToSetSequence(this);
                },
                toSeq: function() {
                    return isIndexed(this) ? this.toIndexedSeq() : isKeyed(this) ? this.toKeyedSeq() : this.toSetSeq();
                },
                toStack: function() {
                    return Stack(isKeyed(this) ? this.valueSeq() : this);
                },
                toList: function() {
                    return List(isKeyed(this) ? this.valueSeq() : this);
                },
                toString: function() {
                    return "[Iterable]";
                },
                __toString: function(head, tail) {
                    if (this.size === 0) {
                        return head + tail;
                    }
                    return head + " " + this.toSeq().map(this.__toStringMapper).join(", ") + " " + tail;
                },
                concat: function() {
                    var values = SLICE$0.call(arguments, 0);
                    return reify(this, concatFactory(this, values));
                },
                includes: function(searchValue) {
                    return this.some((function(value) {
                        return is(value, searchValue);
                    }));
                },
                entries: function() {
                    return this.__iterator(ITERATE_ENTRIES);
                },
                every: function(predicate, context) {
                    assertNotInfinite(this.size);
                    var returnValue = true;
                    this.__iterate((function(v, k, c) {
                        if (!predicate.call(context, v, k, c)) {
                            returnValue = false;
                            return false;
                        }
                    }));
                    return returnValue;
                },
                filter: function(predicate, context) {
                    return reify(this, filterFactory(this, predicate, context, true));
                },
                find: function(predicate, context, notSetValue) {
                    var entry = this.findEntry(predicate, context);
                    return entry ? entry[1] : notSetValue;
                },
                forEach: function(sideEffect, context) {
                    assertNotInfinite(this.size);
                    return this.__iterate(context ? sideEffect.bind(context) : sideEffect);
                },
                join: function(separator) {
                    assertNotInfinite(this.size);
                    separator = separator !== undefined ? "" + separator : ",";
                    var joined = "";
                    var isFirst = true;
                    this.__iterate((function(v) {
                        isFirst ? isFirst = false : joined += separator;
                        joined += v !== null && v !== undefined ? v.toString() : "";
                    }));
                    return joined;
                },
                keys: function() {
                    return this.__iterator(ITERATE_KEYS);
                },
                map: function(mapper, context) {
                    return reify(this, mapFactory(this, mapper, context));
                },
                reduce: function(reducer, initialReduction, context) {
                    assertNotInfinite(this.size);
                    var reduction;
                    var useFirst;
                    if (arguments.length < 2) {
                        useFirst = true;
                    } else {
                        reduction = initialReduction;
                    }
                    this.__iterate((function(v, k, c) {
                        if (useFirst) {
                            useFirst = false;
                            reduction = v;
                        } else {
                            reduction = reducer.call(context, reduction, v, k, c);
                        }
                    }));
                    return reduction;
                },
                reduceRight: function(reducer, initialReduction, context) {
                    var reversed = this.toKeyedSeq().reverse();
                    return reversed.reduce.apply(reversed, arguments);
                },
                reverse: function() {
                    return reify(this, reverseFactory(this, true));
                },
                slice: function(begin, end) {
                    return reify(this, sliceFactory(this, begin, end, true));
                },
                some: function(predicate, context) {
                    return !this.every(not(predicate), context);
                },
                sort: function(comparator) {
                    return reify(this, sortFactory(this, comparator));
                },
                values: function() {
                    return this.__iterator(ITERATE_VALUES);
                },
                butLast: function() {
                    return this.slice(0, -1);
                },
                isEmpty: function() {
                    return this.size !== undefined ? this.size === 0 : !this.some((function() {
                        return true;
                    }));
                },
                count: function(predicate, context) {
                    return ensureSize(predicate ? this.toSeq().filter(predicate, context) : this);
                },
                countBy: function(grouper, context) {
                    return countByFactory(this, grouper, context);
                },
                equals: function(other) {
                    return deepEqual(this, other);
                },
                entrySeq: function() {
                    var iterable = this;
                    if (iterable._cache) {
                        return new ArraySeq(iterable._cache);
                    }
                    var entriesSequence = iterable.toSeq().map(entryMapper).toIndexedSeq();
                    entriesSequence.fromEntrySeq = function() {
                        return iterable.toSeq();
                    };
                    return entriesSequence;
                },
                filterNot: function(predicate, context) {
                    return this.filter(not(predicate), context);
                },
                findEntry: function(predicate, context, notSetValue) {
                    var found = notSetValue;
                    this.__iterate((function(v, k, c) {
                        if (predicate.call(context, v, k, c)) {
                            found = [ k, v ];
                            return false;
                        }
                    }));
                    return found;
                },
                findKey: function(predicate, context) {
                    var entry = this.findEntry(predicate, context);
                    return entry && entry[0];
                },
                findLast: function(predicate, context, notSetValue) {
                    return this.toKeyedSeq().reverse().find(predicate, context, notSetValue);
                },
                findLastEntry: function(predicate, context, notSetValue) {
                    return this.toKeyedSeq().reverse().findEntry(predicate, context, notSetValue);
                },
                findLastKey: function(predicate, context) {
                    return this.toKeyedSeq().reverse().findKey(predicate, context);
                },
                first: function() {
                    return this.find(returnTrue);
                },
                flatMap: function(mapper, context) {
                    return reify(this, flatMapFactory(this, mapper, context));
                },
                flatten: function(depth) {
                    return reify(this, flattenFactory(this, depth, true));
                },
                fromEntrySeq: function() {
                    return new FromEntriesSequence(this);
                },
                get: function(searchKey, notSetValue) {
                    return this.find((function(_, key) {
                        return is(key, searchKey);
                    }), undefined, notSetValue);
                },
                getIn: function(searchKeyPath, notSetValue) {
                    var nested = this;
                    var iter = forceIterator(searchKeyPath);
                    var step;
                    while (!(step = iter.next()).done) {
                        var key = step.value;
                        nested = nested && nested.get ? nested.get(key, NOT_SET) : NOT_SET;
                        if (nested === NOT_SET) {
                            return notSetValue;
                        }
                    }
                    return nested;
                },
                groupBy: function(grouper, context) {
                    return groupByFactory(this, grouper, context);
                },
                has: function(searchKey) {
                    return this.get(searchKey, NOT_SET) !== NOT_SET;
                },
                hasIn: function(searchKeyPath) {
                    return this.getIn(searchKeyPath, NOT_SET) !== NOT_SET;
                },
                isSubset: function(iter) {
                    iter = typeof iter.includes === "function" ? iter : Iterable(iter);
                    return this.every((function(value) {
                        return iter.includes(value);
                    }));
                },
                isSuperset: function(iter) {
                    iter = typeof iter.isSubset === "function" ? iter : Iterable(iter);
                    return iter.isSubset(this);
                },
                keyOf: function(searchValue) {
                    return this.findKey((function(value) {
                        return is(value, searchValue);
                    }));
                },
                keySeq: function() {
                    return this.toSeq().map(keyMapper).toIndexedSeq();
                },
                last: function() {
                    return this.toSeq().reverse().first();
                },
                lastKeyOf: function(searchValue) {
                    return this.toKeyedSeq().reverse().keyOf(searchValue);
                },
                max: function(comparator) {
                    return maxFactory(this, comparator);
                },
                maxBy: function(mapper, comparator) {
                    return maxFactory(this, comparator, mapper);
                },
                min: function(comparator) {
                    return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator);
                },
                minBy: function(mapper, comparator) {
                    return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator, mapper);
                },
                rest: function() {
                    return this.slice(1);
                },
                skip: function(amount) {
                    return this.slice(Math.max(0, amount));
                },
                skipLast: function(amount) {
                    return reify(this, this.toSeq().reverse().skip(amount).reverse());
                },
                skipWhile: function(predicate, context) {
                    return reify(this, skipWhileFactory(this, predicate, context, true));
                },
                skipUntil: function(predicate, context) {
                    return this.skipWhile(not(predicate), context);
                },
                sortBy: function(mapper, comparator) {
                    return reify(this, sortFactory(this, comparator, mapper));
                },
                take: function(amount) {
                    return this.slice(0, Math.max(0, amount));
                },
                takeLast: function(amount) {
                    return reify(this, this.toSeq().reverse().take(amount).reverse());
                },
                takeWhile: function(predicate, context) {
                    return reify(this, takeWhileFactory(this, predicate, context));
                },
                takeUntil: function(predicate, context) {
                    return this.takeWhile(not(predicate), context);
                },
                valueSeq: function() {
                    return this.toIndexedSeq();
                },
                hashCode: function() {
                    return this.__hash || (this.__hash = hashIterable(this));
                }
            });
            var IterablePrototype = Iterable.prototype;
            IterablePrototype[IS_ITERABLE_SENTINEL] = true;
            IterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.values;
            IterablePrototype.__toJS = IterablePrototype.toArray;
            IterablePrototype.__toStringMapper = quoteString;
            IterablePrototype.inspect = IterablePrototype.toSource = function() {
                return this.toString();
            };
            IterablePrototype.chain = IterablePrototype.flatMap;
            IterablePrototype.contains = IterablePrototype.includes;
            mixin(KeyedIterable, {
                flip: function() {
                    return reify(this, flipFactory(this));
                },
                mapEntries: function(mapper, context) {
                    var this$0 = this;
                    var iterations = 0;
                    return reify(this, this.toSeq().map((function(v, k) {
                        return mapper.call(context, [ k, v ], iterations++, this$0);
                    })).fromEntrySeq());
                },
                mapKeys: function(mapper, context) {
                    var this$0 = this;
                    return reify(this, this.toSeq().flip().map((function(k, v) {
                        return mapper.call(context, k, v, this$0);
                    })).flip());
                }
            });
            var KeyedIterablePrototype = KeyedIterable.prototype;
            KeyedIterablePrototype[IS_KEYED_SENTINEL] = true;
            KeyedIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.entries;
            KeyedIterablePrototype.__toJS = IterablePrototype.toObject;
            KeyedIterablePrototype.__toStringMapper = function(v, k) {
                return JSON.stringify(k) + ": " + quoteString(v);
            };
            mixin(IndexedIterable, {
                toKeyedSeq: function() {
                    return new ToKeyedSequence(this, false);
                },
                filter: function(predicate, context) {
                    return reify(this, filterFactory(this, predicate, context, false));
                },
                findIndex: function(predicate, context) {
                    var entry = this.findEntry(predicate, context);
                    return entry ? entry[0] : -1;
                },
                indexOf: function(searchValue) {
                    var key = this.keyOf(searchValue);
                    return key === undefined ? -1 : key;
                },
                lastIndexOf: function(searchValue) {
                    var key = this.lastKeyOf(searchValue);
                    return key === undefined ? -1 : key;
                },
                reverse: function() {
                    return reify(this, reverseFactory(this, false));
                },
                slice: function(begin, end) {
                    return reify(this, sliceFactory(this, begin, end, false));
                },
                splice: function(index, removeNum) {
                    var numArgs = arguments.length;
                    removeNum = Math.max(removeNum | 0, 0);
                    if (numArgs === 0 || numArgs === 2 && !removeNum) {
                        return this;
                    }
                    index = resolveBegin(index, index < 0 ? this.count() : this.size);
                    var spliced = this.slice(0, index);
                    return reify(this, numArgs === 1 ? spliced : spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum)));
                },
                findLastIndex: function(predicate, context) {
                    var entry = this.findLastEntry(predicate, context);
                    return entry ? entry[0] : -1;
                },
                first: function() {
                    return this.get(0);
                },
                flatten: function(depth) {
                    return reify(this, flattenFactory(this, depth, false));
                },
                get: function(index, notSetValue) {
                    index = wrapIndex(this, index);
                    return index < 0 || (this.size === Infinity || this.size !== undefined && index > this.size) ? notSetValue : this.find((function(_, key) {
                        return key === index;
                    }), undefined, notSetValue);
                },
                has: function(index) {
                    index = wrapIndex(this, index);
                    return index >= 0 && (this.size !== undefined ? this.size === Infinity || index < this.size : this.indexOf(index) !== -1);
                },
                interpose: function(separator) {
                    return reify(this, interposeFactory(this, separator));
                },
                interleave: function() {
                    var iterables = [ this ].concat(arrCopy(arguments));
                    var zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, iterables);
                    var interleaved = zipped.flatten(true);
                    if (zipped.size) {
                        interleaved.size = zipped.size * iterables.length;
                    }
                    return reify(this, interleaved);
                },
                keySeq: function() {
                    return Range(0, this.size);
                },
                last: function() {
                    return this.get(-1);
                },
                skipWhile: function(predicate, context) {
                    return reify(this, skipWhileFactory(this, predicate, context, false));
                },
                zip: function() {
                    var iterables = [ this ].concat(arrCopy(arguments));
                    return reify(this, zipWithFactory(this, defaultZipper, iterables));
                },
                zipWith: function(zipper) {
                    var iterables = arrCopy(arguments);
                    iterables[0] = this;
                    return reify(this, zipWithFactory(this, zipper, iterables));
                }
            });
            IndexedIterable.prototype[IS_INDEXED_SENTINEL] = true;
            IndexedIterable.prototype[IS_ORDERED_SENTINEL] = true;
            mixin(SetIterable, {
                get: function(value, notSetValue) {
                    return this.has(value) ? value : notSetValue;
                },
                includes: function(value) {
                    return this.has(value);
                },
                keySeq: function() {
                    return this.valueSeq();
                }
            });
            SetIterable.prototype.has = IterablePrototype.includes;
            SetIterable.prototype.contains = SetIterable.prototype.includes;
            mixin(KeyedSeq, KeyedIterable.prototype);
            mixin(IndexedSeq, IndexedIterable.prototype);
            mixin(SetSeq, SetIterable.prototype);
            mixin(KeyedCollection, KeyedIterable.prototype);
            mixin(IndexedCollection, IndexedIterable.prototype);
            mixin(SetCollection, SetIterable.prototype);
            function keyMapper(v, k) {
                return k;
            }
            function entryMapper(v, k) {
                return [ k, v ];
            }
            function not(predicate) {
                return function() {
                    return !predicate.apply(this, arguments);
                };
            }
            function neg(predicate) {
                return function() {
                    return -predicate.apply(this, arguments);
                };
            }
            function quoteString(value) {
                return typeof value === "string" ? JSON.stringify(value) : String(value);
            }
            function defaultZipper() {
                return arrCopy(arguments);
            }
            function defaultNegComparator(a, b) {
                return a < b ? 1 : a > b ? -1 : 0;
            }
            function hashIterable(iterable) {
                if (iterable.size === Infinity) {
                    return 0;
                }
                var ordered = isOrdered(iterable);
                var keyed = isKeyed(iterable);
                var h = ordered ? 1 : 0;
                var size = iterable.__iterate(keyed ? ordered ? function(v, k) {
                    h = 31 * h + hashMerge(hash(v), hash(k)) | 0;
                } : function(v, k) {
                    h = h + hashMerge(hash(v), hash(k)) | 0;
                } : ordered ? function(v) {
                    h = 31 * h + hash(v) | 0;
                } : function(v) {
                    h = h + hash(v) | 0;
                });
                return murmurHashOfSize(size, h);
            }
            function murmurHashOfSize(size, h) {
                h = imul(h, 3432918353);
                h = imul(h << 15 | h >>> -15, 461845907);
                h = imul(h << 13 | h >>> -13, 5);
                h = (h + 3864292196 | 0) ^ size;
                h = imul(h ^ h >>> 16, 2246822507);
                h = imul(h ^ h >>> 13, 3266489909);
                h = smi(h ^ h >>> 16);
                return h;
            }
            function hashMerge(a, b) {
                return a ^ b + 2654435769 + (a << 6) + (a >> 2) | 0;
            }
            var Immutable = {
                Iterable,
                Seq,
                Collection,
                Map,
                OrderedMap,
                List,
                Stack,
                Set,
                OrderedSet,
                Record,
                Range,
                Repeat,
                is,
                fromJS
            };
            return Immutable;
        }));
    }, (module, __webpack_exports__, __webpack_require__) => {
        "use strict";
        __webpack_require__.d(__webpack_exports__, {
            Z: () => es
        });
        function symbolObservablePonyfill(root) {
            var result;
            var Symbol = root.Symbol;
            if (typeof Symbol === "function") {
                if (Symbol.observable) {
                    result = Symbol.observable;
                } else {
                    result = Symbol("observable");
                    Symbol.observable = result;
                }
            } else {
                result = "@@observable";
            }
            return result;
        }
        module = __webpack_require__.hmd(module);
        var root;
        if (typeof self !== "undefined") {
            root = self;
        } else if (typeof window !== "undefined") {
            root = window;
        } else if (typeof global !== "undefined") {
            root = global;
        } else if (true) {
            root = module;
        } else {}
        var result = symbolObservablePonyfill(root);
        const es = result;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        var __webpack_unused_export__;
        __webpack_unused_export__ = {
            value: true
        };
        __webpack_unused_export__ = __webpack_unused_export__ = __webpack_unused_export__ = __webpack_unused_export__ = exports.LH = exports.Sq = void 0;
        const fs_1 = __webpack_require__(14);
        const path_1 = __webpack_require__(15);
        const LEDS_DIR = "/sys/class/leds";
        class Led {
            constructor(name) {
                this.name = name;
                this.ready = this.open();
                this.ready.catch((() => {}));
            }
            async open() {
                this.maxBrightness = parseInt(await fs_1.promises.readFile(path_1.join(LEDS_DIR, this.name, "max_brightness"), "utf8"), 10);
                this.handle = await fs_1.promises.open(path_1.join(LEDS_DIR, this.name, "brightness"), "w");
            }
            async close() {
                await this.ready;
                await this.handle.close();
            }
            async setIntensity(intensity) {
                await this.ready;
                if (intensity < 0 || intensity > 1) {
                    throw new Error("Led intensity must be between 0 and 1");
                }
                const value = Math.round(intensity * this.maxBrightness);
                if (value !== this.lastValue) {
                    await this.handle.write(value.toString(), 0);
                    this.lastValue = value;
                }
            }
        }
        class RGBLed {
            constructor(names) {
                this.leds = names.map((name => new Led(name)));
            }
            async close() {
                await Promise.all(this.leds.map((l => l.close())));
            }
            async setColor(color) {
                await Promise.all([ this.leds[0].setIntensity(color[0]), this.leds[1].setIntensity(color[1]), this.leds[2].setIntensity(color[2]) ]);
            }
        }
        exports.Sq = RGBLed;
        class Animator {
            constructor(mapping, frequency = 10) {
                this.mapping = mapping;
                this.updating = false;
                this.setFrequency(frequency);
            }
            async setFrequency(frequency) {
                if (frequency < 0) {
                    throw new Error("frequency must be greater or equal to 0");
                }
                const period = 1e3 / frequency;
                this.stop();
                if (period === Infinity) {
                    if (this.lastUpdate !== undefined) {
                        await this.lastUpdate;
                    }
                } else {
                    this.start(period);
                }
            }
            start(period) {
                if (this.intervalId === undefined) {
                    this.intervalId = setInterval((() => {
                        this.updateOrSkip();
                    }), period);
                }
            }
            stop() {
                if (this.intervalId !== undefined) {
                    clearInterval(this.intervalId);
                    this.intervalId = undefined;
                }
            }
            updateOrSkip() {
                if (!this.updating) {
                    this.lastUpdate = this.update();
                }
            }
            async update() {
                this.updating = true;
                const t = (new Date).getTime() / 1e3;
                const promises = [];
                for (const {animation, rgbLeds} of this.mapping) {
                    const color = animation(t);
                    promises.push(...rgbLeds.map((rgbLed => rgbLed.setColor(color))));
                }
                await Promise.all(promises);
                this.updating = false;
            }
        }
        exports.LH = Animator;
        function sin01(t) {
            return (1 + Math.sin(t)) / 2;
        }
        __webpack_unused_export__ = sin01;
        function breatheGreen(t) {
            return [ 0, sin01(t), 0 ];
        }
        __webpack_unused_export__ = breatheGreen;
        const THIRD_OF_PI = Math.PI / 3;
        function rainbow(t) {
            return [ sin01(t), sin01(t + 2 * THIRD_OF_PI), sin01(t + 4 * THIRD_OF_PI) ];
        }
        __webpack_unused_export__ = rainbow;
        function blinkWhite(t) {
            const intensity = Math.floor(t) % 2;
            return [ intensity, intensity, intensity ];
        }
        __webpack_unused_export__ = blinkWhite;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const SentryLib = __webpack_require__(298);
        const MixpanelLib = __webpack_require__(299);
        module.exports = __webpack_require__(300)(SentryLib, MixpanelLib);
    }, module => {
        (function(f) {
            if (true) {
                module.exports = f();
            } else {
                var g;
            }
        })((function() {
            var define, module, exports;
            return function e(t, n, r) {
                function s(o, u) {
                    if (!n[o]) {
                        if (!t[o]) {
                            var a = undefined;
                            if (!u && a) return require(o, !0);
                            if (i) return i(o, !0);
                            var f = new Error("Cannot find module '" + o + "'");
                            throw f.code = "MODULE_NOT_FOUND", f;
                        }
                        var l = n[o] = {
                            exports: {}
                        };
                        t[o][0].call(l.exports, (function(e) {
                            var n = t[o][1][e];
                            return s(n ? n : e);
                        }), l, l.exports, e, t, n, r);
                    }
                    return n[o].exports;
                }
                var i = undefined;
                for (var o = 0; o < r.length; o++) s(r[o]);
                return s;
            }({
                1: [ function(_dereq_, module, exports) {
                    function RavenConfigError(message) {
                        this.name = "RavenConfigError";
                        this.message = message;
                    }
                    RavenConfigError.prototype = new Error;
                    RavenConfigError.prototype.constructor = RavenConfigError;
                    module.exports = RavenConfigError;
                }, {} ],
                2: [ function(_dereq_, module, exports) {
                    var utils = _dereq_(5);
                    var wrapMethod = function(console, level, callback) {
                        var originalConsoleLevel = console[level];
                        var originalConsole = console;
                        if (!(level in console)) {
                            return;
                        }
                        var sentryLevel = level === "warn" ? "warning" : level;
                        console[level] = function() {
                            var args = [].slice.call(arguments);
                            var msg = utils.safeJoin(args, " ");
                            var data = {
                                level: sentryLevel,
                                logger: "console",
                                extra: {
                                    arguments: args
                                }
                            };
                            if (level === "assert") {
                                if (args[0] === false) {
                                    msg = "Assertion failed: " + (utils.safeJoin(args.slice(1), " ") || "console.assert");
                                    data.extra.arguments = args.slice(1);
                                    callback && callback(msg, data);
                                }
                            } else {
                                callback && callback(msg, data);
                            }
                            if (originalConsoleLevel) {
                                Function.prototype.apply.call(originalConsoleLevel, originalConsole, args);
                            }
                        };
                    };
                    module.exports = {
                        wrapMethod
                    };
                }, {
                    5: 5
                } ],
                3: [ function(_dereq_, module, exports) {
                    (function(global) {
                        var TraceKit = _dereq_(6);
                        var stringify = _dereq_(7);
                        var md5 = _dereq_(8);
                        var RavenConfigError = _dereq_(1);
                        var utils = _dereq_(5);
                        var isErrorEvent = utils.isErrorEvent;
                        var isDOMError = utils.isDOMError;
                        var isDOMException = utils.isDOMException;
                        var isError = utils.isError;
                        var isObject = utils.isObject;
                        var isPlainObject = utils.isPlainObject;
                        var isUndefined = utils.isUndefined;
                        var isFunction = utils.isFunction;
                        var isString = utils.isString;
                        var isArray = utils.isArray;
                        var isEmptyObject = utils.isEmptyObject;
                        var each = utils.each;
                        var objectMerge = utils.objectMerge;
                        var truncate = utils.truncate;
                        var objectFrozen = utils.objectFrozen;
                        var hasKey = utils.hasKey;
                        var joinRegExp = utils.joinRegExp;
                        var urlencode = utils.urlencode;
                        var uuid4 = utils.uuid4;
                        var htmlTreeAsString = utils.htmlTreeAsString;
                        var isSameException = utils.isSameException;
                        var isSameStacktrace = utils.isSameStacktrace;
                        var parseUrl = utils.parseUrl;
                        var fill = utils.fill;
                        var supportsFetch = utils.supportsFetch;
                        var supportsReferrerPolicy = utils.supportsReferrerPolicy;
                        var serializeKeysForMessage = utils.serializeKeysForMessage;
                        var serializeException = utils.serializeException;
                        var sanitize = utils.sanitize;
                        var wrapConsoleMethod = _dereq_(2).wrapMethod;
                        var dsnKeys = "source protocol user pass host port path".split(" "), dsnPattern = /^(?:(\w+):)?\/\/(?:(\w+)(:\w+)?@)?([\w\.-]+)(?::(\d+))?(\/.*)/;
                        function now() {
                            return +new Date;
                        }
                        var _window = typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
                        var _document = _window.document;
                        var _navigator = _window.navigator;
                        function keepOriginalCallback(original, callback) {
                            return isFunction(callback) ? function(data) {
                                return callback(data, original);
                            } : callback;
                        }
                        function Raven() {
                            this._hasJSON = !!(typeof JSON === "object" && JSON.stringify);
                            this._hasDocument = !isUndefined(_document);
                            this._hasNavigator = !isUndefined(_navigator);
                            this._lastCapturedException = null;
                            this._lastData = null;
                            this._lastEventId = null;
                            this._globalServer = null;
                            this._globalKey = null;
                            this._globalProject = null;
                            this._globalContext = {};
                            this._globalOptions = {
                                release: _window.SENTRY_RELEASE && _window.SENTRY_RELEASE.id,
                                logger: "javascript",
                                ignoreErrors: [],
                                ignoreUrls: [],
                                whitelistUrls: [],
                                includePaths: [],
                                headers: null,
                                collectWindowErrors: true,
                                captureUnhandledRejections: true,
                                maxMessageLength: 0,
                                maxUrlLength: 250,
                                stackTraceLimit: 50,
                                autoBreadcrumbs: true,
                                instrument: true,
                                sampleRate: 1,
                                sanitizeKeys: []
                            };
                            this._fetchDefaults = {
                                method: "POST",
                                referrerPolicy: supportsReferrerPolicy() ? "origin" : ""
                            };
                            this._ignoreOnError = 0;
                            this._isRavenInstalled = false;
                            this._originalErrorStackTraceLimit = Error.stackTraceLimit;
                            this._originalConsole = _window.console || {};
                            this._originalConsoleMethods = {};
                            this._plugins = [];
                            this._startTime = now();
                            this._wrappedBuiltIns = [];
                            this._breadcrumbs = [];
                            this._lastCapturedEvent = null;
                            this._keypressTimeout;
                            this._location = _window.location;
                            this._lastHref = this._location && this._location.href;
                            this._resetBackoff();
                            for (var method in this._originalConsole) {
                                this._originalConsoleMethods[method] = this._originalConsole[method];
                            }
                        }
                        Raven.prototype = {
                            VERSION: "3.27.2",
                            debug: false,
                            TraceKit,
                            config: function(dsn, options) {
                                var self = this;
                                if (self._globalServer) {
                                    this._logDebug("error", "Error: Raven has already been configured");
                                    return self;
                                }
                                if (!dsn) return self;
                                var globalOptions = self._globalOptions;
                                if (options) {
                                    each(options, (function(key, value) {
                                        if (key === "tags" || key === "extra" || key === "user") {
                                            self._globalContext[key] = value;
                                        } else {
                                            globalOptions[key] = value;
                                        }
                                    }));
                                }
                                self.setDSN(dsn);
                                globalOptions.ignoreErrors.push(/^Script error\.?$/);
                                globalOptions.ignoreErrors.push(/^Javascript error: Script error\.? on line 0$/);
                                globalOptions.ignoreErrors = joinRegExp(globalOptions.ignoreErrors);
                                globalOptions.ignoreUrls = globalOptions.ignoreUrls.length ? joinRegExp(globalOptions.ignoreUrls) : false;
                                globalOptions.whitelistUrls = globalOptions.whitelistUrls.length ? joinRegExp(globalOptions.whitelistUrls) : false;
                                globalOptions.includePaths = joinRegExp(globalOptions.includePaths);
                                globalOptions.maxBreadcrumbs = Math.max(0, Math.min(globalOptions.maxBreadcrumbs || 100, 100));
                                var autoBreadcrumbDefaults = {
                                    xhr: true,
                                    console: true,
                                    dom: true,
                                    location: true,
                                    sentry: true
                                };
                                var autoBreadcrumbs = globalOptions.autoBreadcrumbs;
                                if ({}.toString.call(autoBreadcrumbs) === "[object Object]") {
                                    autoBreadcrumbs = objectMerge(autoBreadcrumbDefaults, autoBreadcrumbs);
                                } else if (autoBreadcrumbs !== false) {
                                    autoBreadcrumbs = autoBreadcrumbDefaults;
                                }
                                globalOptions.autoBreadcrumbs = autoBreadcrumbs;
                                var instrumentDefaults = {
                                    tryCatch: true
                                };
                                var instrument = globalOptions.instrument;
                                if ({}.toString.call(instrument) === "[object Object]") {
                                    instrument = objectMerge(instrumentDefaults, instrument);
                                } else if (instrument !== false) {
                                    instrument = instrumentDefaults;
                                }
                                globalOptions.instrument = instrument;
                                TraceKit.collectWindowErrors = !!globalOptions.collectWindowErrors;
                                return self;
                            },
                            install: function() {
                                var self = this;
                                if (self.isSetup() && !self._isRavenInstalled) {
                                    TraceKit.report.subscribe((function() {
                                        self._handleOnErrorStackInfo.apply(self, arguments);
                                    }));
                                    if (self._globalOptions.captureUnhandledRejections) {
                                        self._attachPromiseRejectionHandler();
                                    }
                                    self._patchFunctionToString();
                                    if (self._globalOptions.instrument && self._globalOptions.instrument.tryCatch) {
                                        self._instrumentTryCatch();
                                    }
                                    if (self._globalOptions.autoBreadcrumbs) self._instrumentBreadcrumbs();
                                    self._drainPlugins();
                                    self._isRavenInstalled = true;
                                }
                                Error.stackTraceLimit = self._globalOptions.stackTraceLimit;
                                return this;
                            },
                            setDSN: function(dsn) {
                                var self = this, uri = self._parseDSN(dsn), lastSlash = uri.path.lastIndexOf("/"), path = uri.path.substr(1, lastSlash);
                                self._dsn = dsn;
                                self._globalKey = uri.user;
                                self._globalSecret = uri.pass && uri.pass.substr(1);
                                self._globalProject = uri.path.substr(lastSlash + 1);
                                self._globalServer = self._getGlobalServer(uri);
                                self._globalEndpoint = self._globalServer + "/" + path + "api/" + self._globalProject + "/store/";
                                this._resetBackoff();
                            },
                            context: function(options, func, args) {
                                if (isFunction(options)) {
                                    args = func || [];
                                    func = options;
                                    options = {};
                                }
                                return this.wrap(options, func).apply(this, args);
                            },
                            wrap: function(options, func, _before) {
                                var self = this;
                                if (isUndefined(func) && !isFunction(options)) {
                                    return options;
                                }
                                if (isFunction(options)) {
                                    func = options;
                                    options = undefined;
                                }
                                if (!isFunction(func)) {
                                    return func;
                                }
                                try {
                                    if (func.__raven__) {
                                        return func;
                                    }
                                    if (func.__raven_wrapper__) {
                                        return func.__raven_wrapper__;
                                    }
                                } catch (e) {
                                    return func;
                                }
                                function wrapped() {
                                    var args = [], i = arguments.length, deep = !options || options && options.deep !== false;
                                    if (_before && isFunction(_before)) {
                                        _before.apply(this, arguments);
                                    }
                                    while (i--) args[i] = deep ? self.wrap(options, arguments[i]) : arguments[i];
                                    try {
                                        return func.apply(this, args);
                                    } catch (e) {
                                        self._ignoreNextOnError();
                                        self.captureException(e, options);
                                        throw e;
                                    }
                                }
                                for (var property in func) {
                                    if (hasKey(func, property)) {
                                        wrapped[property] = func[property];
                                    }
                                }
                                wrapped.prototype = func.prototype;
                                func.__raven_wrapper__ = wrapped;
                                wrapped.__raven__ = true;
                                wrapped.__orig__ = func;
                                return wrapped;
                            },
                            uninstall: function() {
                                TraceKit.report.uninstall();
                                this._detachPromiseRejectionHandler();
                                this._unpatchFunctionToString();
                                this._restoreBuiltIns();
                                this._restoreConsole();
                                Error.stackTraceLimit = this._originalErrorStackTraceLimit;
                                this._isRavenInstalled = false;
                                return this;
                            },
                            _promiseRejectionHandler: function(event) {
                                this._logDebug("debug", "Raven caught unhandled promise rejection:", event);
                                this.captureException(event.reason, {
                                    mechanism: {
                                        type: "onunhandledrejection",
                                        handled: false
                                    }
                                });
                            },
                            _attachPromiseRejectionHandler: function() {
                                this._promiseRejectionHandler = this._promiseRejectionHandler.bind(this);
                                _window.addEventListener && _window.addEventListener("unhandledrejection", this._promiseRejectionHandler);
                                return this;
                            },
                            _detachPromiseRejectionHandler: function() {
                                _window.removeEventListener && _window.removeEventListener("unhandledrejection", this._promiseRejectionHandler);
                                return this;
                            },
                            captureException: function(ex, options) {
                                options = objectMerge({
                                    trimHeadFrames: 0
                                }, options ? options : {});
                                if (isErrorEvent(ex) && ex.error) {
                                    ex = ex.error;
                                } else if (isDOMError(ex) || isDOMException(ex)) {
                                    var name = ex.name || (isDOMError(ex) ? "DOMError" : "DOMException");
                                    var message = ex.message ? name + ": " + ex.message : name;
                                    return this.captureMessage(message, objectMerge(options, {
                                        stacktrace: true,
                                        trimHeadFrames: options.trimHeadFrames + 1
                                    }));
                                } else if (isError(ex)) {
                                    ex = ex;
                                } else if (isPlainObject(ex)) {
                                    options = this._getCaptureExceptionOptionsFromPlainObject(options, ex);
                                    ex = new Error(options.message);
                                } else {
                                    return this.captureMessage(ex, objectMerge(options, {
                                        stacktrace: true,
                                        trimHeadFrames: options.trimHeadFrames + 1
                                    }));
                                }
                                this._lastCapturedException = ex;
                                try {
                                    var stack = TraceKit.computeStackTrace(ex);
                                    this._handleStackInfo(stack, options);
                                } catch (ex1) {
                                    if (ex !== ex1) {
                                        throw ex1;
                                    }
                                }
                                return this;
                            },
                            _getCaptureExceptionOptionsFromPlainObject: function(currentOptions, ex) {
                                var exKeys = Object.keys(ex).sort();
                                var options = objectMerge(currentOptions, {
                                    message: "Non-Error exception captured with keys: " + serializeKeysForMessage(exKeys),
                                    fingerprint: [ md5(exKeys) ],
                                    extra: currentOptions.extra || {}
                                });
                                options.extra.__serialized__ = serializeException(ex);
                                return options;
                            },
                            captureMessage: function(msg, options) {
                                if (!!this._globalOptions.ignoreErrors.test && this._globalOptions.ignoreErrors.test(msg)) {
                                    return;
                                }
                                options = options || {};
                                msg = msg + "";
                                var data = objectMerge({
                                    message: msg
                                }, options);
                                var ex;
                                try {
                                    throw new Error(msg);
                                } catch (ex1) {
                                    ex = ex1;
                                }
                                ex.name = null;
                                var stack = TraceKit.computeStackTrace(ex);
                                var initialCall = isArray(stack.stack) && stack.stack[1];
                                if (initialCall && initialCall.func === "Raven.captureException") {
                                    initialCall = stack.stack[2];
                                }
                                var fileurl = initialCall && initialCall.url || "";
                                if (!!this._globalOptions.ignoreUrls.test && this._globalOptions.ignoreUrls.test(fileurl)) {
                                    return;
                                }
                                if (!!this._globalOptions.whitelistUrls.test && !this._globalOptions.whitelistUrls.test(fileurl)) {
                                    return;
                                }
                                if (this._globalOptions.stacktrace || options.stacktrace || data.message === "") {
                                    data.fingerprint = data.fingerprint == null ? msg : data.fingerprint;
                                    options = objectMerge({
                                        trimHeadFrames: 0
                                    }, options);
                                    options.trimHeadFrames += 1;
                                    var frames = this._prepareFrames(stack, options);
                                    data.stacktrace = {
                                        frames: frames.reverse()
                                    };
                                }
                                if (data.fingerprint) {
                                    data.fingerprint = isArray(data.fingerprint) ? data.fingerprint : [ data.fingerprint ];
                                }
                                this._send(data);
                                return this;
                            },
                            captureBreadcrumb: function(obj) {
                                var crumb = objectMerge({
                                    timestamp: now() / 1e3
                                }, obj);
                                if (isFunction(this._globalOptions.breadcrumbCallback)) {
                                    var result = this._globalOptions.breadcrumbCallback(crumb);
                                    if (isObject(result) && !isEmptyObject(result)) {
                                        crumb = result;
                                    } else if (result === false) {
                                        return this;
                                    }
                                }
                                this._breadcrumbs.push(crumb);
                                if (this._breadcrumbs.length > this._globalOptions.maxBreadcrumbs) {
                                    this._breadcrumbs.shift();
                                }
                                return this;
                            },
                            addPlugin: function(plugin) {
                                var pluginArgs = [].slice.call(arguments, 1);
                                this._plugins.push([ plugin, pluginArgs ]);
                                if (this._isRavenInstalled) {
                                    this._drainPlugins();
                                }
                                return this;
                            },
                            setUserContext: function(user) {
                                this._globalContext.user = user;
                                return this;
                            },
                            setExtraContext: function(extra) {
                                this._mergeContext("extra", extra);
                                return this;
                            },
                            setTagsContext: function(tags) {
                                this._mergeContext("tags", tags);
                                return this;
                            },
                            clearContext: function() {
                                this._globalContext = {};
                                return this;
                            },
                            getContext: function() {
                                return JSON.parse(stringify(this._globalContext));
                            },
                            setEnvironment: function(environment) {
                                this._globalOptions.environment = environment;
                                return this;
                            },
                            setRelease: function(release) {
                                this._globalOptions.release = release;
                                return this;
                            },
                            setDataCallback: function(callback) {
                                var original = this._globalOptions.dataCallback;
                                this._globalOptions.dataCallback = keepOriginalCallback(original, callback);
                                return this;
                            },
                            setBreadcrumbCallback: function(callback) {
                                var original = this._globalOptions.breadcrumbCallback;
                                this._globalOptions.breadcrumbCallback = keepOriginalCallback(original, callback);
                                return this;
                            },
                            setShouldSendCallback: function(callback) {
                                var original = this._globalOptions.shouldSendCallback;
                                this._globalOptions.shouldSendCallback = keepOriginalCallback(original, callback);
                                return this;
                            },
                            setTransport: function(transport) {
                                this._globalOptions.transport = transport;
                                return this;
                            },
                            lastException: function() {
                                return this._lastCapturedException;
                            },
                            lastEventId: function() {
                                return this._lastEventId;
                            },
                            isSetup: function() {
                                if (!this._hasJSON) return false;
                                if (!this._globalServer) {
                                    if (!this.ravenNotConfiguredError) {
                                        this.ravenNotConfiguredError = true;
                                        this._logDebug("error", "Error: Raven has not been configured.");
                                    }
                                    return false;
                                }
                                return true;
                            },
                            afterLoad: function() {
                                var RavenConfig = _window.RavenConfig;
                                if (RavenConfig) {
                                    this.config(RavenConfig.dsn, RavenConfig.config).install();
                                }
                            },
                            showReportDialog: function(options) {
                                if (!_document) return;
                                options = objectMerge({
                                    eventId: this.lastEventId(),
                                    dsn: this._dsn,
                                    user: this._globalContext.user || {}
                                }, options);
                                if (!options.eventId) {
                                    throw new RavenConfigError("Missing eventId");
                                }
                                if (!options.dsn) {
                                    throw new RavenConfigError("Missing DSN");
                                }
                                var encode = encodeURIComponent;
                                var encodedOptions = [];
                                for (var key in options) {
                                    if (key === "user") {
                                        var user = options.user;
                                        if (user.name) encodedOptions.push("name=" + encode(user.name));
                                        if (user.email) encodedOptions.push("email=" + encode(user.email));
                                    } else {
                                        encodedOptions.push(encode(key) + "=" + encode(options[key]));
                                    }
                                }
                                var globalServer = this._getGlobalServer(this._parseDSN(options.dsn));
                                var script = _document.createElement("script");
                                script.async = true;
                                script.src = globalServer + "/api/embed/error-page/?" + encodedOptions.join("&");
                                (_document.head || _document.body).appendChild(script);
                            },
                            _ignoreNextOnError: function() {
                                var self = this;
                                this._ignoreOnError += 1;
                                setTimeout((function() {
                                    self._ignoreOnError -= 1;
                                }));
                            },
                            _triggerEvent: function(eventType, options) {
                                var evt, key;
                                if (!this._hasDocument) return;
                                options = options || {};
                                eventType = "raven" + eventType.substr(0, 1).toUpperCase() + eventType.substr(1);
                                if (_document.createEvent) {
                                    evt = _document.createEvent("HTMLEvents");
                                    evt.initEvent(eventType, true, true);
                                } else {
                                    evt = _document.createEventObject();
                                    evt.eventType = eventType;
                                }
                                for (key in options) if (hasKey(options, key)) {
                                    evt[key] = options[key];
                                }
                                if (_document.createEvent) {
                                    _document.dispatchEvent(evt);
                                } else {
                                    try {
                                        _document.fireEvent("on" + evt.eventType.toLowerCase(), evt);
                                    } catch (e) {}
                                }
                            },
                            _breadcrumbEventHandler: function(evtName) {
                                var self = this;
                                return function(evt) {
                                    self._keypressTimeout = null;
                                    if (self._lastCapturedEvent === evt) return;
                                    self._lastCapturedEvent = evt;
                                    var target;
                                    try {
                                        target = htmlTreeAsString(evt.target);
                                    } catch (e) {
                                        target = "<unknown>";
                                    }
                                    self.captureBreadcrumb({
                                        category: "ui." + evtName,
                                        message: target
                                    });
                                };
                            },
                            _keypressEventHandler: function() {
                                var self = this, debounceDuration = 1e3;
                                return function(evt) {
                                    var target;
                                    try {
                                        target = evt.target;
                                    } catch (e) {
                                        return;
                                    }
                                    var tagName = target && target.tagName;
                                    if (!tagName || tagName !== "INPUT" && tagName !== "TEXTAREA" && !target.isContentEditable) return;
                                    var timeout = self._keypressTimeout;
                                    if (!timeout) {
                                        self._breadcrumbEventHandler("input")(evt);
                                    }
                                    clearTimeout(timeout);
                                    self._keypressTimeout = setTimeout((function() {
                                        self._keypressTimeout = null;
                                    }), debounceDuration);
                                };
                            },
                            _captureUrlChange: function(from, to) {
                                var parsedLoc = parseUrl(this._location.href);
                                var parsedTo = parseUrl(to);
                                var parsedFrom = parseUrl(from);
                                this._lastHref = to;
                                if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) to = parsedTo.relative;
                                if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) from = parsedFrom.relative;
                                this.captureBreadcrumb({
                                    category: "navigation",
                                    data: {
                                        to,
                                        from
                                    }
                                });
                            },
                            _patchFunctionToString: function() {
                                var self = this;
                                self._originalFunctionToString = Function.prototype.toString;
                                Function.prototype.toString = function() {
                                    if (typeof this === "function" && this.__raven__) {
                                        return self._originalFunctionToString.apply(this.__orig__, arguments);
                                    }
                                    return self._originalFunctionToString.apply(this, arguments);
                                };
                            },
                            _unpatchFunctionToString: function() {
                                if (this._originalFunctionToString) {
                                    Function.prototype.toString = this._originalFunctionToString;
                                }
                            },
                            _instrumentTryCatch: function() {
                                var self = this;
                                var wrappedBuiltIns = self._wrappedBuiltIns;
                                function wrapTimeFn(orig) {
                                    return function(fn, t) {
                                        var args = new Array(arguments.length);
                                        for (var i = 0; i < args.length; ++i) {
                                            args[i] = arguments[i];
                                        }
                                        var originalCallback = args[0];
                                        if (isFunction(originalCallback)) {
                                            args[0] = self.wrap({
                                                mechanism: {
                                                    type: "instrument",
                                                    data: {
                                                        function: orig.name || "<anonymous>"
                                                    }
                                                }
                                            }, originalCallback);
                                        }
                                        if (orig.apply) {
                                            return orig.apply(this, args);
                                        } else {
                                            return orig(args[0], args[1]);
                                        }
                                    };
                                }
                                var autoBreadcrumbs = this._globalOptions.autoBreadcrumbs;
                                function wrapEventTarget(global) {
                                    var proto = _window[global] && _window[global].prototype;
                                    if (proto && proto.hasOwnProperty && proto.hasOwnProperty("addEventListener")) {
                                        fill(proto, "addEventListener", (function(orig) {
                                            return function(evtName, fn, capture, secure) {
                                                try {
                                                    if (fn && fn.handleEvent) {
                                                        fn.handleEvent = self.wrap({
                                                            mechanism: {
                                                                type: "instrument",
                                                                data: {
                                                                    target: global,
                                                                    function: "handleEvent",
                                                                    handler: fn && fn.name || "<anonymous>"
                                                                }
                                                            }
                                                        }, fn.handleEvent);
                                                    }
                                                } catch (err) {}
                                                var before, clickHandler, keypressHandler;
                                                if (autoBreadcrumbs && autoBreadcrumbs.dom && (global === "EventTarget" || global === "Node")) {
                                                    clickHandler = self._breadcrumbEventHandler("click");
                                                    keypressHandler = self._keypressEventHandler();
                                                    before = function(evt) {
                                                        if (!evt) return;
                                                        var eventType;
                                                        try {
                                                            eventType = evt.type;
                                                        } catch (e) {
                                                            return;
                                                        }
                                                        if (eventType === "click") return clickHandler(evt); else if (eventType === "keypress") return keypressHandler(evt);
                                                    };
                                                }
                                                return orig.call(this, evtName, self.wrap({
                                                    mechanism: {
                                                        type: "instrument",
                                                        data: {
                                                            target: global,
                                                            function: "addEventListener",
                                                            handler: fn && fn.name || "<anonymous>"
                                                        }
                                                    }
                                                }, fn, before), capture, secure);
                                            };
                                        }), wrappedBuiltIns);
                                        fill(proto, "removeEventListener", (function(orig) {
                                            return function(evt, fn, capture, secure) {
                                                try {
                                                    fn = fn && (fn.__raven_wrapper__ ? fn.__raven_wrapper__ : fn);
                                                } catch (e) {}
                                                return orig.call(this, evt, fn, capture, secure);
                                            };
                                        }), wrappedBuiltIns);
                                    }
                                }
                                fill(_window, "setTimeout", wrapTimeFn, wrappedBuiltIns);
                                fill(_window, "setInterval", wrapTimeFn, wrappedBuiltIns);
                                if (_window.requestAnimationFrame) {
                                    fill(_window, "requestAnimationFrame", (function(orig) {
                                        return function(cb) {
                                            return orig(self.wrap({
                                                mechanism: {
                                                    type: "instrument",
                                                    data: {
                                                        function: "requestAnimationFrame",
                                                        handler: orig && orig.name || "<anonymous>"
                                                    }
                                                }
                                            }, cb));
                                        };
                                    }), wrappedBuiltIns);
                                }
                                var eventTargets = [ "EventTarget", "Window", "Node", "ApplicationCache", "AudioTrackList", "ChannelMergerNode", "CryptoOperation", "EventSource", "FileReader", "HTMLUnknownElement", "IDBDatabase", "IDBRequest", "IDBTransaction", "KeyOperation", "MediaController", "MessagePort", "ModalWindow", "Notification", "SVGElementInstance", "Screen", "TextTrack", "TextTrackCue", "TextTrackList", "WebSocket", "WebSocketWorker", "Worker", "XMLHttpRequest", "XMLHttpRequestEventTarget", "XMLHttpRequestUpload" ];
                                for (var i = 0; i < eventTargets.length; i++) {
                                    wrapEventTarget(eventTargets[i]);
                                }
                            },
                            _instrumentBreadcrumbs: function() {
                                var self = this;
                                var autoBreadcrumbs = this._globalOptions.autoBreadcrumbs;
                                var wrappedBuiltIns = self._wrappedBuiltIns;
                                function wrapProp(prop, xhr) {
                                    if (prop in xhr && isFunction(xhr[prop])) {
                                        fill(xhr, prop, (function(orig) {
                                            return self.wrap({
                                                mechanism: {
                                                    type: "instrument",
                                                    data: {
                                                        function: prop,
                                                        handler: orig && orig.name || "<anonymous>"
                                                    }
                                                }
                                            }, orig);
                                        }));
                                    }
                                }
                                if (autoBreadcrumbs.xhr && "XMLHttpRequest" in _window) {
                                    var xhrproto = _window.XMLHttpRequest && _window.XMLHttpRequest.prototype;
                                    fill(xhrproto, "open", (function(origOpen) {
                                        return function(method, url) {
                                            if (isString(url) && url.indexOf(self._globalKey) === -1) {
                                                this.__raven_xhr = {
                                                    method,
                                                    url,
                                                    status_code: null
                                                };
                                            }
                                            return origOpen.apply(this, arguments);
                                        };
                                    }), wrappedBuiltIns);
                                    fill(xhrproto, "send", (function(origSend) {
                                        return function() {
                                            var xhr = this;
                                            function onreadystatechangeHandler() {
                                                if (xhr.__raven_xhr && xhr.readyState === 4) {
                                                    try {
                                                        xhr.__raven_xhr.status_code = xhr.status;
                                                    } catch (e) {}
                                                    self.captureBreadcrumb({
                                                        type: "http",
                                                        category: "xhr",
                                                        data: xhr.__raven_xhr
                                                    });
                                                }
                                            }
                                            var props = [ "onload", "onerror", "onprogress" ];
                                            for (var j = 0; j < props.length; j++) {
                                                wrapProp(props[j], xhr);
                                            }
                                            if ("onreadystatechange" in xhr && isFunction(xhr.onreadystatechange)) {
                                                fill(xhr, "onreadystatechange", (function(orig) {
                                                    return self.wrap({
                                                        mechanism: {
                                                            type: "instrument",
                                                            data: {
                                                                function: "onreadystatechange",
                                                                handler: orig && orig.name || "<anonymous>"
                                                            }
                                                        }
                                                    }, orig, onreadystatechangeHandler);
                                                }));
                                            } else {
                                                xhr.onreadystatechange = onreadystatechangeHandler;
                                            }
                                            return origSend.apply(this, arguments);
                                        };
                                    }), wrappedBuiltIns);
                                }
                                if (autoBreadcrumbs.xhr && supportsFetch()) {
                                    fill(_window, "fetch", (function(origFetch) {
                                        return function() {
                                            var args = new Array(arguments.length);
                                            for (var i = 0; i < args.length; ++i) {
                                                args[i] = arguments[i];
                                            }
                                            var fetchInput = args[0];
                                            var method = "GET";
                                            var url;
                                            if (typeof fetchInput === "string") {
                                                url = fetchInput;
                                            } else if ("Request" in _window && fetchInput instanceof _window.Request) {
                                                url = fetchInput.url;
                                                if (fetchInput.method) {
                                                    method = fetchInput.method;
                                                }
                                            } else {
                                                url = "" + fetchInput;
                                            }
                                            if (url.indexOf(self._globalKey) !== -1) {
                                                return origFetch.apply(this, args);
                                            }
                                            if (args[1] && args[1].method) {
                                                method = args[1].method;
                                            }
                                            var fetchData = {
                                                method,
                                                url,
                                                status_code: null
                                            };
                                            return origFetch.apply(this, args).then((function(response) {
                                                fetchData.status_code = response.status;
                                                self.captureBreadcrumb({
                                                    type: "http",
                                                    category: "fetch",
                                                    data: fetchData
                                                });
                                                return response;
                                            }))["catch"]((function(err) {
                                                self.captureBreadcrumb({
                                                    type: "http",
                                                    category: "fetch",
                                                    data: fetchData,
                                                    level: "error"
                                                });
                                                throw err;
                                            }));
                                        };
                                    }), wrappedBuiltIns);
                                }
                                if (autoBreadcrumbs.dom && this._hasDocument) {
                                    if (_document.addEventListener) {
                                        _document.addEventListener("click", self._breadcrumbEventHandler("click"), false);
                                        _document.addEventListener("keypress", self._keypressEventHandler(), false);
                                    } else if (_document.attachEvent) {
                                        _document.attachEvent("onclick", self._breadcrumbEventHandler("click"));
                                        _document.attachEvent("onkeypress", self._keypressEventHandler());
                                    }
                                }
                                var chrome = _window.chrome;
                                var isChromePackagedApp = chrome && chrome.app && chrome.app.runtime;
                                var hasPushAndReplaceState = !isChromePackagedApp && _window.history && _window.history.pushState && _window.history.replaceState;
                                if (autoBreadcrumbs.location && hasPushAndReplaceState) {
                                    var oldOnPopState = _window.onpopstate;
                                    _window.onpopstate = function() {
                                        var currentHref = self._location.href;
                                        self._captureUrlChange(self._lastHref, currentHref);
                                        if (oldOnPopState) {
                                            return oldOnPopState.apply(this, arguments);
                                        }
                                    };
                                    var historyReplacementFunction = function(origHistFunction) {
                                        return function() {
                                            var url = arguments.length > 2 ? arguments[2] : undefined;
                                            if (url) {
                                                self._captureUrlChange(self._lastHref, url + "");
                                            }
                                            return origHistFunction.apply(this, arguments);
                                        };
                                    };
                                    fill(_window.history, "pushState", historyReplacementFunction, wrappedBuiltIns);
                                    fill(_window.history, "replaceState", historyReplacementFunction, wrappedBuiltIns);
                                }
                                if (autoBreadcrumbs.console && "console" in _window && console.log) {
                                    var consoleMethodCallback = function(msg, data) {
                                        self.captureBreadcrumb({
                                            message: msg,
                                            level: data.level,
                                            category: "console"
                                        });
                                    };
                                    each([ "debug", "info", "warn", "error", "log" ], (function(_, level) {
                                        wrapConsoleMethod(console, level, consoleMethodCallback);
                                    }));
                                }
                            },
                            _restoreBuiltIns: function() {
                                var builtin;
                                while (this._wrappedBuiltIns.length) {
                                    builtin = this._wrappedBuiltIns.shift();
                                    var obj = builtin[0], name = builtin[1], orig = builtin[2];
                                    obj[name] = orig;
                                }
                            },
                            _restoreConsole: function() {
                                for (var method in this._originalConsoleMethods) {
                                    this._originalConsole[method] = this._originalConsoleMethods[method];
                                }
                            },
                            _drainPlugins: function() {
                                var self = this;
                                each(this._plugins, (function(_, plugin) {
                                    var installer = plugin[0];
                                    var args = plugin[1];
                                    installer.apply(self, [ self ].concat(args));
                                }));
                            },
                            _parseDSN: function(str) {
                                var m = dsnPattern.exec(str), dsn = {}, i = 7;
                                try {
                                    while (i--) dsn[dsnKeys[i]] = m[i] || "";
                                } catch (e) {
                                    throw new RavenConfigError("Invalid DSN: " + str);
                                }
                                if (dsn.pass && !this._globalOptions.allowSecretKey) {
                                    throw new RavenConfigError("Do not specify your secret key in the DSN. See: http://bit.ly/raven-secret-key");
                                }
                                return dsn;
                            },
                            _getGlobalServer: function(uri) {
                                var globalServer = "//" + uri.host + (uri.port ? ":" + uri.port : "");
                                if (uri.protocol) {
                                    globalServer = uri.protocol + ":" + globalServer;
                                }
                                return globalServer;
                            },
                            _handleOnErrorStackInfo: function(stackInfo, options) {
                                options = options || {};
                                options.mechanism = options.mechanism || {
                                    type: "onerror",
                                    handled: false
                                };
                                if (!this._ignoreOnError) {
                                    this._handleStackInfo(stackInfo, options);
                                }
                            },
                            _handleStackInfo: function(stackInfo, options) {
                                var frames = this._prepareFrames(stackInfo, options);
                                this._triggerEvent("handle", {
                                    stackInfo,
                                    options
                                });
                                this._processException(stackInfo.name, stackInfo.message, stackInfo.url, stackInfo.lineno, frames, options);
                            },
                            _prepareFrames: function(stackInfo, options) {
                                var self = this;
                                var frames = [];
                                if (stackInfo.stack && stackInfo.stack.length) {
                                    each(stackInfo.stack, (function(i, stack) {
                                        var frame = self._normalizeFrame(stack, stackInfo.url);
                                        if (frame) {
                                            frames.push(frame);
                                        }
                                    }));
                                    if (options && options.trimHeadFrames) {
                                        for (var j = 0; j < options.trimHeadFrames && j < frames.length; j++) {
                                            frames[j].in_app = false;
                                        }
                                    }
                                }
                                frames = frames.slice(0, this._globalOptions.stackTraceLimit);
                                return frames;
                            },
                            _normalizeFrame: function(frame, stackInfoUrl) {
                                var normalized = {
                                    filename: frame.url,
                                    lineno: frame.line,
                                    colno: frame.column,
                                    function: frame.func || "?"
                                };
                                if (!frame.url) {
                                    normalized.filename = stackInfoUrl;
                                }
                                normalized.in_app = !(!!this._globalOptions.includePaths.test && !this._globalOptions.includePaths.test(normalized.filename) || /(Raven|TraceKit)\./.test(normalized["function"]) || /raven\.(min\.)?js$/.test(normalized.filename));
                                return normalized;
                            },
                            _processException: function(type, message, fileurl, lineno, frames, options) {
                                var prefixedMessage = (type ? type + ": " : "") + (message || "");
                                if (!!this._globalOptions.ignoreErrors.test && (this._globalOptions.ignoreErrors.test(message) || this._globalOptions.ignoreErrors.test(prefixedMessage))) {
                                    return;
                                }
                                var stacktrace;
                                if (frames && frames.length) {
                                    fileurl = frames[0].filename || fileurl;
                                    frames.reverse();
                                    stacktrace = {
                                        frames
                                    };
                                } else if (fileurl) {
                                    stacktrace = {
                                        frames: [ {
                                            filename: fileurl,
                                            lineno,
                                            in_app: true
                                        } ]
                                    };
                                }
                                if (!!this._globalOptions.ignoreUrls.test && this._globalOptions.ignoreUrls.test(fileurl)) {
                                    return;
                                }
                                if (!!this._globalOptions.whitelistUrls.test && !this._globalOptions.whitelistUrls.test(fileurl)) {
                                    return;
                                }
                                var data = objectMerge({
                                    exception: {
                                        values: [ {
                                            type,
                                            value: message,
                                            stacktrace
                                        } ]
                                    },
                                    transaction: fileurl
                                }, options);
                                var ex = data.exception.values[0];
                                if (ex.type == null && ex.value === "") {
                                    ex.value = "Unrecoverable error caught";
                                }
                                if (!data.exception.mechanism && data.mechanism) {
                                    data.exception.mechanism = data.mechanism;
                                    delete data.mechanism;
                                }
                                data.exception.mechanism = objectMerge({
                                    type: "generic",
                                    handled: true
                                }, data.exception.mechanism || {});
                                this._send(data);
                            },
                            _trimPacket: function(data) {
                                var max = this._globalOptions.maxMessageLength;
                                if (data.message) {
                                    data.message = truncate(data.message, max);
                                }
                                if (data.exception) {
                                    var exception = data.exception.values[0];
                                    exception.value = truncate(exception.value, max);
                                }
                                var request = data.request;
                                if (request) {
                                    if (request.url) {
                                        request.url = truncate(request.url, this._globalOptions.maxUrlLength);
                                    }
                                    if (request.Referer) {
                                        request.Referer = truncate(request.Referer, this._globalOptions.maxUrlLength);
                                    }
                                }
                                if (data.breadcrumbs && data.breadcrumbs.values) this._trimBreadcrumbs(data.breadcrumbs);
                                return data;
                            },
                            _trimBreadcrumbs: function(breadcrumbs) {
                                var urlProps = [ "to", "from", "url" ], urlProp, crumb, data;
                                for (var i = 0; i < breadcrumbs.values.length; ++i) {
                                    crumb = breadcrumbs.values[i];
                                    if (!crumb.hasOwnProperty("data") || !isObject(crumb.data) || objectFrozen(crumb.data)) continue;
                                    data = objectMerge({}, crumb.data);
                                    for (var j = 0; j < urlProps.length; ++j) {
                                        urlProp = urlProps[j];
                                        if (data.hasOwnProperty(urlProp) && data[urlProp]) {
                                            data[urlProp] = truncate(data[urlProp], this._globalOptions.maxUrlLength);
                                        }
                                    }
                                    breadcrumbs.values[i].data = data;
                                }
                            },
                            _getHttpData: function() {
                                if (!this._hasNavigator && !this._hasDocument) return;
                                var httpData = {};
                                if (this._hasNavigator && _navigator.userAgent) {
                                    httpData.headers = {
                                        "User-Agent": _navigator.userAgent
                                    };
                                }
                                if (_window.location && _window.location.href) {
                                    httpData.url = _window.location.href;
                                }
                                if (this._hasDocument && _document.referrer) {
                                    if (!httpData.headers) httpData.headers = {};
                                    httpData.headers.Referer = _document.referrer;
                                }
                                return httpData;
                            },
                            _resetBackoff: function() {
                                this._backoffDuration = 0;
                                this._backoffStart = null;
                            },
                            _shouldBackoff: function() {
                                return this._backoffDuration && now() - this._backoffStart < this._backoffDuration;
                            },
                            _isRepeatData: function(current) {
                                var last = this._lastData;
                                if (!last || current.message !== last.message || current.transaction !== last.transaction) return false;
                                if (current.stacktrace || last.stacktrace) {
                                    return isSameStacktrace(current.stacktrace, last.stacktrace);
                                } else if (current.exception || last.exception) {
                                    return isSameException(current.exception, last.exception);
                                } else if (current.fingerprint || last.fingerprint) {
                                    return Boolean(current.fingerprint && last.fingerprint) && JSON.stringify(current.fingerprint) === JSON.stringify(last.fingerprint);
                                }
                                return true;
                            },
                            _setBackoffState: function(request) {
                                if (this._shouldBackoff()) {
                                    return;
                                }
                                var status = request.status;
                                if (!(status === 400 || status === 401 || status === 429)) return;
                                var retry;
                                try {
                                    if (supportsFetch()) {
                                        retry = request.headers.get("Retry-After");
                                    } else {
                                        retry = request.getResponseHeader("Retry-After");
                                    }
                                    retry = parseInt(retry, 10) * 1e3;
                                } catch (e) {}
                                this._backoffDuration = retry ? retry : this._backoffDuration * 2 || 1e3;
                                this._backoffStart = now();
                            },
                            _send: function(data) {
                                var globalOptions = this._globalOptions;
                                var baseData = {
                                    project: this._globalProject,
                                    logger: globalOptions.logger,
                                    platform: "javascript"
                                }, httpData = this._getHttpData();
                                if (httpData) {
                                    baseData.request = httpData;
                                }
                                if (data.trimHeadFrames) delete data.trimHeadFrames;
                                data = objectMerge(baseData, data);
                                data.tags = objectMerge(objectMerge({}, this._globalContext.tags), data.tags);
                                data.extra = objectMerge(objectMerge({}, this._globalContext.extra), data.extra);
                                data.extra["session:duration"] = now() - this._startTime;
                                if (this._breadcrumbs && this._breadcrumbs.length > 0) {
                                    data.breadcrumbs = {
                                        values: [].slice.call(this._breadcrumbs, 0)
                                    };
                                }
                                if (this._globalContext.user) {
                                    data.user = this._globalContext.user;
                                }
                                if (globalOptions.environment) data.environment = globalOptions.environment;
                                if (globalOptions.release) data.release = globalOptions.release;
                                if (globalOptions.serverName) data.server_name = globalOptions.serverName;
                                data = this._sanitizeData(data);
                                Object.keys(data).forEach((function(key) {
                                    if (data[key] == null || data[key] === "" || isEmptyObject(data[key])) {
                                        delete data[key];
                                    }
                                }));
                                if (isFunction(globalOptions.dataCallback)) {
                                    data = globalOptions.dataCallback(data) || data;
                                }
                                if (!data || isEmptyObject(data)) {
                                    return;
                                }
                                if (isFunction(globalOptions.shouldSendCallback) && !globalOptions.shouldSendCallback(data)) {
                                    return;
                                }
                                if (this._shouldBackoff()) {
                                    this._logDebug("warn", "Raven dropped error due to backoff: ", data);
                                    return;
                                }
                                if (typeof globalOptions.sampleRate === "number") {
                                    if (Math.random() < globalOptions.sampleRate) {
                                        this._sendProcessedPayload(data);
                                    }
                                } else {
                                    this._sendProcessedPayload(data);
                                }
                            },
                            _sanitizeData: function(data) {
                                return sanitize(data, this._globalOptions.sanitizeKeys);
                            },
                            _getUuid: function() {
                                return uuid4();
                            },
                            _sendProcessedPayload: function(data, callback) {
                                var self = this;
                                var globalOptions = this._globalOptions;
                                if (!this.isSetup()) return;
                                data = this._trimPacket(data);
                                if (!this._globalOptions.allowDuplicates && this._isRepeatData(data)) {
                                    this._logDebug("warn", "Raven dropped repeat event: ", data);
                                    return;
                                }
                                this._lastEventId = data.event_id || (data.event_id = this._getUuid());
                                this._lastData = data;
                                this._logDebug("debug", "Raven about to send:", data);
                                var auth = {
                                    sentry_version: "7",
                                    sentry_client: "raven-js/" + this.VERSION,
                                    sentry_key: this._globalKey
                                };
                                if (this._globalSecret) {
                                    auth.sentry_secret = this._globalSecret;
                                }
                                var exception = data.exception && data.exception.values[0];
                                if (this._globalOptions.autoBreadcrumbs && this._globalOptions.autoBreadcrumbs.sentry) {
                                    this.captureBreadcrumb({
                                        category: "sentry",
                                        message: exception ? (exception.type ? exception.type + ": " : "") + exception.value : data.message,
                                        event_id: data.event_id,
                                        level: data.level || "error"
                                    });
                                }
                                var url = this._globalEndpoint;
                                (globalOptions.transport || this._makeRequest).call(this, {
                                    url,
                                    auth,
                                    data,
                                    options: globalOptions,
                                    onSuccess: function success() {
                                        self._resetBackoff();
                                        self._triggerEvent("success", {
                                            data,
                                            src: url
                                        });
                                        callback && callback();
                                    },
                                    onError: function failure(error) {
                                        self._logDebug("error", "Raven transport failed to send: ", error);
                                        if (error.request) {
                                            self._setBackoffState(error.request);
                                        }
                                        self._triggerEvent("failure", {
                                            data,
                                            src: url
                                        });
                                        error = error || new Error("Raven send failed (no additional details provided)");
                                        callback && callback(error);
                                    }
                                });
                            },
                            _makeRequest: function(opts) {
                                var url = opts.url + "?" + urlencode(opts.auth);
                                var evaluatedHeaders = null;
                                var evaluatedFetchParameters = {};
                                if (opts.options.headers) {
                                    evaluatedHeaders = this._evaluateHash(opts.options.headers);
                                }
                                if (opts.options.fetchParameters) {
                                    evaluatedFetchParameters = this._evaluateHash(opts.options.fetchParameters);
                                }
                                if (supportsFetch()) {
                                    evaluatedFetchParameters.body = stringify(opts.data);
                                    var defaultFetchOptions = objectMerge({}, this._fetchDefaults);
                                    var fetchOptions = objectMerge(defaultFetchOptions, evaluatedFetchParameters);
                                    if (evaluatedHeaders) {
                                        fetchOptions.headers = evaluatedHeaders;
                                    }
                                    return _window.fetch(url, fetchOptions).then((function(response) {
                                        if (response.ok) {
                                            opts.onSuccess && opts.onSuccess();
                                        } else {
                                            var error = new Error("Sentry error code: " + response.status);
                                            error.request = response;
                                            opts.onError && opts.onError(error);
                                        }
                                    }))["catch"]((function() {
                                        opts.onError && opts.onError(new Error("Sentry error code: network unavailable"));
                                    }));
                                }
                                var request = _window.XMLHttpRequest && new _window.XMLHttpRequest;
                                if (!request) return;
                                var hasCORS = "withCredentials" in request || typeof XDomainRequest !== "undefined";
                                if (!hasCORS) return;
                                if ("withCredentials" in request) {
                                    request.onreadystatechange = function() {
                                        if (request.readyState !== 4) {
                                            return;
                                        } else if (request.status === 200) {
                                            opts.onSuccess && opts.onSuccess();
                                        } else if (opts.onError) {
                                            var err = new Error("Sentry error code: " + request.status);
                                            err.request = request;
                                            opts.onError(err);
                                        }
                                    };
                                } else {
                                    request = new XDomainRequest;
                                    url = url.replace(/^https?:/, "");
                                    if (opts.onSuccess) {
                                        request.onload = opts.onSuccess;
                                    }
                                    if (opts.onError) {
                                        request.onerror = function() {
                                            var err = new Error("Sentry error code: XDomainRequest");
                                            err.request = request;
                                            opts.onError(err);
                                        };
                                    }
                                }
                                request.open("POST", url);
                                if (evaluatedHeaders) {
                                    each(evaluatedHeaders, (function(key, value) {
                                        request.setRequestHeader(key, value);
                                    }));
                                }
                                request.send(stringify(opts.data));
                            },
                            _evaluateHash: function(hash) {
                                var evaluated = {};
                                for (var key in hash) {
                                    if (hash.hasOwnProperty(key)) {
                                        var value = hash[key];
                                        evaluated[key] = typeof value === "function" ? value() : value;
                                    }
                                }
                                return evaluated;
                            },
                            _logDebug: function(level) {
                                if (this._originalConsoleMethods[level] && (this.debug || this._globalOptions.debug)) {
                                    Function.prototype.apply.call(this._originalConsoleMethods[level], this._originalConsole, [].slice.call(arguments, 1));
                                }
                            },
                            _mergeContext: function(key, context) {
                                if (isUndefined(context)) {
                                    delete this._globalContext[key];
                                } else {
                                    this._globalContext[key] = objectMerge(this._globalContext[key] || {}, context);
                                }
                            }
                        };
                        Raven.prototype.setUser = Raven.prototype.setUserContext;
                        Raven.prototype.setReleaseContext = Raven.prototype.setRelease;
                        module.exports = Raven;
                    }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
                }, {
                    1: 1,
                    2: 2,
                    5: 5,
                    6: 6,
                    7: 7,
                    8: 8
                } ],
                4: [ function(_dereq_, module, exports) {
                    (function(global) {
                        var RavenConstructor = _dereq_(3);
                        var _window = typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
                        var _Raven = _window.Raven;
                        var Raven = new RavenConstructor;
                        Raven.noConflict = function() {
                            _window.Raven = _Raven;
                            return Raven;
                        };
                        Raven.afterLoad();
                        module.exports = Raven;
                        module.exports.Client = RavenConstructor;
                    }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
                }, {
                    3: 3
                } ],
                5: [ function(_dereq_, module, exports) {
                    (function(global) {
                        var stringify = _dereq_(7);
                        var _window = typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
                        function isObject(what) {
                            return typeof what === "object" && what !== null;
                        }
                        function isError(value) {
                            switch (Object.prototype.toString.call(value)) {
                              case "[object Error]":
                                return true;

                              case "[object Exception]":
                                return true;

                              case "[object DOMException]":
                                return true;

                              default:
                                return value instanceof Error;
                            }
                        }
                        function isErrorEvent(value) {
                            return Object.prototype.toString.call(value) === "[object ErrorEvent]";
                        }
                        function isDOMError(value) {
                            return Object.prototype.toString.call(value) === "[object DOMError]";
                        }
                        function isDOMException(value) {
                            return Object.prototype.toString.call(value) === "[object DOMException]";
                        }
                        function isUndefined(what) {
                            return what === void 0;
                        }
                        function isFunction(what) {
                            return typeof what === "function";
                        }
                        function isPlainObject(what) {
                            return Object.prototype.toString.call(what) === "[object Object]";
                        }
                        function isString(what) {
                            return Object.prototype.toString.call(what) === "[object String]";
                        }
                        function isArray(what) {
                            return Object.prototype.toString.call(what) === "[object Array]";
                        }
                        function isEmptyObject(what) {
                            if (!isPlainObject(what)) return false;
                            for (var _ in what) {
                                if (what.hasOwnProperty(_)) {
                                    return false;
                                }
                            }
                            return true;
                        }
                        function supportsErrorEvent() {
                            try {
                                new ErrorEvent("");
                                return true;
                            } catch (e) {
                                return false;
                            }
                        }
                        function supportsDOMError() {
                            try {
                                new DOMError("");
                                return true;
                            } catch (e) {
                                return false;
                            }
                        }
                        function supportsDOMException() {
                            try {
                                new DOMException("");
                                return true;
                            } catch (e) {
                                return false;
                            }
                        }
                        function supportsFetch() {
                            if (!("fetch" in _window)) return false;
                            try {
                                new Headers;
                                new Request("");
                                new Response;
                                return true;
                            } catch (e) {
                                return false;
                            }
                        }
                        function supportsReferrerPolicy() {
                            if (!supportsFetch()) return false;
                            try {
                                new Request("pickleRick", {
                                    referrerPolicy: "origin"
                                });
                                return true;
                            } catch (e) {
                                return false;
                            }
                        }
                        function supportsPromiseRejectionEvent() {
                            return typeof PromiseRejectionEvent === "function";
                        }
                        function wrappedCallback(callback) {
                            function dataCallback(data, original) {
                                var normalizedData = callback(data) || data;
                                if (original) {
                                    return original(normalizedData) || normalizedData;
                                }
                                return normalizedData;
                            }
                            return dataCallback;
                        }
                        function each(obj, callback) {
                            var i, j;
                            if (isUndefined(obj.length)) {
                                for (i in obj) {
                                    if (hasKey(obj, i)) {
                                        callback.call(null, i, obj[i]);
                                    }
                                }
                            } else {
                                j = obj.length;
                                if (j) {
                                    for (i = 0; i < j; i++) {
                                        callback.call(null, i, obj[i]);
                                    }
                                }
                            }
                        }
                        function objectMerge(obj1, obj2) {
                            if (!obj2) {
                                return obj1;
                            }
                            each(obj2, (function(key, value) {
                                obj1[key] = value;
                            }));
                            return obj1;
                        }
                        function objectFrozen(obj) {
                            if (!Object.isFrozen) {
                                return false;
                            }
                            return Object.isFrozen(obj);
                        }
                        function truncate(str, max) {
                            if (typeof max !== "number") {
                                throw new Error("2nd argument to `truncate` function should be a number");
                            }
                            if (typeof str !== "string" || max === 0) {
                                return str;
                            }
                            return str.length <= max ? str : str.substr(0, max) + "…";
                        }
                        function hasKey(object, key) {
                            return Object.prototype.hasOwnProperty.call(object, key);
                        }
                        function joinRegExp(patterns) {
                            var sources = [], i = 0, len = patterns.length, pattern;
                            for (;i < len; i++) {
                                pattern = patterns[i];
                                if (isString(pattern)) {
                                    sources.push(pattern.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"));
                                } else if (pattern && pattern.source) {
                                    sources.push(pattern.source);
                                }
                            }
                            return new RegExp(sources.join("|"), "i");
                        }
                        function urlencode(o) {
                            var pairs = [];
                            each(o, (function(key, value) {
                                pairs.push(encodeURIComponent(key) + "=" + encodeURIComponent(value));
                            }));
                            return pairs.join("&");
                        }
                        function parseUrl(url) {
                            if (typeof url !== "string") return {};
                            var match = url.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);
                            var query = match[6] || "";
                            var fragment = match[8] || "";
                            return {
                                protocol: match[2],
                                host: match[4],
                                path: match[5],
                                relative: match[5] + query + fragment
                            };
                        }
                        function uuid4() {
                            var crypto = _window.crypto || _window.msCrypto;
                            if (!isUndefined(crypto) && crypto.getRandomValues) {
                                var arr = new Uint16Array(8);
                                crypto.getRandomValues(arr);
                                arr[3] = arr[3] & 4095 | 16384;
                                arr[4] = arr[4] & 16383 | 32768;
                                var pad = function(num) {
                                    var v = num.toString(16);
                                    while (v.length < 4) {
                                        v = "0" + v;
                                    }
                                    return v;
                                };
                                return pad(arr[0]) + pad(arr[1]) + pad(arr[2]) + pad(arr[3]) + pad(arr[4]) + pad(arr[5]) + pad(arr[6]) + pad(arr[7]);
                            } else {
                                return "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g, (function(c) {
                                    var r = Math.random() * 16 | 0, v = c === "x" ? r : r & 3 | 8;
                                    return v.toString(16);
                                }));
                            }
                        }
                        function htmlTreeAsString(elem) {
                            var MAX_TRAVERSE_HEIGHT = 5, MAX_OUTPUT_LEN = 80, out = [], height = 0, len = 0, separator = " > ", sepLength = separator.length, nextStr;
                            while (elem && height++ < MAX_TRAVERSE_HEIGHT) {
                                nextStr = htmlElementAsString(elem);
                                if (nextStr === "html" || height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN) {
                                    break;
                                }
                                out.push(nextStr);
                                len += nextStr.length;
                                elem = elem.parentNode;
                            }
                            return out.reverse().join(separator);
                        }
                        function htmlElementAsString(elem) {
                            var out = [], className, classes, key, attr, i;
                            if (!elem || !elem.tagName) {
                                return "";
                            }
                            out.push(elem.tagName.toLowerCase());
                            if (elem.id) {
                                out.push("#" + elem.id);
                            }
                            className = elem.className;
                            if (className && isString(className)) {
                                classes = className.split(/\s+/);
                                for (i = 0; i < classes.length; i++) {
                                    out.push("." + classes[i]);
                                }
                            }
                            var attrWhitelist = [ "type", "name", "title", "alt" ];
                            for (i = 0; i < attrWhitelist.length; i++) {
                                key = attrWhitelist[i];
                                attr = elem.getAttribute(key);
                                if (attr) {
                                    out.push("[" + key + '="' + attr + '"]');
                                }
                            }
                            return out.join("");
                        }
                        function isOnlyOneTruthy(a, b) {
                            return !!(!!a ^ !!b);
                        }
                        function isBothUndefined(a, b) {
                            return isUndefined(a) && isUndefined(b);
                        }
                        function isSameException(ex1, ex2) {
                            if (isOnlyOneTruthy(ex1, ex2)) return false;
                            ex1 = ex1.values[0];
                            ex2 = ex2.values[0];
                            if (ex1.type !== ex2.type || ex1.value !== ex2.value) return false;
                            if (isBothUndefined(ex1.stacktrace, ex2.stacktrace)) return false;
                            return isSameStacktrace(ex1.stacktrace, ex2.stacktrace);
                        }
                        function isSameStacktrace(stack1, stack2) {
                            if (isOnlyOneTruthy(stack1, stack2)) return false;
                            var frames1 = stack1.frames;
                            var frames2 = stack2.frames;
                            if (frames1 === undefined || frames2 === undefined) return false;
                            if (frames1.length !== frames2.length) return false;
                            var a, b;
                            for (var i = 0; i < frames1.length; i++) {
                                a = frames1[i];
                                b = frames2[i];
                                if (a.filename !== b.filename || a.lineno !== b.lineno || a.colno !== b.colno || a["function"] !== b["function"]) return false;
                            }
                            return true;
                        }
                        function fill(obj, name, replacement, track) {
                            if (obj == null) return;
                            var orig = obj[name];
                            obj[name] = replacement(orig);
                            obj[name].__raven__ = true;
                            obj[name].__orig__ = orig;
                            if (track) {
                                track.push([ obj, name, orig ]);
                            }
                        }
                        function safeJoin(input, delimiter) {
                            if (!isArray(input)) return "";
                            var output = [];
                            for (var i = 0; i < input.length; i++) {
                                try {
                                    output.push(String(input[i]));
                                } catch (e) {
                                    output.push("[value cannot be serialized]");
                                }
                            }
                            return output.join(delimiter);
                        }
                        var MAX_SERIALIZE_EXCEPTION_DEPTH = 3;
                        var MAX_SERIALIZE_EXCEPTION_SIZE = 50 * 1024;
                        var MAX_SERIALIZE_KEYS_LENGTH = 40;
                        function utf8Length(value) {
                            return ~-encodeURI(value).split(/%..|./).length;
                        }
                        function jsonSize(value) {
                            return utf8Length(JSON.stringify(value));
                        }
                        function serializeValue(value) {
                            if (typeof value === "string") {
                                var maxLength = 40;
                                return truncate(value, maxLength);
                            } else if (typeof value === "number" || typeof value === "boolean" || typeof value === "undefined") {
                                return value;
                            }
                            var type = Object.prototype.toString.call(value);
                            if (type === "[object Object]") return "[Object]";
                            if (type === "[object Array]") return "[Array]";
                            if (type === "[object Function]") return value.name ? "[Function: " + value.name + "]" : "[Function]";
                            return value;
                        }
                        function serializeObject(value, depth) {
                            if (depth === 0) return serializeValue(value);
                            if (isPlainObject(value)) {
                                return Object.keys(value).reduce((function(acc, key) {
                                    acc[key] = serializeObject(value[key], depth - 1);
                                    return acc;
                                }), {});
                            } else if (Array.isArray(value)) {
                                return value.map((function(val) {
                                    return serializeObject(val, depth - 1);
                                }));
                            }
                            return serializeValue(value);
                        }
                        function serializeException(ex, depth, maxSize) {
                            if (!isPlainObject(ex)) return ex;
                            depth = typeof depth !== "number" ? MAX_SERIALIZE_EXCEPTION_DEPTH : depth;
                            maxSize = typeof depth !== "number" ? MAX_SERIALIZE_EXCEPTION_SIZE : maxSize;
                            var serialized = serializeObject(ex, depth);
                            if (jsonSize(stringify(serialized)) > maxSize) {
                                return serializeException(ex, depth - 1);
                            }
                            return serialized;
                        }
                        function serializeKeysForMessage(keys, maxLength) {
                            if (typeof keys === "number" || typeof keys === "string") return keys.toString();
                            if (!Array.isArray(keys)) return "";
                            keys = keys.filter((function(key) {
                                return typeof key === "string";
                            }));
                            if (keys.length === 0) return "[object has no keys]";
                            maxLength = typeof maxLength !== "number" ? MAX_SERIALIZE_KEYS_LENGTH : maxLength;
                            if (keys[0].length >= maxLength) return keys[0];
                            for (var usedKeys = keys.length; usedKeys > 0; usedKeys--) {
                                var serialized = keys.slice(0, usedKeys).join(", ");
                                if (serialized.length > maxLength) continue;
                                if (usedKeys === keys.length) return serialized;
                                return serialized + "…";
                            }
                            return "";
                        }
                        function sanitize(input, sanitizeKeys) {
                            if (!isArray(sanitizeKeys) || isArray(sanitizeKeys) && sanitizeKeys.length === 0) return input;
                            var sanitizeRegExp = joinRegExp(sanitizeKeys);
                            var sanitizeMask = "********";
                            var safeInput;
                            try {
                                safeInput = JSON.parse(stringify(input));
                            } catch (o_O) {
                                return input;
                            }
                            function sanitizeWorker(workerInput) {
                                if (isArray(workerInput)) {
                                    return workerInput.map((function(val) {
                                        return sanitizeWorker(val);
                                    }));
                                }
                                if (isPlainObject(workerInput)) {
                                    return Object.keys(workerInput).reduce((function(acc, k) {
                                        if (sanitizeRegExp.test(k)) {
                                            acc[k] = sanitizeMask;
                                        } else {
                                            acc[k] = sanitizeWorker(workerInput[k]);
                                        }
                                        return acc;
                                    }), {});
                                }
                                return workerInput;
                            }
                            return sanitizeWorker(safeInput);
                        }
                        module.exports = {
                            isObject,
                            isError,
                            isErrorEvent,
                            isDOMError,
                            isDOMException,
                            isUndefined,
                            isFunction,
                            isPlainObject,
                            isString,
                            isArray,
                            isEmptyObject,
                            supportsErrorEvent,
                            supportsDOMError,
                            supportsDOMException,
                            supportsFetch,
                            supportsReferrerPolicy,
                            supportsPromiseRejectionEvent,
                            wrappedCallback,
                            each,
                            objectMerge,
                            truncate,
                            objectFrozen,
                            hasKey,
                            joinRegExp,
                            urlencode,
                            uuid4,
                            htmlTreeAsString,
                            htmlElementAsString,
                            isSameException,
                            isSameStacktrace,
                            parseUrl,
                            fill,
                            safeJoin,
                            serializeException,
                            serializeKeysForMessage,
                            sanitize
                        };
                    }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
                }, {
                    7: 7
                } ],
                6: [ function(_dereq_, module, exports) {
                    (function(global) {
                        var utils = _dereq_(5);
                        var TraceKit = {
                            collectWindowErrors: true,
                            debug: false
                        };
                        var _window = typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
                        var _slice = [].slice;
                        var UNKNOWN_FUNCTION = "?";
                        var ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;
                        function getLocationHref() {
                            if (typeof document === "undefined" || document.location == null) return "";
                            return document.location.href;
                        }
                        function getLocationOrigin() {
                            if (typeof document === "undefined" || document.location == null) return "";
                            if (!document.location.origin) {
                                return document.location.protocol + "//" + document.location.hostname + (document.location.port ? ":" + document.location.port : "");
                            }
                            return document.location.origin;
                        }
                        TraceKit.report = function reportModuleWrapper() {
                            var handlers = [], lastArgs = null, lastException = null, lastExceptionStack = null;
                            function subscribe(handler) {
                                installGlobalHandler();
                                handlers.push(handler);
                            }
                            function unsubscribe(handler) {
                                for (var i = handlers.length - 1; i >= 0; --i) {
                                    if (handlers[i] === handler) {
                                        handlers.splice(i, 1);
                                    }
                                }
                            }
                            function unsubscribeAll() {
                                uninstallGlobalHandler();
                                handlers = [];
                            }
                            function notifyHandlers(stack, isWindowError) {
                                var exception = null;
                                if (isWindowError && !TraceKit.collectWindowErrors) {
                                    return;
                                }
                                for (var i in handlers) {
                                    if (handlers.hasOwnProperty(i)) {
                                        try {
                                            handlers[i].apply(null, [ stack ].concat(_slice.call(arguments, 2)));
                                        } catch (inner) {
                                            exception = inner;
                                        }
                                    }
                                }
                                if (exception) {
                                    throw exception;
                                }
                            }
                            var _oldOnerrorHandler, _onErrorHandlerInstalled;
                            function traceKitWindowOnError(msg, url, lineNo, colNo, ex) {
                                var stack = null;
                                var exception = utils.isErrorEvent(ex) ? ex.error : ex;
                                var message = utils.isErrorEvent(msg) ? msg.message : msg;
                                if (lastExceptionStack) {
                                    TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(lastExceptionStack, url, lineNo, message);
                                    processLastException();
                                } else if (exception && utils.isError(exception)) {
                                    stack = TraceKit.computeStackTrace(exception);
                                    notifyHandlers(stack, true);
                                } else {
                                    var location = {
                                        url,
                                        line: lineNo,
                                        column: colNo
                                    };
                                    var name = undefined;
                                    var groups;
                                    if ({}.toString.call(message) === "[object String]") {
                                        var groups = message.match(ERROR_TYPES_RE);
                                        if (groups) {
                                            name = groups[1];
                                            message = groups[2];
                                        }
                                    }
                                    location.func = UNKNOWN_FUNCTION;
                                    stack = {
                                        name,
                                        message,
                                        url: getLocationHref(),
                                        stack: [ location ]
                                    };
                                    notifyHandlers(stack, true);
                                }
                                if (_oldOnerrorHandler) {
                                    return _oldOnerrorHandler.apply(this, arguments);
                                }
                                return false;
                            }
                            function installGlobalHandler() {
                                if (_onErrorHandlerInstalled) {
                                    return;
                                }
                                _oldOnerrorHandler = _window.onerror;
                                _window.onerror = traceKitWindowOnError;
                                _onErrorHandlerInstalled = true;
                            }
                            function uninstallGlobalHandler() {
                                if (!_onErrorHandlerInstalled) {
                                    return;
                                }
                                _window.onerror = _oldOnerrorHandler;
                                _onErrorHandlerInstalled = false;
                                _oldOnerrorHandler = undefined;
                            }
                            function processLastException() {
                                var _lastExceptionStack = lastExceptionStack, _lastArgs = lastArgs;
                                lastArgs = null;
                                lastExceptionStack = null;
                                lastException = null;
                                notifyHandlers.apply(null, [ _lastExceptionStack, false ].concat(_lastArgs));
                            }
                            function report(ex, rethrow) {
                                var args = _slice.call(arguments, 1);
                                if (lastExceptionStack) {
                                    if (lastException === ex) {
                                        return;
                                    } else {
                                        processLastException();
                                    }
                                }
                                var stack = TraceKit.computeStackTrace(ex);
                                lastExceptionStack = stack;
                                lastException = ex;
                                lastArgs = args;
                                setTimeout((function() {
                                    if (lastException === ex) {
                                        processLastException();
                                    }
                                }), stack.incomplete ? 2e3 : 0);
                                if (rethrow !== false) {
                                    throw ex;
                                }
                            }
                            report.subscribe = subscribe;
                            report.unsubscribe = unsubscribe;
                            report.uninstall = unsubscribeAll;
                            return report;
                        }();
                        TraceKit.computeStackTrace = function computeStackTraceWrapper() {
                            function computeStackTraceFromStackProp(ex) {
                                if (typeof ex.stack === "undefined" || !ex.stack) return;
                                var chrome = /^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|[a-z]:|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i;
                                var winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx(?:-web)|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
                                var gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|moz-extension).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js))(?::(\d+))?(?::(\d+))?\s*$/i;
                                var geckoEval = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i;
                                var chromeEval = /\((\S*)(?::(\d+))(?::(\d+))\)/;
                                var lines = ex.stack.split("\n");
                                var stack = [];
                                var submatch;
                                var parts;
                                var element;
                                var reference = /^(.*) is undefined$/.exec(ex.message);
                                for (var i = 0, j = lines.length; i < j; ++i) {
                                    if (parts = chrome.exec(lines[i])) {
                                        var isNative = parts[2] && parts[2].indexOf("native") === 0;
                                        var isEval = parts[2] && parts[2].indexOf("eval") === 0;
                                        if (isEval && (submatch = chromeEval.exec(parts[2]))) {
                                            parts[2] = submatch[1];
                                            parts[3] = submatch[2];
                                            parts[4] = submatch[3];
                                        }
                                        element = {
                                            url: !isNative ? parts[2] : null,
                                            func: parts[1] || UNKNOWN_FUNCTION,
                                            args: isNative ? [ parts[2] ] : [],
                                            line: parts[3] ? +parts[3] : null,
                                            column: parts[4] ? +parts[4] : null
                                        };
                                    } else if (parts = winjs.exec(lines[i])) {
                                        element = {
                                            url: parts[2],
                                            func: parts[1] || UNKNOWN_FUNCTION,
                                            args: [],
                                            line: +parts[3],
                                            column: parts[4] ? +parts[4] : null
                                        };
                                    } else if (parts = gecko.exec(lines[i])) {
                                        var isEval = parts[3] && parts[3].indexOf(" > eval") > -1;
                                        if (isEval && (submatch = geckoEval.exec(parts[3]))) {
                                            parts[3] = submatch[1];
                                            parts[4] = submatch[2];
                                            parts[5] = null;
                                        } else if (i === 0 && !parts[5] && typeof ex.columnNumber !== "undefined") {
                                            stack[0].column = ex.columnNumber + 1;
                                        }
                                        element = {
                                            url: parts[3],
                                            func: parts[1] || UNKNOWN_FUNCTION,
                                            args: parts[2] ? parts[2].split(",") : [],
                                            line: parts[4] ? +parts[4] : null,
                                            column: parts[5] ? +parts[5] : null
                                        };
                                    } else {
                                        continue;
                                    }
                                    if (!element.func && element.line) {
                                        element.func = UNKNOWN_FUNCTION;
                                    }
                                    if (element.url && element.url.substr(0, 5) === "blob:") {
                                        var xhr = new XMLHttpRequest;
                                        xhr.open("GET", element.url, false);
                                        xhr.send(null);
                                        if (xhr.status === 200) {
                                            var source = xhr.responseText || "";
                                            source = source.slice(-300);
                                            var sourceMaps = source.match(/\/\/# sourceMappingURL=(.*)$/);
                                            if (sourceMaps) {
                                                var sourceMapAddress = sourceMaps[1];
                                                if (sourceMapAddress.charAt(0) === "~") {
                                                    sourceMapAddress = getLocationOrigin() + sourceMapAddress.slice(1);
                                                }
                                                element.url = sourceMapAddress.slice(0, -4);
                                            }
                                        }
                                    }
                                    stack.push(element);
                                }
                                if (!stack.length) {
                                    return null;
                                }
                                return {
                                    name: ex.name,
                                    message: ex.message,
                                    url: getLocationHref(),
                                    stack
                                };
                            }
                            function augmentStackTraceWithInitialElement(stackInfo, url, lineNo, message) {
                                var initial = {
                                    url,
                                    line: lineNo
                                };
                                if (initial.url && initial.line) {
                                    stackInfo.incomplete = false;
                                    if (!initial.func) {
                                        initial.func = UNKNOWN_FUNCTION;
                                    }
                                    if (stackInfo.stack.length > 0) {
                                        if (stackInfo.stack[0].url === initial.url) {
                                            if (stackInfo.stack[0].line === initial.line) {
                                                return false;
                                            } else if (!stackInfo.stack[0].line && stackInfo.stack[0].func === initial.func) {
                                                stackInfo.stack[0].line = initial.line;
                                                return false;
                                            }
                                        }
                                    }
                                    stackInfo.stack.unshift(initial);
                                    stackInfo.partial = true;
                                    return true;
                                } else {
                                    stackInfo.incomplete = true;
                                }
                                return false;
                            }
                            function computeStackTraceByWalkingCallerChain(ex, depth) {
                                var functionName = /function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i, stack = [], funcs = {}, recursion = false, parts, item, source;
                                for (var curr = computeStackTraceByWalkingCallerChain.caller; curr && !recursion; curr = curr.caller) {
                                    if (curr === computeStackTrace || curr === TraceKit.report) {
                                        continue;
                                    }
                                    item = {
                                        url: null,
                                        func: UNKNOWN_FUNCTION,
                                        line: null,
                                        column: null
                                    };
                                    if (curr.name) {
                                        item.func = curr.name;
                                    } else if (parts = functionName.exec(curr.toString())) {
                                        item.func = parts[1];
                                    }
                                    if (typeof item.func === "undefined") {
                                        try {
                                            item.func = parts.input.substring(0, parts.input.indexOf("{"));
                                        } catch (e) {}
                                    }
                                    if (funcs["" + curr]) {
                                        recursion = true;
                                    } else {
                                        funcs["" + curr] = true;
                                    }
                                    stack.push(item);
                                }
                                if (depth) {
                                    stack.splice(0, depth);
                                }
                                var result = {
                                    name: ex.name,
                                    message: ex.message,
                                    url: getLocationHref(),
                                    stack
                                };
                                augmentStackTraceWithInitialElement(result, ex.sourceURL || ex.fileName, ex.line || ex.lineNumber, ex.message || ex.description);
                                return result;
                            }
                            function computeStackTrace(ex, depth) {
                                var stack = null;
                                depth = depth == null ? 0 : +depth;
                                try {
                                    stack = computeStackTraceFromStackProp(ex);
                                    if (stack) {
                                        return stack;
                                    }
                                } catch (e) {
                                    if (TraceKit.debug) {
                                        throw e;
                                    }
                                }
                                try {
                                    stack = computeStackTraceByWalkingCallerChain(ex, depth + 1);
                                    if (stack) {
                                        return stack;
                                    }
                                } catch (e) {
                                    if (TraceKit.debug) {
                                        throw e;
                                    }
                                }
                                return {
                                    name: ex.name,
                                    message: ex.message,
                                    url: getLocationHref()
                                };
                            }
                            computeStackTrace.augmentStackTraceWithInitialElement = augmentStackTraceWithInitialElement;
                            computeStackTrace.computeStackTraceFromStackProp = computeStackTraceFromStackProp;
                            return computeStackTrace;
                        }();
                        module.exports = TraceKit;
                    }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
                }, {
                    5: 5
                } ],
                7: [ function(_dereq_, module, exports) {
                    exports = module.exports = stringify;
                    exports.getSerialize = serializer;
                    function indexOf(haystack, needle) {
                        for (var i = 0; i < haystack.length; ++i) {
                            if (haystack[i] === needle) return i;
                        }
                        return -1;
                    }
                    function stringify(obj, replacer, spaces, cycleReplacer) {
                        return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces);
                    }
                    function stringifyError(value) {
                        var err = {
                            stack: value.stack,
                            message: value.message,
                            name: value.name
                        };
                        for (var i in value) {
                            if (Object.prototype.hasOwnProperty.call(value, i)) {
                                err[i] = value[i];
                            }
                        }
                        return err;
                    }
                    function serializer(replacer, cycleReplacer) {
                        var stack = [];
                        var keys = [];
                        if (cycleReplacer == null) {
                            cycleReplacer = function(key, value) {
                                if (stack[0] === value) {
                                    return "[Circular ~]";
                                }
                                return "[Circular ~." + keys.slice(0, indexOf(stack, value)).join(".") + "]";
                            };
                        }
                        return function(key, value) {
                            if (stack.length > 0) {
                                var thisPos = indexOf(stack, this);
                                ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
                                ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
                                if (~indexOf(stack, value)) {
                                    value = cycleReplacer.call(this, key, value);
                                }
                            } else {
                                stack.push(value);
                            }
                            return replacer == null ? value instanceof Error ? stringifyError(value) : value : replacer.call(this, key, value);
                        };
                    }
                }, {} ],
                8: [ function(_dereq_, module, exports) {
                    function safeAdd(x, y) {
                        var lsw = (x & 65535) + (y & 65535);
                        var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
                        return msw << 16 | lsw & 65535;
                    }
                    function bitRotateLeft(num, cnt) {
                        return num << cnt | num >>> 32 - cnt;
                    }
                    function md5cmn(q, a, b, x, s, t) {
                        return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);
                    }
                    function md5ff(a, b, c, d, x, s, t) {
                        return md5cmn(b & c | ~b & d, a, b, x, s, t);
                    }
                    function md5gg(a, b, c, d, x, s, t) {
                        return md5cmn(b & d | c & ~d, a, b, x, s, t);
                    }
                    function md5hh(a, b, c, d, x, s, t) {
                        return md5cmn(b ^ c ^ d, a, b, x, s, t);
                    }
                    function md5ii(a, b, c, d, x, s, t) {
                        return md5cmn(c ^ (b | ~d), a, b, x, s, t);
                    }
                    function binlMD5(x, len) {
                        x[len >> 5] |= 128 << len % 32;
                        x[(len + 64 >>> 9 << 4) + 14] = len;
                        var i;
                        var olda;
                        var oldb;
                        var oldc;
                        var oldd;
                        var a = 1732584193;
                        var b = -271733879;
                        var c = -1732584194;
                        var d = 271733878;
                        for (i = 0; i < x.length; i += 16) {
                            olda = a;
                            oldb = b;
                            oldc = c;
                            oldd = d;
                            a = md5ff(a, b, c, d, x[i], 7, -680876936);
                            d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);
                            c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);
                            b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);
                            a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);
                            d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);
                            c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);
                            b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);
                            a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);
                            d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);
                            c = md5ff(c, d, a, b, x[i + 10], 17, -42063);
                            b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);
                            a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);
                            d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);
                            c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);
                            b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);
                            a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);
                            d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);
                            c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);
                            b = md5gg(b, c, d, a, x[i], 20, -373897302);
                            a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);
                            d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);
                            c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);
                            b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);
                            a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);
                            d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);
                            c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);
                            b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);
                            a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);
                            d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);
                            c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);
                            b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);
                            a = md5hh(a, b, c, d, x[i + 5], 4, -378558);
                            d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);
                            c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);
                            b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);
                            a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);
                            d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);
                            c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);
                            b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);
                            a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);
                            d = md5hh(d, a, b, c, x[i], 11, -358537222);
                            c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);
                            b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);
                            a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);
                            d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);
                            c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);
                            b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);
                            a = md5ii(a, b, c, d, x[i], 6, -198630844);
                            d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);
                            c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);
                            b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);
                            a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);
                            d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);
                            c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);
                            b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);
                            a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);
                            d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);
                            c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);
                            b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);
                            a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);
                            d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);
                            c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);
                            b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);
                            a = safeAdd(a, olda);
                            b = safeAdd(b, oldb);
                            c = safeAdd(c, oldc);
                            d = safeAdd(d, oldd);
                        }
                        return [ a, b, c, d ];
                    }
                    function binl2rstr(input) {
                        var i;
                        var output = "";
                        var length32 = input.length * 32;
                        for (i = 0; i < length32; i += 8) {
                            output += String.fromCharCode(input[i >> 5] >>> i % 32 & 255);
                        }
                        return output;
                    }
                    function rstr2binl(input) {
                        var i;
                        var output = [];
                        output[(input.length >> 2) - 1] = undefined;
                        for (i = 0; i < output.length; i += 1) {
                            output[i] = 0;
                        }
                        var length8 = input.length * 8;
                        for (i = 0; i < length8; i += 8) {
                            output[i >> 5] |= (input.charCodeAt(i / 8) & 255) << i % 32;
                        }
                        return output;
                    }
                    function rstrMD5(s) {
                        return binl2rstr(binlMD5(rstr2binl(s), s.length * 8));
                    }
                    function rstrHMACMD5(key, data) {
                        var i;
                        var bkey = rstr2binl(key);
                        var ipad = [];
                        var opad = [];
                        var hash;
                        ipad[15] = opad[15] = undefined;
                        if (bkey.length > 16) {
                            bkey = binlMD5(bkey, key.length * 8);
                        }
                        for (i = 0; i < 16; i += 1) {
                            ipad[i] = bkey[i] ^ 909522486;
                            opad[i] = bkey[i] ^ 1549556828;
                        }
                        hash = binlMD5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);
                        return binl2rstr(binlMD5(opad.concat(hash), 512 + 128));
                    }
                    function rstr2hex(input) {
                        var hexTab = "0123456789abcdef";
                        var output = "";
                        var x;
                        var i;
                        for (i = 0; i < input.length; i += 1) {
                            x = input.charCodeAt(i);
                            output += hexTab.charAt(x >>> 4 & 15) + hexTab.charAt(x & 15);
                        }
                        return output;
                    }
                    function str2rstrUTF8(input) {
                        return unescape(encodeURIComponent(input));
                    }
                    function rawMD5(s) {
                        return rstrMD5(str2rstrUTF8(s));
                    }
                    function hexMD5(s) {
                        return rstr2hex(rawMD5(s));
                    }
                    function rawHMACMD5(k, d) {
                        return rstrHMACMD5(str2rstrUTF8(k), str2rstrUTF8(d));
                    }
                    function hexHMACMD5(k, d) {
                        return rstr2hex(rawHMACMD5(k, d));
                    }
                    function md5(string, key, raw) {
                        if (!key) {
                            if (!raw) {
                                return hexMD5(string);
                            }
                            return rawMD5(string);
                        }
                        if (!raw) {
                            return hexHMACMD5(key, string);
                        }
                        return rawHMACMD5(key, string);
                    }
                    module.exports = md5;
                }, {} ]
            }, {}, [ 4 ])(4);
        }));
    }, module => {
        "use strict";
        var Config = {
            DEBUG: false,
            LIB_VERSION: "2.30.1"
        };
        var window$1;
        if (typeof window === "undefined") {
            var loc = {
                hostname: ""
            };
            window$1 = {
                navigator: {
                    userAgent: ""
                },
                document: {
                    location: loc,
                    referrer: ""
                },
                screen: {
                    width: 0,
                    height: 0
                },
                location: loc
            };
        } else {
            window$1 = window;
        }
        var ArrayProto = Array.prototype;
        var FuncProto = Function.prototype;
        var ObjProto = Object.prototype;
        var slice = ArrayProto.slice;
        var toString = ObjProto.toString;
        var hasOwnProperty = ObjProto.hasOwnProperty;
        var windowConsole = window$1.console;
        var navigator$1 = window$1.navigator;
        var document$1 = window$1.document;
        var windowOpera = window$1.opera;
        var screen = window$1.screen;
        var userAgent = navigator$1.userAgent;
        var nativeBind = FuncProto.bind;
        var nativeForEach = ArrayProto.forEach;
        var nativeIndexOf = ArrayProto.indexOf;
        var nativeIsArray = Array.isArray;
        var breaker = {};
        var DOMAIN_MATCH_REGEX = /[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i;
        var _ = {
            trim: function(str) {
                return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
            }
        };
        var console$1 = {
            log: function() {
                if (Config.DEBUG && !_.isUndefined(windowConsole) && windowConsole) {
                    try {
                        windowConsole.log.apply(windowConsole, arguments);
                    } catch (err) {
                        _.each(arguments, (function(arg) {
                            windowConsole.log(arg);
                        }));
                    }
                }
            },
            error: function() {
                if (Config.DEBUG && !_.isUndefined(windowConsole) && windowConsole) {
                    var args = [ "Mixpanel error:" ].concat(_.toArray(arguments));
                    try {
                        windowConsole.error.apply(windowConsole, args);
                    } catch (err) {
                        _.each(args, (function(arg) {
                            windowConsole.error(arg);
                        }));
                    }
                }
            },
            critical: function() {
                if (!_.isUndefined(windowConsole) && windowConsole) {
                    var args = [ "Mixpanel error:" ].concat(_.toArray(arguments));
                    try {
                        windowConsole.error.apply(windowConsole, args);
                    } catch (err) {
                        _.each(args, (function(arg) {
                            windowConsole.error(arg);
                        }));
                    }
                }
            }
        };
        _.bind = function(func, context) {
            var args, bound;
            if (nativeBind && func.bind === nativeBind) {
                return nativeBind.apply(func, slice.call(arguments, 1));
            }
            if (!_.isFunction(func)) {
                throw new TypeError;
            }
            args = slice.call(arguments, 2);
            bound = function() {
                if (!(this instanceof bound)) {
                    return func.apply(context, args.concat(slice.call(arguments)));
                }
                var ctor = {};
                ctor.prototype = func.prototype;
                var self = new ctor;
                ctor.prototype = null;
                var result = func.apply(self, args.concat(slice.call(arguments)));
                if (Object(result) === result) {
                    return result;
                }
                return self;
            };
            return bound;
        };
        _.bind_instance_methods = function(obj) {
            for (var func in obj) {
                if (typeof obj[func] === "function") {
                    obj[func] = _.bind(obj[func], obj);
                }
            }
        };
        _.each = function(obj, iterator, context) {
            if (obj === null || obj === undefined) {
                return;
            }
            if (nativeForEach && obj.forEach === nativeForEach) {
                obj.forEach(iterator, context);
            } else if (obj.length === +obj.length) {
                for (var i = 0, l = obj.length; i < l; i++) {
                    if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) {
                        return;
                    }
                }
            } else {
                for (var key in obj) {
                    if (hasOwnProperty.call(obj, key)) {
                        if (iterator.call(context, obj[key], key, obj) === breaker) {
                            return;
                        }
                    }
                }
            }
        };
        _.escapeHTML = function(s) {
            var escaped = s;
            if (escaped && _.isString(escaped)) {
                escaped = escaped.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
            }
            return escaped;
        };
        _.extend = function(obj) {
            _.each(slice.call(arguments, 1), (function(source) {
                for (var prop in source) {
                    if (source[prop] !== void 0) {
                        obj[prop] = source[prop];
                    }
                }
            }));
            return obj;
        };
        _.isArray = nativeIsArray || function(obj) {
            return toString.call(obj) === "[object Array]";
        };
        _.isFunction = function(f) {
            try {
                return /^\s*\bfunction\b/.test(f);
            } catch (x) {
                return false;
            }
        };
        _.isArguments = function(obj) {
            return !!(obj && hasOwnProperty.call(obj, "callee"));
        };
        _.toArray = function(iterable) {
            if (!iterable) {
                return [];
            }
            if (iterable.toArray) {
                return iterable.toArray();
            }
            if (_.isArray(iterable)) {
                return slice.call(iterable);
            }
            if (_.isArguments(iterable)) {
                return slice.call(iterable);
            }
            return _.values(iterable);
        };
        _.keys = function(obj) {
            var results = [];
            if (obj === null) {
                return results;
            }
            _.each(obj, (function(value, key) {
                results[results.length] = key;
            }));
            return results;
        };
        _.values = function(obj) {
            var results = [];
            if (obj === null) {
                return results;
            }
            _.each(obj, (function(value) {
                results[results.length] = value;
            }));
            return results;
        };
        _.identity = function(value) {
            return value;
        };
        _.include = function(obj, target) {
            var found = false;
            if (obj === null) {
                return found;
            }
            if (nativeIndexOf && obj.indexOf === nativeIndexOf) {
                return obj.indexOf(target) != -1;
            }
            _.each(obj, (function(value) {
                if (found || (found = value === target)) {
                    return breaker;
                }
            }));
            return found;
        };
        _.includes = function(str, needle) {
            return str.indexOf(needle) !== -1;
        };
        _.inherit = function(subclass, superclass) {
            subclass.prototype = new superclass;
            subclass.prototype.constructor = subclass;
            subclass.superclass = superclass.prototype;
            return subclass;
        };
        _.isObject = function(obj) {
            return obj === Object(obj) && !_.isArray(obj);
        };
        _.isEmptyObject = function(obj) {
            if (_.isObject(obj)) {
                for (var key in obj) {
                    if (hasOwnProperty.call(obj, key)) {
                        return false;
                    }
                }
                return true;
            }
            return false;
        };
        _.isUndefined = function(obj) {
            return obj === void 0;
        };
        _.isString = function(obj) {
            return toString.call(obj) == "[object String]";
        };
        _.isDate = function(obj) {
            return toString.call(obj) == "[object Date]";
        };
        _.isNumber = function(obj) {
            return toString.call(obj) == "[object Number]";
        };
        _.isElement = function(obj) {
            return !!(obj && obj.nodeType === 1);
        };
        _.encodeDates = function(obj) {
            _.each(obj, (function(v, k) {
                if (_.isDate(v)) {
                    obj[k] = _.formatDate(v);
                } else if (_.isObject(v)) {
                    obj[k] = _.encodeDates(v);
                }
            }));
            return obj;
        };
        _.timestamp = function() {
            Date.now = Date.now || function() {
                return +new Date;
            };
            return Date.now();
        };
        _.formatDate = function(d) {
            function pad(n) {
                return n < 10 ? "0" + n : n;
            }
            return d.getUTCFullYear() + "-" + pad(d.getUTCMonth() + 1) + "-" + pad(d.getUTCDate()) + "T" + pad(d.getUTCHours()) + ":" + pad(d.getUTCMinutes()) + ":" + pad(d.getUTCSeconds());
        };
        _.safewrap = function(f) {
            return function() {
                try {
                    return f.apply(this, arguments);
                } catch (e) {
                    console$1.critical("Implementation error. Please turn on debug and contact support@mixpanel.com.");
                    if (Config.DEBUG) {
                        console$1.critical(e);
                    }
                }
            };
        };
        _.safewrap_class = function(klass, functions) {
            for (var i = 0; i < functions.length; i++) {
                klass.prototype[functions[i]] = _.safewrap(klass.prototype[functions[i]]);
            }
        };
        _.safewrap_instance_methods = function(obj) {
            for (var func in obj) {
                if (typeof obj[func] === "function") {
                    obj[func] = _.safewrap(obj[func]);
                }
            }
        };
        _.strip_empty_properties = function(p) {
            var ret = {};
            _.each(p, (function(v, k) {
                if (_.isString(v) && v.length > 0) {
                    ret[k] = v;
                }
            }));
            return ret;
        };
        _.truncate = function(obj, length) {
            var ret;
            if (typeof obj === "string") {
                ret = obj.slice(0, length);
            } else if (_.isArray(obj)) {
                ret = [];
                _.each(obj, (function(val) {
                    ret.push(_.truncate(val, length));
                }));
            } else if (_.isObject(obj)) {
                ret = {};
                _.each(obj, (function(val, key) {
                    ret[key] = _.truncate(val, length);
                }));
            } else {
                ret = obj;
            }
            return ret;
        };
        _.JSONEncode = function() {
            return function(mixed_val) {
                var value = mixed_val;
                var quote = function(string) {
                    var escapable = /[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
                    var meta = {
                        "\b": "\\b",
                        "\t": "\\t",
                        "\n": "\\n",
                        "\f": "\\f",
                        "\r": "\\r",
                        '"': '\\"',
                        "\\": "\\\\"
                    };
                    escapable.lastIndex = 0;
                    return escapable.test(string) ? '"' + string.replace(escapable, (function(a) {
                        var c = meta[a];
                        return typeof c === "string" ? c : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
                    })) + '"' : '"' + string + '"';
                };
                var str = function(key, holder) {
                    var gap = "";
                    var indent = "    ";
                    var i = 0;
                    var k = "";
                    var v = "";
                    var length = 0;
                    var mind = gap;
                    var partial = [];
                    var value = holder[key];
                    if (value && typeof value === "object" && typeof value.toJSON === "function") {
                        value = value.toJSON(key);
                    }
                    switch (typeof value) {
                      case "string":
                        return quote(value);

                      case "number":
                        return isFinite(value) ? String(value) : "null";

                      case "boolean":
                      case "null":
                        return String(value);

                      case "object":
                        if (!value) {
                            return "null";
                        }
                        gap += indent;
                        partial = [];
                        if (toString.apply(value) === "[object Array]") {
                            length = value.length;
                            for (i = 0; i < length; i += 1) {
                                partial[i] = str(i, value) || "null";
                            }
                            v = partial.length === 0 ? "[]" : gap ? "[\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "]" : "[" + partial.join(",") + "]";
                            gap = mind;
                            return v;
                        }
                        for (k in value) {
                            if (hasOwnProperty.call(value, k)) {
                                v = str(k, value);
                                if (v) {
                                    partial.push(quote(k) + (gap ? ": " : ":") + v);
                                }
                            }
                        }
                        v = partial.length === 0 ? "{}" : gap ? "{" + partial.join(",") + "" + mind + "}" : "{" + partial.join(",") + "}";
                        gap = mind;
                        return v;
                    }
                };
                return str("", {
                    "": value
                });
            };
        }();
        _.JSONDecode = function() {
            var at, ch, escapee = {
                '"': '"',
                "\\": "\\",
                "/": "/",
                b: "\b",
                f: "\f",
                n: "\n",
                r: "\r",
                t: "\t"
            }, text, error = function(m) {
                var e = new SyntaxError(m);
                e.at = at;
                e.text = text;
                throw e;
            }, next = function(c) {
                if (c && c !== ch) {
                    error("Expected '" + c + "' instead of '" + ch + "'");
                }
                ch = text.charAt(at);
                at += 1;
                return ch;
            }, number = function() {
                var number, string = "";
                if (ch === "-") {
                    string = "-";
                    next("-");
                }
                while (ch >= "0" && ch <= "9") {
                    string += ch;
                    next();
                }
                if (ch === ".") {
                    string += ".";
                    while (next() && ch >= "0" && ch <= "9") {
                        string += ch;
                    }
                }
                if (ch === "e" || ch === "E") {
                    string += ch;
                    next();
                    if (ch === "-" || ch === "+") {
                        string += ch;
                        next();
                    }
                    while (ch >= "0" && ch <= "9") {
                        string += ch;
                        next();
                    }
                }
                number = +string;
                if (!isFinite(number)) {
                    error("Bad number");
                } else {
                    return number;
                }
            }, string = function() {
                var hex, i, string = "", uffff;
                if (ch === '"') {
                    while (next()) {
                        if (ch === '"') {
                            next();
                            return string;
                        }
                        if (ch === "\\") {
                            next();
                            if (ch === "u") {
                                uffff = 0;
                                for (i = 0; i < 4; i += 1) {
                                    hex = parseInt(next(), 16);
                                    if (!isFinite(hex)) {
                                        break;
                                    }
                                    uffff = uffff * 16 + hex;
                                }
                                string += String.fromCharCode(uffff);
                            } else if (typeof escapee[ch] === "string") {
                                string += escapee[ch];
                            } else {
                                break;
                            }
                        } else {
                            string += ch;
                        }
                    }
                }
                error("Bad string");
            }, white = function() {
                while (ch && ch <= " ") {
                    next();
                }
            }, word = function() {
                switch (ch) {
                  case "t":
                    next("t");
                    next("r");
                    next("u");
                    next("e");
                    return true;

                  case "f":
                    next("f");
                    next("a");
                    next("l");
                    next("s");
                    next("e");
                    return false;

                  case "n":
                    next("n");
                    next("u");
                    next("l");
                    next("l");
                    return null;
                }
                error('Unexpected "' + ch + '"');
            }, value, array = function() {
                var array = [];
                if (ch === "[") {
                    next("[");
                    white();
                    if (ch === "]") {
                        next("]");
                        return array;
                    }
                    while (ch) {
                        array.push(value());
                        white();
                        if (ch === "]") {
                            next("]");
                            return array;
                        }
                        next(",");
                        white();
                    }
                }
                error("Bad array");
            }, object = function() {
                var key, object = {};
                if (ch === "{") {
                    next("{");
                    white();
                    if (ch === "}") {
                        next("}");
                        return object;
                    }
                    while (ch) {
                        key = string();
                        white();
                        next(":");
                        if (Object.hasOwnProperty.call(object, key)) {
                            error('Duplicate key "' + key + '"');
                        }
                        object[key] = value();
                        white();
                        if (ch === "}") {
                            next("}");
                            return object;
                        }
                        next(",");
                        white();
                    }
                }
                error("Bad object");
            };
            value = function() {
                white();
                switch (ch) {
                  case "{":
                    return object();

                  case "[":
                    return array();

                  case '"':
                    return string();

                  case "-":
                    return number();

                  default:
                    return ch >= "0" && ch <= "9" ? number() : word();
                }
            };
            return function(source) {
                var result;
                text = source;
                at = 0;
                ch = " ";
                result = value();
                white();
                if (ch) {
                    error("Syntax error");
                }
                return result;
            };
        }();
        _.base64Encode = function(data) {
            var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
            var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, ac = 0, enc = "", tmp_arr = [];
            if (!data) {
                return data;
            }
            data = _.utf8Encode(data);
            do {
                o1 = data.charCodeAt(i++);
                o2 = data.charCodeAt(i++);
                o3 = data.charCodeAt(i++);
                bits = o1 << 16 | o2 << 8 | o3;
                h1 = bits >> 18 & 63;
                h2 = bits >> 12 & 63;
                h3 = bits >> 6 & 63;
                h4 = bits & 63;
                tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
            } while (i < data.length);
            enc = tmp_arr.join("");
            switch (data.length % 3) {
              case 1:
                enc = enc.slice(0, -2) + "==";
                break;

              case 2:
                enc = enc.slice(0, -1) + "=";
                break;
            }
            return enc;
        };
        _.utf8Encode = function(string) {
            string = (string + "").replace(/\r\n/g, "\n").replace(/\r/g, "\n");
            var utftext = "", start, end;
            var stringl = 0, n;
            start = end = 0;
            stringl = string.length;
            for (n = 0; n < stringl; n++) {
                var c1 = string.charCodeAt(n);
                var enc = null;
                if (c1 < 128) {
                    end++;
                } else if (c1 > 127 && c1 < 2048) {
                    enc = String.fromCharCode(c1 >> 6 | 192, c1 & 63 | 128);
                } else {
                    enc = String.fromCharCode(c1 >> 12 | 224, c1 >> 6 & 63 | 128, c1 & 63 | 128);
                }
                if (enc !== null) {
                    if (end > start) {
                        utftext += string.substring(start, end);
                    }
                    utftext += enc;
                    start = end = n + 1;
                }
            }
            if (end > start) {
                utftext += string.substring(start, string.length);
            }
            return utftext;
        };
        _.UUID = function() {
            var T = function() {
                var d = 1 * new Date, i = 0;
                while (d == 1 * new Date) {
                    i++;
                }
                return d.toString(16) + i.toString(16);
            };
            var R = function() {
                return Math.random().toString(16).replace(".", "");
            };
            var UA = function() {
                var ua = userAgent, i, ch, buffer = [], ret = 0;
                function xor(result, byte_array) {
                    var j, tmp = 0;
                    for (j = 0; j < byte_array.length; j++) {
                        tmp |= buffer[j] << j * 8;
                    }
                    return result ^ tmp;
                }
                for (i = 0; i < ua.length; i++) {
                    ch = ua.charCodeAt(i);
                    buffer.unshift(ch & 255);
                    if (buffer.length >= 4) {
                        ret = xor(ret, buffer);
                        buffer = [];
                    }
                }
                if (buffer.length > 0) {
                    ret = xor(ret, buffer);
                }
                return ret.toString(16);
            };
            return function() {
                var se = (screen.height * screen.width).toString(16);
                return T() + "-" + R() + "-" + UA() + "-" + se + "-" + T();
            };
        }();
        _.isBlockedUA = function(ua) {
            if (/(google web preview|baiduspider|yandexbot|bingbot|googlebot|yahoo! slurp)/i.test(ua)) {
                return true;
            }
            return false;
        };
        _.HTTPBuildQuery = function(formdata, arg_separator) {
            var use_val, use_key, tmp_arr = [];
            if (_.isUndefined(arg_separator)) {
                arg_separator = "&";
            }
            _.each(formdata, (function(val, key) {
                use_val = encodeURIComponent(val.toString());
                use_key = encodeURIComponent(key);
                tmp_arr[tmp_arr.length] = use_key + "=" + use_val;
            }));
            return tmp_arr.join(arg_separator);
        };
        _.getQueryParam = function(url, param) {
            param = param.replace(/[[]/, "\\[").replace(/[\]]/, "\\]");
            var regexS = "[\\?&]" + param + "=([^&#]*)", regex = new RegExp(regexS), results = regex.exec(url);
            if (results === null || results && typeof results[1] !== "string" && results[1].length) {
                return "";
            } else {
                return decodeURIComponent(results[1]).replace(/\+/g, " ");
            }
        };
        _.getHashParam = function(hash, param) {
            var matches = hash.match(new RegExp(param + "=([^&]*)"));
            return matches ? matches[1] : null;
        };
        _.cookie = {
            get: function(name) {
                var nameEQ = name + "=";
                var ca = document$1.cookie.split(";");
                for (var i = 0; i < ca.length; i++) {
                    var c = ca[i];
                    while (c.charAt(0) == " ") {
                        c = c.substring(1, c.length);
                    }
                    if (c.indexOf(nameEQ) === 0) {
                        return decodeURIComponent(c.substring(nameEQ.length, c.length));
                    }
                }
                return null;
            },
            parse: function(name) {
                var cookie;
                try {
                    cookie = _.JSONDecode(_.cookie.get(name)) || {};
                } catch (err) {}
                return cookie;
            },
            set_seconds: function(name, value, seconds, cross_subdomain, is_secure) {
                var cdomain = "", expires = "", secure = "";
                if (cross_subdomain) {
                    var matches = document$1.location.hostname.match(DOMAIN_MATCH_REGEX), domain = matches ? matches[0] : "";
                    cdomain = domain ? "; domain=." + domain : "";
                }
                if (seconds) {
                    var date = new Date;
                    date.setTime(date.getTime() + seconds * 1e3);
                    expires = "; expires=" + date.toGMTString();
                }
                if (is_secure) {
                    secure = "; secure";
                }
                document$1.cookie = name + "=" + encodeURIComponent(value) + expires + "; path=/" + cdomain + secure;
            },
            set: function(name, value, days, cross_subdomain, is_secure) {
                var cdomain = "", expires = "", secure = "";
                if (cross_subdomain) {
                    var matches = document$1.location.hostname.match(DOMAIN_MATCH_REGEX), domain = matches ? matches[0] : "";
                    cdomain = domain ? "; domain=." + domain : "";
                }
                if (days) {
                    var date = new Date;
                    date.setTime(date.getTime() + days * 24 * 60 * 60 * 1e3);
                    expires = "; expires=" + date.toGMTString();
                }
                if (is_secure) {
                    secure = "; secure";
                }
                var new_cookie_val = name + "=" + encodeURIComponent(value) + expires + "; path=/" + cdomain + secure;
                document$1.cookie = new_cookie_val;
                return new_cookie_val;
            },
            remove: function(name, cross_subdomain) {
                _.cookie.set(name, "", -1, cross_subdomain);
            }
        };
        var _localStorage_supported = null;
        _.localStorage = {
            is_supported: function() {
                if (_localStorage_supported !== null) {
                    return _localStorage_supported;
                }
                var supported = true;
                try {
                    var key = "__mplssupport__", val = "xyz";
                    _.localStorage.set(key, val);
                    if (_.localStorage.get(key) !== val) {
                        supported = false;
                    }
                    _.localStorage.remove(key);
                } catch (err) {
                    supported = false;
                }
                if (!supported) {
                    console$1.error("localStorage unsupported; falling back to cookie store");
                }
                _localStorage_supported = supported;
                return supported;
            },
            error: function(msg) {
                console$1.error("localStorage error: " + msg);
            },
            get: function(name) {
                try {
                    return window.localStorage.getItem(name);
                } catch (err) {
                    _.localStorage.error(err);
                }
                return null;
            },
            parse: function(name) {
                try {
                    return _.JSONDecode(_.localStorage.get(name)) || {};
                } catch (err) {}
                return null;
            },
            set: function(name, value) {
                try {
                    window.localStorage.setItem(name, value);
                } catch (err) {
                    _.localStorage.error(err);
                }
            },
            remove: function(name) {
                try {
                    window.localStorage.removeItem(name);
                } catch (err) {
                    _.localStorage.error(err);
                }
            }
        };
        _.register_event = function() {
            var register_event = function(element, type, handler, oldSchool, useCapture) {
                if (!element) {
                    console$1.error("No valid element provided to register_event");
                    return;
                }
                if (element.addEventListener && !oldSchool) {
                    element.addEventListener(type, handler, !!useCapture);
                } else {
                    var ontype = "on" + type;
                    var old_handler = element[ontype];
                    element[ontype] = makeHandler(element, handler, old_handler);
                }
            };
            function makeHandler(element, new_handler, old_handlers) {
                var handler = function(event) {
                    event = event || fixEvent(window.event);
                    if (!event) {
                        return undefined;
                    }
                    var ret = true;
                    var old_result, new_result;
                    if (_.isFunction(old_handlers)) {
                        old_result = old_handlers(event);
                    }
                    new_result = new_handler.call(element, event);
                    if (false === old_result || false === new_result) {
                        ret = false;
                    }
                    return ret;
                };
                return handler;
            }
            function fixEvent(event) {
                if (event) {
                    event.preventDefault = fixEvent.preventDefault;
                    event.stopPropagation = fixEvent.stopPropagation;
                }
                return event;
            }
            fixEvent.preventDefault = function() {
                this.returnValue = false;
            };
            fixEvent.stopPropagation = function() {
                this.cancelBubble = true;
            };
            return register_event;
        }();
        var TOKEN_MATCH_REGEX = new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');
        _.dom_query = function() {
            function getAllChildren(e) {
                return e.all ? e.all : e.getElementsByTagName("*");
            }
            var bad_whitespace = /[\t\r\n]/g;
            function hasClass(elem, selector) {
                var className = " " + selector + " ";
                return (" " + elem.className + " ").replace(bad_whitespace, " ").indexOf(className) >= 0;
            }
            function getElementsBySelector(selector) {
                if (!document$1.getElementsByTagName) {
                    return [];
                }
                var tokens = selector.split(" ");
                var token, bits, tagName, found, foundCount, i, j, k, elements, currentContextIndex;
                var currentContext = [ document$1 ];
                for (i = 0; i < tokens.length; i++) {
                    token = tokens[i].replace(/^\s+/, "").replace(/\s+$/, "");
                    if (token.indexOf("#") > -1) {
                        bits = token.split("#");
                        tagName = bits[0];
                        var id = bits[1];
                        var element = document$1.getElementById(id);
                        if (!element || tagName && element.nodeName.toLowerCase() != tagName) {
                            return [];
                        }
                        currentContext = [ element ];
                        continue;
                    }
                    if (token.indexOf(".") > -1) {
                        bits = token.split(".");
                        tagName = bits[0];
                        var className = bits[1];
                        if (!tagName) {
                            tagName = "*";
                        }
                        found = [];
                        foundCount = 0;
                        for (j = 0; j < currentContext.length; j++) {
                            if (tagName == "*") {
                                elements = getAllChildren(currentContext[j]);
                            } else {
                                elements = currentContext[j].getElementsByTagName(tagName);
                            }
                            for (k = 0; k < elements.length; k++) {
                                found[foundCount++] = elements[k];
                            }
                        }
                        currentContext = [];
                        currentContextIndex = 0;
                        for (j = 0; j < found.length; j++) {
                            if (found[j].className && _.isString(found[j].className) && hasClass(found[j], className)) {
                                currentContext[currentContextIndex++] = found[j];
                            }
                        }
                        continue;
                    }
                    var token_match = token.match(TOKEN_MATCH_REGEX);
                    if (token_match) {
                        tagName = token_match[1];
                        var attrName = token_match[2];
                        var attrOperator = token_match[3];
                        var attrValue = token_match[4];
                        if (!tagName) {
                            tagName = "*";
                        }
                        found = [];
                        foundCount = 0;
                        for (j = 0; j < currentContext.length; j++) {
                            if (tagName == "*") {
                                elements = getAllChildren(currentContext[j]);
                            } else {
                                elements = currentContext[j].getElementsByTagName(tagName);
                            }
                            for (k = 0; k < elements.length; k++) {
                                found[foundCount++] = elements[k];
                            }
                        }
                        currentContext = [];
                        currentContextIndex = 0;
                        var checkFunction;
                        switch (attrOperator) {
                          case "=":
                            checkFunction = function(e) {
                                return e.getAttribute(attrName) == attrValue;
                            };
                            break;

                          case "~":
                            checkFunction = function(e) {
                                return e.getAttribute(attrName).match(new RegExp("\\b" + attrValue + "\\b"));
                            };
                            break;

                          case "|":
                            checkFunction = function(e) {
                                return e.getAttribute(attrName).match(new RegExp("^" + attrValue + "-?"));
                            };
                            break;

                          case "^":
                            checkFunction = function(e) {
                                return e.getAttribute(attrName).indexOf(attrValue) === 0;
                            };
                            break;

                          case "$":
                            checkFunction = function(e) {
                                return e.getAttribute(attrName).lastIndexOf(attrValue) == e.getAttribute(attrName).length - attrValue.length;
                            };
                            break;

                          case "*":
                            checkFunction = function(e) {
                                return e.getAttribute(attrName).indexOf(attrValue) > -1;
                            };
                            break;

                          default:
                            checkFunction = function(e) {
                                return e.getAttribute(attrName);
                            };
                        }
                        currentContext = [];
                        currentContextIndex = 0;
                        for (j = 0; j < found.length; j++) {
                            if (checkFunction(found[j])) {
                                currentContext[currentContextIndex++] = found[j];
                            }
                        }
                        continue;
                    }
                    tagName = token;
                    found = [];
                    foundCount = 0;
                    for (j = 0; j < currentContext.length; j++) {
                        elements = currentContext[j].getElementsByTagName(tagName);
                        for (k = 0; k < elements.length; k++) {
                            found[foundCount++] = elements[k];
                        }
                    }
                    currentContext = found;
                }
                return currentContext;
            }
            return function(query) {
                if (_.isElement(query)) {
                    return [ query ];
                } else if (_.isObject(query) && !_.isUndefined(query.length)) {
                    return query;
                } else {
                    return getElementsBySelector.call(this, query);
                }
            };
        }();
        _.info = {
            campaignParams: function() {
                var campaign_keywords = "utm_source utm_medium utm_campaign utm_content utm_term".split(" "), kw = "", params = {};
                _.each(campaign_keywords, (function(kwkey) {
                    kw = _.getQueryParam(document$1.URL, kwkey);
                    if (kw.length) {
                        params[kwkey] = kw;
                    }
                }));
                return params;
            },
            searchEngine: function(referrer) {
                if (referrer.search("https?://(.*)google.([^/?]*)") === 0) {
                    return "google";
                } else if (referrer.search("https?://(.*)bing.com") === 0) {
                    return "bing";
                } else if (referrer.search("https?://(.*)yahoo.com") === 0) {
                    return "yahoo";
                } else if (referrer.search("https?://(.*)duckduckgo.com") === 0) {
                    return "duckduckgo";
                } else {
                    return null;
                }
            },
            searchInfo: function(referrer) {
                var search = _.info.searchEngine(referrer), param = search != "yahoo" ? "q" : "p", ret = {};
                if (search !== null) {
                    ret["$search_engine"] = search;
                    var keyword = _.getQueryParam(referrer, param);
                    if (keyword.length) {
                        ret["mp_keyword"] = keyword;
                    }
                }
                return ret;
            },
            browser: function(user_agent, vendor, opera) {
                vendor = vendor || "";
                if (opera || _.includes(user_agent, " OPR/")) {
                    if (_.includes(user_agent, "Mini")) {
                        return "Opera Mini";
                    }
                    return "Opera";
                } else if (/(BlackBerry|PlayBook|BB10)/i.test(user_agent)) {
                    return "BlackBerry";
                } else if (_.includes(user_agent, "IEMobile") || _.includes(user_agent, "WPDesktop")) {
                    return "Internet Explorer Mobile";
                } else if (_.includes(user_agent, "Edge")) {
                    return "Microsoft Edge";
                } else if (_.includes(user_agent, "FBIOS")) {
                    return "Facebook Mobile";
                } else if (_.includes(user_agent, "Chrome")) {
                    return "Chrome";
                } else if (_.includes(user_agent, "CriOS")) {
                    return "Chrome iOS";
                } else if (_.includes(user_agent, "UCWEB") || _.includes(user_agent, "UCBrowser")) {
                    return "UC Browser";
                } else if (_.includes(user_agent, "FxiOS")) {
                    return "Firefox iOS";
                } else if (_.includes(vendor, "Apple")) {
                    if (_.includes(user_agent, "Mobile")) {
                        return "Mobile Safari";
                    }
                    return "Safari";
                } else if (_.includes(user_agent, "Android")) {
                    return "Android Mobile";
                } else if (_.includes(user_agent, "Konqueror")) {
                    return "Konqueror";
                } else if (_.includes(user_agent, "Firefox")) {
                    return "Firefox";
                } else if (_.includes(user_agent, "MSIE") || _.includes(user_agent, "Trident/")) {
                    return "Internet Explorer";
                } else if (_.includes(user_agent, "Gecko")) {
                    return "Mozilla";
                } else {
                    return "";
                }
            },
            browserVersion: function(userAgent, vendor, opera) {
                var browser = _.info.browser(userAgent, vendor, opera);
                var versionRegexs = {
                    "Internet Explorer Mobile": /rv:(\d+(\.\d+)?)/,
                    "Microsoft Edge": /Edge\/(\d+(\.\d+)?)/,
                    Chrome: /Chrome\/(\d+(\.\d+)?)/,
                    "Chrome iOS": /CriOS\/(\d+(\.\d+)?)/,
                    "UC Browser": /(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,
                    Safari: /Version\/(\d+(\.\d+)?)/,
                    "Mobile Safari": /Version\/(\d+(\.\d+)?)/,
                    Opera: /(Opera|OPR)\/(\d+(\.\d+)?)/,
                    Firefox: /Firefox\/(\d+(\.\d+)?)/,
                    "Firefox iOS": /FxiOS\/(\d+(\.\d+)?)/,
                    Konqueror: /Konqueror:(\d+(\.\d+)?)/,
                    BlackBerry: /BlackBerry (\d+(\.\d+)?)/,
                    "Android Mobile": /android\s(\d+(\.\d+)?)/,
                    "Internet Explorer": /(rv:|MSIE )(\d+(\.\d+)?)/,
                    Mozilla: /rv:(\d+(\.\d+)?)/
                };
                var regex = versionRegexs[browser];
                if (regex === undefined) {
                    return null;
                }
                var matches = userAgent.match(regex);
                if (!matches) {
                    return null;
                }
                return parseFloat(matches[matches.length - 2]);
            },
            os: function() {
                var a = userAgent;
                if (/Windows/i.test(a)) {
                    if (/Phone/.test(a) || /WPDesktop/.test(a)) {
                        return "Windows Phone";
                    }
                    return "Windows";
                } else if (/(iPhone|iPad|iPod)/.test(a)) {
                    return "iOS";
                } else if (/Android/.test(a)) {
                    return "Android";
                } else if (/(BlackBerry|PlayBook|BB10)/i.test(a)) {
                    return "BlackBerry";
                } else if (/Mac/i.test(a)) {
                    return "Mac OS X";
                } else if (/Linux/.test(a)) {
                    return "Linux";
                } else if (/CrOS/.test(a)) {
                    return "Chrome OS";
                } else {
                    return "";
                }
            },
            device: function(user_agent) {
                if (/Windows Phone/i.test(user_agent) || /WPDesktop/.test(user_agent)) {
                    return "Windows Phone";
                } else if (/iPad/.test(user_agent)) {
                    return "iPad";
                } else if (/iPod/.test(user_agent)) {
                    return "iPod Touch";
                } else if (/iPhone/.test(user_agent)) {
                    return "iPhone";
                } else if (/(BlackBerry|PlayBook|BB10)/i.test(user_agent)) {
                    return "BlackBerry";
                } else if (/Android/.test(user_agent)) {
                    return "Android";
                } else {
                    return "";
                }
            },
            referringDomain: function(referrer) {
                var split = referrer.split("/");
                if (split.length >= 3) {
                    return split[2];
                }
                return "";
            },
            properties: function() {
                return _.extend(_.strip_empty_properties({
                    $os: _.info.os(),
                    $browser: _.info.browser(userAgent, navigator$1.vendor, windowOpera),
                    $referrer: document$1.referrer,
                    $referring_domain: _.info.referringDomain(document$1.referrer),
                    $device: _.info.device(userAgent)
                }), {
                    $current_url: window$1.location.href,
                    $browser_version: _.info.browserVersion(userAgent, navigator$1.vendor, windowOpera),
                    $screen_height: screen.height,
                    $screen_width: screen.width,
                    mp_lib: "web",
                    $lib_version: Config.LIB_VERSION,
                    time: _.timestamp() / 1e3
                });
            },
            people_properties: function() {
                return _.extend(_.strip_empty_properties({
                    $os: _.info.os(),
                    $browser: _.info.browser(userAgent, navigator$1.vendor, windowOpera)
                }), {
                    $browser_version: _.info.browserVersion(userAgent, navigator$1.vendor, windowOpera)
                });
            },
            pageviewInfo: function(page) {
                return _.strip_empty_properties({
                    mp_page: page,
                    mp_referrer: document$1.referrer,
                    mp_browser: _.info.browser(userAgent, navigator$1.vendor, windowOpera),
                    mp_platform: _.info.os()
                });
            }
        };
        _["toArray"] = _.toArray;
        _["isObject"] = _.isObject;
        _["JSONEncode"] = _.JSONEncode;
        _["JSONDecode"] = _.JSONDecode;
        _["isBlockedUA"] = _.isBlockedUA;
        _["isEmptyObject"] = _.isEmptyObject;
        _["info"] = _.info;
        _["info"]["device"] = _.info.device;
        _["info"]["browser"] = _.info.browser;
        _["info"]["properties"] = _.info.properties;
        function getClassName(el) {
            switch (typeof el.className) {
              case "string":
                return el.className;

              case "object":
                return el.className.baseVal || el.getAttribute("class") || "";

              default:
                return "";
            }
        }
        function getSafeText(el) {
            var elText = "";
            if (shouldTrackElement(el) && el.childNodes && el.childNodes.length) {
                _.each(el.childNodes, (function(child) {
                    if (isTextNode(child) && child.textContent) {
                        elText += _.trim(child.textContent).split(/(\s+)/).filter(shouldTrackValue).join("").replace(/[\r\n]/g, " ").replace(/[ ]+/g, " ").substring(0, 255);
                    }
                }));
            }
            return _.trim(elText);
        }
        function isElementNode(el) {
            return el && el.nodeType === 1;
        }
        function isTag(el, tag) {
            return el && el.tagName && el.tagName.toLowerCase() === tag.toLowerCase();
        }
        function isTextNode(el) {
            return el && el.nodeType === 3;
        }
        function shouldTrackDomEvent(el, event) {
            if (!el || isTag(el, "html") || !isElementNode(el)) {
                return false;
            }
            var tag = el.tagName.toLowerCase();
            switch (tag) {
              case "html":
                return false;

              case "form":
                return event.type === "submit";

              case "input":
                if ([ "button", "submit" ].indexOf(el.getAttribute("type")) === -1) {
                    return event.type === "change";
                } else {
                    return event.type === "click";
                }

              case "select":
              case "textarea":
                return event.type === "change";

              default:
                return event.type === "click";
            }
        }
        function shouldTrackElement(el) {
            for (var curEl = el; curEl.parentNode && !isTag(curEl, "body"); curEl = curEl.parentNode) {
                var classes = getClassName(curEl).split(" ");
                if (_.includes(classes, "mp-sensitive") || _.includes(classes, "mp-no-track")) {
                    return false;
                }
            }
            if (_.includes(getClassName(el).split(" "), "mp-include")) {
                return true;
            }
            if (isTag(el, "input") || isTag(el, "select") || isTag(el, "textarea") || el.getAttribute("contenteditable") === "true") {
                return false;
            }
            var type = el.type || "";
            if (typeof type === "string") {
                switch (type.toLowerCase()) {
                  case "hidden":
                    return false;

                  case "password":
                    return false;
                }
            }
            var name = el.name || el.id || "";
            if (typeof name === "string") {
                var sensitiveNameRegex = /^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i;
                if (sensitiveNameRegex.test(name.replace(/[^a-zA-Z0-9]/g, ""))) {
                    return false;
                }
            }
            return true;
        }
        function shouldTrackValue(value) {
            if (value === null || _.isUndefined(value)) {
                return false;
            }
            if (typeof value === "string") {
                value = _.trim(value);
                var ccRegex = /^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/;
                if (ccRegex.test((value || "").replace(/[- ]/g, ""))) {
                    return false;
                }
                var ssnRegex = /(^\d{3}-?\d{2}-?\d{4}$)/;
                if (ssnRegex.test(value)) {
                    return false;
                }
            }
            return true;
        }
        var autotrack = {
            _initializedTokens: [],
            _previousElementSibling: function(el) {
                if (el.previousElementSibling) {
                    return el.previousElementSibling;
                } else {
                    do {
                        el = el.previousSibling;
                    } while (el && !isElementNode(el));
                    return el;
                }
            },
            _loadScript: function(scriptUrlToLoad, callback) {
                var scriptTag = document.createElement("script");
                scriptTag.type = "text/javascript";
                scriptTag.src = scriptUrlToLoad;
                scriptTag.onload = callback;
                var scripts = document.getElementsByTagName("script");
                if (scripts.length > 0) {
                    scripts[0].parentNode.insertBefore(scriptTag, scripts[0]);
                } else {
                    document.body.appendChild(scriptTag);
                }
            },
            _getPropertiesFromElement: function(elem) {
                var props = {
                    classes: getClassName(elem).split(" "),
                    tag_name: elem.tagName.toLowerCase()
                };
                if (shouldTrackElement(elem)) {
                    _.each(elem.attributes, (function(attr) {
                        if (shouldTrackValue(attr.value)) {
                            props["attr__" + attr.name] = attr.value;
                        }
                    }));
                }
                var nthChild = 1;
                var nthOfType = 1;
                var currentElem = elem;
                while (currentElem = this._previousElementSibling(currentElem)) {
                    nthChild++;
                    if (currentElem.tagName === elem.tagName) {
                        nthOfType++;
                    }
                }
                props["nth_child"] = nthChild;
                props["nth_of_type"] = nthOfType;
                return props;
            },
            _getDefaultProperties: function(eventType) {
                return {
                    $event_type: eventType,
                    $ce_version: 1,
                    $host: window.location.host,
                    $pathname: window.location.pathname
                };
            },
            _extractCustomPropertyValue: function(customProperty) {
                var propValues = [];
                _.each(document.querySelectorAll(customProperty["css_selector"]), (function(matchedElem) {
                    var value;
                    if ([ "input", "select" ].indexOf(matchedElem.tagName.toLowerCase()) > -1) {
                        value = matchedElem["value"];
                    } else if (matchedElem["textContent"]) {
                        value = matchedElem["textContent"];
                    }
                    if (shouldTrackValue(value)) {
                        propValues.push(value);
                    }
                }));
                return propValues.join(", ");
            },
            _getCustomProperties: function(targetElementList) {
                var props = {};
                _.each(this._customProperties, (function(customProperty) {
                    _.each(customProperty["event_selectors"], (function(eventSelector) {
                        var eventElements = document.querySelectorAll(eventSelector);
                        _.each(eventElements, (function(eventElement) {
                            if (_.includes(targetElementList, eventElement) && shouldTrackElement(eventElement)) {
                                props[customProperty["name"]] = this._extractCustomPropertyValue(customProperty);
                            }
                        }), this);
                    }), this);
                }), this);
                return props;
            },
            _getEventTarget: function(e) {
                if (typeof e.target === "undefined") {
                    return e.srcElement;
                } else {
                    return e.target;
                }
            },
            _trackEvent: function(e, instance) {
                var target = this._getEventTarget(e);
                if (isTextNode(target)) {
                    target = target.parentNode;
                }
                if (shouldTrackDomEvent(target, e)) {
                    var targetElementList = [ target ];
                    var curEl = target;
                    while (curEl.parentNode && !isTag(curEl, "body")) {
                        targetElementList.push(curEl.parentNode);
                        curEl = curEl.parentNode;
                    }
                    var elementsJson = [];
                    var href, explicitNoTrack = false;
                    _.each(targetElementList, (function(el) {
                        var shouldTrackEl = shouldTrackElement(el);
                        if (el.tagName.toLowerCase() === "a") {
                            href = el.getAttribute("href");
                            href = shouldTrackEl && shouldTrackValue(href) && href;
                        }
                        var classes = getClassName(el).split(" ");
                        if (_.includes(classes, "mp-no-track")) {
                            explicitNoTrack = true;
                        }
                        elementsJson.push(this._getPropertiesFromElement(el));
                    }), this);
                    if (explicitNoTrack) {
                        return false;
                    }
                    var elementText;
                    var safeElementText = getSafeText(target);
                    if (safeElementText && safeElementText.length) {
                        elementText = safeElementText;
                    }
                    var props = _.extend(this._getDefaultProperties(e.type), {
                        $elements: elementsJson,
                        $el_attr__href: href,
                        $el_text: elementText
                    }, this._getCustomProperties(targetElementList));
                    instance.track("$web_event", props);
                    return true;
                }
            },
            _navigate: function(href) {
                window.location.href = href;
            },
            _addDomEventHandlers: function(instance) {
                var handler = _.bind((function(e) {
                    e = e || window.event;
                    this._trackEvent(e, instance);
                }), this);
                _.register_event(document, "submit", handler, false, true);
                _.register_event(document, "change", handler, false, true);
                _.register_event(document, "click", handler, false, true);
            },
            _customProperties: {},
            init: function(instance) {
                if (!(document && document.body)) {
                    console.log("document not ready yet, trying again in 500 milliseconds...");
                    var that = this;
                    setTimeout((function() {
                        that.init(instance);
                    }), 500);
                    return;
                }
                var token = instance.get_config("token");
                if (this._initializedTokens.indexOf(token) > -1) {
                    console.log('autotrack already initialized for token "' + token + '"');
                    return;
                }
                this._initializedTokens.push(token);
                if (!this._maybeLoadEditor(instance)) {
                    var parseDecideResponse = _.bind((function(response) {
                        if (response && response["config"] && response["config"]["enable_collect_everything"] === true) {
                            if (response["custom_properties"]) {
                                this._customProperties = response["custom_properties"];
                            }
                            instance.track("$web_event", _.extend({
                                $title: document.title
                            }, this._getDefaultProperties("pageview")));
                            this._addDomEventHandlers(instance);
                        } else {
                            instance["__autotrack_enabled"] = false;
                        }
                    }), this);
                    instance._send_request(instance.get_config("api_host") + "/decide/", {
                        verbose: true,
                        version: "1",
                        lib: "web",
                        token
                    }, instance._prepare_callback(parseDecideResponse));
                }
            },
            _editorParamsFromHash: function(instance, hash) {
                var editorParams;
                try {
                    var state = _.getHashParam(hash, "state");
                    state = JSON.parse(decodeURIComponent(state));
                    var expiresInSeconds = _.getHashParam(hash, "expires_in");
                    editorParams = {
                        accessToken: _.getHashParam(hash, "access_token"),
                        accessTokenExpiresAt: (new Date).getTime() + Number(expiresInSeconds) * 1e3,
                        bookmarkletMode: !!state["bookmarkletMode"],
                        projectId: state["projectId"],
                        projectOwnerId: state["projectOwnerId"],
                        projectToken: state["token"],
                        readOnly: state["readOnly"],
                        userFlags: state["userFlags"],
                        userId: state["userId"]
                    };
                    window.sessionStorage.setItem("editorParams", JSON.stringify(editorParams));
                    if (state["desiredHash"]) {
                        window.location.hash = state["desiredHash"];
                    } else if (window.history) {
                        history.replaceState("", document.title, window.location.pathname + window.location.search);
                    } else {
                        window.location.hash = "";
                    }
                } catch (e) {
                    console.error("Unable to parse data from hash", e);
                }
                return editorParams;
            },
            _maybeLoadEditor: function(instance) {
                try {
                    var parseFromUrl = false;
                    if (_.getHashParam(window.location.hash, "state")) {
                        var state = _.getHashParam(window.location.hash, "state");
                        state = JSON.parse(decodeURIComponent(state));
                        parseFromUrl = state["action"] === "mpeditor";
                    }
                    var parseFromStorage = !!window.sessionStorage.getItem("_mpcehash");
                    var editorParams;
                    if (parseFromUrl) {
                        editorParams = this._editorParamsFromHash(instance, window.location.hash);
                    } else if (parseFromStorage) {
                        editorParams = this._editorParamsFromHash(instance, window.sessionStorage.getItem("_mpcehash"));
                        window.sessionStorage.removeItem("_mpcehash");
                    } else {
                        editorParams = JSON.parse(window.sessionStorage.getItem("editorParams") || "{}");
                    }
                    if (editorParams["projectToken"] && instance.get_config("token") === editorParams["projectToken"]) {
                        this._loadEditor(instance, editorParams);
                        return true;
                    } else {
                        return false;
                    }
                } catch (e) {
                    return false;
                }
            },
            _loadEditor: function(instance, editorParams) {
                if (!window["_mpEditorLoaded"]) {
                    window["_mpEditorLoaded"] = true;
                    var editorUrl = instance.get_config("app_host") + "/js-bundle/reports/collect-everything/editor.js?_ts=" + (new Date).getTime();
                    this._loadScript(editorUrl, (function() {
                        window["mp_load_editor"](editorParams);
                    }));
                    return true;
                }
                return false;
            },
            enabledForProject: function(token, numBuckets, numEnabledBuckets) {
                numBuckets = !_.isUndefined(numBuckets) ? numBuckets : 10;
                numEnabledBuckets = !_.isUndefined(numEnabledBuckets) ? numEnabledBuckets : 10;
                var charCodeSum = 0;
                for (var i = 0; i < token.length; i++) {
                    charCodeSum += token.charCodeAt(i);
                }
                return charCodeSum % numBuckets < numEnabledBuckets;
            },
            isBrowserSupported: function() {
                return _.isFunction(document.querySelectorAll);
            }
        };
        _.bind_instance_methods(autotrack);
        _.safewrap_instance_methods(autotrack);
        var DomTracker = function() {};
        DomTracker.prototype.create_properties = function() {};
        DomTracker.prototype.event_handler = function() {};
        DomTracker.prototype.after_track_handler = function() {};
        DomTracker.prototype.init = function(mixpanel_instance) {
            this.mp = mixpanel_instance;
            return this;
        };
        DomTracker.prototype.track = function(query, event_name, properties, user_callback) {
            var that = this;
            var elements = _.dom_query(query);
            if (elements.length === 0) {
                console$1.error("The DOM query (" + query + ") returned 0 elements");
                return;
            }
            _.each(elements, (function(element) {
                _.register_event(element, this.override_event, (function(e) {
                    var options = {};
                    var props = that.create_properties(properties, this);
                    var timeout = that.mp.get_config("track_links_timeout");
                    that.event_handler(e, this, options);
                    window.setTimeout(that.track_callback(user_callback, props, options, true), timeout);
                    that.mp.track(event_name, props, that.track_callback(user_callback, props, options));
                }));
            }), this);
            return true;
        };
        DomTracker.prototype.track_callback = function(user_callback, props, options, timeout_occured) {
            timeout_occured = timeout_occured || false;
            var that = this;
            return function() {
                if (options.callback_fired) {
                    return;
                }
                options.callback_fired = true;
                if (user_callback && user_callback(timeout_occured, props) === false) {
                    return;
                }
                that.after_track_handler(props, options, timeout_occured);
            };
        };
        DomTracker.prototype.create_properties = function(properties, element) {
            var props;
            if (typeof properties === "function") {
                props = properties(element);
            } else {
                props = _.extend({}, properties);
            }
            return props;
        };
        var LinkTracker = function() {
            this.override_event = "click";
        };
        _.inherit(LinkTracker, DomTracker);
        LinkTracker.prototype.create_properties = function(properties, element) {
            var props = LinkTracker.superclass.create_properties.apply(this, arguments);
            if (element.href) {
                props["url"] = element.href;
            }
            return props;
        };
        LinkTracker.prototype.event_handler = function(evt, element, options) {
            options.new_tab = evt.which === 2 || evt.metaKey || evt.ctrlKey || element.target === "_blank";
            options.href = element.href;
            if (!options.new_tab) {
                evt.preventDefault();
            }
        };
        LinkTracker.prototype.after_track_handler = function(props, options) {
            if (options.new_tab) {
                return;
            }
            setTimeout((function() {
                window.location = options.href;
            }), 0);
        };
        var FormTracker = function() {
            this.override_event = "submit";
        };
        _.inherit(FormTracker, DomTracker);
        FormTracker.prototype.event_handler = function(evt, element, options) {
            options.element = element;
            evt.preventDefault();
        };
        FormTracker.prototype.after_track_handler = function(props, options) {
            setTimeout((function() {
                options.element.submit();
            }), 0);
        };
        var GDPR_DEFAULT_PERSISTENCE_PREFIX = "__mp_opt_in_out_";
        function optIn(token, options) {
            _optInOut(true, token, options);
        }
        function optOut(token, options) {
            _optInOut(false, token, options);
        }
        function hasOptedIn(token, options) {
            return _getStorageValue(token, options) === "1";
        }
        function hasOptedOut(token, options) {
            if (_hasDoNotTrackFlagOn(options)) {
                return true;
            }
            return _getStorageValue(token, options) === "0";
        }
        function addOptOutCheckMixpanelLib(method) {
            return _addOptOutCheck(method, (function(name) {
                return this.get_config(name);
            }));
        }
        function addOptOutCheckMixpanelPeople(method) {
            return _addOptOutCheck(method, (function(name) {
                return this._get_config(name);
            }));
        }
        function addOptOutCheckMixpanelGroup(method) {
            return _addOptOutCheck(method, (function(name) {
                return this._get_config(name);
            }));
        }
        function clearOptInOut(token, options) {
            options = options || {};
            _getStorage(options).remove(_getStorageKey(token, options), !!options.crossSubdomainCookie);
        }
        function _getStorage(options) {
            options = options || {};
            return options.persistenceType === "localStorage" ? _.localStorage : _.cookie;
        }
        function _getStorageKey(token, options) {
            options = options || {};
            return (options.persistencePrefix || GDPR_DEFAULT_PERSISTENCE_PREFIX) + token;
        }
        function _getStorageValue(token, options) {
            return _getStorage(options).get(_getStorageKey(token, options));
        }
        function _hasDoNotTrackFlagOn(options) {
            var win = options && options.window || window$1;
            var nav = win["navigator"] || {};
            var hasDntOn = false;
            _.each([ nav["doNotTrack"], nav["msDoNotTrack"], win["doNotTrack"] ], (function(dntValue) {
                if (_.includes([ true, 1, "1", "yes" ], dntValue)) {
                    hasDntOn = true;
                }
            }));
            return hasDntOn;
        }
        function _optInOut(optValue, token, options) {
            if (!_.isString(token) || !token.length) {
                console.error("gdpr." + (optValue ? "optIn" : "optOut") + " called with an invalid token");
                return;
            }
            options = options || {};
            _getStorage(options).set(_getStorageKey(token, options), optValue ? 1 : 0, _.isNumber(options.cookieExpiration) ? options.cookieExpiration : null, !!options.crossSubdomainCookie, !!options.secureCookie);
            if (options.track && optValue) {
                options.track(options.trackEventName || "$opt_in", options.trackProperties);
            }
        }
        function _addOptOutCheck(method, getConfigValue) {
            return function() {
                var optedOut = false;
                try {
                    var token = getConfigValue.call(this, "token");
                    var persistenceType = getConfigValue.call(this, "opt_out_tracking_persistence_type");
                    var persistencePrefix = getConfigValue.call(this, "opt_out_tracking_cookie_prefix");
                    var win = getConfigValue.call(this, "window");
                    if (token) {
                        optedOut = hasOptedOut(token, {
                            persistenceType,
                            persistencePrefix,
                            window: win
                        });
                    }
                } catch (err) {
                    console.error("Unexpected error when checking tracking opt-out status: " + err);
                }
                if (!optedOut) {
                    return method.apply(this, arguments);
                }
                var callback = arguments[arguments.length - 1];
                if (typeof callback === "function") {
                    callback(0);
                }
                return;
            };
        }
        var SET_ACTION = "$set";
        var SET_ONCE_ACTION = "$set_once";
        var UNSET_ACTION = "$unset";
        var ADD_ACTION = "$add";
        var APPEND_ACTION = "$append";
        var UNION_ACTION = "$union";
        var REMOVE_ACTION = "$remove";
        var DELETE_ACTION = "$delete";
        var apiActions = {
            set_action: function(prop, to) {
                var data = {};
                var $set = {};
                if (_.isObject(prop)) {
                    _.each(prop, (function(v, k) {
                        if (!this._is_reserved_property(k)) {
                            $set[k] = v;
                        }
                    }), this);
                } else {
                    $set[prop] = to;
                }
                data[SET_ACTION] = $set;
                return data;
            },
            unset_action: function(prop) {
                var data = {};
                var $unset = [];
                if (!_.isArray(prop)) {
                    prop = [ prop ];
                }
                _.each(prop, (function(k) {
                    if (!this._is_reserved_property(k)) {
                        $unset.push(k);
                    }
                }), this);
                data[UNSET_ACTION] = $unset;
                return data;
            },
            set_once_action: function(prop, to) {
                var data = {};
                var $set_once = {};
                if (_.isObject(prop)) {
                    _.each(prop, (function(v, k) {
                        if (!this._is_reserved_property(k)) {
                            $set_once[k] = v;
                        }
                    }), this);
                } else {
                    $set_once[prop] = to;
                }
                data[SET_ONCE_ACTION] = $set_once;
                return data;
            },
            union_action: function(list_name, values) {
                var data = {};
                var $union = {};
                if (_.isObject(list_name)) {
                    _.each(list_name, (function(v, k) {
                        if (!this._is_reserved_property(k)) {
                            $union[k] = _.isArray(v) ? v : [ v ];
                        }
                    }), this);
                } else {
                    $union[list_name] = _.isArray(values) ? values : [ values ];
                }
                data[UNION_ACTION] = $union;
                return data;
            },
            append_action: function(list_name, value) {
                var data = {};
                var $append = {};
                if (_.isObject(list_name)) {
                    _.each(list_name, (function(v, k) {
                        if (!this._is_reserved_property(k)) {
                            $append[k] = v;
                        }
                    }), this);
                } else {
                    $append[list_name] = value;
                }
                data[APPEND_ACTION] = $append;
                return data;
            },
            remove_action: function(list_name, value) {
                var data = {};
                var $remove = {};
                if (_.isObject(list_name)) {
                    _.each(list_name, (function(v, k) {
                        if (!this._is_reserved_property(k)) {
                            $remove[k] = v;
                        }
                    }), this);
                } else {
                    $remove[list_name] = value;
                }
                data[REMOVE_ACTION] = $remove;
                return data;
            },
            delete_action: function() {
                var data = {};
                data[DELETE_ACTION] = "";
                return data;
            }
        };
        var MixpanelGroup = function() {};
        _.extend(MixpanelGroup.prototype, apiActions);
        MixpanelGroup.prototype._init = function(mixpanel_instance, group_key, group_id) {
            this._mixpanel = mixpanel_instance;
            this._group_key = group_key;
            this._group_id = group_id;
        };
        MixpanelGroup.prototype.set = addOptOutCheckMixpanelGroup((function(prop, to, callback) {
            var data = this.set_action(prop, to);
            if (_.isObject(prop)) {
                callback = to;
            }
            return this._send_request(data, callback);
        }));
        MixpanelGroup.prototype.set_once = addOptOutCheckMixpanelGroup((function(prop, to, callback) {
            var data = this.set_once_action(prop, to);
            if (_.isObject(prop)) {
                callback = to;
            }
            return this._send_request(data, callback);
        }));
        MixpanelGroup.prototype.unset = addOptOutCheckMixpanelGroup((function(prop, callback) {
            var data = this.unset_action(prop);
            return this._send_request(data, callback);
        }));
        MixpanelGroup.prototype.union = addOptOutCheckMixpanelGroup((function(list_name, values, callback) {
            if (_.isObject(list_name)) {
                callback = values;
            }
            var data = this.union_action(list_name, values);
            return this._send_request(data, callback);
        }));
        MixpanelGroup.prototype["delete"] = addOptOutCheckMixpanelGroup((function(callback) {
            var data = this.delete_action();
            return this._send_request(data, callback);
        }));
        MixpanelGroup.prototype.remove = addOptOutCheckMixpanelGroup((function(list_name, value, callback) {
            var data = this.remove_action(list_name, value);
            return this._send_request(data, callback);
        }));
        MixpanelGroup.prototype._send_request = function(data, callback) {
            data["$group_key"] = this._group_key;
            data["$group_id"] = this._group_id;
            data["$token"] = this._get_config("token");
            var date_encoded_data = _.encodeDates(data);
            var truncated_data = _.truncate(date_encoded_data, 255);
            var json_data = _.JSONEncode(date_encoded_data);
            var encoded_data = _.base64Encode(json_data);
            console$1.log(data);
            this._mixpanel._send_request(this._mixpanel.get_config("api_host") + "/groups/", {
                data: encoded_data
            }, this._mixpanel._prepare_callback(callback, truncated_data));
            return truncated_data;
        };
        MixpanelGroup.prototype._is_reserved_property = function(prop) {
            return prop === "$group_key" || prop === "$group_id";
        };
        MixpanelGroup.prototype._get_config = function(conf) {
            return this._mixpanel.get_config(conf);
        };
        MixpanelGroup.prototype.toString = function() {
            return this._mixpanel.toString() + ".group." + this._group_key + "." + this._group_id;
        };
        MixpanelGroup.prototype["remove"] = MixpanelGroup.prototype.remove;
        MixpanelGroup.prototype["set"] = MixpanelGroup.prototype.set;
        MixpanelGroup.prototype["set_once"] = MixpanelGroup.prototype.set_once;
        MixpanelGroup.prototype["union"] = MixpanelGroup.prototype.union;
        MixpanelGroup.prototype["unset"] = MixpanelGroup.prototype.unset;
        MixpanelGroup.prototype["toString"] = MixpanelGroup.prototype.toString;
        var SET_QUEUE_KEY = "__mps";
        var SET_ONCE_QUEUE_KEY = "__mpso";
        var UNSET_QUEUE_KEY = "__mpus";
        var ADD_QUEUE_KEY = "__mpa";
        var APPEND_QUEUE_KEY = "__mpap";
        var REMOVE_QUEUE_KEY = "__mpr";
        var UNION_QUEUE_KEY = "__mpu";
        var PEOPLE_DISTINCT_ID_KEY = "$people_distinct_id";
        var ALIAS_ID_KEY = "__alias";
        var CAMPAIGN_IDS_KEY = "__cmpns";
        var EVENT_TIMERS_KEY = "__timers";
        var RESERVED_PROPERTIES = [ SET_QUEUE_KEY, SET_ONCE_QUEUE_KEY, UNSET_QUEUE_KEY, ADD_QUEUE_KEY, APPEND_QUEUE_KEY, REMOVE_QUEUE_KEY, UNION_QUEUE_KEY, PEOPLE_DISTINCT_ID_KEY, ALIAS_ID_KEY, CAMPAIGN_IDS_KEY, EVENT_TIMERS_KEY ];
        var MixpanelPersistence = function(config) {
            this["props"] = {};
            this.campaign_params_saved = false;
            if (config["persistence_name"]) {
                this.name = "mp_" + config["persistence_name"];
            } else {
                this.name = "mp_" + config["token"] + "_mixpanel";
            }
            var storage_type = config["persistence"];
            if (storage_type !== "cookie" && storage_type !== "localStorage") {
                console$1.critical("Unknown persistence type " + storage_type + "; falling back to cookie");
                storage_type = config["persistence"] = "cookie";
            }
            if (storage_type === "localStorage" && _.localStorage.is_supported()) {
                this.storage = _.localStorage;
            } else {
                this.storage = _.cookie;
            }
            this.load();
            this.update_config(config);
            this.upgrade(config);
            this.save();
        };
        MixpanelPersistence.prototype.properties = function() {
            var p = {};
            _.each(this["props"], (function(v, k) {
                if (!_.include(RESERVED_PROPERTIES, k)) {
                    p[k] = v;
                }
            }));
            return p;
        };
        MixpanelPersistence.prototype.load = function() {
            if (this.disabled) {
                return;
            }
            var entry = this.storage.parse(this.name);
            if (entry) {
                this["props"] = _.extend({}, entry);
            }
        };
        MixpanelPersistence.prototype.upgrade = function(config) {
            var upgrade_from_old_lib = config["upgrade"], old_cookie_name, old_cookie;
            if (upgrade_from_old_lib) {
                old_cookie_name = "mp_super_properties";
                if (typeof upgrade_from_old_lib === "string") {
                    old_cookie_name = upgrade_from_old_lib;
                }
                old_cookie = this.storage.parse(old_cookie_name);
                this.storage.remove(old_cookie_name);
                this.storage.remove(old_cookie_name, true);
                if (old_cookie) {
                    this["props"] = _.extend(this["props"], old_cookie["all"], old_cookie["events"]);
                }
            }
            if (!config["cookie_name"] && config["name"] !== "mixpanel") {
                old_cookie_name = "mp_" + config["token"] + "_" + config["name"];
                old_cookie = this.storage.parse(old_cookie_name);
                if (old_cookie) {
                    this.storage.remove(old_cookie_name);
                    this.storage.remove(old_cookie_name, true);
                    this.register_once(old_cookie);
                }
            }
            if (this.storage === _.localStorage) {
                old_cookie = _.cookie.parse(this.name);
                _.cookie.remove(this.name);
                _.cookie.remove(this.name, true);
                if (old_cookie) {
                    this.register_once(old_cookie);
                }
            }
        };
        MixpanelPersistence.prototype.save = function() {
            if (this.disabled) {
                return;
            }
            this._expire_notification_campaigns();
            this.storage.set(this.name, _.JSONEncode(this["props"]), this.expire_days, this.cross_subdomain, this.secure);
        };
        MixpanelPersistence.prototype.remove = function() {
            this.storage.remove(this.name, false);
            this.storage.remove(this.name, true);
        };
        MixpanelPersistence.prototype.clear = function() {
            this.remove();
            this["props"] = {};
        };
        MixpanelPersistence.prototype.register_once = function(props, default_value, days) {
            if (_.isObject(props)) {
                if (typeof default_value === "undefined") {
                    default_value = "None";
                }
                this.expire_days = typeof days === "undefined" ? this.default_expiry : days;
                _.each(props, (function(val, prop) {
                    if (!this["props"].hasOwnProperty(prop) || this["props"][prop] === default_value) {
                        this["props"][prop] = val;
                    }
                }), this);
                this.save();
                return true;
            }
            return false;
        };
        MixpanelPersistence.prototype.register = function(props, days) {
            if (_.isObject(props)) {
                this.expire_days = typeof days === "undefined" ? this.default_expiry : days;
                _.extend(this["props"], props);
                this.save();
                return true;
            }
            return false;
        };
        MixpanelPersistence.prototype.unregister = function(prop) {
            if (prop in this["props"]) {
                delete this["props"][prop];
                this.save();
            }
        };
        MixpanelPersistence.prototype._expire_notification_campaigns = _.safewrap((function() {
            var campaigns_shown = this["props"][CAMPAIGN_IDS_KEY], EXPIRY_TIME = Config.DEBUG ? 60 * 1e3 : 60 * 60 * 1e3;
            if (!campaigns_shown) {
                return;
            }
            for (var campaign_id in campaigns_shown) {
                if (1 * new Date - campaigns_shown[campaign_id] > EXPIRY_TIME) {
                    delete campaigns_shown[campaign_id];
                }
            }
            if (_.isEmptyObject(campaigns_shown)) {
                delete this["props"][CAMPAIGN_IDS_KEY];
            }
        }));
        MixpanelPersistence.prototype.update_campaign_params = function() {
            if (!this.campaign_params_saved) {
                this.register_once(_.info.campaignParams());
                this.campaign_params_saved = true;
            }
        };
        MixpanelPersistence.prototype.update_search_keyword = function(referrer) {
            this.register(_.info.searchInfo(referrer));
        };
        MixpanelPersistence.prototype.update_referrer_info = function(referrer) {
            this.register_once({
                $initial_referrer: referrer || "$direct",
                $initial_referring_domain: _.info.referringDomain(referrer) || "$direct"
            }, "");
        };
        MixpanelPersistence.prototype.get_referrer_info = function() {
            return _.strip_empty_properties({
                $initial_referrer: this["props"]["$initial_referrer"],
                $initial_referring_domain: this["props"]["$initial_referring_domain"]
            });
        };
        MixpanelPersistence.prototype.safe_merge = function(props) {
            _.each(this["props"], (function(val, prop) {
                if (!(prop in props)) {
                    props[prop] = val;
                }
            }));
            return props;
        };
        MixpanelPersistence.prototype.update_config = function(config) {
            this.default_expiry = this.expire_days = config["cookie_expiration"];
            this.set_disabled(config["disable_persistence"]);
            this.set_cross_subdomain(config["cross_subdomain_cookie"]);
            this.set_secure(config["secure_cookie"]);
        };
        MixpanelPersistence.prototype.set_disabled = function(disabled) {
            this.disabled = disabled;
            if (this.disabled) {
                this.remove();
            } else {
                this.save();
            }
        };
        MixpanelPersistence.prototype.set_cross_subdomain = function(cross_subdomain) {
            if (cross_subdomain !== this.cross_subdomain) {
                this.cross_subdomain = cross_subdomain;
                this.remove();
                this.save();
            }
        };
        MixpanelPersistence.prototype.get_cross_subdomain = function() {
            return this.cross_subdomain;
        };
        MixpanelPersistence.prototype.set_secure = function(secure) {
            if (secure !== this.secure) {
                this.secure = secure ? true : false;
                this.remove();
                this.save();
            }
        };
        MixpanelPersistence.prototype._add_to_people_queue = function(queue, data) {
            var q_key = this._get_queue_key(queue), q_data = data[queue], set_q = this._get_or_create_queue(SET_ACTION), set_once_q = this._get_or_create_queue(SET_ONCE_ACTION), unset_q = this._get_or_create_queue(UNSET_ACTION), add_q = this._get_or_create_queue(ADD_ACTION), union_q = this._get_or_create_queue(UNION_ACTION), remove_q = this._get_or_create_queue(REMOVE_ACTION, []), append_q = this._get_or_create_queue(APPEND_ACTION, []);
            if (q_key === SET_QUEUE_KEY) {
                _.extend(set_q, q_data);
                this._pop_from_people_queue(ADD_ACTION, q_data);
                this._pop_from_people_queue(UNION_ACTION, q_data);
                this._pop_from_people_queue(UNSET_ACTION, q_data);
            } else if (q_key === SET_ONCE_QUEUE_KEY) {
                _.each(q_data, (function(v, k) {
                    if (!(k in set_once_q)) {
                        set_once_q[k] = v;
                    }
                }));
                this._pop_from_people_queue(UNSET_ACTION, q_data);
            } else if (q_key === UNSET_QUEUE_KEY) {
                _.each(q_data, (function(prop) {
                    _.each([ set_q, set_once_q, add_q, union_q ], (function(enqueued_obj) {
                        if (prop in enqueued_obj) {
                            delete enqueued_obj[prop];
                        }
                    }));
                    _.each(append_q, (function(append_obj) {
                        if (prop in append_obj) {
                            delete append_obj[prop];
                        }
                    }));
                    unset_q[prop] = true;
                }));
            } else if (q_key === ADD_QUEUE_KEY) {
                _.each(q_data, (function(v, k) {
                    if (k in set_q) {
                        set_q[k] += v;
                    } else {
                        if (!(k in add_q)) {
                            add_q[k] = 0;
                        }
                        add_q[k] += v;
                    }
                }), this);
                this._pop_from_people_queue(UNSET_ACTION, q_data);
            } else if (q_key === UNION_QUEUE_KEY) {
                _.each(q_data, (function(v, k) {
                    if (_.isArray(v)) {
                        if (!(k in union_q)) {
                            union_q[k] = [];
                        }
                        union_q[k] = union_q[k].concat(v);
                    }
                }));
                this._pop_from_people_queue(UNSET_ACTION, q_data);
            } else if (q_key === REMOVE_QUEUE_KEY) {
                remove_q.push(q_data);
                this._pop_from_people_queue(APPEND_ACTION, q_data);
            } else if (q_key === APPEND_QUEUE_KEY) {
                append_q.push(q_data);
                this._pop_from_people_queue(UNSET_ACTION, q_data);
            }
            console$1.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):");
            console$1.log(data);
            this.save();
        };
        MixpanelPersistence.prototype._pop_from_people_queue = function(queue, data) {
            var q = this._get_queue(queue);
            if (!_.isUndefined(q)) {
                _.each(data, (function(v, k) {
                    if (queue === APPEND_ACTION || queue === REMOVE_ACTION) {
                        _.each(q, (function(queued_action) {
                            if (queued_action[k] === v) {
                                delete queued_action[k];
                            }
                        }));
                    } else {
                        delete q[k];
                    }
                }), this);
                this.save();
            }
        };
        MixpanelPersistence.prototype._get_queue_key = function(queue) {
            if (queue === SET_ACTION) {
                return SET_QUEUE_KEY;
            } else if (queue === SET_ONCE_ACTION) {
                return SET_ONCE_QUEUE_KEY;
            } else if (queue === UNSET_ACTION) {
                return UNSET_QUEUE_KEY;
            } else if (queue === ADD_ACTION) {
                return ADD_QUEUE_KEY;
            } else if (queue === APPEND_ACTION) {
                return APPEND_QUEUE_KEY;
            } else if (queue === REMOVE_ACTION) {
                return REMOVE_QUEUE_KEY;
            } else if (queue === UNION_ACTION) {
                return UNION_QUEUE_KEY;
            } else {
                console$1.error("Invalid queue:", queue);
            }
        };
        MixpanelPersistence.prototype._get_queue = function(queue) {
            return this["props"][this._get_queue_key(queue)];
        };
        MixpanelPersistence.prototype._get_or_create_queue = function(queue, default_val) {
            var key = this._get_queue_key(queue);
            default_val = _.isUndefined(default_val) ? {} : default_val;
            return this["props"][key] || (this["props"][key] = default_val);
        };
        MixpanelPersistence.prototype.set_event_timer = function(event_name, timestamp) {
            var timers = this["props"][EVENT_TIMERS_KEY] || {};
            timers[event_name] = timestamp;
            this["props"][EVENT_TIMERS_KEY] = timers;
            this.save();
        };
        MixpanelPersistence.prototype.remove_event_timer = function(event_name) {
            var timers = this["props"][EVENT_TIMERS_KEY] || {};
            var timestamp = timers[event_name];
            if (!_.isUndefined(timestamp)) {
                delete this["props"][EVENT_TIMERS_KEY][event_name];
                this.save();
            }
            return timestamp;
        };
        var OPERATOR_KEY = "operator";
        var PROPERTY_KEY = "property";
        var WINDOW_KEY = "window";
        var UNIT_KEY = "unit";
        var VALUE_KEY = "value";
        var HOUR_KEY = "hour";
        var DAY_KEY = "day";
        var WEEK_KEY = "week";
        var MONTH_KEY = "month";
        var EVENT_PROPERTY = "event";
        var LITERAL_PROPERTY = "literal";
        var AND_OPERATOR = "and";
        var OR_OPERATOR = "or";
        var IN_OPERATOR = "in";
        var NOT_IN_OPERATOR = "not in";
        var PLUS_OPERATOR = "+";
        var MINUS_OPERATOR = "-";
        var MUL_OPERATOR = "*";
        var DIV_OPERATOR = "/";
        var MOD_OPERATOR = "%";
        var EQUALS_OPERATOR = "==";
        var NOT_EQUALS_OPERATOR = "!=";
        var GREATER_OPERATOR = ">";
        var LESS_OPERATOR = "<";
        var GREATER_EQUAL_OPERATOR = ">=";
        var LESS_EQUAL_OPERATOR = "<=";
        var BOOLEAN_OPERATOR = "boolean";
        var DATETIME_OPERATOR = "datetime";
        var LIST_OPERATOR = "list";
        var NUMBER_OPERATOR = "number";
        var STRING_OPERATOR = "string";
        var NOT_OPERATOR = "not";
        var DEFINED_OPERATOR = "defined";
        var NOT_DEFINED_OPERATOR = "not defined";
        var NOW_LITERAL = "now";
        function toNumber(value) {
            if (value === null) {
                return null;
            }
            switch (typeof value) {
              case "object":
                if (_.isDate(value) && value.getTime() >= 0) {
                    return value.getTime();
                }
                return null;

              case "boolean":
                return Number(value);

              case "number":
                return value;

              case "string":
                value = Number(value);
                if (!isNaN(value)) {
                    return value;
                }
                return 0;
            }
            return null;
        }
        function evaluateNumber(op, properties) {
            if (!op["operator"] || op["operator"] !== NUMBER_OPERATOR || !op["children"] || op["children"].length !== 1) {
                throw "Invalid cast operator: number " + op;
            }
            return toNumber(evaluateSelector(op["children"][0], properties));
        }
        function toBoolean(value) {
            if (value === null) {
                return false;
            }
            switch (typeof value) {
              case "boolean":
                return value;

              case "number":
                return value !== 0;

              case "string":
                return value.length > 0;

              case "object":
                if (_.isArray(value) && value.length > 0) {
                    return true;
                }
                if (_.isDate(value) && value.getTime() > 0) {
                    return true;
                }
                if (_.isObject(value) && !_.isEmptyObject(value)) {
                    return true;
                }
                return false;
            }
            return false;
        }
        function evaluateBoolean(op, properties) {
            if (!op["operator"] || op["operator"] !== BOOLEAN_OPERATOR || !op["children"] || op["children"].length !== 1) {
                throw "Invalid cast operator: boolean " + op;
            }
            return toBoolean(evaluateSelector(op["children"][0], properties));
        }
        function evaluateDateTime(op, properties) {
            if (!op["operator"] || op["operator"] !== DATETIME_OPERATOR || !op["children"] || op["children"].length !== 1) {
                throw "Invalid cast operator: datetime " + op;
            }
            var v = evaluateSelector(op["children"][0], properties);
            if (v === null) {
                return null;
            }
            switch (typeof v) {
              case "number":
              case "string":
                var d = new Date(v);
                if (isNaN(d.getTime())) {
                    return null;
                }
                return d;

              case "object":
                if (_.isDate(v)) {
                    return v;
                }
            }
            return null;
        }
        function evaluateList(op, properties) {
            if (!op["operator"] || op["operator"] !== LIST_OPERATOR || !op["children"] || op["children"].length !== 1) {
                throw "Invalid cast operator: list " + op;
            }
            var v = evaluateSelector(op["children"][0], properties);
            if (v === null) {
                return null;
            }
            if (_.isArray(v)) {
                return v;
            }
            return null;
        }
        function evaluateString(op, properties) {
            if (!op["operator"] || op["operator"] !== STRING_OPERATOR || !op["children"] || op["children"].length !== 1) {
                throw "Invalid cast operator: string " + op;
            }
            var v = evaluateSelector(op["children"][0], properties);
            switch (typeof v) {
              case "object":
                if (_.isDate(v)) {
                    return v.toJSON();
                }
                return JSON.stringify(v);
            }
            return String(v);
        }
        function evaluateAnd(op, properties) {
            if (!op["operator"] || op["operator"] !== AND_OPERATOR || !op["children"] || op["children"].length !== 2) {
                throw "Invalid operator: AND " + op;
            }
            return toBoolean(evaluateSelector(op["children"][0], properties)) && toBoolean(evaluateSelector(op["children"][1], properties));
        }
        function evaluateOr(op, properties) {
            if (!op["operator"] || op["operator"] !== OR_OPERATOR || !op["children"] || op["children"].length !== 2) {
                throw "Invalid operator: OR " + op;
            }
            return toBoolean(evaluateSelector(op["children"][0], properties)) || toBoolean(evaluateSelector(op["children"][1], properties));
        }
        function evaluateIn(op, properties) {
            if (!op["operator"] || [ IN_OPERATOR, NOT_IN_OPERATOR ].indexOf(op["operator"]) === -1 || !op["children"] || op["children"].length !== 2) {
                throw "Invalid operator: IN/NOT IN " + op;
            }
            var leftValue = evaluateSelector(op["children"][0], properties);
            var rightValue = evaluateSelector(op["children"][1], properties);
            if (!_.isArray(rightValue) && !_.isString(rightValue)) {
                throw "Invalid operand for operator IN: invalid type" + rightValue;
            }
            var v = rightValue.indexOf(leftValue) > -1;
            if (op["operator"] === NOT_IN_OPERATOR) {
                return !v;
            }
            return v;
        }
        function evaluatePlus(op, properties) {
            if (!op["operator"] || op["operator"] !== PLUS_OPERATOR || !op["children"] || op["children"].length < 2) {
                throw "Invalid operator: PLUS " + op;
            }
            var l = evaluateSelector(op["children"][0], properties);
            var r = evaluateSelector(op["children"][1], properties);
            if (typeof l === "number" && typeof r === "number") {
                return l + r;
            }
            if (typeof l === "string" && typeof r === "string") {
                return l + r;
            }
            return null;
        }
        function evaluateArithmetic(op, properties) {
            if (!op["operator"] || [ MINUS_OPERATOR, MUL_OPERATOR, DIV_OPERATOR, MOD_OPERATOR ].indexOf(op["operator"]) === -1 || !op["children"] || op["children"].length < 2) {
                throw "Invalid arithmetic operator " + op;
            }
            var l = evaluateSelector(op["children"][0], properties);
            var r = evaluateSelector(op["children"][1], properties);
            if (typeof l === "number" && typeof r === "number") {
                switch (op["operator"]) {
                  case MINUS_OPERATOR:
                    return l - r;

                  case MUL_OPERATOR:
                    return l * r;

                  case DIV_OPERATOR:
                    if (r !== 0) {
                        return l / r;
                    }
                    return null;

                  case MOD_OPERATOR:
                    if (r === 0) {
                        return null;
                    }
                    if (l === 0) {
                        return 0;
                    }
                    if (l < 0 && r > 0 || l > 0 && r < 0) {
                        return -(Math.floor(l / r) * r - l);
                    }
                    return l % r;

                  default:
                    throw "Unknown operator: " + op["operator"];
                }
            }
            return null;
        }
        function _isArrayEqual(l, r) {
            if (l === r) return true;
            if (l === null || r === null) return false;
            if (l.length !== r.length) return false;
            for (var i = 0; i < l.length; i++) {
                if (l[i] !== r[i]) {
                    return false;
                }
            }
            return true;
        }
        function _isEqual(l, r) {
            if (l === null && l === r) {
                return true;
            }
            if (typeof l === typeof r) {
                switch (typeof l) {
                  case "number":
                  case "string":
                  case "boolean":
                    return l === r;

                  case "object":
                    if (_.isArray(l) && _.isArray(r)) {
                        return _isArrayEqual(l, r);
                    }
                    if (_.isDate(l) && _.isDate(r)) {
                        return l.getTime() === r.getTime();
                    }
                    if (_.isObject(l) && _.isObject(r)) {
                        return JSON.stringify(l) === JSON.stringify(r);
                    }
                }
            }
            return false;
        }
        function evaluateEquality(op, properties) {
            if (!op["operator"] || [ EQUALS_OPERATOR, NOT_EQUALS_OPERATOR ].indexOf(op["operator"]) === -1 || !op["children"] || op["children"].length !== 2) {
                throw "Invalid equality operator " + op;
            }
            var v = _isEqual(evaluateSelector(op["children"][0], properties), evaluateSelector(op["children"][1], properties));
            switch (op["operator"]) {
              case EQUALS_OPERATOR:
                return v;

              case NOT_EQUALS_OPERATOR:
                return !v;
            }
        }
        function evaluateComparison(op, properties) {
            if (!op["operator"] || [ GREATER_OPERATOR, GREATER_EQUAL_OPERATOR, LESS_OPERATOR, LESS_EQUAL_OPERATOR ].indexOf(op["operator"]) === -1 || !op["children"] || op["children"].length !== 2) {
                throw "Invalid comparison operator " + op;
            }
            var l = evaluateSelector(op["children"][0], properties);
            var r = evaluateSelector(op["children"][1], properties);
            if (typeof l === typeof r) {
                if (typeof r === "number" || _.isDate(r)) {
                    l = toNumber(l);
                    r = toNumber(r);
                    switch (op["operator"]) {
                      case GREATER_OPERATOR:
                        return l > r;

                      case GREATER_EQUAL_OPERATOR:
                        return l >= r;

                      case LESS_OPERATOR:
                        return l < r;

                      case LESS_EQUAL_OPERATOR:
                        return l <= r;
                    }
                } else if (typeof r === "string") {
                    var compare = l.localeCompare(r);
                    switch (op["operator"]) {
                      case GREATER_OPERATOR:
                        return compare > 0;

                      case GREATER_EQUAL_OPERATOR:
                        return compare >= 0;

                      case LESS_OPERATOR:
                        return compare < 0;

                      case LESS_EQUAL_OPERATOR:
                        return compare <= 0;
                    }
                }
            }
            return null;
        }
        function evaluateDefined(op, properties) {
            if (!op["operator"] || [ DEFINED_OPERATOR, NOT_DEFINED_OPERATOR ].indexOf(op["operator"]) === -1 || !op["children"] || op["children"].length !== 1) {
                throw "Invalid defined/not defined operator: " + op;
            }
            var b = evaluateSelector(op["children"][0], properties) !== null;
            if (op["operator"] === NOT_DEFINED_OPERATOR) {
                return !b;
            }
            return b;
        }
        function evaluateNot(op, properties) {
            if (!op["operator"] || op["operator"] !== NOT_OPERATOR || !op["children"] || op["children"].length !== 1) {
                throw "Invalid not operator: " + op;
            }
            var v = evaluateSelector(op["children"][0], properties);
            if (v === null) {
                return true;
            }
            if (typeof v === "boolean") {
                return !v;
            }
            return null;
        }
        function evaluateOperator(op, properties) {
            if (!op["operator"]) {
                throw "Invalid operator: operator key missing " + op;
            }
            switch (op["operator"]) {
              case AND_OPERATOR:
                return evaluateAnd(op, properties);

              case OR_OPERATOR:
                return evaluateOr(op, properties);

              case IN_OPERATOR:
              case NOT_IN_OPERATOR:
                return evaluateIn(op, properties);

              case PLUS_OPERATOR:
                return evaluatePlus(op, properties);

              case MINUS_OPERATOR:
              case MUL_OPERATOR:
              case DIV_OPERATOR:
              case MOD_OPERATOR:
                return evaluateArithmetic(op, properties);

              case EQUALS_OPERATOR:
              case NOT_EQUALS_OPERATOR:
                return evaluateEquality(op, properties);

              case GREATER_OPERATOR:
              case LESS_OPERATOR:
              case GREATER_EQUAL_OPERATOR:
              case LESS_EQUAL_OPERATOR:
                return evaluateComparison(op, properties);

              case BOOLEAN_OPERATOR:
                return evaluateBoolean(op, properties);

              case DATETIME_OPERATOR:
                return evaluateDateTime(op, properties);

              case LIST_OPERATOR:
                return evaluateList(op, properties);

              case NUMBER_OPERATOR:
                return evaluateNumber(op, properties);

              case STRING_OPERATOR:
                return evaluateString(op, properties);

              case DEFINED_OPERATOR:
              case NOT_DEFINED_OPERATOR:
                return evaluateDefined(op, properties);

              case NOT_OPERATOR:
                return evaluateNot(op, properties);
            }
        }
        function evaluateWindow(value) {
            var win = value[WINDOW_KEY];
            if (!win || !win[UNIT_KEY] || !win[VALUE_KEY]) {
                throw "Invalid window: missing required keys " + JSON.stringify(value);
            }
            var out = new Date;
            switch (win[UNIT_KEY]) {
              case HOUR_KEY:
                out.setTime(out.getTime() + win[VALUE_KEY] * -1 * 60 * 60 * 1e3);
                break;

              case DAY_KEY:
                out.setTime(out.getTime() + win[VALUE_KEY] * -1 * 24 * 60 * 60 * 1e3);
                break;

              case WEEK_KEY:
                out.setTime(out.getTime() + win[VALUE_KEY] * -1 * 7 * 24 * 60 * 60 * 1e3);
                break;

              case MONTH_KEY:
                out.setTime(out.getTime() + win[VALUE_KEY] * -1 * 30 * 24 * 60 * 60 * 1e3);
                break;

              default:
                throw "Invalid unit: " + win[UNIT_KEY];
            }
            return out;
        }
        function evaluateOperand(op, properties) {
            if (!op["property"] || !op["value"]) {
                throw "Invalid operand: missing required keys " + op;
            }
            switch (op["property"]) {
              case EVENT_PROPERTY:
                if (properties[op["value"]] !== undefined) {
                    return properties[op["value"]];
                }
                return null;

              case LITERAL_PROPERTY:
                if (op["value"] === NOW_LITERAL) {
                    return new Date;
                }
                if (typeof op["value"] === "object") {
                    return evaluateWindow(op["value"]);
                }
                return op["value"];

              default:
                throw "Invalid operand: Invalid property type " + op["property"];
            }
        }
        function evaluateSelector(filters, properties) {
            if (filters[PROPERTY_KEY]) {
                return evaluateOperand(filters, properties);
            }
            if (filters[OPERATOR_KEY]) {
                return evaluateOperator(filters, properties);
            }
        }
        var MixpanelNotification = function(notif_data, mixpanel_instance) {
            _.bind_instance_methods(this);
            this.mixpanel = mixpanel_instance;
            this.persistence = this.mixpanel["persistence"];
            this.resource_protocol = this.mixpanel.get_config("inapp_protocol");
            this.cdn_host = this.mixpanel.get_config("cdn");
            this.campaign_id = _.escapeHTML(notif_data["id"]);
            this.message_id = _.escapeHTML(notif_data["message_id"]);
            this.body = (_.escapeHTML(notif_data["body"]) || "").replace(/\n/g, "<br/>");
            this.cta = _.escapeHTML(notif_data["cta"]) || "Close";
            this.notif_type = _.escapeHTML(notif_data["type"]) || "takeover";
            this.style = _.escapeHTML(notif_data["style"]) || "light";
            this.title = _.escapeHTML(notif_data["title"]) || "";
            this.video_width = MixpanelNotification.VIDEO_WIDTH;
            this.video_height = MixpanelNotification.VIDEO_HEIGHT;
            this.display_triggers = notif_data["display_triggers"] || [];
            this.dest_url = notif_data["cta_url"] || null;
            this.image_url = notif_data["image_url"] || null;
            this.thumb_image_url = notif_data["thumb_image_url"] || null;
            this.video_url = notif_data["video_url"] || null;
            if (this.thumb_image_url && this.thumb_image_url.indexOf("//") === 0) {
                this.thumb_image_url = this.thumb_image_url.replace("//", this.resource_protocol);
            }
            this.clickthrough = true;
            if (!this.dest_url) {
                this.dest_url = "#dismiss";
                this.clickthrough = false;
            }
            this.mini = this.notif_type === "mini";
            if (!this.mini) {
                this.notif_type = "takeover";
            }
            this.notif_width = !this.mini ? MixpanelNotification.NOTIF_WIDTH : MixpanelNotification.NOTIF_WIDTH_MINI;
            this._set_client_config();
            this.imgs_to_preload = this._init_image_html();
            this._init_video();
        };
        MixpanelNotification.ANIM_TIME = 200;
        MixpanelNotification.MARKUP_PREFIX = "mixpanel-notification";
        MixpanelNotification.BG_OPACITY = .6;
        MixpanelNotification.NOTIF_TOP = 25;
        MixpanelNotification.NOTIF_START_TOP = 200;
        MixpanelNotification.NOTIF_WIDTH = 388;
        MixpanelNotification.NOTIF_WIDTH_MINI = 420;
        MixpanelNotification.NOTIF_HEIGHT_MINI = 85;
        MixpanelNotification.THUMB_BORDER_SIZE = 5;
        MixpanelNotification.THUMB_IMG_SIZE = 60;
        MixpanelNotification.THUMB_OFFSET = Math.round(MixpanelNotification.THUMB_IMG_SIZE / 2);
        MixpanelNotification.VIDEO_WIDTH = 595;
        MixpanelNotification.VIDEO_HEIGHT = 334;
        MixpanelNotification.prototype.show = function() {
            var self = this;
            this._set_client_config();
            if (!this.body_el) {
                setTimeout((function() {
                    self.show();
                }), 300);
                return;
            }
            this._init_styles();
            this._init_notification_el();
            this._preload_images(this._attach_and_animate);
        };
        MixpanelNotification.prototype.dismiss = _.safewrap((function() {
            if (!this.marked_as_shown) {
                this._mark_delivery({
                    invisible: true
                });
            }
            var exiting_el = this.showing_video ? this._get_el("video") : this._get_notification_display_el();
            if (this.use_transitions) {
                this._remove_class("bg", "visible");
                this._add_class(exiting_el, "exiting");
                setTimeout(this._remove_notification_el, MixpanelNotification.ANIM_TIME);
            } else {
                var notif_attr, notif_start, notif_goal;
                if (this.mini) {
                    notif_attr = "right";
                    notif_start = 20;
                    notif_goal = -100;
                } else {
                    notif_attr = "top";
                    notif_start = MixpanelNotification.NOTIF_TOP;
                    notif_goal = MixpanelNotification.NOTIF_START_TOP + MixpanelNotification.NOTIF_TOP;
                }
                this._animate_els([ {
                    el: this._get_el("bg"),
                    attr: "opacity",
                    start: MixpanelNotification.BG_OPACITY,
                    goal: 0
                }, {
                    el: exiting_el,
                    attr: "opacity",
                    start: 1,
                    goal: 0
                }, {
                    el: exiting_el,
                    attr: notif_attr,
                    start: notif_start,
                    goal: notif_goal
                } ], MixpanelNotification.ANIM_TIME, this._remove_notification_el);
            }
        }));
        MixpanelNotification.prototype._add_class = _.safewrap((function(el, class_name) {
            class_name = MixpanelNotification.MARKUP_PREFIX + "-" + class_name;
            if (typeof el === "string") {
                el = this._get_el(el);
            }
            if (!el.className) {
                el.className = class_name;
            } else if (!~(" " + el.className + " ").indexOf(" " + class_name + " ")) {
                el.className += " " + class_name;
            }
        }));
        MixpanelNotification.prototype._remove_class = _.safewrap((function(el, class_name) {
            class_name = MixpanelNotification.MARKUP_PREFIX + "-" + class_name;
            if (typeof el === "string") {
                el = this._get_el(el);
            }
            if (el.className) {
                el.className = (" " + el.className + " ").replace(" " + class_name + " ", "").replace(/^[\s\xA0]+/, "").replace(/[\s\xA0]+$/, "");
            }
        }));
        MixpanelNotification.prototype._animate_els = _.safewrap((function(anims, mss, done_cb, start_time) {
            var self = this, in_progress = false, ai, anim, cur_time = 1 * new Date, time_diff;
            start_time = start_time || cur_time;
            time_diff = cur_time - start_time;
            for (ai = 0; ai < anims.length; ai++) {
                anim = anims[ai];
                if (typeof anim.val === "undefined") {
                    anim.val = anim.start;
                }
                if (anim.val !== anim.goal) {
                    in_progress = true;
                    var anim_diff = anim.goal - anim.start, anim_dir = anim.goal >= anim.start ? 1 : -1;
                    anim.val = anim.start + anim_diff * time_diff / mss;
                    if (anim.attr !== "opacity") {
                        anim.val = Math.round(anim.val);
                    }
                    if (anim_dir > 0 && anim.val >= anim.goal || anim_dir < 0 && anim.val <= anim.goal) {
                        anim.val = anim.goal;
                    }
                }
            }
            if (!in_progress) {
                if (done_cb) {
                    done_cb();
                }
                return;
            }
            for (ai = 0; ai < anims.length; ai++) {
                anim = anims[ai];
                if (anim.el) {
                    var suffix = anim.attr === "opacity" ? "" : "px";
                    anim.el.style[anim.attr] = String(anim.val) + suffix;
                }
            }
            setTimeout((function() {
                self._animate_els(anims, mss, done_cb, start_time);
            }), 10);
        }));
        MixpanelNotification.prototype._attach_and_animate = _.safewrap((function() {
            var self = this;
            if (this.shown || this._get_shown_campaigns()[this.campaign_id]) {
                return;
            }
            this.shown = true;
            this.body_el.appendChild(this.notification_el);
            setTimeout((function() {
                var notif_el = self._get_notification_display_el();
                if (self.use_transitions) {
                    if (!self.mini) {
                        self._add_class("bg", "visible");
                    }
                    self._add_class(notif_el, "visible");
                    self._mark_as_shown();
                } else {
                    var notif_attr, notif_start, notif_goal;
                    if (self.mini) {
                        notif_attr = "right";
                        notif_start = -100;
                        notif_goal = 20;
                    } else {
                        notif_attr = "top";
                        notif_start = MixpanelNotification.NOTIF_START_TOP + MixpanelNotification.NOTIF_TOP;
                        notif_goal = MixpanelNotification.NOTIF_TOP;
                    }
                    self._animate_els([ {
                        el: self._get_el("bg"),
                        attr: "opacity",
                        start: 0,
                        goal: MixpanelNotification.BG_OPACITY
                    }, {
                        el: notif_el,
                        attr: "opacity",
                        start: 0,
                        goal: 1
                    }, {
                        el: notif_el,
                        attr: notif_attr,
                        start: notif_start,
                        goal: notif_goal
                    } ], MixpanelNotification.ANIM_TIME, self._mark_as_shown);
                }
            }), 100);
            _.register_event(self._get_el("cancel"), "click", (function(e) {
                e.preventDefault();
                self.dismiss();
            }));
            var click_el = self._get_el("button") || self._get_el("mini-content");
            _.register_event(click_el, "click", (function(e) {
                e.preventDefault();
                if (self.show_video) {
                    self._track_event("$campaign_open", {
                        $resource_type: "video"
                    });
                    self._switch_to_video();
                } else {
                    self.dismiss();
                    if (self.clickthrough) {
                        var tracking_cb = null;
                        if (self.mixpanel.get_config("inapp_link_new_window")) {
                            window.open(self.dest_url);
                        } else {
                            tracking_cb = function() {
                                window.location.href = self.dest_url;
                            };
                        }
                        self._track_event("$campaign_open", {
                            $resource_type: "link"
                        }, tracking_cb);
                    }
                }
            }));
        }));
        MixpanelNotification.prototype._get_el = function(id) {
            return document.getElementById(MixpanelNotification.MARKUP_PREFIX + "-" + id);
        };
        MixpanelNotification.prototype._get_notification_display_el = function() {
            return this._get_el(this.notif_type);
        };
        MixpanelNotification.prototype._get_shown_campaigns = function() {
            return this.persistence["props"][CAMPAIGN_IDS_KEY] || (this.persistence["props"][CAMPAIGN_IDS_KEY] = {});
        };
        MixpanelNotification.prototype._matches_event_data = _.safewrap((function(event_data) {
            var event_name = event_data["event"] || "";
            for (var i = 0; i < this.display_triggers.length; i++) {
                var display_trigger = this.display_triggers[i];
                var match_event = display_trigger["event"] || "";
                if (match_event === "$any_event" || event_name === display_trigger["event"]) {
                    if (display_trigger["selector"] && !_.isEmptyObject(display_trigger["selector"])) {
                        if (evaluateSelector(display_trigger["selector"], event_data["properties"])) {
                            return true;
                        }
                    } else {
                        return true;
                    }
                }
            }
            return false;
        }));
        MixpanelNotification.prototype._browser_lte = function(browser, version) {
            return this.browser_versions[browser] && this.browser_versions[browser] <= version;
        };
        MixpanelNotification.prototype._init_image_html = function() {
            var imgs_to_preload = [];
            if (!this.mini) {
                if (this.image_url) {
                    imgs_to_preload.push(this.image_url);
                    this.img_html = '<img id="img" src="' + this.image_url + '"/>';
                } else {
                    this.img_html = "";
                }
                if (this.thumb_image_url) {
                    imgs_to_preload.push(this.thumb_image_url);
                    this.thumb_img_html = '<div id="thumbborder-wrapper"><div id="thumbborder"></div></div>' + '<img id="thumbnail"' + ' src="' + this.thumb_image_url + '"' + ' width="' + MixpanelNotification.THUMB_IMG_SIZE + '"' + ' height="' + MixpanelNotification.THUMB_IMG_SIZE + '"' + "/>" + '<div id="thumbspacer"></div>';
                } else {
                    this.thumb_img_html = "";
                }
            } else {
                this.thumb_image_url = this.thumb_image_url || this.cdn_host + "/site_media/images/icons/notifications/mini-news-dark.png";
                imgs_to_preload.push(this.thumb_image_url);
            }
            return imgs_to_preload;
        };
        MixpanelNotification.prototype._init_notification_el = function() {
            var notification_html = "";
            var video_src = "";
            var video_html = "";
            var cancel_html = '<div id="cancel">' + '<div id="cancel-icon"></div>' + "</div>";
            this.notification_el = document.createElement("div");
            this.notification_el.id = MixpanelNotification.MARKUP_PREFIX + "-wrapper";
            if (!this.mini) {
                var close_html = this.clickthrough || this.show_video ? "" : '<div id="button-close"></div>', play_html = this.show_video ? '<div id="button-play"></div>' : "";
                if (this._browser_lte("ie", 7)) {
                    close_html = "";
                    play_html = "";
                }
                notification_html = '<div id="takeover">' + this.thumb_img_html + '<div id="mainbox">' + cancel_html + '<div id="content">' + this.img_html + '<div id="title">' + this.title + "</div>" + '<div id="body">' + this.body + "</div>" + '<div id="tagline">' + '<a href="http://mixpanel.com?from=inapp" target="_blank">POWERED BY MIXPANEL</a>' + "</div>" + "</div>" + '<div id="button">' + close_html + '<a id="button-link" href="' + this.dest_url + '">' + this.cta + "</a>" + play_html + "</div>" + "</div>" + "</div>";
            } else {
                notification_html = '<div id="mini">' + '<div id="mainbox">' + cancel_html + '<div id="mini-content">' + '<div id="mini-icon">' + '<div id="mini-icon-img"></div>' + "</div>" + '<div id="body">' + '<div id="body-text"><div>' + this.body + "</div></div>" + "</div>" + "</div>" + "</div>" + '<div id="mini-border"></div>' + "</div>";
            }
            if (this.youtube_video) {
                video_src = this.resource_protocol + "www.youtube.com/embed/" + this.youtube_video + "?wmode=transparent&showinfo=0&modestbranding=0&rel=0&autoplay=1&loop=0&vq=hd1080";
                if (this.yt_custom) {
                    video_src += "&enablejsapi=1&html5=1&controls=0";
                    video_html = '<div id="video-controls">' + '<div id="video-progress" class="video-progress-el">' + '<div id="video-progress-total" class="video-progress-el"></div>' + '<div id="video-elapsed" class="video-progress-el"></div>' + "</div>" + '<div id="video-time" class="video-progress-el"></div>' + "</div>";
                }
            } else if (this.vimeo_video) {
                video_src = this.resource_protocol + "player.vimeo.com/video/" + this.vimeo_video + "?autoplay=1&title=0&byline=0&portrait=0";
            }
            if (this.show_video) {
                this.video_iframe = '<iframe id="' + MixpanelNotification.MARKUP_PREFIX + '-video-frame" ' + 'width="' + this.video_width + '" height="' + this.video_height + '" ' + ' src="' + video_src + '"' + ' frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen="1" scrolling="no"' + "></iframe>";
                video_html = '<div id="video-' + (this.flip_animate ? "" : "no") + 'flip">' + '<div id="video">' + '<div id="video-holder"></div>' + video_html + "</div>" + "</div>";
            }
            var main_html = video_html + notification_html;
            if (this.flip_animate) {
                main_html = (this.mini ? notification_html : "") + '<div id="flipcontainer"><div id="flipper">' + (this.mini ? video_html : main_html) + "</div></div>";
            }
            this.notification_el.innerHTML = ('<div id="overlay" class="' + this.notif_type + '">' + '<div id="campaignid-' + this.campaign_id + '">' + '<div id="bgwrapper">' + '<div id="bg"></div>' + main_html + "</div>" + "</div>" + "</div>").replace(/class="/g, 'class="' + MixpanelNotification.MARKUP_PREFIX + "-").replace(/id="/g, 'id="' + MixpanelNotification.MARKUP_PREFIX + "-");
        };
        MixpanelNotification.prototype._init_styles = function() {
            if (this.style === "dark") {
                this.style_vals = {
                    bg: "#1d1f25",
                    bg_actions: "#282b32",
                    bg_hover: "#3a4147",
                    bg_light: "#4a5157",
                    border_gray: "#32353c",
                    cancel_opacity: "0.4",
                    mini_hover: "#2a3137",
                    text_title: "#fff",
                    text_main: "#9498a3",
                    text_tagline: "#464851",
                    text_hover: "#ddd"
                };
            } else {
                this.style_vals = {
                    bg: "#fff",
                    bg_actions: "#e7eaee",
                    bg_hover: "#eceff3",
                    bg_light: "#f5f5f5",
                    border_gray: "#e4ecf2",
                    cancel_opacity: "1.0",
                    mini_hover: "#fafafa",
                    text_title: "#5c6578",
                    text_main: "#8b949b",
                    text_tagline: "#ced9e6",
                    text_hover: "#7c8598"
                };
            }
            var shadow = "0px 0px 35px 0px rgba(45, 49, 56, 0.7)", video_shadow = shadow, mini_shadow = shadow, thumb_total_size = MixpanelNotification.THUMB_IMG_SIZE + MixpanelNotification.THUMB_BORDER_SIZE * 2, anim_seconds = MixpanelNotification.ANIM_TIME / 1e3 + "s";
            if (this.mini) {
                shadow = "none";
            }
            var notif_media_queries = {}, min_width = MixpanelNotification.NOTIF_WIDTH_MINI + 20;
            notif_media_queries["@media only screen and (max-width: " + (min_width - 1) + "px)"] = {
                "#overlay": {
                    display: "none"
                }
            };
            var notif_styles = {
                ".flipped": {
                    transform: "rotateY(180deg)"
                },
                "#overlay": {
                    position: "fixed",
                    top: "0",
                    left: "0",
                    width: "100%",
                    height: "100%",
                    overflow: "auto",
                    "text-align": "center",
                    "z-index": "10000",
                    "font-family": '"Helvetica", "Arial", sans-serif',
                    "-webkit-font-smoothing": "antialiased",
                    "-moz-osx-font-smoothing": "grayscale"
                },
                "#overlay.mini": {
                    height: "0",
                    overflow: "visible"
                },
                "#overlay a": {
                    width: "initial",
                    padding: "0",
                    "text-decoration": "none",
                    "text-transform": "none",
                    color: "inherit"
                },
                "#bgwrapper": {
                    position: "relative",
                    width: "100%",
                    height: "100%"
                },
                "#bg": {
                    position: "fixed",
                    top: "0",
                    left: "0",
                    width: "100%",
                    height: "100%",
                    "min-width": this.doc_width * 4 + "px",
                    "min-height": this.doc_height * 4 + "px",
                    "background-color": "black",
                    opacity: "0.0",
                    "-ms-filter": "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)",
                    filter: "alpha(opacity=60)",
                    transition: "opacity " + anim_seconds
                },
                "#bg.visible": {
                    opacity: MixpanelNotification.BG_OPACITY
                },
                ".mini #bg": {
                    width: "0",
                    height: "0",
                    "min-width": "0"
                },
                "#flipcontainer": {
                    perspective: "1000px",
                    position: "absolute",
                    width: "100%"
                },
                "#flipper": {
                    position: "relative",
                    "transform-style": "preserve-3d",
                    transition: "0.3s"
                },
                "#takeover": {
                    position: "absolute",
                    left: "50%",
                    width: MixpanelNotification.NOTIF_WIDTH + "px",
                    "margin-left": Math.round(-MixpanelNotification.NOTIF_WIDTH / 2) + "px",
                    "backface-visibility": "hidden",
                    transform: "rotateY(0deg)",
                    opacity: "0.0",
                    top: MixpanelNotification.NOTIF_START_TOP + "px",
                    transition: "opacity " + anim_seconds + ", top " + anim_seconds
                },
                "#takeover.visible": {
                    opacity: "1.0",
                    top: MixpanelNotification.NOTIF_TOP + "px"
                },
                "#takeover.exiting": {
                    opacity: "0.0",
                    top: MixpanelNotification.NOTIF_START_TOP + "px"
                },
                "#thumbspacer": {
                    height: MixpanelNotification.THUMB_OFFSET + "px"
                },
                "#thumbborder-wrapper": {
                    position: "absolute",
                    top: -MixpanelNotification.THUMB_BORDER_SIZE + "px",
                    left: MixpanelNotification.NOTIF_WIDTH / 2 - MixpanelNotification.THUMB_OFFSET - MixpanelNotification.THUMB_BORDER_SIZE + "px",
                    width: thumb_total_size + "px",
                    height: thumb_total_size / 2 + "px",
                    overflow: "hidden"
                },
                "#thumbborder": {
                    position: "absolute",
                    width: thumb_total_size + "px",
                    height: thumb_total_size + "px",
                    "border-radius": thumb_total_size + "px",
                    "background-color": this.style_vals.bg_actions,
                    opacity: "0.5"
                },
                "#thumbnail": {
                    position: "absolute",
                    top: "0px",
                    left: MixpanelNotification.NOTIF_WIDTH / 2 - MixpanelNotification.THUMB_OFFSET + "px",
                    width: MixpanelNotification.THUMB_IMG_SIZE + "px",
                    height: MixpanelNotification.THUMB_IMG_SIZE + "px",
                    overflow: "hidden",
                    "z-index": "100",
                    "border-radius": MixpanelNotification.THUMB_IMG_SIZE + "px"
                },
                "#mini": {
                    position: "absolute",
                    right: "20px",
                    top: MixpanelNotification.NOTIF_TOP + "px",
                    width: this.notif_width + "px",
                    height: MixpanelNotification.NOTIF_HEIGHT_MINI * 2 + "px",
                    "margin-top": 20 - MixpanelNotification.NOTIF_HEIGHT_MINI + "px",
                    "backface-visibility": "hidden",
                    opacity: "0.0",
                    transform: "rotateX(90deg)",
                    transition: "opacity 0.3s, transform 0.3s, right 0.3s"
                },
                "#mini.visible": {
                    opacity: "1.0",
                    transform: "rotateX(0deg)"
                },
                "#mini.exiting": {
                    opacity: "0.0",
                    right: "-150px"
                },
                "#mainbox": {
                    "border-radius": "4px",
                    "box-shadow": shadow,
                    "text-align": "center",
                    "background-color": this.style_vals.bg,
                    "font-size": "14px",
                    color: this.style_vals.text_main
                },
                "#mini #mainbox": {
                    height: MixpanelNotification.NOTIF_HEIGHT_MINI + "px",
                    "margin-top": MixpanelNotification.NOTIF_HEIGHT_MINI + "px",
                    "border-radius": "3px",
                    transition: "background-color " + anim_seconds
                },
                "#mini-border": {
                    height: MixpanelNotification.NOTIF_HEIGHT_MINI + 6 + "px",
                    width: MixpanelNotification.NOTIF_WIDTH_MINI + 6 + "px",
                    position: "absolute",
                    top: "-3px",
                    left: "-3px",
                    "margin-top": MixpanelNotification.NOTIF_HEIGHT_MINI + "px",
                    "border-radius": "6px",
                    opacity: "0.25",
                    "background-color": "#fff",
                    "z-index": "-1",
                    "box-shadow": mini_shadow
                },
                "#mini-icon": {
                    position: "relative",
                    display: "inline-block",
                    width: "75px",
                    height: MixpanelNotification.NOTIF_HEIGHT_MINI + "px",
                    "border-radius": "3px 0 0 3px",
                    "background-color": this.style_vals.bg_actions,
                    background: "linear-gradient(135deg, " + this.style_vals.bg_light + " 0%, " + this.style_vals.bg_actions + " 100%)",
                    transition: "background-color " + anim_seconds
                },
                "#mini:hover #mini-icon": {
                    "background-color": this.style_vals.mini_hover
                },
                "#mini:hover #mainbox": {
                    "background-color": this.style_vals.mini_hover
                },
                "#mini-icon-img": {
                    position: "absolute",
                    "background-image": "url(" + this.thumb_image_url + ")",
                    width: "48px",
                    height: "48px",
                    top: "20px",
                    left: "12px"
                },
                "#content": {
                    padding: "30px 20px 0px 20px"
                },
                "#mini-content": {
                    "text-align": "left",
                    height: MixpanelNotification.NOTIF_HEIGHT_MINI + "px",
                    cursor: "pointer"
                },
                "#img": {
                    width: "328px",
                    "margin-top": "30px",
                    "border-radius": "5px"
                },
                "#title": {
                    "max-height": "600px",
                    overflow: "hidden",
                    "word-wrap": "break-word",
                    padding: "25px 0px 20px 0px",
                    "font-size": "19px",
                    "font-weight": "bold",
                    color: this.style_vals.text_title
                },
                "#body": {
                    "max-height": "600px",
                    "margin-bottom": "25px",
                    overflow: "hidden",
                    "word-wrap": "break-word",
                    "line-height": "21px",
                    "font-size": "15px",
                    "font-weight": "normal",
                    "text-align": "left"
                },
                "#mini #body": {
                    display: "inline-block",
                    "max-width": "250px",
                    margin: "0 0 0 30px",
                    height: MixpanelNotification.NOTIF_HEIGHT_MINI + "px",
                    "font-size": "16px",
                    "letter-spacing": "0.8px",
                    color: this.style_vals.text_title
                },
                "#mini #body-text": {
                    display: "table",
                    height: MixpanelNotification.NOTIF_HEIGHT_MINI + "px"
                },
                "#mini #body-text div": {
                    display: "table-cell",
                    "vertical-align": "middle"
                },
                "#tagline": {
                    "margin-bottom": "15px",
                    "font-size": "10px",
                    "font-weight": "600",
                    "letter-spacing": "0.8px",
                    color: "#ccd7e0",
                    "text-align": "left"
                },
                "#tagline a": {
                    color: this.style_vals.text_tagline,
                    transition: "color " + anim_seconds
                },
                "#tagline a:hover": {
                    color: this.style_vals.text_hover
                },
                "#cancel": {
                    position: "absolute",
                    right: "0",
                    width: "8px",
                    height: "8px",
                    padding: "10px",
                    "border-radius": "20px",
                    margin: "12px 12px 0 0",
                    "box-sizing": "content-box",
                    cursor: "pointer",
                    transition: "background-color " + anim_seconds
                },
                "#mini #cancel": {
                    margin: "7px 7px 0 0"
                },
                "#cancel-icon": {
                    width: "8px",
                    height: "8px",
                    overflow: "hidden",
                    "background-image": "url(" + this.cdn_host + "/site_media/images/icons/notifications/cancel-x.png)",
                    opacity: this.style_vals.cancel_opacity
                },
                "#cancel:hover": {
                    "background-color": this.style_vals.bg_hover
                },
                "#button": {
                    display: "block",
                    height: "60px",
                    "line-height": "60px",
                    "text-align": "center",
                    "background-color": this.style_vals.bg_actions,
                    "border-radius": "0 0 4px 4px",
                    overflow: "hidden",
                    cursor: "pointer",
                    transition: "background-color " + anim_seconds
                },
                "#button-close": {
                    display: "inline-block",
                    width: "9px",
                    height: "60px",
                    "margin-right": "8px",
                    "vertical-align": "top",
                    "background-image": "url(" + this.cdn_host + "/site_media/images/icons/notifications/close-x-" + this.style + ".png)",
                    "background-repeat": "no-repeat",
                    "background-position": "0px 25px"
                },
                "#button-play": {
                    display: "inline-block",
                    width: "30px",
                    height: "60px",
                    "margin-left": "15px",
                    "background-image": "url(" + this.cdn_host + "/site_media/images/icons/notifications/play-" + this.style + "-small.png)",
                    "background-repeat": "no-repeat",
                    "background-position": "0px 15px"
                },
                "a#button-link": {
                    display: "inline-block",
                    "vertical-align": "top",
                    "text-align": "center",
                    "font-size": "17px",
                    "font-weight": "bold",
                    overflow: "hidden",
                    "word-wrap": "break-word",
                    color: this.style_vals.text_title,
                    transition: "color " + anim_seconds
                },
                "#button:hover": {
                    "background-color": this.style_vals.bg_hover,
                    color: this.style_vals.text_hover
                },
                "#button:hover a": {
                    color: this.style_vals.text_hover
                },
                "#video-noflip": {
                    position: "relative",
                    top: -this.video_height * 2 + "px"
                },
                "#video-flip": {
                    "backface-visibility": "hidden",
                    transform: "rotateY(180deg)"
                },
                "#video": {
                    position: "absolute",
                    width: this.video_width - 1 + "px",
                    height: this.video_height + "px",
                    top: MixpanelNotification.NOTIF_TOP + "px",
                    "margin-top": "100px",
                    left: "50%",
                    "margin-left": Math.round(-this.video_width / 2) + "px",
                    overflow: "hidden",
                    "border-radius": "5px",
                    "box-shadow": video_shadow,
                    transform: "translateZ(1px)",
                    transition: "opacity " + anim_seconds + ", top " + anim_seconds
                },
                "#video.exiting": {
                    opacity: "0.0",
                    top: this.video_height + "px"
                },
                "#video-holder": {
                    position: "absolute",
                    width: this.video_width - 1 + "px",
                    height: this.video_height + "px",
                    overflow: "hidden",
                    "border-radius": "5px"
                },
                "#video-frame": {
                    "margin-left": "-1px",
                    width: this.video_width + "px"
                },
                "#video-controls": {
                    opacity: "0",
                    transition: "opacity 0.5s"
                },
                "#video:hover #video-controls": {
                    opacity: "1.0"
                },
                "#video .video-progress-el": {
                    position: "absolute",
                    bottom: "0",
                    height: "25px",
                    "border-radius": "0 0 0 5px"
                },
                "#video-progress": {
                    width: "90%"
                },
                "#video-progress-total": {
                    width: "100%",
                    "background-color": this.style_vals.bg,
                    opacity: "0.7"
                },
                "#video-elapsed": {
                    width: "0",
                    "background-color": "#6cb6f5",
                    opacity: "0.9"
                },
                "#video #video-time": {
                    width: "10%",
                    right: "0",
                    "font-size": "11px",
                    "line-height": "25px",
                    color: this.style_vals.text_main,
                    "background-color": "#666",
                    "border-radius": "0 0 5px 0"
                }
            };
            if (this._browser_lte("ie", 8)) {
                _.extend(notif_styles, {
                    "* html #overlay": {
                        position: "absolute"
                    },
                    "* html #bg": {
                        position: "absolute"
                    },
                    "html, body": {
                        height: "100%"
                    }
                });
            }
            if (this._browser_lte("ie", 7)) {
                _.extend(notif_styles, {
                    "#mini #body": {
                        display: "inline",
                        zoom: "1",
                        border: "1px solid " + this.style_vals.bg_hover
                    },
                    "#mini #body-text": {
                        padding: "20px"
                    },
                    "#mini #mini-icon": {
                        display: "none"
                    }
                });
            }
            var VENDOR_STYLES = [ "backface-visibility", "border-radius", "box-shadow", "opacity", "perspective", "transform", "transform-style", "transition" ], VENDOR_PREFIXES = [ "khtml", "moz", "ms", "o", "webkit" ];
            for (var selector in notif_styles) {
                for (var si = 0; si < VENDOR_STYLES.length; si++) {
                    var prop = VENDOR_STYLES[si];
                    if (prop in notif_styles[selector]) {
                        var val = notif_styles[selector][prop];
                        for (var pi = 0; pi < VENDOR_PREFIXES.length; pi++) {
                            notif_styles[selector]["-" + VENDOR_PREFIXES[pi] + "-" + prop] = val;
                        }
                    }
                }
            }
            var inject_styles = function(styles, media_queries) {
                var create_style_text = function(style_defs) {
                    var st = "";
                    for (var selector in style_defs) {
                        var mp_selector = selector.replace(/#/g, "#" + MixpanelNotification.MARKUP_PREFIX + "-").replace(/\./g, "." + MixpanelNotification.MARKUP_PREFIX + "-");
                        st += "\n" + mp_selector + " {";
                        var props = style_defs[selector];
                        for (var k in props) {
                            st += k + ":" + props[k] + ";";
                        }
                        st += "}";
                    }
                    return st;
                };
                var create_media_query_text = function(mq_defs) {
                    var mqt = "";
                    for (var mq in mq_defs) {
                        mqt += "\n" + mq + " {" + create_style_text(mq_defs[mq]) + "\n}";
                    }
                    return mqt;
                };
                var style_text = create_style_text(styles) + create_media_query_text(media_queries), head_el = document.head || document.getElementsByTagName("head")[0] || document.documentElement, style_el = document.createElement("style");
                head_el.appendChild(style_el);
                style_el.setAttribute("type", "text/css");
                if (style_el.styleSheet) {
                    style_el.styleSheet.cssText = style_text;
                } else {
                    style_el.textContent = style_text;
                }
            };
            inject_styles(notif_styles, notif_media_queries);
        };
        MixpanelNotification.prototype._init_video = _.safewrap((function() {
            if (!this.video_url) {
                return;
            }
            var self = this;
            self.yt_custom = "postMessage" in window;
            self.dest_url = self.video_url;
            var youtube_match = self.video_url.match(/(?:youtube(?:-nocookie)?\.com\/(?:[^/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?/ ]{11})/i), vimeo_match = self.video_url.match(/vimeo\.com\/.*?(\d+)/i);
            if (youtube_match) {
                self.show_video = true;
                self.youtube_video = youtube_match[1];
                if (self.yt_custom) {
                    window["onYouTubeIframeAPIReady"] = function() {
                        if (self._get_el("video-frame")) {
                            self._yt_video_ready();
                        }
                    };
                    var tag = document.createElement("script");
                    tag.src = self.resource_protocol + "www.youtube.com/iframe_api";
                    var firstScriptTag = document.getElementsByTagName("script")[0];
                    firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
                }
            } else if (vimeo_match) {
                self.show_video = true;
                self.vimeo_video = vimeo_match[1];
            }
            if (self._browser_lte("ie", 7) || self._browser_lte("firefox", 3)) {
                self.show_video = false;
                self.clickthrough = true;
            }
        }));
        MixpanelNotification.prototype._mark_as_shown = _.safewrap((function() {
            var self = this;
            _.register_event(self._get_el("bg"), "click", (function() {
                self.dismiss();
            }));
            var get_style = function(el, style_name) {
                var styles = {};
                if (document.defaultView && document.defaultView.getComputedStyle) {
                    styles = document.defaultView.getComputedStyle(el, null);
                } else if (el.currentStyle) {
                    styles = el.currentStyle;
                }
                return styles[style_name];
            };
            if (this.campaign_id) {
                var notif_el = this._get_el("overlay");
                if (notif_el && get_style(notif_el, "visibility") !== "hidden" && get_style(notif_el, "display") !== "none") {
                    this._mark_delivery();
                }
            }
        }));
        MixpanelNotification.prototype._mark_delivery = _.safewrap((function(extra_props) {
            if (!this.marked_as_shown) {
                this.marked_as_shown = true;
                if (this.campaign_id) {
                    this._get_shown_campaigns()[this.campaign_id] = 1 * new Date;
                    this.persistence.save();
                }
                this._track_event("$campaign_delivery", extra_props);
                this.mixpanel["people"]["append"]({
                    $campaigns: this.campaign_id,
                    $notifications: {
                        campaign_id: this.campaign_id,
                        message_id: this.message_id,
                        type: "web",
                        time: new Date
                    }
                });
            }
        }));
        MixpanelNotification.prototype._preload_images = function(all_loaded_cb) {
            var self = this;
            if (this.imgs_to_preload.length === 0) {
                all_loaded_cb();
                return;
            }
            var preloaded_imgs = 0;
            var img_objs = [];
            var onload = function() {
                preloaded_imgs++;
                if (preloaded_imgs === self.imgs_to_preload.length && all_loaded_cb) {
                    all_loaded_cb();
                    all_loaded_cb = null;
                }
            };
            for (var i = 0; i < this.imgs_to_preload.length; i++) {
                var img = new Image;
                img.onload = onload;
                img.src = this.imgs_to_preload[i];
                if (img.complete) {
                    onload();
                }
                img_objs.push(img);
            }
            if (this._browser_lte("ie", 7)) {
                setTimeout((function() {
                    var imgs_loaded = true;
                    for (i = 0; i < img_objs.length; i++) {
                        if (!img_objs[i].complete) {
                            imgs_loaded = false;
                        }
                    }
                    if (imgs_loaded && all_loaded_cb) {
                        all_loaded_cb();
                        all_loaded_cb = null;
                    }
                }), 500);
            }
        };
        MixpanelNotification.prototype._remove_notification_el = _.safewrap((function() {
            window.clearInterval(this._video_progress_checker);
            this.notification_el.style.visibility = "hidden";
            this.body_el.removeChild(this.notification_el);
        }));
        MixpanelNotification.prototype._set_client_config = function() {
            var get_browser_version = function(browser_ex) {
                var match = navigator.userAgent.match(browser_ex);
                return match && match[1];
            };
            this.browser_versions = {};
            this.browser_versions["chrome"] = get_browser_version(/Chrome\/(\d+)/);
            this.browser_versions["firefox"] = get_browser_version(/Firefox\/(\d+)/);
            this.browser_versions["ie"] = get_browser_version(/MSIE (\d+).+/);
            if (!this.browser_versions["ie"] && !window.ActiveXObject && "ActiveXObject" in window) {
                this.browser_versions["ie"] = 11;
            }
            this.body_el = document.body || document.getElementsByTagName("body")[0];
            if (this.body_el) {
                this.doc_width = Math.max(this.body_el.scrollWidth, document.documentElement.scrollWidth, this.body_el.offsetWidth, document.documentElement.offsetWidth, this.body_el.clientWidth, document.documentElement.clientWidth);
                this.doc_height = Math.max(this.body_el.scrollHeight, document.documentElement.scrollHeight, this.body_el.offsetHeight, document.documentElement.offsetHeight, this.body_el.clientHeight, document.documentElement.clientHeight);
            }
            var ie_ver = this.browser_versions["ie"];
            var sample_styles = document.createElement("div").style, is_css_compatible = function(rule) {
                if (rule in sample_styles) {
                    return true;
                }
                if (!ie_ver) {
                    rule = rule[0].toUpperCase() + rule.slice(1);
                    var props = [ "O" + rule, "Webkit" + rule, "Moz" + rule ];
                    for (var i = 0; i < props.length; i++) {
                        if (props[i] in sample_styles) {
                            return true;
                        }
                    }
                }
                return false;
            };
            this.use_transitions = this.body_el && is_css_compatible("transition") && is_css_compatible("transform");
            this.flip_animate = (this.browser_versions["chrome"] >= 33 || this.browser_versions["firefox"] >= 15) && this.body_el && is_css_compatible("backfaceVisibility") && is_css_compatible("perspective") && is_css_compatible("transform");
        };
        MixpanelNotification.prototype._switch_to_video = _.safewrap((function() {
            var self = this, anims = [ {
                el: self._get_notification_display_el(),
                attr: "opacity",
                start: 1,
                goal: 0
            }, {
                el: self._get_notification_display_el(),
                attr: "top",
                start: MixpanelNotification.NOTIF_TOP,
                goal: -500
            }, {
                el: self._get_el("video-noflip"),
                attr: "opacity",
                start: 0,
                goal: 1
            }, {
                el: self._get_el("video-noflip"),
                attr: "top",
                start: -self.video_height * 2,
                goal: 0
            } ];
            if (self.mini) {
                var bg = self._get_el("bg"), overlay = self._get_el("overlay");
                bg.style.width = "100%";
                bg.style.height = "100%";
                overlay.style.width = "100%";
                self._add_class(self._get_notification_display_el(), "exiting");
                self._add_class(bg, "visible");
                anims.push({
                    el: self._get_el("bg"),
                    attr: "opacity",
                    start: 0,
                    goal: MixpanelNotification.BG_OPACITY
                });
            }
            var video_el = self._get_el("video-holder");
            video_el.innerHTML = self.video_iframe;
            var video_ready = function() {
                if (window["YT"] && window["YT"]["loaded"]) {
                    self._yt_video_ready();
                }
                self.showing_video = true;
                self._get_notification_display_el().style.visibility = "hidden";
            };
            if (self.flip_animate) {
                self._add_class("flipper", "flipped");
                setTimeout(video_ready, MixpanelNotification.ANIM_TIME);
            } else {
                self._animate_els(anims, MixpanelNotification.ANIM_TIME, video_ready);
            }
        }));
        MixpanelNotification.prototype._track_event = function(event_name, properties, cb) {
            if (this.campaign_id) {
                properties = properties || {};
                properties = _.extend(properties, {
                    campaign_id: this.campaign_id,
                    message_id: this.message_id,
                    message_type: "web_inapp",
                    message_subtype: this.notif_type
                });
                this.mixpanel["track"](event_name, properties, cb);
            } else if (cb) {
                cb.call();
            }
        };
        MixpanelNotification.prototype._yt_video_ready = _.safewrap((function() {
            var self = this;
            if (self.video_inited) {
                return;
            }
            self.video_inited = true;
            var progress_bar = self._get_el("video-elapsed"), progress_time = self._get_el("video-time"), progress_el = self._get_el("video-progress");
            new window["YT"]["Player"](MixpanelNotification.MARKUP_PREFIX + "-video-frame", {
                events: {
                    onReady: function(event) {
                        var ytplayer = event["target"], video_duration = ytplayer["getDuration"](), pad = function(i) {
                            return ("00" + i).slice(-2);
                        }, update_video_time = function(current_time) {
                            var secs = Math.round(video_duration - current_time), mins = Math.floor(secs / 60), hours = Math.floor(mins / 60);
                            secs -= mins * 60;
                            mins -= hours * 60;
                            progress_time.innerHTML = "-" + (hours ? hours + ":" : "") + pad(mins) + ":" + pad(secs);
                        };
                        update_video_time(0);
                        self._video_progress_checker = window.setInterval((function() {
                            var current_time = ytplayer["getCurrentTime"]();
                            progress_bar.style.width = current_time / video_duration * 100 + "%";
                            update_video_time(current_time);
                        }), 250);
                        _.register_event(progress_el, "click", (function(e) {
                            var clickx = Math.max(0, e.pageX - progress_el.getBoundingClientRect().left);
                            ytplayer["seekTo"](video_duration * clickx / progress_el.clientWidth, true);
                        }));
                    }
                }
            });
        }));
        var MixpanelPeople = function() {};
        _.extend(MixpanelPeople.prototype, apiActions);
        MixpanelPeople.prototype._init = function(mixpanel_instance) {
            this._mixpanel = mixpanel_instance;
        };
        MixpanelPeople.prototype.set = addOptOutCheckMixpanelPeople((function(prop, to, callback) {
            var data = this.set_action(prop, to);
            if (_.isObject(prop)) {
                callback = to;
            }
            if (this._get_config("save_referrer")) {
                this._mixpanel["persistence"].update_referrer_info(document.referrer);
            }
            data[SET_ACTION] = _.extend({}, _.info.people_properties(), this._mixpanel["persistence"].get_referrer_info(), data[SET_ACTION]);
            return this._send_request(data, callback);
        }));
        MixpanelPeople.prototype.set_once = addOptOutCheckMixpanelPeople((function(prop, to, callback) {
            var data = this.set_once_action(prop, to);
            if (_.isObject(prop)) {
                callback = to;
            }
            return this._send_request(data, callback);
        }));
        MixpanelPeople.prototype.unset = addOptOutCheckMixpanelPeople((function(prop, callback) {
            var data = this.unset_action(prop);
            return this._send_request(data, callback);
        }));
        MixpanelPeople.prototype.increment = addOptOutCheckMixpanelPeople((function(prop, by, callback) {
            var data = {};
            var $add = {};
            if (_.isObject(prop)) {
                _.each(prop, (function(v, k) {
                    if (!this._is_reserved_property(k)) {
                        if (isNaN(parseFloat(v))) {
                            console$1.error("Invalid increment value passed to mixpanel.people.increment - must be a number");
                            return;
                        } else {
                            $add[k] = v;
                        }
                    }
                }), this);
                callback = by;
            } else {
                if (_.isUndefined(by)) {
                    by = 1;
                }
                $add[prop] = by;
            }
            data[ADD_ACTION] = $add;
            return this._send_request(data, callback);
        }));
        MixpanelPeople.prototype.append = addOptOutCheckMixpanelPeople((function(list_name, value, callback) {
            if (_.isObject(list_name)) {
                callback = value;
            }
            var data = this.append_action(list_name, value);
            return this._send_request(data, callback);
        }));
        MixpanelPeople.prototype.remove = addOptOutCheckMixpanelPeople((function(list_name, value, callback) {
            if (_.isObject(list_name)) {
                callback = value;
            }
            var data = this.remove_action(list_name, value);
            return this._send_request(data, callback);
        }));
        MixpanelPeople.prototype.union = addOptOutCheckMixpanelPeople((function(list_name, values, callback) {
            if (_.isObject(list_name)) {
                callback = values;
            }
            var data = this.union_action(list_name, values);
            return this._send_request(data, callback);
        }));
        MixpanelPeople.prototype.track_charge = addOptOutCheckMixpanelPeople((function(amount, properties, callback) {
            if (!_.isNumber(amount)) {
                amount = parseFloat(amount);
                if (isNaN(amount)) {
                    console$1.error("Invalid value passed to mixpanel.people.track_charge - must be a number");
                    return;
                }
            }
            return this.append("$transactions", _.extend({
                $amount: amount
            }, properties), callback);
        }));
        MixpanelPeople.prototype.clear_charges = function(callback) {
            return this.set("$transactions", [], callback);
        };
        MixpanelPeople.prototype.delete_user = function() {
            if (!this._identify_called()) {
                console$1.error("mixpanel.people.delete_user() requires you to call identify() first");
                return;
            }
            var data = {
                $delete: this._mixpanel.get_distinct_id()
            };
            return this._send_request(data);
        };
        MixpanelPeople.prototype.toString = function() {
            return this._mixpanel.toString() + ".people";
        };
        MixpanelPeople.prototype._send_request = function(data, callback) {
            data["$token"] = this._get_config("token");
            data["$distinct_id"] = this._mixpanel.get_distinct_id();
            var device_id = this._mixpanel.get_property("$device_id");
            var user_id = this._mixpanel.get_property("$user_id");
            var had_persisted_distinct_id = this._mixpanel.get_property("$had_persisted_distinct_id");
            if (device_id) {
                data["$device_id"] = device_id;
            }
            if (user_id) {
                data["$user_id"] = user_id;
            }
            if (had_persisted_distinct_id) {
                data["$had_persisted_distinct_id"] = had_persisted_distinct_id;
            }
            var date_encoded_data = _.encodeDates(data);
            var truncated_data = _.truncate(date_encoded_data, 255);
            var json_data = _.JSONEncode(date_encoded_data);
            var encoded_data = _.base64Encode(json_data);
            if (!this._identify_called()) {
                this._enqueue(data);
                if (!_.isUndefined(callback)) {
                    if (this._get_config("verbose")) {
                        callback({
                            status: -1,
                            error: null
                        });
                    } else {
                        callback(-1);
                    }
                }
                return truncated_data;
            }
            console$1.log("MIXPANEL PEOPLE REQUEST:");
            console$1.log(truncated_data);
            this._mixpanel._send_request(this._get_config("api_host") + "/engage/", {
                data: encoded_data
            }, this._mixpanel._prepare_callback(callback, truncated_data));
            return truncated_data;
        };
        MixpanelPeople.prototype._get_config = function(conf_var) {
            return this._mixpanel.get_config(conf_var);
        };
        MixpanelPeople.prototype._identify_called = function() {
            return this._mixpanel._flags.identify_called === true;
        };
        MixpanelPeople.prototype._enqueue = function(data) {
            if (SET_ACTION in data) {
                this._mixpanel["persistence"]._add_to_people_queue(SET_ACTION, data);
            } else if (SET_ONCE_ACTION in data) {
                this._mixpanel["persistence"]._add_to_people_queue(SET_ONCE_ACTION, data);
            } else if (UNSET_ACTION in data) {
                this._mixpanel["persistence"]._add_to_people_queue(UNSET_ACTION, data);
            } else if (ADD_ACTION in data) {
                this._mixpanel["persistence"]._add_to_people_queue(ADD_ACTION, data);
            } else if (APPEND_ACTION in data) {
                this._mixpanel["persistence"]._add_to_people_queue(APPEND_ACTION, data);
            } else if (REMOVE_ACTION in data) {
                this._mixpanel["persistence"]._add_to_people_queue(REMOVE_ACTION, data);
            } else if (UNION_ACTION in data) {
                this._mixpanel["persistence"]._add_to_people_queue(UNION_ACTION, data);
            } else {
                console$1.error("Invalid call to _enqueue():", data);
            }
        };
        MixpanelPeople.prototype._flush_one_queue = function(action, action_method, callback, queue_to_params_fn) {
            var _this = this;
            var queued_data = _.extend({}, this._mixpanel["persistence"]._get_queue(action));
            var action_params = queued_data;
            if (!_.isUndefined(queued_data) && _.isObject(queued_data) && !_.isEmptyObject(queued_data)) {
                _this._mixpanel["persistence"]._pop_from_people_queue(action, queued_data);
                if (queue_to_params_fn) {
                    action_params = queue_to_params_fn(queued_data);
                }
                action_method.call(_this, action_params, (function(response, data) {
                    if (response === 0) {
                        _this._mixpanel["persistence"]._add_to_people_queue(action, queued_data);
                    }
                    if (!_.isUndefined(callback)) {
                        callback(response, data);
                    }
                }));
            }
        };
        MixpanelPeople.prototype._flush = function(_set_callback, _add_callback, _append_callback, _set_once_callback, _union_callback, _unset_callback, _remove_callback) {
            var _this = this;
            var $append_queue = this._mixpanel["persistence"]._get_queue(APPEND_ACTION);
            var $remove_queue = this._mixpanel["persistence"]._get_queue(REMOVE_ACTION);
            this._flush_one_queue(SET_ACTION, this.set, _set_callback);
            this._flush_one_queue(SET_ONCE_ACTION, this.set_once, _set_once_callback);
            this._flush_one_queue(UNSET_ACTION, this.unset, _unset_callback, (function(queue) {
                return _.keys(queue);
            }));
            this._flush_one_queue(ADD_ACTION, this.increment, _add_callback);
            this._flush_one_queue(UNION_ACTION, this.union, _union_callback);
            if (!_.isUndefined($append_queue) && _.isArray($append_queue) && $append_queue.length) {
                var $append_item;
                var append_callback = function(response, data) {
                    if (response === 0) {
                        _this._mixpanel["persistence"]._add_to_people_queue(APPEND_ACTION, $append_item);
                    }
                    if (!_.isUndefined(_append_callback)) {
                        _append_callback(response, data);
                    }
                };
                for (var i = $append_queue.length - 1; i >= 0; i--) {
                    $append_item = $append_queue.pop();
                    if (!_.isEmptyObject($append_item)) {
                        _this.append($append_item, append_callback);
                    }
                }
                _this._mixpanel["persistence"].save();
            }
            if (!_.isUndefined($remove_queue) && _.isArray($remove_queue) && $remove_queue.length) {
                var $remove_item;
                var remove_callback = function(response, data) {
                    if (response === 0) {
                        _this._mixpanel["persistence"]._add_to_people_queue(REMOVE_ACTION, $remove_item);
                    }
                    if (!_.isUndefined(_remove_callback)) {
                        _remove_callback(response, data);
                    }
                };
                for (var j = $remove_queue.length - 1; j >= 0; j--) {
                    $remove_item = $remove_queue.pop();
                    if (!_.isEmptyObject($remove_item)) {
                        _this.remove($remove_item, remove_callback);
                    }
                }
                _this._mixpanel["persistence"].save();
            }
        };
        MixpanelPeople.prototype._is_reserved_property = function(prop) {
            return prop === "$distinct_id" || prop === "$token" || prop === "$device_id" || prop === "$user_id" || prop === "$had_persisted_distinct_id";
        };
        MixpanelPeople.prototype["set"] = MixpanelPeople.prototype.set;
        MixpanelPeople.prototype["set_once"] = MixpanelPeople.prototype.set_once;
        MixpanelPeople.prototype["unset"] = MixpanelPeople.prototype.unset;
        MixpanelPeople.prototype["increment"] = MixpanelPeople.prototype.increment;
        MixpanelPeople.prototype["append"] = MixpanelPeople.prototype.append;
        MixpanelPeople.prototype["remove"] = MixpanelPeople.prototype.remove;
        MixpanelPeople.prototype["union"] = MixpanelPeople.prototype.union;
        MixpanelPeople.prototype["track_charge"] = MixpanelPeople.prototype.track_charge;
        MixpanelPeople.prototype["clear_charges"] = MixpanelPeople.prototype.clear_charges;
        MixpanelPeople.prototype["delete_user"] = MixpanelPeople.prototype.delete_user;
        MixpanelPeople.prototype["toString"] = MixpanelPeople.prototype.toString;
        var init_type;
        var mixpanel_master;
        var INIT_MODULE = 0;
        var INIT_SNIPPET = 1;
        var PRIMARY_INSTANCE_NAME = "mixpanel";
        var USE_XHR = window$1.XMLHttpRequest && "withCredentials" in new XMLHttpRequest;
        var ENQUEUE_REQUESTS = !USE_XHR && userAgent.indexOf("MSIE") === -1 && userAgent.indexOf("Mozilla") === -1;
        var DEFAULT_CONFIG = {
            api_host: "https://api.mixpanel.com",
            app_host: "https://mixpanel.com",
            autotrack: true,
            cdn: "https://cdn.mxpnl.com",
            cross_subdomain_cookie: true,
            persistence: "cookie",
            persistence_name: "",
            cookie_name: "",
            loaded: function() {},
            store_google: true,
            save_referrer: true,
            test: false,
            verbose: false,
            img: false,
            track_pageview: true,
            debug: false,
            track_links_timeout: 300,
            cookie_expiration: 365,
            upgrade: false,
            disable_persistence: false,
            disable_cookie: false,
            secure_cookie: false,
            ip: true,
            opt_out_tracking_by_default: false,
            opt_out_persistence_by_default: false,
            opt_out_tracking_persistence_type: "localStorage",
            opt_out_tracking_cookie_prefix: null,
            property_blacklist: [],
            xhr_headers: {},
            inapp_protocol: "//",
            inapp_link_new_window: false
        };
        var DOM_LOADED = false;
        var MixpanelLib = function() {};
        var create_mplib = function(token, config, name) {
            var instance, target = name === PRIMARY_INSTANCE_NAME ? mixpanel_master : mixpanel_master[name];
            if (target && init_type === INIT_MODULE) {
                instance = target;
            } else {
                if (target && !_.isArray(target)) {
                    console$1.error("You have already initialized " + name);
                    return;
                }
                instance = new MixpanelLib;
            }
            instance._init(token, config, name);
            instance["people"] = new MixpanelPeople;
            instance["people"]._init(instance);
            instance._cached_groups = {};
            instance._user_decide_check_complete = false;
            instance._events_tracked_before_user_decide_check_complete = [];
            Config.DEBUG = Config.DEBUG || instance.get_config("debug");
            instance["__autotrack_enabled"] = instance.get_config("autotrack");
            if (instance.get_config("autotrack")) {
                var num_buckets = 100;
                var num_enabled_buckets = 100;
                if (!autotrack.enabledForProject(instance.get_config("token"), num_buckets, num_enabled_buckets)) {
                    instance["__autotrack_enabled"] = false;
                    console$1.log("Not in active bucket: disabling Automatic Event Collection.");
                } else if (!autotrack.isBrowserSupported()) {
                    instance["__autotrack_enabled"] = false;
                    console$1.log("Disabling Automatic Event Collection because this browser is not supported");
                } else {
                    autotrack.init(instance);
                }
            }
            if (!_.isUndefined(target) && _.isArray(target)) {
                instance._execute_array.call(instance["people"], target["people"]);
                instance._execute_array(target);
            }
            return instance;
        };
        MixpanelLib.prototype.init = function(token, config, name) {
            if (_.isUndefined(name)) {
                console$1.error("You must name your new library: init(token, config, name)");
                return;
            }
            if (name === PRIMARY_INSTANCE_NAME) {
                console$1.error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");
                return;
            }
            var instance = create_mplib(token, config, name);
            mixpanel_master[name] = instance;
            instance._loaded();
            return instance;
        };
        MixpanelLib.prototype._init = function(token, config, name) {
            this["__loaded"] = true;
            this["config"] = {};
            this["_triggered_notifs"] = [];
            this.set_config(_.extend({}, DEFAULT_CONFIG, config, {
                name,
                token,
                callback_fn: (name === PRIMARY_INSTANCE_NAME ? name : PRIMARY_INSTANCE_NAME + "." + name) + "._jsc"
            }));
            this["_jsc"] = function() {};
            this.__dom_loaded_queue = [];
            this.__request_queue = [];
            this.__disabled_events = [];
            this._flags = {
                disable_all_events: false,
                identify_called: false
            };
            this["persistence"] = this["cookie"] = new MixpanelPersistence(this["config"]);
            this._gdpr_init();
            var uuid = _.UUID();
            if (!this.get_distinct_id()) {
                this.register_once({
                    distinct_id: uuid,
                    $device_id: uuid
                }, "");
            }
        };
        MixpanelLib.prototype._loaded = function() {
            this.get_config("loaded")(this);
            if (this.get_config("track_pageview")) {
                this.track_pageview();
            }
        };
        MixpanelLib.prototype._dom_loaded = function() {
            _.each(this.__dom_loaded_queue, (function(item) {
                this._track_dom.apply(this, item);
            }), this);
            if (!this.has_opted_out_tracking()) {
                _.each(this.__request_queue, (function(item) {
                    this._send_request.apply(this, item);
                }), this);
            }
            delete this.__dom_loaded_queue;
            delete this.__request_queue;
        };
        MixpanelLib.prototype._track_dom = function(DomClass, args) {
            if (this.get_config("img")) {
                console$1.error("You can't use DOM tracking functions with img = true.");
                return false;
            }
            if (!DOM_LOADED) {
                this.__dom_loaded_queue.push([ DomClass, args ]);
                return false;
            }
            var dt = (new DomClass).init(this);
            return dt.track.apply(dt, args);
        };
        MixpanelLib.prototype._prepare_callback = function(callback, data) {
            if (_.isUndefined(callback)) {
                return null;
            }
            if (USE_XHR) {
                var callback_function = function(response) {
                    callback(response, data);
                };
                return callback_function;
            } else {
                var jsc = this["_jsc"];
                var randomized_cb = "" + Math.floor(Math.random() * 1e8);
                var callback_string = this.get_config("callback_fn") + "[" + randomized_cb + "]";
                jsc[randomized_cb] = function(response) {
                    delete jsc[randomized_cb];
                    callback(response, data);
                };
                return callback_string;
            }
        };
        MixpanelLib.prototype._send_request = function(url, data, callback) {
            if (ENQUEUE_REQUESTS) {
                this.__request_queue.push(arguments);
                return;
            }
            var verbose_mode = this.get_config("verbose");
            if (data["verbose"]) {
                verbose_mode = true;
            }
            if (this.get_config("test")) {
                data["test"] = 1;
            }
            if (verbose_mode) {
                data["verbose"] = 1;
            }
            if (this.get_config("img")) {
                data["img"] = 1;
            }
            if (!USE_XHR) {
                if (callback) {
                    data["callback"] = callback;
                } else if (verbose_mode || this.get_config("test")) {
                    data["callback"] = "(function(){})";
                }
            }
            data["ip"] = this.get_config("ip") ? 1 : 0;
            data["_"] = (new Date).getTime().toString();
            url += "?" + _.HTTPBuildQuery(data);
            if ("img" in data) {
                var img = document$1.createElement("img");
                img.src = url;
                document$1.body.appendChild(img);
            } else if (USE_XHR) {
                try {
                    var req = new XMLHttpRequest;
                    req.open("GET", url, true);
                    var headers = this.get_config("xhr_headers");
                    _.each(headers, (function(headerValue, headerName) {
                        req.setRequestHeader(headerName, headerValue);
                    }));
                    req.withCredentials = true;
                    req.onreadystatechange = function() {
                        if (req.readyState === 4) {
                            if (req.status === 200) {
                                if (callback) {
                                    if (verbose_mode) {
                                        var response;
                                        try {
                                            response = _.JSONDecode(req.responseText);
                                        } catch (e) {
                                            console$1.error(e);
                                            return;
                                        }
                                        callback(response);
                                    } else {
                                        callback(Number(req.responseText));
                                    }
                                }
                            } else {
                                var error = "Bad HTTP status: " + req.status + " " + req.statusText;
                                console$1.error(error);
                                if (callback) {
                                    if (verbose_mode) {
                                        callback({
                                            status: 0,
                                            error
                                        });
                                    } else {
                                        callback(0);
                                    }
                                }
                            }
                        }
                    };
                    req.send(null);
                } catch (e) {
                    console$1.error(e);
                }
            } else {
                var script = document$1.createElement("script");
                script.type = "text/javascript";
                script.async = true;
                script.defer = true;
                script.src = url;
                var s = document$1.getElementsByTagName("script")[0];
                s.parentNode.insertBefore(script, s);
            }
        };
        MixpanelLib.prototype._execute_array = function(array) {
            var fn_name, alias_calls = [], other_calls = [], tracking_calls = [];
            _.each(array, (function(item) {
                if (item) {
                    fn_name = item[0];
                    if (_.isArray(fn_name)) {
                        tracking_calls.push(item);
                    } else if (typeof item === "function") {
                        item.call(this);
                    } else if (_.isArray(item) && fn_name === "alias") {
                        alias_calls.push(item);
                    } else if (_.isArray(item) && fn_name.indexOf("track") !== -1 && typeof this[fn_name] === "function") {
                        tracking_calls.push(item);
                    } else {
                        other_calls.push(item);
                    }
                }
            }), this);
            var execute = function(calls, context) {
                _.each(calls, (function(item) {
                    if (_.isArray(item[0])) {
                        var caller = context;
                        _.each(item, (function(call) {
                            caller = caller[call[0]].apply(caller, call.slice(1));
                        }));
                    } else {
                        this[item[0]].apply(this, item.slice(1));
                    }
                }), context);
            };
            execute(alias_calls, this);
            execute(other_calls, this);
            execute(tracking_calls, this);
        };
        MixpanelLib.prototype.push = function(item) {
            this._execute_array([ item ]);
        };
        MixpanelLib.prototype.disable = function(events) {
            if (typeof events === "undefined") {
                this._flags.disable_all_events = true;
            } else {
                this.__disabled_events = this.__disabled_events.concat(events);
            }
        };
        MixpanelLib.prototype.track = addOptOutCheckMixpanelLib((function(event_name, properties, callback) {
            if (typeof callback !== "function") {
                callback = function() {};
            }
            if (_.isUndefined(event_name)) {
                console$1.error("No event name provided to mixpanel.track");
                return;
            }
            if (this._event_is_disabled(event_name)) {
                callback(0);
                return;
            }
            properties = properties || {};
            properties["token"] = this.get_config("token");
            var start_timestamp = this["persistence"].remove_event_timer(event_name);
            if (!_.isUndefined(start_timestamp)) {
                var duration_in_ms = (new Date).getTime() - start_timestamp;
                properties["$duration"] = parseFloat((duration_in_ms / 1e3).toFixed(3));
            }
            this["persistence"].update_search_keyword(document$1.referrer);
            if (this.get_config("store_google")) {
                this["persistence"].update_campaign_params();
            }
            if (this.get_config("save_referrer")) {
                this["persistence"].update_referrer_info(document$1.referrer);
            }
            properties = _.extend({}, _.info.properties(), this["persistence"].properties(), properties);
            var property_blacklist = this.get_config("property_blacklist");
            if (_.isArray(property_blacklist)) {
                _.each(property_blacklist, (function(blacklisted_prop) {
                    delete properties[blacklisted_prop];
                }));
            } else {
                console$1.error("Invalid value for property_blacklist config: " + property_blacklist);
            }
            var data = {
                event: event_name,
                properties
            };
            var truncated_data = _.truncate(data, 255);
            var json_data = _.JSONEncode(truncated_data);
            var encoded_data = _.base64Encode(json_data);
            console$1.log("MIXPANEL REQUEST:");
            console$1.log(truncated_data);
            this._send_request(this.get_config("api_host") + "/track/", {
                data: encoded_data
            }, this._prepare_callback(callback, truncated_data));
            this._check_and_handle_triggered_notifications(data);
            return truncated_data;
        }));
        MixpanelLib.prototype.set_group = addOptOutCheckMixpanelLib((function(group_key, group_ids, callback) {
            if (!_.isArray(group_ids)) {
                group_ids = [ group_ids ];
            }
            var prop = {};
            prop[group_key] = group_ids;
            this.register(prop);
            return this["people"].set(group_key, group_ids, callback);
        }));
        MixpanelLib.prototype.add_group = addOptOutCheckMixpanelLib((function(group_key, group_id, callback) {
            var old_values = this.get_property(group_key);
            if (old_values === undefined) {
                var prop = {};
                prop[group_key] = [ group_id ];
                this.register(prop);
            } else {
                if (old_values.indexOf(group_id) === -1) {
                    old_values.push(group_id);
                    this.register(prop);
                }
            }
            return this["people"].union(group_key, group_id, callback);
        }));
        MixpanelLib.prototype.remove_group = addOptOutCheckMixpanelLib((function(group_key, group_id, callback) {
            var old_value = this.get_property(group_key);
            if (old_value !== undefined) {
                var idx = old_value.indexOf(group_id);
                if (idx > -1) {
                    old_value.splice(idx, 1);
                    this.register({
                        group_key: old_value
                    });
                }
                if (old_value.length === 0) {
                    this.unregister(group_key);
                }
            }
            return this["people"].remove(group_key, group_id, callback);
        }));
        MixpanelLib.prototype.track_with_groups = addOptOutCheckMixpanelLib((function(event_name, properties, groups, callback) {
            var tracking_props = _.extend({}, properties || {});
            _.each(groups, (function(v, k) {
                if (v !== null && v !== undefined) {
                    tracking_props[k] = v;
                }
            }));
            return this.track(event_name, tracking_props, callback);
        }));
        MixpanelLib.prototype._create_map_key = function(group_key, group_id) {
            return group_key + "_" + JSON.stringify(group_id);
        };
        MixpanelLib.prototype._remove_group_from_cache = function(group_key, group_id) {
            delete this._cached_groups[this._create_map_key(group_key, group_id)];
        };
        MixpanelLib.prototype.get_group = function(group_key, group_id) {
            var map_key = this._create_map_key(group_key, group_id);
            var group = this._cached_groups[map_key];
            if (group === undefined || group._group_key !== group_key || group._group_id !== group_id) {
                group = new MixpanelGroup;
                group._init(this, group_key, group_id);
                this._cached_groups[map_key] = group;
            }
            return group;
        };
        MixpanelLib.prototype.track_pageview = function(page) {
            if (_.isUndefined(page)) {
                page = document$1.location.href;
            }
            this.track("mp_page_view", _.info.pageviewInfo(page));
        };
        MixpanelLib.prototype.track_links = function() {
            return this._track_dom.call(this, LinkTracker, arguments);
        };
        MixpanelLib.prototype.track_forms = function() {
            return this._track_dom.call(this, FormTracker, arguments);
        };
        MixpanelLib.prototype.time_event = function(event_name) {
            if (_.isUndefined(event_name)) {
                console$1.error("No event name provided to mixpanel.time_event");
                return;
            }
            if (this._event_is_disabled(event_name)) {
                return;
            }
            this["persistence"].set_event_timer(event_name, (new Date).getTime());
        };
        MixpanelLib.prototype.register = function(props, days) {
            this["persistence"].register(props, days);
        };
        MixpanelLib.prototype.register_once = function(props, default_value, days) {
            this["persistence"].register_once(props, default_value, days);
        };
        MixpanelLib.prototype.unregister = function(property) {
            this["persistence"].unregister(property);
        };
        MixpanelLib.prototype._register_single = function(prop, value) {
            var props = {};
            props[prop] = value;
            this.register(props);
        };
        MixpanelLib.prototype.identify = function(new_distinct_id, _set_callback, _add_callback, _append_callback, _set_once_callback, _union_callback, _unset_callback, _remove_callback) {
            var previous_distinct_id = this.get_distinct_id();
            this.register({
                $user_id: new_distinct_id
            });
            if (!this.get_property("$device_id")) {
                var device_id = previous_distinct_id;
                this.register_once({
                    $had_persisted_distinct_id: true,
                    $device_id: device_id
                }, "");
            }
            if (new_distinct_id !== previous_distinct_id && new_distinct_id !== this.get_property(ALIAS_ID_KEY)) {
                this.unregister(ALIAS_ID_KEY);
                this.register({
                    distinct_id: new_distinct_id
                });
            }
            this._check_and_handle_notifications(this.get_distinct_id());
            this._flags.identify_called = true;
            this["people"]._flush(_set_callback, _add_callback, _append_callback, _set_once_callback, _union_callback, _unset_callback, _remove_callback);
            if (new_distinct_id !== previous_distinct_id) {
                this.track("$identify", {
                    distinct_id: new_distinct_id,
                    $anon_distinct_id: previous_distinct_id
                });
            }
        };
        MixpanelLib.prototype.reset = function() {
            this["persistence"].clear();
            this._flags.identify_called = false;
            var uuid = _.UUID();
            this.register_once({
                distinct_id: uuid,
                $device_id: uuid
            }, "");
        };
        MixpanelLib.prototype.get_distinct_id = function() {
            return this.get_property("distinct_id");
        };
        MixpanelLib.prototype.alias = function(alias, original) {
            if (alias === this.get_property(PEOPLE_DISTINCT_ID_KEY)) {
                console$1.critical("Attempting to create alias for existing People user - aborting.");
                return -2;
            }
            var _this = this;
            if (_.isUndefined(original)) {
                original = this.get_distinct_id();
            }
            if (alias !== original) {
                this._register_single(ALIAS_ID_KEY, alias);
                return this.track("$create_alias", {
                    alias,
                    distinct_id: original
                }, (function() {
                    _this.identify(alias);
                }));
            } else {
                console$1.error("alias matches current distinct_id - skipping api call.");
                this.identify(alias);
                return -1;
            }
        };
        MixpanelLib.prototype.name_tag = function(name_tag) {
            this._register_single("mp_name_tag", name_tag);
        };
        MixpanelLib.prototype.set_config = function(config) {
            if (_.isObject(config)) {
                _.extend(this["config"], config);
                if (!this.get_config("persistence_name")) {
                    this["config"]["persistence_name"] = this["config"]["cookie_name"];
                }
                if (!this.get_config("disable_persistence")) {
                    this["config"]["disable_persistence"] = this["config"]["disable_cookie"];
                }
                if (this["persistence"]) {
                    this["persistence"].update_config(this["config"]);
                }
                Config.DEBUG = Config.DEBUG || this.get_config("debug");
            }
        };
        MixpanelLib.prototype.get_config = function(prop_name) {
            return this["config"][prop_name];
        };
        MixpanelLib.prototype.get_property = function(property_name) {
            return this["persistence"]["props"][property_name];
        };
        MixpanelLib.prototype.toString = function() {
            var name = this.get_config("name");
            if (name !== PRIMARY_INSTANCE_NAME) {
                name = PRIMARY_INSTANCE_NAME + "." + name;
            }
            return name;
        };
        MixpanelLib.prototype._event_is_disabled = function(event_name) {
            return _.isBlockedUA(userAgent) || this._flags.disable_all_events || _.include(this.__disabled_events, event_name);
        };
        MixpanelLib.prototype._check_and_handle_triggered_notifications = addOptOutCheckMixpanelLib((function(event_data) {
            if (!this._user_decide_check_complete) {
                this._events_tracked_before_user_decide_check_complete.push(event_data);
            } else {
                var arr = this["_triggered_notifs"];
                for (var i = 0; i < arr.length; i++) {
                    var notif = new MixpanelNotification(arr[i], this);
                    if (notif._matches_event_data(event_data)) {
                        this._show_notification(arr[i]);
                        return;
                    }
                }
            }
        }));
        MixpanelLib.prototype._check_and_handle_notifications = addOptOutCheckMixpanelLib((function(distinct_id) {
            if (!distinct_id || this._flags.identify_called || this.get_config("disable_notifications")) {
                return;
            }
            console$1.log("MIXPANEL NOTIFICATION CHECK");
            var data = {
                verbose: true,
                version: "3",
                lib: "web",
                token: this.get_config("token"),
                distinct_id
            };
            this._send_request(this.get_config("api_host") + "/decide/", data, this._prepare_callback(_.bind((function(result) {
                if (result["notifications"] && result["notifications"].length > 0) {
                    this["_triggered_notifs"] = [];
                    var notifications = [];
                    _.each(result["notifications"], (function(notif) {
                        (notif["display_triggers"] && notif["display_triggers"].length > 0 ? this["_triggered_notifs"] : notifications).push(notif);
                    }), this);
                    if (notifications.length > 0) {
                        this._show_notification.call(this, notifications[0]);
                    }
                }
                this._handle_user_decide_check_complete();
            }), this)));
        }));
        MixpanelLib.prototype._handle_user_decide_check_complete = function() {
            this._user_decide_check_complete = true;
            var events = this._events_tracked_before_user_decide_check_complete;
            while (events.length > 0) {
                var data = events.shift();
                this._check_and_handle_triggered_notifications(data);
            }
        };
        MixpanelLib.prototype._show_notification = function(notif_data) {
            var notification = new MixpanelNotification(notif_data, this);
            notification.show();
        };
        MixpanelLib.prototype._gdpr_init = function() {
            var is_localStorage_requested = this.get_config("opt_out_tracking_persistence_type") === "localStorage";
            if (is_localStorage_requested && _.localStorage.is_supported()) {
                if (!this.has_opted_in_tracking() && this.has_opted_in_tracking({
                    persistence_type: "cookie"
                })) {
                    this.opt_in_tracking({
                        enable_persistence: false
                    });
                }
                if (!this.has_opted_out_tracking() && this.has_opted_out_tracking({
                    persistence_type: "cookie"
                })) {
                    this.opt_out_tracking({
                        clear_persistence: false
                    });
                }
                this.clear_opt_in_out_tracking({
                    persistence_type: "cookie",
                    enable_persistence: false
                });
            }
            if (this.has_opted_out_tracking()) {
                this._gdpr_update_persistence({
                    clear_persistence: true
                });
            } else if (!this.has_opted_in_tracking() && (this.get_config("opt_out_tracking_by_default") || _.cookie.get("mp_optout"))) {
                _.cookie.remove("mp_optout");
                this.opt_out_tracking({
                    clear_persistence: this.get_config("opt_out_persistence_by_default")
                });
            }
        };
        MixpanelLib.prototype._gdpr_update_persistence = function(options) {
            var disabled;
            if (options && options["clear_persistence"]) {
                disabled = true;
            } else if (options && options["enable_persistence"]) {
                disabled = false;
            } else {
                return;
            }
            if (!this.get_config("disable_persistence") && this["persistence"].disabled !== disabled) {
                this["persistence"].set_disabled(disabled);
            }
        };
        MixpanelLib.prototype._gdpr_call_func = function(func, options) {
            options = _.extend({
                track: _.bind(this.track, this),
                persistence_type: this.get_config("opt_out_tracking_persistence_type"),
                cookie_prefix: this.get_config("opt_out_tracking_cookie_prefix"),
                cookie_expiration: this.get_config("cookie_expiration"),
                cross_subdomain_cookie: this.get_config("cross_subdomain_cookie"),
                secure_cookie: this.get_config("secure_cookie")
            }, options);
            if (!_.localStorage.is_supported()) {
                options["persistence_type"] = "cookie";
            }
            return func(this.get_config("token"), {
                track: options["track"],
                trackEventName: options["track_event_name"],
                trackProperties: options["track_properties"],
                persistenceType: options["persistence_type"],
                persistencePrefix: options["cookie_prefix"],
                cookieExpiration: options["cookie_expiration"],
                crossSubdomainCookie: options["cross_subdomain_cookie"],
                secureCookie: options["secure_cookie"]
            });
        };
        MixpanelLib.prototype.opt_in_tracking = function(options) {
            options = _.extend({
                enable_persistence: true
            }, options);
            this._gdpr_call_func(optIn, options);
            this._gdpr_update_persistence(options);
        };
        MixpanelLib.prototype.opt_out_tracking = function(options) {
            options = _.extend({
                clear_persistence: true,
                delete_user: true
            }, options);
            if (options["delete_user"] && this["people"] && this["people"]._identify_called()) {
                this["people"].delete_user();
                this["people"].clear_charges();
            }
            this._gdpr_call_func(optOut, options);
            this._gdpr_update_persistence(options);
        };
        MixpanelLib.prototype.has_opted_in_tracking = function(options) {
            return this._gdpr_call_func(hasOptedIn, options);
        };
        MixpanelLib.prototype.has_opted_out_tracking = function(options) {
            return this._gdpr_call_func(hasOptedOut, options);
        };
        MixpanelLib.prototype.clear_opt_in_out_tracking = function(options) {
            options = _.extend({
                enable_persistence: true
            }, options);
            this._gdpr_call_func(clearOptInOut, options);
            this._gdpr_update_persistence(options);
        };
        MixpanelLib.prototype["init"] = MixpanelLib.prototype.init;
        MixpanelLib.prototype["reset"] = MixpanelLib.prototype.reset;
        MixpanelLib.prototype["disable"] = MixpanelLib.prototype.disable;
        MixpanelLib.prototype["time_event"] = MixpanelLib.prototype.time_event;
        MixpanelLib.prototype["track"] = MixpanelLib.prototype.track;
        MixpanelLib.prototype["track_links"] = MixpanelLib.prototype.track_links;
        MixpanelLib.prototype["track_forms"] = MixpanelLib.prototype.track_forms;
        MixpanelLib.prototype["track_pageview"] = MixpanelLib.prototype.track_pageview;
        MixpanelLib.prototype["register"] = MixpanelLib.prototype.register;
        MixpanelLib.prototype["register_once"] = MixpanelLib.prototype.register_once;
        MixpanelLib.prototype["unregister"] = MixpanelLib.prototype.unregister;
        MixpanelLib.prototype["identify"] = MixpanelLib.prototype.identify;
        MixpanelLib.prototype["alias"] = MixpanelLib.prototype.alias;
        MixpanelLib.prototype["name_tag"] = MixpanelLib.prototype.name_tag;
        MixpanelLib.prototype["set_config"] = MixpanelLib.prototype.set_config;
        MixpanelLib.prototype["get_config"] = MixpanelLib.prototype.get_config;
        MixpanelLib.prototype["get_property"] = MixpanelLib.prototype.get_property;
        MixpanelLib.prototype["get_distinct_id"] = MixpanelLib.prototype.get_distinct_id;
        MixpanelLib.prototype["toString"] = MixpanelLib.prototype.toString;
        MixpanelLib.prototype["_check_and_handle_notifications"] = MixpanelLib.prototype._check_and_handle_notifications;
        MixpanelLib.prototype["_show_notification"] = MixpanelLib.prototype._show_notification;
        MixpanelLib.prototype["opt_out_tracking"] = MixpanelLib.prototype.opt_out_tracking;
        MixpanelLib.prototype["opt_in_tracking"] = MixpanelLib.prototype.opt_in_tracking;
        MixpanelLib.prototype["has_opted_out_tracking"] = MixpanelLib.prototype.has_opted_out_tracking;
        MixpanelLib.prototype["has_opted_in_tracking"] = MixpanelLib.prototype.has_opted_in_tracking;
        MixpanelLib.prototype["clear_opt_in_out_tracking"] = MixpanelLib.prototype.clear_opt_in_out_tracking;
        MixpanelLib.prototype["get_group"] = MixpanelLib.prototype.get_group;
        MixpanelLib.prototype["set_group"] = MixpanelLib.prototype.set_group;
        MixpanelLib.prototype["add_group"] = MixpanelLib.prototype.add_group;
        MixpanelLib.prototype["remove_group"] = MixpanelLib.prototype.remove_group;
        MixpanelLib.prototype["track_with_groups"] = MixpanelLib.prototype.track_with_groups;
        MixpanelPersistence.prototype["properties"] = MixpanelPersistence.prototype.properties;
        MixpanelPersistence.prototype["update_search_keyword"] = MixpanelPersistence.prototype.update_search_keyword;
        MixpanelPersistence.prototype["update_referrer_info"] = MixpanelPersistence.prototype.update_referrer_info;
        MixpanelPersistence.prototype["get_cross_subdomain"] = MixpanelPersistence.prototype.get_cross_subdomain;
        MixpanelPersistence.prototype["clear"] = MixpanelPersistence.prototype.clear;
        _.safewrap_class(MixpanelLib, [ "identify", "_check_and_handle_notifications", "_show_notification" ]);
        var instances = {};
        var extend_mp = function() {
            _.each(instances, (function(instance, name) {
                if (name !== PRIMARY_INSTANCE_NAME) {
                    mixpanel_master[name] = instance;
                }
            }));
            mixpanel_master["_"] = _;
        };
        var override_mp_init_func = function() {
            mixpanel_master["init"] = function(token, config, name) {
                if (name) {
                    if (!mixpanel_master[name]) {
                        mixpanel_master[name] = instances[name] = create_mplib(token, config, name);
                        mixpanel_master[name]._loaded();
                    }
                    return mixpanel_master[name];
                } else {
                    var instance = mixpanel_master;
                    if (instances[PRIMARY_INSTANCE_NAME]) {
                        instance = instances[PRIMARY_INSTANCE_NAME];
                    } else if (token) {
                        instance = create_mplib(token, config, PRIMARY_INSTANCE_NAME);
                        instance._loaded();
                        instances[PRIMARY_INSTANCE_NAME] = instance;
                    }
                    mixpanel_master = instance;
                    if (init_type === INIT_SNIPPET) {
                        window$1[PRIMARY_INSTANCE_NAME] = mixpanel_master;
                    }
                    extend_mp();
                }
            };
        };
        var add_dom_loaded_handler = function() {
            function dom_loaded_handler() {
                if (dom_loaded_handler.done) {
                    return;
                }
                dom_loaded_handler.done = true;
                DOM_LOADED = true;
                ENQUEUE_REQUESTS = false;
                _.each(instances, (function(inst) {
                    inst._dom_loaded();
                }));
            }
            function do_scroll_check() {
                try {
                    document$1.documentElement.doScroll("left");
                } catch (e) {
                    setTimeout(do_scroll_check, 1);
                    return;
                }
                dom_loaded_handler();
            }
            if (document$1.addEventListener) {
                if (document$1.readyState === "complete") {
                    dom_loaded_handler();
                } else {
                    document$1.addEventListener("DOMContentLoaded", dom_loaded_handler, false);
                }
            } else if (document$1.attachEvent) {
                document$1.attachEvent("onreadystatechange", dom_loaded_handler);
                var toplevel = false;
                try {
                    toplevel = window$1.frameElement === null;
                } catch (e) {}
                if (document$1.documentElement.doScroll && toplevel) {
                    do_scroll_check();
                }
            }
            _.register_event(window$1, "load", dom_loaded_handler, true);
        };
        function init_as_module() {
            init_type = INIT_MODULE;
            mixpanel_master = new MixpanelLib;
            override_mp_init_func();
            mixpanel_master["init"]();
            add_dom_loaded_handler();
            return mixpanel_master;
        }
        var mixpanel = init_as_module();
        module.exports = mixpanel;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        const _ = __webpack_require__(284);
        const Mixpanel = __webpack_require__(301);
        const Sentry = __webpack_require__(352);
        const utils = __webpack_require__(306);
        module.exports = (SentryLib, MixpanelLib, fake = false) => {
            const sentry = Sentry(SentryLib);
            const mixpanel = Mixpanel(MixpanelLib);
            const installedServices = [];
            let installed = false;
            let enabled = true;
            let consoleOutputDisabled = false;
            const getSupportedServices = () => [ "sentry", "mixpanel" ];
            const logDebug = message => {
                const debugMessage = `${new Date} ${message}`;
                if (!consoleOutputDisabled) {
                    console.log(utils.hideAbsolutePathsInObject(debugMessage));
                }
            };
            let shouldReportCallback = _.constant(true);
            const setShouldReport = callback => {
                if (!_.isFunction(callback)) {
                    throw new Error("Function expected");
                } else {
                    shouldReportCallback = callback;
                }
            };
            const shouldSendToExternalServices = () => enabled && !fake && shouldReportCallback();
            return {
                getSupportedServices,
                logDebug,
                enable: () => {
                    enabled = true;
                },
                disable: () => {
                    enabled = false;
                },
                isEnabled: () => enabled && !fake,
                getInstalledServices: () => installedServices,
                install: config => {
                    consoleOutputDisabled = Boolean(config.options.disableConsoleOutput);
                    if (fake) {
                        return;
                    }
                    if (installed) {
                        throw new Error("Already installed");
                    }
                    installed = true;
                    if (!_.isNil(config.options.shouldReport)) {
                        setShouldReport(config.options.shouldReport);
                    }
                    Object.keys(config.services).forEach((serviceName => {
                        if (!getSupportedServices().includes(serviceName)) {
                            throw new Error(`Service not supported: ${serviceName}`);
                        }
                        if (serviceName === "sentry" && !_.isNil(config.services.sentry)) {
                            sentry.install(config.services.sentry, {
                                release: config.options.release,
                                serverName: config.options.serverName,
                                disableConsoleAlerts: consoleOutputDisabled
                            });
                            installedServices.push("sentry");
                        }
                        if (serviceName === "mixpanel" && !_.isNil(config.services.mixpanel)) {
                            mixpanel.install(config.services.mixpanel, {
                                version: config.options.release,
                                serverName: config.options.serverName
                            }, config.options.mixpanel, config.options.mixpanelDeferred);
                            installedServices.push("mixpanel");
                        }
                    }));
                },
                logEvent: (message, data) => {
                    const debugMessage = _.attempt((() => {
                        if (data) {
                            return `${message} (${JSON.stringify(data)})`;
                        }
                        return message;
                    }));
                    logDebug(debugMessage);
                    if (shouldSendToExternalServices() && installedServices.includes("mixpanel")) {
                        mixpanel.track(message, data);
                    }
                },
                logException: error => {
                    if (!consoleOutputDisabled) {
                        console.error(JSON.stringify(utils.hideAbsolutePathsInObject(error)));
                    }
                    if (!installedServices.includes("sentry") || !shouldSendToExternalServices() || !utils.shouldReportError(error)) {
                        return;
                    }
                    sentry.captureException(error);
                },
                shouldReport: setShouldReport,
                disableConsoleOutput: () => {
                    consoleOutputDisabled = true;
                },
                enableConsoleOutput: () => {
                    consoleOutputDisabled = false;
                },
                setConfigs: configs => {
                    mixpanel.setConfig(configs.mixpanel);
                }
            };
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        const detect = __webpack_require__(302);
        const utils = __webpack_require__(306);
        const defaultContext = __webpack_require__(313);
        const _ = __webpack_require__(284);
        module.exports = MixpanelLib => {
            const env = detect.getName();
            const queue = [];
            let installed = false;
            let projectToken = null;
            let client = null;
            let mixpanelContext = {};
            let disabled = false;
            function disposeEventsQueue() {
                if (client === null) {
                    return;
                }
                let element = queue.shift();
                while (element !== undefined) {
                    const {event, data} = element;
                    client.track(event, data);
                    element = queue.shift();
                }
            }
            function setConfig(config) {
                if (config == null) {
                    disabled = true;
                    queue.splice(0, queue.length);
                } else {
                    client = MixpanelLib.init(projectToken, config) || MixpanelLib;
                }
            }
            return {
                isInstalled: () => installed,
                install: (token, context, config, deferred = false) => {
                    if (installed) {
                        throw new Error("Mixpanel already installed");
                    }
                    if (global.window) {
                        global.window["_mpEditorLoaded"] = true;
                        global.window.sessionStorage.setItem("editorParams", JSON.stringify({
                            projectToken: token
                        }));
                    }
                    projectToken = token;
                    mixpanelContext = utils.flattenStartCase(_.defaults(context, defaultContext[env]));
                    installed = true;
                    if (!deferred) {
                        setConfig(config);
                    }
                },
                uninstall: () => {
                    if (!installed) {
                        throw new Error("Mixpanel not installed");
                    }
                    installed = false;
                },
                track: (message, data) => {
                    if (!installed) {
                        throw new Error("Mixpanel not installed");
                    }
                    if (disabled) {
                        return;
                    }
                    queue.push({
                        event: message,
                        data: utils.hideAbsolutePathsInObject(Object.assign({}, mixpanelContext, utils.flattenStartCase(data)))
                    });
                    disposeEventsQueue();
                },
                setConfig
            };
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var isNode = __webpack_require__(303);
        var isPhantom = __webpack_require__(304);
        var isElectron = __webpack_require__(305);
        var getName = function() {
            if (isElectron()) {
                return "electron";
            }
            if (isPhantom()) {
                return "phantom";
            }
            if (isNode) {
                return "nodejs";
            }
            return "browser";
        };
        module.exports = {
            getName
        };
    }, module => {
        module.exports = false;
    }, function(module, exports, __webpack_require__) {
        var __WEBPACK_AMD_DEFINE_RESULT__;
        (function(exports) {
            "use strict";
            function isPhantom() {
                return !!(typeof window != "undefined" && window.callPhantom && window._phantom);
            }
            if (true) {
                !(__WEBPACK_AMD_DEFINE_RESULT__ = function() {
                    return isPhantom;
                }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
            } else {}
        })(this);
    }, module => {
        function isElectron() {
            if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
                return true;
            }
            if (typeof process !== "undefined" && typeof process.versions === "object" && !!process.versions.electron) {
                return true;
            }
            if (typeof navigator === "object" && typeof navigator.userAgent === "string" && navigator.userAgent.indexOf("Electron") >= 0) {
                return true;
            }
            return false;
        }
        module.exports = isElectron;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        const jc = __webpack_require__(307);
        const _ = __webpack_require__(284);
        _.mixin(__webpack_require__(308));
        const flatten = __webpack_require__(309).flatten;
        const deepMapKeys = __webpack_require__(311);
        const path = __webpack_require__(15);
        exports.flattenStartCase = object => {
            if (_.isUndefined(object)) {
                return undefined;
            }
            if (!_.isObject(object)) {
                return {
                    Value: object
                };
            }
            if (_.isArray(object)) {
                return _.map(object, (property => {
                    if (_.isObject(property)) {
                        return exports.flattenStartCase(property);
                    }
                    return property;
                }));
            }
            const transformedKeysObject = deepMapKeys(object, (key => {
                const regex = /^[A-Z_]+$/;
                if (regex.test(key)) {
                    return key;
                }
                return _.startCase(key);
            }));
            return flatten(transformedKeysObject, {
                delimiter: " ",
                safe: true
            });
        };
        exports.hideAbsolutePathsInObject = object => {
            if (_.isError(object)) {
                object = _.reduce(Object.getOwnPropertyNames(object), ((accumulator, key) => {
                    accumulator[key] = object[key];
                    return accumulator;
                }), {});
            }
            if (_.isString(object)) {
                const words = object.split(" ").map((word => path.isAbsolute(word) ? path.basename(word) : word));
                return words.join(" ");
            }
            object = jc.decycle(object);
            return _.deepMapValues(object, (value => {
                if (!_.isString(value)) {
                    return value;
                }
                if (value.startsWith("/dev/") || value.startsWith("\\\\.\\")) {
                    return value;
                }
                return path.isAbsolute(value) ? path.basename(value) : value;
            }));
        };
        exports.shouldReportError = error => !_.has(error, [ "report" ]) || Boolean(error.report);
    }, module => {
        "use strict";
        function decycle(object) {
            var objects = [], paths = [];
            return function derez(value, path) {
                var i, name, nu;
                var _value = value && value.toJSON instanceof Function ? value.toJSON() : value;
                if (typeof _value === "object" && _value !== null) {
                    for (i = 0; i < objects.length; i += 1) {
                        if (objects[i] === _value) {
                            return {
                                $ref: paths[i]
                            };
                        }
                    }
                    objects.push(_value);
                    paths.push(path);
                    if (Object.prototype.toString.apply(_value) === "[object Array]") {
                        nu = [];
                        for (i = 0; i < _value.length; i += 1) {
                            nu[i] = derez(_value[i], path + "[" + i + "]");
                        }
                    } else {
                        nu = {};
                        for (name in _value) {
                            if (Object.prototype.hasOwnProperty.call(_value, name)) {
                                nu[name] = derez(_value[name], path + "[" + JSON.stringify(name) + "]");
                            }
                        }
                    }
                    return nu;
                }
                return _value;
            }(object, "$");
        }
        function retrocycle($) {
            var px = /^\$(?:\[(?:\d+|\"(?:[^\\\"\u0000-\u001f]|\\([\\\"\/bfnrt]|u[0-9a-zA-Z]{4}))*\")\])*$/;
            (function rez(value) {
                var i, item, name, path;
                if (value && typeof value === "object") {
                    if (Object.prototype.toString.apply(value) === "[object Array]") {
                        for (i = 0; i < value.length; i += 1) {
                            item = value[i];
                            if (item && typeof item === "object") {
                                path = item.$ref;
                                if (typeof path === "string" && px.test(path)) {
                                    value[i] = eval(path);
                                } else {
                                    rez(item);
                                }
                            }
                        }
                    } else {
                        for (name in value) {
                            if (typeof value[name] === "object") {
                                item = value[name];
                                if (item) {
                                    path = item.$ref;
                                    if (typeof path === "string" && px.test(path)) {
                                        value[name] = eval(path);
                                    } else {
                                        rez(item);
                                    }
                                }
                            }
                        }
                    }
                }
            })($);
            return $;
        }
        module.exports = {
            stringify: function stringifyJC(object, replacer, space) {
                return JSON.stringify(decycle(object), replacer, space);
            },
            parse: function parseJC($, reviver) {
                return retrocycle(JSON.parse($, reviver));
            },
            decycle,
            retrocycle
        };
    }, function(module, exports, __webpack_require__) {
        var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
        (function(root, factory) {
            if (true) {
                !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(284) ], __WEBPACK_AMD_DEFINE_FACTORY__ = factory, 
                __WEBPACK_AMD_DEFINE_RESULT__ = typeof __WEBPACK_AMD_DEFINE_FACTORY__ === "function" ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__, 
                __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
            } else {}
        })(this, (function(_, undefined) {
            "use strict";
            var mixins = {
                deepMapValues: function(object, callback, propertyPath) {
                    propertyPath = propertyPath || "";
                    if (_.isArray(object)) {
                        return _.map(object, deepMapValuesIteratee);
                    } else if (_.isObject(object) && !_.isDate(object) && !_.isRegExp(object) && !_.isFunction(object)) {
                        return _.extend({}, object, _.mapValues(object, deepMapValuesIteratee));
                    } else {
                        return callback(object, propertyPath);
                    }
                    function deepMapValuesIteratee(value, key) {
                        var valuePath = propertyPath ? propertyPath + "." + key : key;
                        return _.deepMapValues(value, callback, valuePath);
                    }
                }
            };
            _.mixin(mixins);
            return mixins;
        }));
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var isBuffer = __webpack_require__(310);
        module.exports = flatten;
        flatten.flatten = flatten;
        flatten.unflatten = unflatten;
        function flatten(target, opts) {
            opts = opts || {};
            var delimiter = opts.delimiter || ".";
            var maxDepth = opts.maxDepth;
            var output = {};
            function step(object, prev, currentDepth) {
                currentDepth = currentDepth || 1;
                Object.keys(object).forEach((function(key) {
                    var value = object[key];
                    var isarray = opts.safe && Array.isArray(value);
                    var type = Object.prototype.toString.call(value);
                    var isbuffer = isBuffer(value);
                    var isobject = type === "[object Object]" || type === "[object Array]";
                    var newKey = prev ? prev + delimiter + key : key;
                    if (!isarray && !isbuffer && isobject && Object.keys(value).length && (!opts.maxDepth || currentDepth < maxDepth)) {
                        return step(value, newKey, currentDepth + 1);
                    }
                    output[newKey] = value;
                }));
            }
            step(target);
            return output;
        }
        function unflatten(target, opts) {
            opts = opts || {};
            var delimiter = opts.delimiter || ".";
            var overwrite = opts.overwrite || false;
            var result = {};
            var isbuffer = isBuffer(target);
            if (isbuffer || Object.prototype.toString.call(target) !== "[object Object]") {
                return target;
            }
            function getkey(key) {
                var parsedKey = Number(key);
                return isNaN(parsedKey) || key.indexOf(".") !== -1 || opts.object ? key : parsedKey;
            }
            var sortedKeys = Object.keys(target).sort((function(keyA, keyB) {
                return keyA.length - keyB.length;
            }));
            sortedKeys.forEach((function(key) {
                var split = key.split(delimiter);
                var key1 = getkey(split.shift());
                var key2 = getkey(split[0]);
                var recipient = result;
                while (key2 !== undefined) {
                    if (key1 === "__proto__") {
                        return;
                    }
                    var type = Object.prototype.toString.call(recipient[key1]);
                    var isobject = type === "[object Object]" || type === "[object Array]";
                    if (!overwrite && !isobject && typeof recipient[key1] !== "undefined") {
                        return;
                    }
                    if (overwrite && !isobject || !overwrite && recipient[key1] == null) {
                        recipient[key1] = typeof key2 === "number" && !opts.object ? [] : {};
                    }
                    recipient = recipient[key1];
                    if (split.length > 0) {
                        key1 = getkey(split.shift());
                        key2 = getkey(split[0]);
                    }
                }
                recipient[key1] = unflatten(target[key], opts);
            }));
            return result;
        }
    }, module => {
        module.exports = function isBuffer(obj) {
            return obj != null && obj.constructor != null && typeof obj.constructor.isBuffer === "function" && obj.constructor.isBuffer(obj);
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var lodash_1 = __webpack_require__(284);
        var deep_map_keys_1 = __webpack_require__(312);
        function deepMapKeys(object, mapFn, options) {
            options = lodash_1.isNil(options) ? {} : options;
            if (!mapFn) {
                throw new Error("mapFn is required");
            } else if (!lodash_1.isFunction(mapFn)) {
                throw new TypeError("mapFn must be a function");
            } else if (!lodash_1.isObject(options)) {
                throw new TypeError("options must be an object");
            }
            return new deep_map_keys_1.DeepMapKeys(mapFn, options).map(object);
        }
        module.exports = deepMapKeys;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        var lodash_1 = __webpack_require__(284);
        var DeepMapKeys = function() {
            function DeepMapKeys(mapFn, opts) {
                this.mapFn = mapFn;
                this.opts = opts;
                this.cache = new WeakMap;
            }
            DeepMapKeys.prototype.map = function(value) {
                return lodash_1.isArray(value) ? this.mapArray(value) : lodash_1.isObject(value) ? this.mapObject(value) : value;
            };
            DeepMapKeys.prototype.mapArray = function(arr) {
                if (this.cache.has(arr)) {
                    return this.cache.get(arr);
                }
                var length = arr.length;
                var result = [];
                this.cache.set(arr, result);
                for (var i = 0; i < length; i++) {
                    result.push(this.map(arr[i]));
                }
                return result;
            };
            DeepMapKeys.prototype.mapObject = function(obj) {
                if (this.cache.has(obj)) {
                    return this.cache.get(obj);
                }
                var _a = this, mapFn = _a.mapFn, thisArg = _a.opts.thisArg;
                var result = {};
                this.cache.set(obj, result);
                for (var key in obj) {
                    if (obj.hasOwnProperty(key)) {
                        result[mapFn.call(thisArg, key, obj[key])] = this.map(obj[key]);
                    }
                }
                return result;
            };
            return DeepMapKeys;
        }();
        exports.DeepMapKeys = DeepMapKeys;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        const arch = __webpack_require__(314);
        const os = __webpack_require__(93);
        const osLocale = __webpack_require__(315);
        const getHostArchitecture = () => {
            if (/ia32|x64/.test(process.arch)) {
                return arch().replace("x86", "ia32");
            }
            return process.arch;
        };
        module.exports.node = {
            arch: process.arch,
            node: process.version,
            osPlatform: os.platform(),
            osRelease: os.release(),
            cpuCores: os.cpus().length,
            totalMemory: os.totalmem(),
            startFreeMemory: os.freemem(),
            hostArch: getHostArchitecture(),
            locale: osLocale.sync()
        };
        module.exports.electron = Object.assign({}, module.exports.node, {
            electron: process.versions.electron
        });
        module.exports.browser = {};
    }, module => {
        module.exports = function arch() {
            var userAgent = navigator.userAgent;
            if ([ "x86_64", "x86-64", "Win64", "x64;", "amd64", "AMD64", "WOW64", "x64_64" ].some((function(str) {
                return userAgent.indexOf(str) > -1;
            }))) {
                return "x64";
            }
            var platform = navigator.platform;
            if (platform === "MacIntel" || platform === "Linux x86_64") {
                return "x64";
            }
            if (navigator.cpuClass === "x64") {
                return "x64";
            }
            return "x86";
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        const execa = __webpack_require__(316);
        const lcid = __webpack_require__(347);
        const mem = __webpack_require__(350);
        const defaultOpts = {
            spawn: true
        };
        const defaultLocale = "en_US";
        function getEnvLocale(env) {
            env = env || process.env;
            return env.LC_ALL || env.LC_MESSAGES || env.LANG || env.LANGUAGE;
        }
        function parseLocale(x) {
            const env = x.split("\n").reduce(((env, def) => {
                def = def.split("=");
                env[def[0]] = def[1].replace(/^"|"$/g, "");
                return env;
            }), {});
            return getEnvLocale(env);
        }
        function getLocale(str) {
            return str && str.replace(/[.:].*/, "");
        }
        function getAppleLocale() {
            return execa.stdout("defaults", [ "read", "-g", "AppleLocale" ]);
        }
        function getAppleLocaleSync() {
            return execa.sync("defaults", [ "read", "-g", "AppleLocale" ]).stdout;
        }
        function getUnixLocale() {
            if (process.platform === "darwin") {
                return getAppleLocale();
            }
            return execa.stdout("locale").then((stdout => getLocale(parseLocale(stdout))));
        }
        function getUnixLocaleSync() {
            if (process.platform === "darwin") {
                return getAppleLocaleSync();
            }
            return getLocale(parseLocale(execa.sync("locale").stdout));
        }
        function getWinLocale() {
            return execa.stdout("wmic", [ "os", "get", "locale" ]).then((stdout => {
                const lcidCode = parseInt(stdout.replace("Locale", ""), 16);
                return lcid.from(lcidCode);
            }));
        }
        function getWinLocaleSync() {
            const stdout = execa.sync("wmic", [ "os", "get", "locale" ]).stdout;
            const lcidCode = parseInt(stdout.replace("Locale", ""), 16);
            return lcid.from(lcidCode);
        }
        module.exports = mem((opts => {
            opts = opts || defaultOpts;
            const envLocale = getEnvLocale();
            let thenable;
            if (envLocale || opts.spawn === false) {
                thenable = Promise.resolve(getLocale(envLocale));
            } else if (process.platform === "win32") {
                thenable = getWinLocale();
            } else {
                thenable = getUnixLocale();
            }
            return thenable.then((locale => locale || defaultLocale)).catch((() => defaultLocale));
        }));
        module.exports.sync = mem((opts => {
            opts = opts || defaultOpts;
            const envLocale = getEnvLocale();
            let res;
            if (envLocale || opts.spawn === false) {
                res = getLocale(envLocale);
            } else {
                try {
                    if (process.platform === "win32") {
                        res = getWinLocaleSync();
                    } else {
                        res = getUnixLocaleSync();
                    }
                } catch (err) {}
            }
            return res || defaultLocale;
        }));
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        const childProcess = __webpack_require__(96);
        const util = __webpack_require__(58);
        const crossSpawn = __webpack_require__(317);
        const stripEof = __webpack_require__(336);
        const npmRunPath = __webpack_require__(337);
        const isStream = __webpack_require__(339);
        const _getStream = __webpack_require__(340);
        const pFinally = __webpack_require__(342);
        const onExit = __webpack_require__(343);
        const errname = __webpack_require__(345);
        const stdio = __webpack_require__(346);
        const TEN_MEGABYTES = 1e3 * 1e3 * 10;
        function handleArgs(cmd, args, opts) {
            let parsed;
            if (opts && opts.env && opts.extendEnv !== false) {
                opts.env = Object.assign({}, process.env, opts.env);
            }
            if (opts && opts.__winShell === true) {
                delete opts.__winShell;
                parsed = {
                    command: cmd,
                    args,
                    options: opts,
                    file: cmd,
                    original: cmd
                };
            } else {
                parsed = crossSpawn._parse(cmd, args, opts);
            }
            opts = Object.assign({
                maxBuffer: TEN_MEGABYTES,
                stripEof: true,
                preferLocal: true,
                localDir: parsed.options.cwd || process.cwd(),
                encoding: "utf8",
                reject: true,
                cleanup: true
            }, parsed.options);
            opts.stdio = stdio(opts);
            if (opts.preferLocal) {
                opts.env = npmRunPath.env(Object.assign({}, opts, {
                    cwd: opts.localDir
                }));
            }
            return {
                cmd: parsed.command,
                args: parsed.args,
                opts,
                parsed
            };
        }
        function handleInput(spawned, opts) {
            const input = opts.input;
            if (input === null || input === undefined) {
                return;
            }
            if (isStream(input)) {
                input.pipe(spawned.stdin);
            } else {
                spawned.stdin.end(input);
            }
        }
        function handleOutput(opts, val) {
            if (val && opts.stripEof) {
                val = stripEof(val);
            }
            return val;
        }
        function handleShell(fn, cmd, opts) {
            let file = "/bin/sh";
            let args = [ "-c", cmd ];
            opts = Object.assign({}, opts);
            if (process.platform === "win32") {
                opts.__winShell = true;
                file = process.env.comspec || "cmd.exe";
                args = [ "/s", "/c", `"${cmd}"` ];
                opts.windowsVerbatimArguments = true;
            }
            if (opts.shell) {
                file = opts.shell;
                delete opts.shell;
            }
            return fn(file, args, opts);
        }
        function getStream(process, stream, encoding, maxBuffer) {
            if (!process[stream]) {
                return null;
            }
            let ret;
            if (encoding) {
                ret = _getStream(process[stream], {
                    encoding,
                    maxBuffer
                });
            } else {
                ret = _getStream.buffer(process[stream], {
                    maxBuffer
                });
            }
            return ret.catch((err => {
                err.stream = stream;
                err.message = `${stream} ${err.message}`;
                throw err;
            }));
        }
        module.exports = (cmd, args, opts) => {
            let joinedCmd = cmd;
            if (Array.isArray(args) && args.length > 0) {
                joinedCmd += " " + args.join(" ");
            }
            const parsed = handleArgs(cmd, args, opts);
            const encoding = parsed.opts.encoding;
            const maxBuffer = parsed.opts.maxBuffer;
            let spawned;
            try {
                spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
            } catch (err) {
                return Promise.reject(err);
            }
            let removeExitHandler;
            if (parsed.opts.cleanup) {
                removeExitHandler = onExit((() => {
                    spawned.kill();
                }));
            }
            let timeoutId = null;
            let timedOut = false;
            const cleanupTimeout = () => {
                if (timeoutId) {
                    clearTimeout(timeoutId);
                    timeoutId = null;
                }
            };
            if (parsed.opts.timeout > 0) {
                timeoutId = setTimeout((() => {
                    timeoutId = null;
                    timedOut = true;
                    spawned.kill(parsed.opts.killSignal);
                }), parsed.opts.timeout);
            }
            const processDone = new Promise((resolve => {
                spawned.on("exit", ((code, signal) => {
                    cleanupTimeout();
                    resolve({
                        code,
                        signal
                    });
                }));
                spawned.on("error", (err => {
                    cleanupTimeout();
                    resolve({
                        err
                    });
                }));
                if (spawned.stdin) {
                    spawned.stdin.on("error", (err => {
                        cleanupTimeout();
                        resolve({
                            err
                        });
                    }));
                }
            }));
            function destroy() {
                if (spawned.stdout) {
                    spawned.stdout.destroy();
                }
                if (spawned.stderr) {
                    spawned.stderr.destroy();
                }
            }
            const promise = pFinally(Promise.all([ processDone, getStream(spawned, "stdout", encoding, maxBuffer), getStream(spawned, "stderr", encoding, maxBuffer) ]).then((arr => {
                const result = arr[0];
                const stdout = arr[1];
                const stderr = arr[2];
                let err = result.err;
                const code = result.code;
                const signal = result.signal;
                if (removeExitHandler) {
                    removeExitHandler();
                }
                if (err || code !== 0 || signal !== null) {
                    if (!err) {
                        let output = "";
                        if (Array.isArray(parsed.opts.stdio)) {
                            if (parsed.opts.stdio[2] !== "inherit") {
                                output += output.length > 0 ? stderr : `\n${stderr}`;
                            }
                            if (parsed.opts.stdio[1] !== "inherit") {
                                output += `\n${stdout}`;
                            }
                        } else if (parsed.opts.stdio !== "inherit") {
                            output = `\n${stderr}${stdout}`;
                        }
                        err = new Error(`Command failed: ${joinedCmd}${output}`);
                        err.code = code < 0 ? errname(code) : code;
                    }
                    err.killed = err.killed || spawned.killed;
                    err.stdout = stdout;
                    err.stderr = stderr;
                    err.failed = true;
                    err.signal = signal || null;
                    err.cmd = joinedCmd;
                    err.timedOut = timedOut;
                    if (!parsed.opts.reject) {
                        return err;
                    }
                    throw err;
                }
                return {
                    stdout: handleOutput(parsed.opts, stdout),
                    stderr: handleOutput(parsed.opts, stderr),
                    code: 0,
                    failed: false,
                    killed: false,
                    signal: null,
                    cmd: joinedCmd,
                    timedOut: false
                };
            })), destroy);
            crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
            handleInput(spawned, parsed.opts);
            spawned.then = promise.then.bind(promise);
            spawned.catch = promise.catch.bind(promise);
            return spawned;
        };
        module.exports.stdout = function() {
            return module.exports.apply(null, arguments).then((x => x.stdout));
        };
        module.exports.stderr = function() {
            return module.exports.apply(null, arguments).then((x => x.stderr));
        };
        module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
        module.exports.sync = (cmd, args, opts) => {
            const parsed = handleArgs(cmd, args, opts);
            if (isStream(parsed.opts.input)) {
                throw new TypeError("The `input` option cannot be a stream in sync mode");
            }
            const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
            if (result.error || result.status !== 0) {
                throw result.error || new Error(result.stderr === "" ? result.stdout : result.stderr);
            }
            result.stdout = handleOutput(parsed.opts, result.stdout);
            result.stderr = handleOutput(parsed.opts, result.stderr);
            return result;
        };
        module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
        module.exports.spawn = util.deprecate(module.exports, "execa.spawn() is deprecated. Use execa() instead.");
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var cp = __webpack_require__(96);
        var parse = __webpack_require__(318);
        var enoent = __webpack_require__(334);
        var cpSpawnSync = cp.spawnSync;
        function spawn(command, args, options) {
            var parsed;
            var spawned;
            parsed = parse(command, args, options);
            spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
            enoent.hookChildProcess(spawned, parsed);
            return spawned;
        }
        function spawnSync(command, args, options) {
            var parsed;
            var result;
            if (!cpSpawnSync) {
                try {
                    cpSpawnSync = __webpack_require__(335);
                } catch (ex) {
                    throw new Error("In order to use spawnSync on node 0.10 or older, you must " + "install spawn-sync:\n\n" + "  npm install spawn-sync --save");
                }
            }
            parsed = parse(command, args, options);
            result = cpSpawnSync(parsed.command, parsed.args, parsed.options);
            result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
            return result;
        }
        module.exports = spawn;
        module.exports.spawn = spawn;
        module.exports.sync = spawnSync;
        module.exports._parse = parse;
        module.exports._enoent = enoent;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var resolveCommand = __webpack_require__(319);
        var hasEmptyArgumentBug = __webpack_require__(328);
        var escapeArgument = __webpack_require__(329);
        var escapeCommand = __webpack_require__(330);
        var readShebang = __webpack_require__(331);
        var isWin = process.platform === "win32";
        var skipShellRegExp = /\.(?:com|exe)$/i;
        var supportsShellOption = parseInt(process.version.substr(1).split(".")[0], 10) >= 6 || parseInt(process.version.substr(1).split(".")[0], 10) === 4 && parseInt(process.version.substr(1).split(".")[1], 10) >= 8;
        function parseNonShell(parsed) {
            var shebang;
            var needsShell;
            var applyQuotes;
            if (!isWin) {
                return parsed;
            }
            parsed.file = resolveCommand(parsed.command);
            parsed.file = parsed.file || resolveCommand(parsed.command, true);
            shebang = parsed.file && readShebang(parsed.file);
            if (shebang) {
                parsed.args.unshift(parsed.file);
                parsed.command = shebang;
                needsShell = hasEmptyArgumentBug || !skipShellRegExp.test(resolveCommand(shebang) || resolveCommand(shebang, true));
            } else {
                needsShell = hasEmptyArgumentBug || !skipShellRegExp.test(parsed.file);
            }
            if (needsShell) {
                applyQuotes = parsed.command !== "echo";
                parsed.command = escapeCommand(parsed.command);
                parsed.args = parsed.args.map((function(arg) {
                    return escapeArgument(arg, applyQuotes);
                }));
                parsed.args = [ "/d", "/s", "/c", '"' + parsed.command + (parsed.args.length ? " " + parsed.args.join(" ") : "") + '"' ];
                parsed.command = process.env.comspec || "cmd.exe";
                parsed.options.windowsVerbatimArguments = true;
            }
            return parsed;
        }
        function parseShell(parsed) {
            var shellCommand;
            if (supportsShellOption) {
                return parsed;
            }
            shellCommand = [ parsed.command ].concat(parsed.args).join(" ");
            if (isWin) {
                parsed.command = typeof parsed.options.shell === "string" ? parsed.options.shell : process.env.comspec || "cmd.exe";
                parsed.args = [ "/d", "/s", "/c", '"' + shellCommand + '"' ];
                parsed.options.windowsVerbatimArguments = true;
            } else {
                if (typeof parsed.options.shell === "string") {
                    parsed.command = parsed.options.shell;
                } else if (process.platform === "android") {
                    parsed.command = "/system/bin/sh";
                } else {
                    parsed.command = "/bin/sh";
                }
                parsed.args = [ "-c", shellCommand ];
            }
            return parsed;
        }
        function parse(command, args, options) {
            var parsed;
            if (args && !Array.isArray(args)) {
                options = args;
                args = null;
            }
            args = args ? args.slice(0) : [];
            options = options || {};
            parsed = {
                command,
                args,
                options,
                file: undefined,
                original: command
            };
            return options.shell ? parseShell(parsed) : parseNonShell(parsed);
        }
        module.exports = parse;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var path = __webpack_require__(15);
        var which = __webpack_require__(320);
        var LRU = __webpack_require__(324);
        var commandCache = new LRU({
            max: 50,
            maxAge: 30 * 1e3
        });
        function resolveCommand(command, noExtension) {
            var resolved;
            noExtension = !!noExtension;
            resolved = commandCache.get(command + "!" + noExtension);
            if (commandCache.has(command)) {
                return commandCache.get(command);
            }
            try {
                resolved = !noExtension ? which.sync(command) : which.sync(command, {
                    pathExt: path.delimiter + (process.env.PATHEXT || "")
                });
            } catch (e) {}
            commandCache.set(command + "!" + noExtension, resolved);
            return resolved;
        }
        module.exports = resolveCommand;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        module.exports = which;
        which.sync = whichSync;
        var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
        var path = __webpack_require__(15);
        var COLON = isWindows ? ";" : ":";
        var isexe = __webpack_require__(321);
        function getNotFoundError(cmd) {
            var er = new Error("not found: " + cmd);
            er.code = "ENOENT";
            return er;
        }
        function getPathInfo(cmd, opt) {
            var colon = opt.colon || COLON;
            var pathEnv = opt.path || process.env.PATH || "";
            var pathExt = [ "" ];
            pathEnv = pathEnv.split(colon);
            var pathExtExe = "";
            if (isWindows) {
                pathEnv.unshift(process.cwd());
                pathExtExe = opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM";
                pathExt = pathExtExe.split(colon);
                if (cmd.indexOf(".") !== -1 && pathExt[0] !== "") pathExt.unshift("");
            }
            if (cmd.match(/\//) || isWindows && cmd.match(/\\/)) pathEnv = [ "" ];
            return {
                env: pathEnv,
                ext: pathExt,
                extExe: pathExtExe
            };
        }
        function which(cmd, opt, cb) {
            if (typeof opt === "function") {
                cb = opt;
                opt = {};
            }
            var info = getPathInfo(cmd, opt);
            var pathEnv = info.env;
            var pathExt = info.ext;
            var pathExtExe = info.extExe;
            var found = [];
            (function F(i, l) {
                if (i === l) {
                    if (opt.all && found.length) return cb(null, found); else return cb(getNotFoundError(cmd));
                }
                var pathPart = pathEnv[i];
                if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') pathPart = pathPart.slice(1, -1);
                var p = path.join(pathPart, cmd);
                if (!pathPart && /^\.[\\\/]/.test(cmd)) {
                    p = cmd.slice(0, 2) + p;
                }
                (function E(ii, ll) {
                    if (ii === ll) return F(i + 1, l);
                    var ext = pathExt[ii];
                    isexe(p + ext, {
                        pathExt: pathExtExe
                    }, (function(er, is) {
                        if (!er && is) {
                            if (opt.all) found.push(p + ext); else return cb(null, p + ext);
                        }
                        return E(ii + 1, ll);
                    }));
                })(0, pathExt.length);
            })(0, pathEnv.length);
        }
        function whichSync(cmd, opt) {
            opt = opt || {};
            var info = getPathInfo(cmd, opt);
            var pathEnv = info.env;
            var pathExt = info.ext;
            var pathExtExe = info.extExe;
            var found = [];
            for (var i = 0, l = pathEnv.length; i < l; i++) {
                var pathPart = pathEnv[i];
                if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') pathPart = pathPart.slice(1, -1);
                var p = path.join(pathPart, cmd);
                if (!pathPart && /^\.[\\\/]/.test(cmd)) {
                    p = cmd.slice(0, 2) + p;
                }
                for (var j = 0, ll = pathExt.length; j < ll; j++) {
                    var cur = p + pathExt[j];
                    var is;
                    try {
                        is = isexe.sync(cur, {
                            pathExt: pathExtExe
                        });
                        if (is) {
                            if (opt.all) found.push(cur); else return cur;
                        }
                    } catch (ex) {}
                }
            }
            if (opt.all && found.length) return found;
            if (opt.nothrow) return null;
            throw getNotFoundError(cmd);
        }
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var fs = __webpack_require__(14);
        var core;
        if (process.platform === "win32" || global.TESTING_WINDOWS) {
            core = __webpack_require__(322);
        } else {
            core = __webpack_require__(323);
        }
        module.exports = isexe;
        isexe.sync = sync;
        function isexe(path, options, cb) {
            if (typeof options === "function") {
                cb = options;
                options = {};
            }
            if (!cb) {
                if (typeof Promise !== "function") {
                    throw new TypeError("callback not provided");
                }
                return new Promise((function(resolve, reject) {
                    isexe(path, options || {}, (function(er, is) {
                        if (er) {
                            reject(er);
                        } else {
                            resolve(is);
                        }
                    }));
                }));
            }
            core(path, options || {}, (function(er, is) {
                if (er) {
                    if (er.code === "EACCES" || options && options.ignoreErrors) {
                        er = null;
                        is = false;
                    }
                }
                cb(er, is);
            }));
        }
        function sync(path, options) {
            try {
                return core.sync(path, options || {});
            } catch (er) {
                if (options && options.ignoreErrors || er.code === "EACCES") {
                    return false;
                } else {
                    throw er;
                }
            }
        }
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        module.exports = isexe;
        isexe.sync = sync;
        var fs = __webpack_require__(14);
        function checkPathExt(path, options) {
            var pathext = options.pathExt !== undefined ? options.pathExt : process.env.PATHEXT;
            if (!pathext) {
                return true;
            }
            pathext = pathext.split(";");
            if (pathext.indexOf("") !== -1) {
                return true;
            }
            for (var i = 0; i < pathext.length; i++) {
                var p = pathext[i].toLowerCase();
                if (p && path.substr(-p.length).toLowerCase() === p) {
                    return true;
                }
            }
            return false;
        }
        function checkStat(stat, path, options) {
            if (!stat.isSymbolicLink() && !stat.isFile()) {
                return false;
            }
            return checkPathExt(path, options);
        }
        function isexe(path, options, cb) {
            fs.stat(path, (function(er, stat) {
                cb(er, er ? false : checkStat(stat, path, options));
            }));
        }
        function sync(path, options) {
            return checkStat(fs.statSync(path), path, options);
        }
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        module.exports = isexe;
        isexe.sync = sync;
        var fs = __webpack_require__(14);
        function isexe(path, options, cb) {
            fs.stat(path, (function(er, stat) {
                cb(er, er ? false : checkStat(stat, options));
            }));
        }
        function sync(path, options) {
            return checkStat(fs.statSync(path), options);
        }
        function checkStat(stat, options) {
            return stat.isFile() && checkMode(stat, options);
        }
        function checkMode(stat, options) {
            var mod = stat.mode;
            var uid = stat.uid;
            var gid = stat.gid;
            var myUid = options.uid !== undefined ? options.uid : process.getuid && process.getuid();
            var myGid = options.gid !== undefined ? options.gid : process.getgid && process.getgid();
            var u = parseInt("100", 8);
            var g = parseInt("010", 8);
            var o = parseInt("001", 8);
            var ug = u | g;
            var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
            return ret;
        }
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        module.exports = LRUCache;
        var Map = __webpack_require__(325);
        var util = __webpack_require__(58);
        var Yallist = __webpack_require__(327);
        var hasSymbol = typeof Symbol === "function" && process.env._nodeLRUCacheForceNoSymbol !== "1";
        var makeSymbol;
        if (hasSymbol) {
            makeSymbol = function(key) {
                return Symbol(key);
            };
        } else {
            makeSymbol = function(key) {
                return "_" + key;
            };
        }
        var MAX = makeSymbol("max");
        var LENGTH = makeSymbol("length");
        var LENGTH_CALCULATOR = makeSymbol("lengthCalculator");
        var ALLOW_STALE = makeSymbol("allowStale");
        var MAX_AGE = makeSymbol("maxAge");
        var DISPOSE = makeSymbol("dispose");
        var NO_DISPOSE_ON_SET = makeSymbol("noDisposeOnSet");
        var LRU_LIST = makeSymbol("lruList");
        var CACHE = makeSymbol("cache");
        function naiveLength() {
            return 1;
        }
        function LRUCache(options) {
            if (!(this instanceof LRUCache)) {
                return new LRUCache(options);
            }
            if (typeof options === "number") {
                options = {
                    max: options
                };
            }
            if (!options) {
                options = {};
            }
            var max = this[MAX] = options.max;
            if (!max || !(typeof max === "number") || max <= 0) {
                this[MAX] = Infinity;
            }
            var lc = options.length || naiveLength;
            if (typeof lc !== "function") {
                lc = naiveLength;
            }
            this[LENGTH_CALCULATOR] = lc;
            this[ALLOW_STALE] = options.stale || false;
            this[MAX_AGE] = options.maxAge || 0;
            this[DISPOSE] = options.dispose;
            this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
            this.reset();
        }
        Object.defineProperty(LRUCache.prototype, "max", {
            set: function(mL) {
                if (!mL || !(typeof mL === "number") || mL <= 0) {
                    mL = Infinity;
                }
                this[MAX] = mL;
                trim(this);
            },
            get: function() {
                return this[MAX];
            },
            enumerable: true
        });
        Object.defineProperty(LRUCache.prototype, "allowStale", {
            set: function(allowStale) {
                this[ALLOW_STALE] = !!allowStale;
            },
            get: function() {
                return this[ALLOW_STALE];
            },
            enumerable: true
        });
        Object.defineProperty(LRUCache.prototype, "maxAge", {
            set: function(mA) {
                if (!mA || !(typeof mA === "number") || mA < 0) {
                    mA = 0;
                }
                this[MAX_AGE] = mA;
                trim(this);
            },
            get: function() {
                return this[MAX_AGE];
            },
            enumerable: true
        });
        Object.defineProperty(LRUCache.prototype, "lengthCalculator", {
            set: function(lC) {
                if (typeof lC !== "function") {
                    lC = naiveLength;
                }
                if (lC !== this[LENGTH_CALCULATOR]) {
                    this[LENGTH_CALCULATOR] = lC;
                    this[LENGTH] = 0;
                    this[LRU_LIST].forEach((function(hit) {
                        hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
                        this[LENGTH] += hit.length;
                    }), this);
                }
                trim(this);
            },
            get: function() {
                return this[LENGTH_CALCULATOR];
            },
            enumerable: true
        });
        Object.defineProperty(LRUCache.prototype, "length", {
            get: function() {
                return this[LENGTH];
            },
            enumerable: true
        });
        Object.defineProperty(LRUCache.prototype, "itemCount", {
            get: function() {
                return this[LRU_LIST].length;
            },
            enumerable: true
        });
        LRUCache.prototype.rforEach = function(fn, thisp) {
            thisp = thisp || this;
            for (var walker = this[LRU_LIST].tail; walker !== null; ) {
                var prev = walker.prev;
                forEachStep(this, fn, walker, thisp);
                walker = prev;
            }
        };
        function forEachStep(self, fn, node, thisp) {
            var hit = node.value;
            if (isStale(self, hit)) {
                del(self, node);
                if (!self[ALLOW_STALE]) {
                    hit = undefined;
                }
            }
            if (hit) {
                fn.call(thisp, hit.value, hit.key, self);
            }
        }
        LRUCache.prototype.forEach = function(fn, thisp) {
            thisp = thisp || this;
            for (var walker = this[LRU_LIST].head; walker !== null; ) {
                var next = walker.next;
                forEachStep(this, fn, walker, thisp);
                walker = next;
            }
        };
        LRUCache.prototype.keys = function() {
            return this[LRU_LIST].toArray().map((function(k) {
                return k.key;
            }), this);
        };
        LRUCache.prototype.values = function() {
            return this[LRU_LIST].toArray().map((function(k) {
                return k.value;
            }), this);
        };
        LRUCache.prototype.reset = function() {
            if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
                this[LRU_LIST].forEach((function(hit) {
                    this[DISPOSE](hit.key, hit.value);
                }), this);
            }
            this[CACHE] = new Map;
            this[LRU_LIST] = new Yallist;
            this[LENGTH] = 0;
        };
        LRUCache.prototype.dump = function() {
            return this[LRU_LIST].map((function(hit) {
                if (!isStale(this, hit)) {
                    return {
                        k: hit.key,
                        v: hit.value,
                        e: hit.now + (hit.maxAge || 0)
                    };
                }
            }), this).toArray().filter((function(h) {
                return h;
            }));
        };
        LRUCache.prototype.dumpLru = function() {
            return this[LRU_LIST];
        };
        LRUCache.prototype.inspect = function(n, opts) {
            var str = "LRUCache {";
            var extras = false;
            var as = this[ALLOW_STALE];
            if (as) {
                str += "\n  allowStale: true";
                extras = true;
            }
            var max = this[MAX];
            if (max && max !== Infinity) {
                if (extras) {
                    str += ",";
                }
                str += "\n  max: " + util.inspect(max, opts);
                extras = true;
            }
            var maxAge = this[MAX_AGE];
            if (maxAge) {
                if (extras) {
                    str += ",";
                }
                str += "\n  maxAge: " + util.inspect(maxAge, opts);
                extras = true;
            }
            var lc = this[LENGTH_CALCULATOR];
            if (lc && lc !== naiveLength) {
                if (extras) {
                    str += ",";
                }
                str += "\n  length: " + util.inspect(this[LENGTH], opts);
                extras = true;
            }
            var didFirst = false;
            this[LRU_LIST].forEach((function(item) {
                if (didFirst) {
                    str += ",\n  ";
                } else {
                    if (extras) {
                        str += ",\n";
                    }
                    didFirst = true;
                    str += "\n  ";
                }
                var key = util.inspect(item.key).split("\n").join("\n  ");
                var val = {
                    value: item.value
                };
                if (item.maxAge !== maxAge) {
                    val.maxAge = item.maxAge;
                }
                if (lc !== naiveLength) {
                    val.length = item.length;
                }
                if (isStale(this, item)) {
                    val.stale = true;
                }
                val = util.inspect(val, opts).split("\n").join("\n  ");
                str += key + " => " + val;
            }));
            if (didFirst || extras) {
                str += "\n";
            }
            str += "}";
            return str;
        };
        LRUCache.prototype.set = function(key, value, maxAge) {
            maxAge = maxAge || this[MAX_AGE];
            var now = maxAge ? Date.now() : 0;
            var len = this[LENGTH_CALCULATOR](value, key);
            if (this[CACHE].has(key)) {
                if (len > this[MAX]) {
                    del(this, this[CACHE].get(key));
                    return false;
                }
                var node = this[CACHE].get(key);
                var item = node.value;
                if (this[DISPOSE]) {
                    if (!this[NO_DISPOSE_ON_SET]) {
                        this[DISPOSE](key, item.value);
                    }
                }
                item.now = now;
                item.maxAge = maxAge;
                item.value = value;
                this[LENGTH] += len - item.length;
                item.length = len;
                this.get(key);
                trim(this);
                return true;
            }
            var hit = new Entry(key, value, len, now, maxAge);
            if (hit.length > this[MAX]) {
                if (this[DISPOSE]) {
                    this[DISPOSE](key, value);
                }
                return false;
            }
            this[LENGTH] += hit.length;
            this[LRU_LIST].unshift(hit);
            this[CACHE].set(key, this[LRU_LIST].head);
            trim(this);
            return true;
        };
        LRUCache.prototype.has = function(key) {
            if (!this[CACHE].has(key)) return false;
            var hit = this[CACHE].get(key).value;
            if (isStale(this, hit)) {
                return false;
            }
            return true;
        };
        LRUCache.prototype.get = function(key) {
            return get(this, key, true);
        };
        LRUCache.prototype.peek = function(key) {
            return get(this, key, false);
        };
        LRUCache.prototype.pop = function() {
            var node = this[LRU_LIST].tail;
            if (!node) return null;
            del(this, node);
            return node.value;
        };
        LRUCache.prototype.del = function(key) {
            del(this, this[CACHE].get(key));
        };
        LRUCache.prototype.load = function(arr) {
            this.reset();
            var now = Date.now();
            for (var l = arr.length - 1; l >= 0; l--) {
                var hit = arr[l];
                var expiresAt = hit.e || 0;
                if (expiresAt === 0) {
                    this.set(hit.k, hit.v);
                } else {
                    var maxAge = expiresAt - now;
                    if (maxAge > 0) {
                        this.set(hit.k, hit.v, maxAge);
                    }
                }
            }
        };
        LRUCache.prototype.prune = function() {
            var self = this;
            this[CACHE].forEach((function(value, key) {
                get(self, key, false);
            }));
        };
        function get(self, key, doUse) {
            var node = self[CACHE].get(key);
            if (node) {
                var hit = node.value;
                if (isStale(self, hit)) {
                    del(self, node);
                    if (!self[ALLOW_STALE]) hit = undefined;
                } else {
                    if (doUse) {
                        self[LRU_LIST].unshiftNode(node);
                    }
                }
                if (hit) hit = hit.value;
            }
            return hit;
        }
        function isStale(self, hit) {
            if (!hit || !hit.maxAge && !self[MAX_AGE]) {
                return false;
            }
            var stale = false;
            var diff = Date.now() - hit.now;
            if (hit.maxAge) {
                stale = diff > hit.maxAge;
            } else {
                stale = self[MAX_AGE] && diff > self[MAX_AGE];
            }
            return stale;
        }
        function trim(self) {
            if (self[LENGTH] > self[MAX]) {
                for (var walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null; ) {
                    var prev = walker.prev;
                    del(self, walker);
                    walker = prev;
                }
            }
        }
        function del(self, node) {
            if (node) {
                var hit = node.value;
                if (self[DISPOSE]) {
                    self[DISPOSE](hit.key, hit.value);
                }
                self[LENGTH] -= hit.length;
                self[CACHE].delete(hit.key);
                self[LRU_LIST].removeNode(node);
            }
        }
        function Entry(key, value, length, now, maxAge) {
            this.key = key;
            this.value = value;
            this.length = length;
            this.now = now;
            this.maxAge = maxAge || 0;
        }
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        if (process.env.npm_package_name === "pseudomap" && process.env.npm_lifecycle_script === "test") process.env.TEST_PSEUDOMAP = "true";
        if (typeof Map === "function" && !process.env.TEST_PSEUDOMAP) {
            module.exports = Map;
        } else {
            module.exports = __webpack_require__(326);
        }
    }, module => {
        var hasOwnProperty = Object.prototype.hasOwnProperty;
        module.exports = PseudoMap;
        function PseudoMap(set) {
            if (!(this instanceof PseudoMap)) throw new TypeError("Constructor PseudoMap requires 'new'");
            this.clear();
            if (set) {
                if (set instanceof PseudoMap || typeof Map === "function" && set instanceof Map) set.forEach((function(value, key) {
                    this.set(key, value);
                }), this); else if (Array.isArray(set)) set.forEach((function(kv) {
                    this.set(kv[0], kv[1]);
                }), this); else throw new TypeError("invalid argument");
            }
        }
        PseudoMap.prototype.forEach = function(fn, thisp) {
            thisp = thisp || this;
            Object.keys(this._data).forEach((function(k) {
                if (k !== "size") fn.call(thisp, this._data[k].value, this._data[k].key);
            }), this);
        };
        PseudoMap.prototype.has = function(k) {
            return !!find(this._data, k);
        };
        PseudoMap.prototype.get = function(k) {
            var res = find(this._data, k);
            return res && res.value;
        };
        PseudoMap.prototype.set = function(k, v) {
            set(this._data, k, v);
        };
        PseudoMap.prototype.delete = function(k) {
            var res = find(this._data, k);
            if (res) {
                delete this._data[res._index];
                this._data.size--;
            }
        };
        PseudoMap.prototype.clear = function() {
            var data = Object.create(null);
            data.size = 0;
            Object.defineProperty(this, "_data", {
                value: data,
                enumerable: false,
                configurable: true,
                writable: false
            });
        };
        Object.defineProperty(PseudoMap.prototype, "size", {
            get: function() {
                return this._data.size;
            },
            set: function(n) {},
            enumerable: true,
            configurable: true
        });
        PseudoMap.prototype.values = PseudoMap.prototype.keys = PseudoMap.prototype.entries = function() {
            throw new Error("iterators are not implemented in this version");
        };
        function same(a, b) {
            return a === b || a !== a && b !== b;
        }
        function Entry(k, v, i) {
            this.key = k;
            this.value = v;
            this._index = i;
        }
        function find(data, k) {
            for (var i = 0, s = "_" + k, key = s; hasOwnProperty.call(data, key); key = s + i++) {
                if (same(data[key].key, k)) return data[key];
            }
        }
        function set(data, k, v) {
            for (var i = 0, s = "_" + k, key = s; hasOwnProperty.call(data, key); key = s + i++) {
                if (same(data[key].key, k)) {
                    data[key].value = v;
                    return;
                }
            }
            data.size++;
            data[key] = new Entry(k, v, key);
        }
    }, module => {
        module.exports = Yallist;
        Yallist.Node = Node;
        Yallist.create = Yallist;
        function Yallist(list) {
            var self = this;
            if (!(self instanceof Yallist)) {
                self = new Yallist;
            }
            self.tail = null;
            self.head = null;
            self.length = 0;
            if (list && typeof list.forEach === "function") {
                list.forEach((function(item) {
                    self.push(item);
                }));
            } else if (arguments.length > 0) {
                for (var i = 0, l = arguments.length; i < l; i++) {
                    self.push(arguments[i]);
                }
            }
            return self;
        }
        Yallist.prototype.removeNode = function(node) {
            if (node.list !== this) {
                throw new Error("removing node which does not belong to this list");
            }
            var next = node.next;
            var prev = node.prev;
            if (next) {
                next.prev = prev;
            }
            if (prev) {
                prev.next = next;
            }
            if (node === this.head) {
                this.head = next;
            }
            if (node === this.tail) {
                this.tail = prev;
            }
            node.list.length--;
            node.next = null;
            node.prev = null;
            node.list = null;
        };
        Yallist.prototype.unshiftNode = function(node) {
            if (node === this.head) {
                return;
            }
            if (node.list) {
                node.list.removeNode(node);
            }
            var head = this.head;
            node.list = this;
            node.next = head;
            if (head) {
                head.prev = node;
            }
            this.head = node;
            if (!this.tail) {
                this.tail = node;
            }
            this.length++;
        };
        Yallist.prototype.pushNode = function(node) {
            if (node === this.tail) {
                return;
            }
            if (node.list) {
                node.list.removeNode(node);
            }
            var tail = this.tail;
            node.list = this;
            node.prev = tail;
            if (tail) {
                tail.next = node;
            }
            this.tail = node;
            if (!this.head) {
                this.head = node;
            }
            this.length++;
        };
        Yallist.prototype.push = function() {
            for (var i = 0, l = arguments.length; i < l; i++) {
                push(this, arguments[i]);
            }
            return this.length;
        };
        Yallist.prototype.unshift = function() {
            for (var i = 0, l = arguments.length; i < l; i++) {
                unshift(this, arguments[i]);
            }
            return this.length;
        };
        Yallist.prototype.pop = function() {
            if (!this.tail) {
                return undefined;
            }
            var res = this.tail.value;
            this.tail = this.tail.prev;
            if (this.tail) {
                this.tail.next = null;
            } else {
                this.head = null;
            }
            this.length--;
            return res;
        };
        Yallist.prototype.shift = function() {
            if (!this.head) {
                return undefined;
            }
            var res = this.head.value;
            this.head = this.head.next;
            if (this.head) {
                this.head.prev = null;
            } else {
                this.tail = null;
            }
            this.length--;
            return res;
        };
        Yallist.prototype.forEach = function(fn, thisp) {
            thisp = thisp || this;
            for (var walker = this.head, i = 0; walker !== null; i++) {
                fn.call(thisp, walker.value, i, this);
                walker = walker.next;
            }
        };
        Yallist.prototype.forEachReverse = function(fn, thisp) {
            thisp = thisp || this;
            for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
                fn.call(thisp, walker.value, i, this);
                walker = walker.prev;
            }
        };
        Yallist.prototype.get = function(n) {
            for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
                walker = walker.next;
            }
            if (i === n && walker !== null) {
                return walker.value;
            }
        };
        Yallist.prototype.getReverse = function(n) {
            for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
                walker = walker.prev;
            }
            if (i === n && walker !== null) {
                return walker.value;
            }
        };
        Yallist.prototype.map = function(fn, thisp) {
            thisp = thisp || this;
            var res = new Yallist;
            for (var walker = this.head; walker !== null; ) {
                res.push(fn.call(thisp, walker.value, this));
                walker = walker.next;
            }
            return res;
        };
        Yallist.prototype.mapReverse = function(fn, thisp) {
            thisp = thisp || this;
            var res = new Yallist;
            for (var walker = this.tail; walker !== null; ) {
                res.push(fn.call(thisp, walker.value, this));
                walker = walker.prev;
            }
            return res;
        };
        Yallist.prototype.reduce = function(fn, initial) {
            var acc;
            var walker = this.head;
            if (arguments.length > 1) {
                acc = initial;
            } else if (this.head) {
                walker = this.head.next;
                acc = this.head.value;
            } else {
                throw new TypeError("Reduce of empty list with no initial value");
            }
            for (var i = 0; walker !== null; i++) {
                acc = fn(acc, walker.value, i);
                walker = walker.next;
            }
            return acc;
        };
        Yallist.prototype.reduceReverse = function(fn, initial) {
            var acc;
            var walker = this.tail;
            if (arguments.length > 1) {
                acc = initial;
            } else if (this.tail) {
                walker = this.tail.prev;
                acc = this.tail.value;
            } else {
                throw new TypeError("Reduce of empty list with no initial value");
            }
            for (var i = this.length - 1; walker !== null; i--) {
                acc = fn(acc, walker.value, i);
                walker = walker.prev;
            }
            return acc;
        };
        Yallist.prototype.toArray = function() {
            var arr = new Array(this.length);
            for (var i = 0, walker = this.head; walker !== null; i++) {
                arr[i] = walker.value;
                walker = walker.next;
            }
            return arr;
        };
        Yallist.prototype.toArrayReverse = function() {
            var arr = new Array(this.length);
            for (var i = 0, walker = this.tail; walker !== null; i++) {
                arr[i] = walker.value;
                walker = walker.prev;
            }
            return arr;
        };
        Yallist.prototype.slice = function(from, to) {
            to = to || this.length;
            if (to < 0) {
                to += this.length;
            }
            from = from || 0;
            if (from < 0) {
                from += this.length;
            }
            var ret = new Yallist;
            if (to < from || to < 0) {
                return ret;
            }
            if (from < 0) {
                from = 0;
            }
            if (to > this.length) {
                to = this.length;
            }
            for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
                walker = walker.next;
            }
            for (;walker !== null && i < to; i++, walker = walker.next) {
                ret.push(walker.value);
            }
            return ret;
        };
        Yallist.prototype.sliceReverse = function(from, to) {
            to = to || this.length;
            if (to < 0) {
                to += this.length;
            }
            from = from || 0;
            if (from < 0) {
                from += this.length;
            }
            var ret = new Yallist;
            if (to < from || to < 0) {
                return ret;
            }
            if (from < 0) {
                from = 0;
            }
            if (to > this.length) {
                to = this.length;
            }
            for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
                walker = walker.prev;
            }
            for (;walker !== null && i > from; i--, walker = walker.prev) {
                ret.push(walker.value);
            }
            return ret;
        };
        Yallist.prototype.reverse = function() {
            var head = this.head;
            var tail = this.tail;
            for (var walker = head; walker !== null; walker = walker.prev) {
                var p = walker.prev;
                walker.prev = walker.next;
                walker.next = p;
            }
            this.head = tail;
            this.tail = head;
            return this;
        };
        function push(self, item) {
            self.tail = new Node(item, self.tail, null, self);
            if (!self.head) {
                self.head = self.tail;
            }
            self.length++;
        }
        function unshift(self, item) {
            self.head = new Node(item, null, self.head, self);
            if (!self.tail) {
                self.tail = self.head;
            }
            self.length++;
        }
        function Node(value, prev, next, list) {
            if (!(this instanceof Node)) {
                return new Node(value, prev, next, list);
            }
            this.list = list;
            this.value = value;
            if (prev) {
                prev.next = this;
                this.prev = prev;
            } else {
                this.prev = null;
            }
            if (next) {
                next.prev = this;
                this.next = next;
            } else {
                this.next = null;
            }
        }
    }, module => {
        "use strict";
        function hasEmptyArgumentBug() {
            var nodeVer;
            if (process.platform !== "win32") {
                return false;
            }
            nodeVer = process.version.substr(1).split(".").map((function(num) {
                return parseInt(num, 10);
            }));
            return nodeVer[0] === 0 && nodeVer[1] < 12;
        }
        module.exports = hasEmptyArgumentBug();
    }, module => {
        "use strict";
        function escapeArgument(arg, quote) {
            arg = "" + arg;
            if (!quote) {
                arg = arg.replace(/([()%!^<>&|;,"'\s])/g, "^$1");
            } else {
                arg = arg.replace(/(\\*)"/g, '$1$1\\"');
                arg = arg.replace(/(\\*)$/, "$1$1");
                arg = '"' + arg + '"';
            }
            return arg;
        }
        module.exports = escapeArgument;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var escapeArgument = __webpack_require__(329);
        function escapeCommand(command) {
            return /^[a-z0-9_-]+$/i.test(command) ? command : escapeArgument(command, true);
        }
        module.exports = escapeCommand;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var fs = __webpack_require__(14);
        var LRU = __webpack_require__(324);
        var shebangCommand = __webpack_require__(332);
        var shebangCache = new LRU({
            max: 50,
            maxAge: 30 * 1e3
        });
        function readShebang(command) {
            var buffer;
            var fd;
            var shebang;
            if (shebangCache.has(command)) {
                return shebangCache.get(command);
            }
            buffer = new Buffer(150);
            try {
                fd = fs.openSync(command, "r");
                fs.readSync(fd, buffer, 0, 150, 0);
                fs.closeSync(fd);
            } catch (e) {}
            shebang = shebangCommand(buffer.toString());
            shebangCache.set(command, shebang);
            return shebang;
        }
        module.exports = readShebang;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var shebangRegex = __webpack_require__(333);
        module.exports = function(str) {
            var match = str.match(shebangRegex);
            if (!match) {
                return null;
            }
            var arr = match[0].replace(/#! ?/, "").split(" ");
            var bin = arr[0].split("/").pop();
            var arg = arr[1];
            return bin === "env" ? arg : bin + (arg ? " " + arg : "");
        };
    }, module => {
        "use strict";
        module.exports = /^#!.*/;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var isWin = process.platform === "win32";
        var resolveCommand = __webpack_require__(319);
        var isNode10 = process.version.indexOf("v0.10.") === 0;
        function notFoundError(command, syscall) {
            var err;
            err = new Error(syscall + " " + command + " ENOENT");
            err.code = err.errno = "ENOENT";
            err.syscall = syscall + " " + command;
            return err;
        }
        function hookChildProcess(cp, parsed) {
            var originalEmit;
            if (!isWin) {
                return;
            }
            originalEmit = cp.emit;
            cp.emit = function(name, arg1) {
                var err;
                if (name === "exit") {
                    err = verifyENOENT(arg1, parsed, "spawn");
                    if (err) {
                        return originalEmit.call(cp, "error", err);
                    }
                }
                return originalEmit.apply(cp, arguments);
            };
        }
        function verifyENOENT(status, parsed) {
            if (isWin && status === 1 && !parsed.file) {
                return notFoundError(parsed.original, "spawn");
            }
            return null;
        }
        function verifyENOENTSync(status, parsed) {
            if (isWin && status === 1 && !parsed.file) {
                return notFoundError(parsed.original, "spawnSync");
            }
            if (isNode10 && status === -1) {
                parsed.file = isWin ? parsed.file : resolveCommand(parsed.original);
                if (!parsed.file) {
                    return notFoundError(parsed.original, "spawnSync");
                }
            }
            return null;
        }
        module.exports.hookChildProcess = hookChildProcess;
        module.exports.verifyENOENT = verifyENOENT;
        module.exports.verifyENOENTSync = verifyENOENTSync;
        module.exports.notFoundError = notFoundError;
    }, module => {
        "use strict";
        if (typeof {} === "undefined") {
            var e = new Error("Cannot find module '{}'");
            e.code = "MODULE_NOT_FOUND";
            throw e;
        }
        module.exports = {};
    }, module => {
        "use strict";
        module.exports = function(x) {
            var lf = typeof x === "string" ? "\n" : "\n".charCodeAt();
            var cr = typeof x === "string" ? "\r" : "\r".charCodeAt();
            if (x[x.length - 1] === lf) {
                x = x.slice(0, x.length - 1);
            }
            if (x[x.length - 1] === cr) {
                x = x.slice(0, x.length - 1);
            }
            return x;
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        const path = __webpack_require__(15);
        const pathKey = __webpack_require__(338);
        module.exports = opts => {
            opts = Object.assign({
                cwd: process.cwd(),
                path: process.env[pathKey()]
            }, opts);
            let prev;
            let pth = path.resolve(opts.cwd);
            const ret = [];
            while (prev !== pth) {
                ret.push(path.join(pth, "node_modules/.bin"));
                prev = pth;
                pth = path.resolve(pth, "..");
            }
            ret.push(path.dirname(process.execPath));
            return ret.concat(opts.path).join(path.delimiter);
        };
        module.exports.env = opts => {
            opts = Object.assign({
                env: process.env
            }, opts);
            const env = Object.assign({}, opts.env);
            const path = pathKey({
                env
            });
            opts.path = env[path];
            env[path] = module.exports(opts);
            return env;
        };
    }, module => {
        "use strict";
        module.exports = opts => {
            opts = opts || {};
            const env = opts.env || process.env;
            const platform = opts.platform || process.platform;
            if (platform !== "win32") {
                return "PATH";
            }
            return Object.keys(env).find((x => x.toUpperCase() === "PATH")) || "Path";
        };
    }, module => {
        "use strict";
        var isStream = module.exports = function(stream) {
            return stream !== null && typeof stream === "object" && typeof stream.pipe === "function";
        };
        isStream.writable = function(stream) {
            return isStream(stream) && stream.writable !== false && typeof stream._write === "function" && typeof stream._writableState === "object";
        };
        isStream.readable = function(stream) {
            return isStream(stream) && stream.readable !== false && typeof stream._read === "function" && typeof stream._readableState === "object";
        };
        isStream.duplex = function(stream) {
            return isStream.writable(stream) && isStream.readable(stream);
        };
        isStream.transform = function(stream) {
            return isStream.duplex(stream) && typeof stream._transform === "function" && typeof stream._transformState === "object";
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        const bufferStream = __webpack_require__(341);
        function getStream(inputStream, opts) {
            if (!inputStream) {
                return Promise.reject(new Error("Expected a stream"));
            }
            opts = Object.assign({
                maxBuffer: Infinity
            }, opts);
            const maxBuffer = opts.maxBuffer;
            let stream;
            let clean;
            const p = new Promise(((resolve, reject) => {
                const error = err => {
                    if (err) {
                        err.bufferedData = stream.getBufferedValue();
                    }
                    reject(err);
                };
                stream = bufferStream(opts);
                inputStream.once("error", error);
                inputStream.pipe(stream);
                stream.on("data", (() => {
                    if (stream.getBufferedLength() > maxBuffer) {
                        reject(new Error("maxBuffer exceeded"));
                    }
                }));
                stream.once("error", error);
                stream.on("end", resolve);
                clean = () => {
                    if (inputStream.unpipe) {
                        inputStream.unpipe(stream);
                    }
                };
            }));
            p.then(clean, clean);
            return p.then((() => stream.getBufferedValue()));
        }
        module.exports = getStream;
        module.exports.buffer = (stream, opts) => getStream(stream, Object.assign({}, opts, {
            encoding: "buffer"
        }));
        module.exports.array = (stream, opts) => getStream(stream, Object.assign({}, opts, {
            array: true
        }));
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        const PassThrough = __webpack_require__(17).PassThrough;
        module.exports = opts => {
            opts = Object.assign({}, opts);
            const array = opts.array;
            let encoding = opts.encoding;
            const buffer = encoding === "buffer";
            let objectMode = false;
            if (array) {
                objectMode = !(encoding || buffer);
            } else {
                encoding = encoding || "utf8";
            }
            if (buffer) {
                encoding = null;
            }
            let len = 0;
            const ret = [];
            const stream = new PassThrough({
                objectMode
            });
            if (encoding) {
                stream.setEncoding(encoding);
            }
            stream.on("data", (chunk => {
                ret.push(chunk);
                if (objectMode) {
                    len = ret.length;
                } else {
                    len += chunk.length;
                }
            }));
            stream.getBufferedValue = () => {
                if (array) {
                    return ret;
                }
                return buffer ? Buffer.concat(ret, len) : ret.join("");
            };
            stream.getBufferedLength = () => len;
            return stream;
        };
    }, module => {
        "use strict";
        module.exports = (promise, onFinally) => {
            onFinally = onFinally || (() => {});
            return promise.then((val => new Promise((resolve => {
                resolve(onFinally());
            })).then((() => val))), (err => new Promise((resolve => {
                resolve(onFinally());
            })).then((() => {
                throw err;
            }))));
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var assert = __webpack_require__(197);
        var signals = __webpack_require__(344);
        var isWin = /^win/i.test(process.platform);
        var EE = __webpack_require__(26);
        if (typeof EE !== "function") {
            EE = EE.EventEmitter;
        }
        var emitter;
        if (process.__signal_exit_emitter__) {
            emitter = process.__signal_exit_emitter__;
        } else {
            emitter = process.__signal_exit_emitter__ = new EE;
            emitter.count = 0;
            emitter.emitted = {};
        }
        if (!emitter.infinite) {
            emitter.setMaxListeners(Infinity);
            emitter.infinite = true;
        }
        module.exports = function(cb, opts) {
            assert.equal(typeof cb, "function", "a callback must be provided for exit handler");
            if (loaded === false) {
                load();
            }
            var ev = "exit";
            if (opts && opts.alwaysLast) {
                ev = "afterexit";
            }
            var remove = function() {
                emitter.removeListener(ev, cb);
                if (emitter.listeners("exit").length === 0 && emitter.listeners("afterexit").length === 0) {
                    unload();
                }
            };
            emitter.on(ev, cb);
            return remove;
        };
        module.exports.unload = unload;
        function unload() {
            if (!loaded) {
                return;
            }
            loaded = false;
            signals.forEach((function(sig) {
                try {
                    process.removeListener(sig, sigListeners[sig]);
                } catch (er) {}
            }));
            process.emit = originalProcessEmit;
            process.reallyExit = originalProcessReallyExit;
            emitter.count -= 1;
        }
        function emit(event, code, signal) {
            if (emitter.emitted[event]) {
                return;
            }
            emitter.emitted[event] = true;
            emitter.emit(event, code, signal);
        }
        var sigListeners = {};
        signals.forEach((function(sig) {
            sigListeners[sig] = function listener() {
                var listeners = process.listeners(sig);
                if (listeners.length === emitter.count) {
                    unload();
                    emit("exit", null, sig);
                    emit("afterexit", null, sig);
                    if (isWin && sig === "SIGHUP") {
                        sig = "SIGINT";
                    }
                    process.kill(process.pid, sig);
                }
            };
        }));
        module.exports.signals = function() {
            return signals;
        };
        module.exports.load = load;
        var loaded = false;
        function load() {
            if (loaded) {
                return;
            }
            loaded = true;
            emitter.count += 1;
            signals = signals.filter((function(sig) {
                try {
                    process.on(sig, sigListeners[sig]);
                    return true;
                } catch (er) {
                    return false;
                }
            }));
            process.emit = processEmit;
            process.reallyExit = processReallyExit;
        }
        var originalProcessReallyExit = process.reallyExit;
        function processReallyExit(code) {
            process.exitCode = code || 0;
            emit("exit", process.exitCode, null);
            emit("afterexit", process.exitCode, null);
            originalProcessReallyExit.call(process, process.exitCode);
        }
        var originalProcessEmit = process.emit;
        function processEmit(ev, arg) {
            if (ev === "exit") {
                if (arg !== undefined) {
                    process.exitCode = arg;
                }
                var ret = originalProcessEmit.apply(this, arguments);
                emit("exit", process.exitCode, null);
                emit("afterexit", process.exitCode, null);
                return ret;
            } else {
                return originalProcessEmit.apply(this, arguments);
            }
        }
    }, module => {
        module.exports = [ "SIGABRT", "SIGALRM", "SIGHUP", "SIGINT", "SIGTERM" ];
        if (process.platform !== "win32") {
            module.exports.push("SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
        }
        if (process.platform === "linux") {
            module.exports.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT", "SIGUNUSED");
        }
    }, module => {
        "use strict";
        let uv;
        try {
            uv = process.binding("uv");
            if (typeof uv.errname !== "function") {
                throw new TypeError("uv.errname is not a function");
            }
        } catch (err) {
            console.error("execa/lib/errname: unable to establish process.binding('uv')", err);
            uv = null;
        }
        function errname(uv, code) {
            if (uv) {
                return uv.errname(code);
            }
            if (!(code < 0)) {
                throw new Error("err >= 0");
            }
            return `Unknown system error ${code}`;
        }
        module.exports = code => errname(uv, code);
        module.exports.__test__ = errname;
    }, module => {
        "use strict";
        const alias = [ "stdin", "stdout", "stderr" ];
        const hasAlias = opts => alias.some((x => Boolean(opts[x])));
        module.exports = opts => {
            if (!opts) {
                return null;
            }
            if (opts.stdio && hasAlias(opts)) {
                throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map((x => `\`${x}\``)).join(", ")}`);
            }
            if (typeof opts.stdio === "string") {
                return opts.stdio;
            }
            const stdio = opts.stdio || [];
            if (!Array.isArray(stdio)) {
                throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
            }
            const result = [];
            const len = Math.max(stdio.length, alias.length);
            for (let i = 0; i < len; i++) {
                let value = null;
                if (stdio[i] !== undefined) {
                    value = stdio[i];
                } else if (opts[alias[i]] !== undefined) {
                    value = opts[alias[i]];
                }
                result[i] = value;
            }
            return result;
        };
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        var invertKv = __webpack_require__(348);
        var all = __webpack_require__(349);
        var inverted = invertKv(all);
        exports.from = function(lcidCode) {
            if (typeof lcidCode !== "number") {
                throw new TypeError("Expected a number");
            }
            return inverted[lcidCode];
        };
        exports.to = function(localeId) {
            if (typeof localeId !== "string") {
                throw new TypeError("Expected a string");
            }
            return all[localeId];
        };
        exports.all = all;
    }, module => {
        "use strict";
        module.exports = function(obj) {
            if (typeof obj !== "object") {
                throw new TypeError("Expected an object");
            }
            var ret = {};
            for (var key in obj) {
                var val = obj[key];
                ret[val] = key;
            }
            return ret;
        };
    }, module => {
        "use strict";
        module.exports = JSON.parse('{"af_ZA":1078,"am_ET":1118,"ar_AE":14337,"ar_BH":15361,"ar_DZ":5121,"ar_EG":3073,"ar_IQ":2049,"ar_JO":11265,"ar_KW":13313,"ar_LB":12289,"ar_LY":4097,"ar_MA":6145,"ar_OM":8193,"ar_QA":16385,"ar_SA":1025,"ar_SY":10241,"ar_TN":7169,"ar_YE":9217,"arn_CL":1146,"as_IN":1101,"az_AZ":2092,"ba_RU":1133,"be_BY":1059,"bg_BG":1026,"bn_IN":1093,"bo_BT":2129,"bo_CN":1105,"br_FR":1150,"bs_BA":8218,"ca_ES":1027,"co_FR":1155,"cs_CZ":1029,"cy_GB":1106,"da_DK":1030,"de_AT":3079,"de_CH":2055,"de_DE":1031,"de_LI":5127,"de_LU":4103,"div_MV":1125,"dsb_DE":2094,"el_GR":1032,"en_AU":3081,"en_BZ":10249,"en_CA":4105,"en_CB":9225,"en_GB":2057,"en_IE":6153,"en_IN":18441,"en_JA":8201,"en_MY":17417,"en_NZ":5129,"en_PH":13321,"en_TT":11273,"en_US":1033,"en_ZA":7177,"en_ZW":12297,"es_AR":11274,"es_BO":16394,"es_CL":13322,"es_CO":9226,"es_CR":5130,"es_DO":7178,"es_EC":12298,"es_ES":3082,"es_GT":4106,"es_HN":18442,"es_MX":2058,"es_NI":19466,"es_PA":6154,"es_PE":10250,"es_PR":20490,"es_PY":15370,"es_SV":17418,"es_UR":14346,"es_US":21514,"es_VE":8202,"et_EE":1061,"eu_ES":1069,"fa_IR":1065,"fi_FI":1035,"fil_PH":1124,"fo_FO":1080,"fr_BE":2060,"fr_CA":3084,"fr_CH":4108,"fr_FR":1036,"fr_LU":5132,"fr_MC":6156,"fy_NL":1122,"ga_IE":2108,"gbz_AF":1164,"gl_ES":1110,"gsw_FR":1156,"gu_IN":1095,"ha_NG":1128,"he_IL":1037,"hi_IN":1081,"hr_BA":4122,"hr_HR":1050,"hu_HU":1038,"hy_AM":1067,"id_ID":1057,"ii_CN":1144,"is_IS":1039,"it_CH":2064,"it_IT":1040,"iu_CA":2141,"ja_JP":1041,"ka_GE":1079,"kh_KH":1107,"kk_KZ":1087,"kl_GL":1135,"kn_IN":1099,"ko_KR":1042,"kok_IN":1111,"ky_KG":1088,"lb_LU":1134,"lo_LA":1108,"lt_LT":1063,"lv_LV":1062,"mi_NZ":1153,"mk_MK":1071,"ml_IN":1100,"mn_CN":2128,"mn_MN":1104,"moh_CA":1148,"mr_IN":1102,"ms_BN":2110,"ms_MY":1086,"mt_MT":1082,"my_MM":1109,"nb_NO":1044,"ne_NP":1121,"nl_BE":2067,"nl_NL":1043,"nn_NO":2068,"ns_ZA":1132,"oc_FR":1154,"or_IN":1096,"pa_IN":1094,"pl_PL":1045,"ps_AF":1123,"pt_BR":1046,"pt_PT":2070,"qut_GT":1158,"quz_BO":1131,"quz_EC":2155,"quz_PE":3179,"rm_CH":1047,"ro_RO":1048,"ru_RU":1049,"rw_RW":1159,"sa_IN":1103,"sah_RU":1157,"se_FI":3131,"se_NO":1083,"se_SE":2107,"si_LK":1115,"sk_SK":1051,"sl_SI":1060,"sma_NO":6203,"sma_SE":7227,"smj_NO":4155,"smj_SE":5179,"smn_FI":9275,"sms_FI":8251,"sq_AL":1052,"sr_BA":7194,"sr_SP":3098,"sv_FI":2077,"sv_SE":1053,"sw_KE":1089,"syr_SY":1114,"ta_IN":1097,"te_IN":1098,"tg_TJ":1064,"th_TH":1054,"tk_TM":1090,"tmz_DZ":2143,"tn_ZA":1074,"tr_TR":1055,"tt_RU":1092,"ug_CN":1152,"uk_UA":1058,"ur_IN":2080,"ur_PK":1056,"uz_UZ":2115,"vi_VN":1066,"wen_DE":1070,"wo_SN":1160,"xh_ZA":1076,"yo_NG":1130,"zh_CHS":4,"zh_CHT":31748,"zh_CN":2052,"zh_HK":3076,"zh_MO":5124,"zh_SG":4100,"zh_TW":1028,"zu_ZA":1077}');
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        const mimicFn = __webpack_require__(351);
        const cacheStore = new WeakMap;
        const defaultCacheKey = function(x) {
            if (arguments.length === 1 && (x === null || x === undefined || typeof x !== "function" && typeof x !== "object")) {
                return x;
            }
            return JSON.stringify(arguments);
        };
        module.exports = (fn, opts) => {
            opts = Object.assign({
                cacheKey: defaultCacheKey,
                cache: new Map
            }, opts);
            const memoized = function() {
                const cache = cacheStore.get(memoized);
                const key = opts.cacheKey.apply(null, arguments);
                if (cache.has(key)) {
                    const c = cache.get(key);
                    if (typeof opts.maxAge !== "number" || Date.now() < c.maxAge) {
                        return c.data;
                    }
                }
                const ret = fn.apply(null, arguments);
                cache.set(key, {
                    data: ret,
                    maxAge: Date.now() + (opts.maxAge || 0)
                });
                return ret;
            };
            mimicFn(memoized, fn);
            cacheStore.set(memoized, opts.cache);
            return memoized;
        };
        module.exports.clear = fn => {
            const cache = cacheStore.get(fn);
            if (cache && typeof cache.clear === "function") {
                cache.clear();
            }
        };
    }, module => {
        "use strict";
        module.exports = (to, from) => {
            for (const prop of Object.getOwnPropertyNames(from).concat(Object.getOwnPropertySymbols(from))) {
                Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop));
            }
            return to;
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        const _ = __webpack_require__(284);
        const detect = __webpack_require__(302);
        const defaultContext = __webpack_require__(313);
        const utils = __webpack_require__(306);
        const env = detect.getName();
        module.exports = SentryLib => {
            const properties = {
                installed: false,
                enabled: true
            };
            return {
                isInstalled: () => properties.installed,
                install: (dsn, config) => {
                    if (properties.installed) {
                        throw new Error("Sentry already installed");
                    }
                    const sentryConfig = _.cloneDeep(config);
                    const transport = SentryLib.transports && SentryLib.transports.https;
                    _.defaults(sentryConfig, {
                        autoBreadcrumbs: true,
                        allowSecretKey: true,
                        dataCallback: utils.hideAbsolutePathsInObject,
                        transport
                    });
                    _.merge(sentryConfig, {
                        extra: defaultContext[env]
                    });
                    properties.client = SentryLib.config(dsn, sentryConfig).install();
                    properties.installed = true;
                },
                uninstall: () => {
                    if (!properties.installed) {
                        throw new Error("Sentry not installed");
                    }
                    properties.client.uninstall();
                    properties.installed = false;
                },
                captureException: exception => {
                    if (!properties.installed) {
                        throw new Error("Sentry not installed");
                    }
                    properties.client.captureException(exception);
                }
            };
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        if (false) {
            var throwOnDirectAccess, ReactIs;
        } else {
            module.exports = __webpack_require__(354)();
        }
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var ReactPropTypesSecret = __webpack_require__(355);
        function emptyFunction() {}
        function emptyFunctionWithReset() {}
        emptyFunctionWithReset.resetWarningCache = emptyFunction;
        module.exports = function() {
            function shim(props, propName, componentName, location, propFullName, secret) {
                if (secret === ReactPropTypesSecret) {
                    return;
                }
                var err = new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. " + "Use PropTypes.checkPropTypes() to call them. " + "Read more at http://fb.me/use-check-prop-types");
                err.name = "Invariant Violation";
                throw err;
            }
            shim.isRequired = shim;
            function getShim() {
                return shim;
            }
            var ReactPropTypes = {
                array: shim,
                bool: shim,
                func: shim,
                number: shim,
                object: shim,
                string: shim,
                symbol: shim,
                any: shim,
                arrayOf: getShim,
                element: shim,
                elementType: shim,
                instanceOf: getShim,
                node: shim,
                objectOf: getShim,
                oneOf: getShim,
                oneOfType: getShim,
                shape: getShim,
                exact: getShim,
                checkPropTypes: emptyFunctionWithReset,
                resetWarningCache: emptyFunction
            };
            ReactPropTypes.PropTypes = ReactPropTypes;
            return ReactPropTypes;
        };
    }, module => {
        "use strict";
        var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
        module.exports = ReactPropTypesSecret;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseClone = __webpack_require__(357);
        var CLONE_DEEP_FLAG = 1, CLONE_SYMBOLS_FLAG = 4;
        function cloneDeep(value) {
            return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
        }
        module.exports = cloneDeep;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var Stack = __webpack_require__(358), arrayEach = __webpack_require__(402), assignValue = __webpack_require__(403), baseAssign = __webpack_require__(406), baseAssignIn = __webpack_require__(428), cloneBuffer = __webpack_require__(432), copyArray = __webpack_require__(433), copySymbols = __webpack_require__(434), copySymbolsIn = __webpack_require__(438), getAllKeys = __webpack_require__(442), getAllKeysIn = __webpack_require__(444), getTag = __webpack_require__(445), initCloneArray = __webpack_require__(450), initCloneByTag = __webpack_require__(451), initCloneObject = __webpack_require__(458), isArray = __webpack_require__(414), isBuffer = __webpack_require__(415), isMap = __webpack_require__(460), isObject = __webpack_require__(382), isSet = __webpack_require__(462), keys = __webpack_require__(408), keysIn = __webpack_require__(429);
        var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
        var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", weakMapTag = "[object WeakMap]";
        var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
        var cloneableTags = {};
        cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
        cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
        function baseClone(value, bitmask, customizer, key, object, stack) {
            var result, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG;
            if (customizer) {
                result = object ? customizer(value, key, object, stack) : customizer(value);
            }
            if (result !== undefined) {
                return result;
            }
            if (!isObject(value)) {
                return value;
            }
            var isArr = isArray(value);
            if (isArr) {
                result = initCloneArray(value);
                if (!isDeep) {
                    return copyArray(value, result);
                }
            } else {
                var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
                if (isBuffer(value)) {
                    return cloneBuffer(value, isDeep);
                }
                if (tag == objectTag || tag == argsTag || isFunc && !object) {
                    result = isFlat || isFunc ? {} : initCloneObject(value);
                    if (!isDeep) {
                        return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value));
                    }
                } else {
                    if (!cloneableTags[tag]) {
                        return object ? value : {};
                    }
                    result = initCloneByTag(value, tag, isDeep);
                }
            }
            stack || (stack = new Stack);
            var stacked = stack.get(value);
            if (stacked) {
                return stacked;
            }
            stack.set(value, result);
            if (isSet(value)) {
                value.forEach((function(subValue) {
                    result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
                }));
            } else if (isMap(value)) {
                value.forEach((function(subValue, key) {
                    result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
                }));
            }
            var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
            var props = isArr ? undefined : keysFunc(value);
            arrayEach(props || value, (function(subValue, key) {
                if (props) {
                    key = subValue;
                    subValue = value[key];
                }
                assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
            }));
            return result;
        }
        module.exports = baseClone;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var ListCache = __webpack_require__(359), stackClear = __webpack_require__(367), stackDelete = __webpack_require__(368), stackGet = __webpack_require__(369), stackHas = __webpack_require__(370), stackSet = __webpack_require__(371);
        function Stack(entries) {
            var data = this.__data__ = new ListCache(entries);
            this.size = data.size;
        }
        Stack.prototype.clear = stackClear;
        Stack.prototype["delete"] = stackDelete;
        Stack.prototype.get = stackGet;
        Stack.prototype.has = stackHas;
        Stack.prototype.set = stackSet;
        module.exports = Stack;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var listCacheClear = __webpack_require__(360), listCacheDelete = __webpack_require__(361), listCacheGet = __webpack_require__(364), listCacheHas = __webpack_require__(365), listCacheSet = __webpack_require__(366);
        function ListCache(entries) {
            var index = -1, length = entries == null ? 0 : entries.length;
            this.clear();
            while (++index < length) {
                var entry = entries[index];
                this.set(entry[0], entry[1]);
            }
        }
        ListCache.prototype.clear = listCacheClear;
        ListCache.prototype["delete"] = listCacheDelete;
        ListCache.prototype.get = listCacheGet;
        ListCache.prototype.has = listCacheHas;
        ListCache.prototype.set = listCacheSet;
        module.exports = ListCache;
    }, module => {
        function listCacheClear() {
            this.__data__ = [];
            this.size = 0;
        }
        module.exports = listCacheClear;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var assocIndexOf = __webpack_require__(362);
        var arrayProto = Array.prototype;
        var splice = arrayProto.splice;
        function listCacheDelete(key) {
            var data = this.__data__, index = assocIndexOf(data, key);
            if (index < 0) {
                return false;
            }
            var lastIndex = data.length - 1;
            if (index == lastIndex) {
                data.pop();
            } else {
                splice.call(data, index, 1);
            }
            --this.size;
            return true;
        }
        module.exports = listCacheDelete;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var eq = __webpack_require__(363);
        function assocIndexOf(array, key) {
            var length = array.length;
            while (length--) {
                if (eq(array[length][0], key)) {
                    return length;
                }
            }
            return -1;
        }
        module.exports = assocIndexOf;
    }, module => {
        function eq(value, other) {
            return value === other || value !== value && other !== other;
        }
        module.exports = eq;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var assocIndexOf = __webpack_require__(362);
        function listCacheGet(key) {
            var data = this.__data__, index = assocIndexOf(data, key);
            return index < 0 ? undefined : data[index][1];
        }
        module.exports = listCacheGet;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var assocIndexOf = __webpack_require__(362);
        function listCacheHas(key) {
            return assocIndexOf(this.__data__, key) > -1;
        }
        module.exports = listCacheHas;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var assocIndexOf = __webpack_require__(362);
        function listCacheSet(key, value) {
            var data = this.__data__, index = assocIndexOf(data, key);
            if (index < 0) {
                ++this.size;
                data.push([ key, value ]);
            } else {
                data[index][1] = value;
            }
            return this;
        }
        module.exports = listCacheSet;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var ListCache = __webpack_require__(359);
        function stackClear() {
            this.__data__ = new ListCache;
            this.size = 0;
        }
        module.exports = stackClear;
    }, module => {
        function stackDelete(key) {
            var data = this.__data__, result = data["delete"](key);
            this.size = data.size;
            return result;
        }
        module.exports = stackDelete;
    }, module => {
        function stackGet(key) {
            return this.__data__.get(key);
        }
        module.exports = stackGet;
    }, module => {
        function stackHas(key) {
            return this.__data__.has(key);
        }
        module.exports = stackHas;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var ListCache = __webpack_require__(359), Map = __webpack_require__(372), MapCache = __webpack_require__(387);
        var LARGE_ARRAY_SIZE = 200;
        function stackSet(key, value) {
            var data = this.__data__;
            if (data instanceof ListCache) {
                var pairs = data.__data__;
                if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
                    pairs.push([ key, value ]);
                    this.size = ++data.size;
                    return this;
                }
                data = this.__data__ = new MapCache(pairs);
            }
            data.set(key, value);
            this.size = data.size;
            return this;
        }
        module.exports = stackSet;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var getNative = __webpack_require__(373), root = __webpack_require__(378);
        var Map = getNative(root, "Map");
        module.exports = Map;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseIsNative = __webpack_require__(374), getValue = __webpack_require__(386);
        function getNative(object, key) {
            var value = getValue(object, key);
            return baseIsNative(value) ? value : undefined;
        }
        module.exports = getNative;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var isFunction = __webpack_require__(375), isMasked = __webpack_require__(383), isObject = __webpack_require__(382), toSource = __webpack_require__(385);
        var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
        var reIsHostCtor = /^\[object .+?Constructor\]$/;
        var funcProto = Function.prototype, objectProto = Object.prototype;
        var funcToString = funcProto.toString;
        var hasOwnProperty = objectProto.hasOwnProperty;
        var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
        function baseIsNative(value) {
            if (!isObject(value) || isMasked(value)) {
                return false;
            }
            var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
            return pattern.test(toSource(value));
        }
        module.exports = baseIsNative;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseGetTag = __webpack_require__(376), isObject = __webpack_require__(382);
        var asyncTag = "[object AsyncFunction]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
        function isFunction(value) {
            if (!isObject(value)) {
                return false;
            }
            var tag = baseGetTag(value);
            return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
        }
        module.exports = isFunction;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var Symbol = __webpack_require__(377), getRawTag = __webpack_require__(380), objectToString = __webpack_require__(381);
        var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
        var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
        function baseGetTag(value) {
            if (value == null) {
                return value === undefined ? undefinedTag : nullTag;
            }
            return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
        }
        module.exports = baseGetTag;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var root = __webpack_require__(378);
        var Symbol = root.Symbol;
        module.exports = Symbol;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var freeGlobal = __webpack_require__(379);
        var freeSelf = typeof self == "object" && self && self.Object === Object && self;
        var root = freeGlobal || freeSelf || Function("return this")();
        module.exports = root;
    }, module => {
        var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
        module.exports = freeGlobal;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var Symbol = __webpack_require__(377);
        var objectProto = Object.prototype;
        var hasOwnProperty = objectProto.hasOwnProperty;
        var nativeObjectToString = objectProto.toString;
        var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
        function getRawTag(value) {
            var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
            try {
                value[symToStringTag] = undefined;
                var unmasked = true;
            } catch (e) {}
            var result = nativeObjectToString.call(value);
            if (unmasked) {
                if (isOwn) {
                    value[symToStringTag] = tag;
                } else {
                    delete value[symToStringTag];
                }
            }
            return result;
        }
        module.exports = getRawTag;
    }, module => {
        var objectProto = Object.prototype;
        var nativeObjectToString = objectProto.toString;
        function objectToString(value) {
            return nativeObjectToString.call(value);
        }
        module.exports = objectToString;
    }, module => {
        function isObject(value) {
            var type = typeof value;
            return value != null && (type == "object" || type == "function");
        }
        module.exports = isObject;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var coreJsData = __webpack_require__(384);
        var maskSrcKey = function() {
            var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
            return uid ? "Symbol(src)_1." + uid : "";
        }();
        function isMasked(func) {
            return !!maskSrcKey && maskSrcKey in func;
        }
        module.exports = isMasked;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var root = __webpack_require__(378);
        var coreJsData = root["__core-js_shared__"];
        module.exports = coreJsData;
    }, module => {
        var funcProto = Function.prototype;
        var funcToString = funcProto.toString;
        function toSource(func) {
            if (func != null) {
                try {
                    return funcToString.call(func);
                } catch (e) {}
                try {
                    return func + "";
                } catch (e) {}
            }
            return "";
        }
        module.exports = toSource;
    }, module => {
        function getValue(object, key) {
            return object == null ? undefined : object[key];
        }
        module.exports = getValue;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var mapCacheClear = __webpack_require__(388), mapCacheDelete = __webpack_require__(396), mapCacheGet = __webpack_require__(399), mapCacheHas = __webpack_require__(400), mapCacheSet = __webpack_require__(401);
        function MapCache(entries) {
            var index = -1, length = entries == null ? 0 : entries.length;
            this.clear();
            while (++index < length) {
                var entry = entries[index];
                this.set(entry[0], entry[1]);
            }
        }
        MapCache.prototype.clear = mapCacheClear;
        MapCache.prototype["delete"] = mapCacheDelete;
        MapCache.prototype.get = mapCacheGet;
        MapCache.prototype.has = mapCacheHas;
        MapCache.prototype.set = mapCacheSet;
        module.exports = MapCache;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var Hash = __webpack_require__(389), ListCache = __webpack_require__(359), Map = __webpack_require__(372);
        function mapCacheClear() {
            this.size = 0;
            this.__data__ = {
                hash: new Hash,
                map: new (Map || ListCache),
                string: new Hash
            };
        }
        module.exports = mapCacheClear;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var hashClear = __webpack_require__(390), hashDelete = __webpack_require__(392), hashGet = __webpack_require__(393), hashHas = __webpack_require__(394), hashSet = __webpack_require__(395);
        function Hash(entries) {
            var index = -1, length = entries == null ? 0 : entries.length;
            this.clear();
            while (++index < length) {
                var entry = entries[index];
                this.set(entry[0], entry[1]);
            }
        }
        Hash.prototype.clear = hashClear;
        Hash.prototype["delete"] = hashDelete;
        Hash.prototype.get = hashGet;
        Hash.prototype.has = hashHas;
        Hash.prototype.set = hashSet;
        module.exports = Hash;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var nativeCreate = __webpack_require__(391);
        function hashClear() {
            this.__data__ = nativeCreate ? nativeCreate(null) : {};
            this.size = 0;
        }
        module.exports = hashClear;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var getNative = __webpack_require__(373);
        var nativeCreate = getNative(Object, "create");
        module.exports = nativeCreate;
    }, module => {
        function hashDelete(key) {
            var result = this.has(key) && delete this.__data__[key];
            this.size -= result ? 1 : 0;
            return result;
        }
        module.exports = hashDelete;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var nativeCreate = __webpack_require__(391);
        var HASH_UNDEFINED = "__lodash_hash_undefined__";
        var objectProto = Object.prototype;
        var hasOwnProperty = objectProto.hasOwnProperty;
        function hashGet(key) {
            var data = this.__data__;
            if (nativeCreate) {
                var result = data[key];
                return result === HASH_UNDEFINED ? undefined : result;
            }
            return hasOwnProperty.call(data, key) ? data[key] : undefined;
        }
        module.exports = hashGet;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var nativeCreate = __webpack_require__(391);
        var objectProto = Object.prototype;
        var hasOwnProperty = objectProto.hasOwnProperty;
        function hashHas(key) {
            var data = this.__data__;
            return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
        }
        module.exports = hashHas;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var nativeCreate = __webpack_require__(391);
        var HASH_UNDEFINED = "__lodash_hash_undefined__";
        function hashSet(key, value) {
            var data = this.__data__;
            this.size += this.has(key) ? 0 : 1;
            data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
            return this;
        }
        module.exports = hashSet;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var getMapData = __webpack_require__(397);
        function mapCacheDelete(key) {
            var result = getMapData(this, key)["delete"](key);
            this.size -= result ? 1 : 0;
            return result;
        }
        module.exports = mapCacheDelete;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var isKeyable = __webpack_require__(398);
        function getMapData(map, key) {
            var data = map.__data__;
            return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
        }
        module.exports = getMapData;
    }, module => {
        function isKeyable(value) {
            var type = typeof value;
            return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
        }
        module.exports = isKeyable;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var getMapData = __webpack_require__(397);
        function mapCacheGet(key) {
            return getMapData(this, key).get(key);
        }
        module.exports = mapCacheGet;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var getMapData = __webpack_require__(397);
        function mapCacheHas(key) {
            return getMapData(this, key).has(key);
        }
        module.exports = mapCacheHas;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var getMapData = __webpack_require__(397);
        function mapCacheSet(key, value) {
            var data = getMapData(this, key), size = data.size;
            data.set(key, value);
            this.size += data.size == size ? 0 : 1;
            return this;
        }
        module.exports = mapCacheSet;
    }, module => {
        function arrayEach(array, iteratee) {
            var index = -1, length = array == null ? 0 : array.length;
            while (++index < length) {
                if (iteratee(array[index], index, array) === false) {
                    break;
                }
            }
            return array;
        }
        module.exports = arrayEach;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseAssignValue = __webpack_require__(404), eq = __webpack_require__(363);
        var objectProto = Object.prototype;
        var hasOwnProperty = objectProto.hasOwnProperty;
        function assignValue(object, key, value) {
            var objValue = object[key];
            if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined && !(key in object)) {
                baseAssignValue(object, key, value);
            }
        }
        module.exports = assignValue;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var defineProperty = __webpack_require__(405);
        function baseAssignValue(object, key, value) {
            if (key == "__proto__" && defineProperty) {
                defineProperty(object, key, {
                    configurable: true,
                    enumerable: true,
                    value,
                    writable: true
                });
            } else {
                object[key] = value;
            }
        }
        module.exports = baseAssignValue;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var getNative = __webpack_require__(373);
        var defineProperty = function() {
            try {
                var func = getNative(Object, "defineProperty");
                func({}, "", {});
                return func;
            } catch (e) {}
        }();
        module.exports = defineProperty;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var copyObject = __webpack_require__(407), keys = __webpack_require__(408);
        function baseAssign(object, source) {
            return object && copyObject(source, keys(source), object);
        }
        module.exports = baseAssign;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var assignValue = __webpack_require__(403), baseAssignValue = __webpack_require__(404);
        function copyObject(source, props, object, customizer) {
            var isNew = !object;
            object || (object = {});
            var index = -1, length = props.length;
            while (++index < length) {
                var key = props[index];
                var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined;
                if (newValue === undefined) {
                    newValue = source[key];
                }
                if (isNew) {
                    baseAssignValue(object, key, newValue);
                } else {
                    assignValue(object, key, newValue);
                }
            }
            return object;
        }
        module.exports = copyObject;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var arrayLikeKeys = __webpack_require__(409), baseKeys = __webpack_require__(423), isArrayLike = __webpack_require__(427);
        function keys(object) {
            return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
        }
        module.exports = keys;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseTimes = __webpack_require__(410), isArguments = __webpack_require__(411), isArray = __webpack_require__(414), isBuffer = __webpack_require__(415), isIndex = __webpack_require__(417), isTypedArray = __webpack_require__(418);
        var objectProto = Object.prototype;
        var hasOwnProperty = objectProto.hasOwnProperty;
        function arrayLikeKeys(value, inherited) {
            var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
            for (var key in value) {
                if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) {
                    result.push(key);
                }
            }
            return result;
        }
        module.exports = arrayLikeKeys;
    }, module => {
        function baseTimes(n, iteratee) {
            var index = -1, result = Array(n);
            while (++index < n) {
                result[index] = iteratee(index);
            }
            return result;
        }
        module.exports = baseTimes;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseIsArguments = __webpack_require__(412), isObjectLike = __webpack_require__(413);
        var objectProto = Object.prototype;
        var hasOwnProperty = objectProto.hasOwnProperty;
        var propertyIsEnumerable = objectProto.propertyIsEnumerable;
        var isArguments = baseIsArguments(function() {
            return arguments;
        }()) ? baseIsArguments : function(value) {
            return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
        };
        module.exports = isArguments;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseGetTag = __webpack_require__(376), isObjectLike = __webpack_require__(413);
        var argsTag = "[object Arguments]";
        function baseIsArguments(value) {
            return isObjectLike(value) && baseGetTag(value) == argsTag;
        }
        module.exports = baseIsArguments;
    }, module => {
        function isObjectLike(value) {
            return value != null && typeof value == "object";
        }
        module.exports = isObjectLike;
    }, module => {
        var isArray = Array.isArray;
        module.exports = isArray;
    }, (module, exports, __webpack_require__) => {
        module = __webpack_require__.nmd(module);
        var root = __webpack_require__(378), stubFalse = __webpack_require__(416);
        var freeExports = true && exports && !exports.nodeType && exports;
        var freeModule = freeExports && "object" == "object" && module && !module.nodeType && module;
        var moduleExports = freeModule && freeModule.exports === freeExports;
        var Buffer = moduleExports ? root.Buffer : undefined;
        var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
        var isBuffer = nativeIsBuffer || stubFalse;
        module.exports = isBuffer;
    }, module => {
        function stubFalse() {
            return false;
        }
        module.exports = stubFalse;
    }, module => {
        var MAX_SAFE_INTEGER = 9007199254740991;
        var reIsUint = /^(?:0|[1-9]\d*)$/;
        function isIndex(value, length) {
            var type = typeof value;
            length = length == null ? MAX_SAFE_INTEGER : length;
            return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
        }
        module.exports = isIndex;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseIsTypedArray = __webpack_require__(419), baseUnary = __webpack_require__(421), nodeUtil = __webpack_require__(422);
        var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
        var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
        module.exports = isTypedArray;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseGetTag = __webpack_require__(376), isLength = __webpack_require__(420), isObjectLike = __webpack_require__(413);
        var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", weakMapTag = "[object WeakMap]";
        var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
        var typedArrayTags = {};
        typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
        typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
        function baseIsTypedArray(value) {
            return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
        }
        module.exports = baseIsTypedArray;
    }, module => {
        var MAX_SAFE_INTEGER = 9007199254740991;
        function isLength(value) {
            return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
        }
        module.exports = isLength;
    }, module => {
        function baseUnary(func) {
            return function(value) {
                return func(value);
            };
        }
        module.exports = baseUnary;
    }, (module, exports, __webpack_require__) => {
        module = __webpack_require__.nmd(module);
        var freeGlobal = __webpack_require__(379);
        var freeExports = true && exports && !exports.nodeType && exports;
        var freeModule = freeExports && "object" == "object" && module && !module.nodeType && module;
        var moduleExports = freeModule && freeModule.exports === freeExports;
        var freeProcess = moduleExports && freeGlobal.process;
        var nodeUtil = function() {
            try {
                var types = freeModule && freeModule.require && freeModule.require("util").types;
                if (types) {
                    return types;
                }
                return freeProcess && freeProcess.binding && freeProcess.binding("util");
            } catch (e) {}
        }();
        module.exports = nodeUtil;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var isPrototype = __webpack_require__(424), nativeKeys = __webpack_require__(425);
        var objectProto = Object.prototype;
        var hasOwnProperty = objectProto.hasOwnProperty;
        function baseKeys(object) {
            if (!isPrototype(object)) {
                return nativeKeys(object);
            }
            var result = [];
            for (var key in Object(object)) {
                if (hasOwnProperty.call(object, key) && key != "constructor") {
                    result.push(key);
                }
            }
            return result;
        }
        module.exports = baseKeys;
    }, module => {
        var objectProto = Object.prototype;
        function isPrototype(value) {
            var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
            return value === proto;
        }
        module.exports = isPrototype;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var overArg = __webpack_require__(426);
        var nativeKeys = overArg(Object.keys, Object);
        module.exports = nativeKeys;
    }, module => {
        function overArg(func, transform) {
            return function(arg) {
                return func(transform(arg));
            };
        }
        module.exports = overArg;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var isFunction = __webpack_require__(375), isLength = __webpack_require__(420);
        function isArrayLike(value) {
            return value != null && isLength(value.length) && !isFunction(value);
        }
        module.exports = isArrayLike;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var copyObject = __webpack_require__(407), keysIn = __webpack_require__(429);
        function baseAssignIn(object, source) {
            return object && copyObject(source, keysIn(source), object);
        }
        module.exports = baseAssignIn;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var arrayLikeKeys = __webpack_require__(409), baseKeysIn = __webpack_require__(430), isArrayLike = __webpack_require__(427);
        function keysIn(object) {
            return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
        }
        module.exports = keysIn;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var isObject = __webpack_require__(382), isPrototype = __webpack_require__(424), nativeKeysIn = __webpack_require__(431);
        var objectProto = Object.prototype;
        var hasOwnProperty = objectProto.hasOwnProperty;
        function baseKeysIn(object) {
            if (!isObject(object)) {
                return nativeKeysIn(object);
            }
            var isProto = isPrototype(object), result = [];
            for (var key in object) {
                if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) {
                    result.push(key);
                }
            }
            return result;
        }
        module.exports = baseKeysIn;
    }, module => {
        function nativeKeysIn(object) {
            var result = [];
            if (object != null) {
                for (var key in Object(object)) {
                    result.push(key);
                }
            }
            return result;
        }
        module.exports = nativeKeysIn;
    }, (module, exports, __webpack_require__) => {
        module = __webpack_require__.nmd(module);
        var root = __webpack_require__(378);
        var freeExports = true && exports && !exports.nodeType && exports;
        var freeModule = freeExports && "object" == "object" && module && !module.nodeType && module;
        var moduleExports = freeModule && freeModule.exports === freeExports;
        var Buffer = moduleExports ? root.Buffer : undefined, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
        function cloneBuffer(buffer, isDeep) {
            if (isDeep) {
                return buffer.slice();
            }
            var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
            buffer.copy(result);
            return result;
        }
        module.exports = cloneBuffer;
    }, module => {
        function copyArray(source, array) {
            var index = -1, length = source.length;
            array || (array = Array(length));
            while (++index < length) {
                array[index] = source[index];
            }
            return array;
        }
        module.exports = copyArray;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var copyObject = __webpack_require__(407), getSymbols = __webpack_require__(435);
        function copySymbols(source, object) {
            return copyObject(source, getSymbols(source), object);
        }
        module.exports = copySymbols;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var arrayFilter = __webpack_require__(436), stubArray = __webpack_require__(437);
        var objectProto = Object.prototype;
        var propertyIsEnumerable = objectProto.propertyIsEnumerable;
        var nativeGetSymbols = Object.getOwnPropertySymbols;
        var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
            if (object == null) {
                return [];
            }
            object = Object(object);
            return arrayFilter(nativeGetSymbols(object), (function(symbol) {
                return propertyIsEnumerable.call(object, symbol);
            }));
        };
        module.exports = getSymbols;
    }, module => {
        function arrayFilter(array, predicate) {
            var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
            while (++index < length) {
                var value = array[index];
                if (predicate(value, index, array)) {
                    result[resIndex++] = value;
                }
            }
            return result;
        }
        module.exports = arrayFilter;
    }, module => {
        function stubArray() {
            return [];
        }
        module.exports = stubArray;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var copyObject = __webpack_require__(407), getSymbolsIn = __webpack_require__(439);
        function copySymbolsIn(source, object) {
            return copyObject(source, getSymbolsIn(source), object);
        }
        module.exports = copySymbolsIn;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var arrayPush = __webpack_require__(440), getPrototype = __webpack_require__(441), getSymbols = __webpack_require__(435), stubArray = __webpack_require__(437);
        var nativeGetSymbols = Object.getOwnPropertySymbols;
        var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
            var result = [];
            while (object) {
                arrayPush(result, getSymbols(object));
                object = getPrototype(object);
            }
            return result;
        };
        module.exports = getSymbolsIn;
    }, module => {
        function arrayPush(array, values) {
            var index = -1, length = values.length, offset = array.length;
            while (++index < length) {
                array[offset + index] = values[index];
            }
            return array;
        }
        module.exports = arrayPush;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var overArg = __webpack_require__(426);
        var getPrototype = overArg(Object.getPrototypeOf, Object);
        module.exports = getPrototype;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseGetAllKeys = __webpack_require__(443), getSymbols = __webpack_require__(435), keys = __webpack_require__(408);
        function getAllKeys(object) {
            return baseGetAllKeys(object, keys, getSymbols);
        }
        module.exports = getAllKeys;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var arrayPush = __webpack_require__(440), isArray = __webpack_require__(414);
        function baseGetAllKeys(object, keysFunc, symbolsFunc) {
            var result = keysFunc(object);
            return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
        }
        module.exports = baseGetAllKeys;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseGetAllKeys = __webpack_require__(443), getSymbolsIn = __webpack_require__(439), keysIn = __webpack_require__(429);
        function getAllKeysIn(object) {
            return baseGetAllKeys(object, keysIn, getSymbolsIn);
        }
        module.exports = getAllKeysIn;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var DataView = __webpack_require__(446), Map = __webpack_require__(372), Promise = __webpack_require__(447), Set = __webpack_require__(448), WeakMap = __webpack_require__(449), baseGetTag = __webpack_require__(376), toSource = __webpack_require__(385);
        var mapTag = "[object Map]", objectTag = "[object Object]", promiseTag = "[object Promise]", setTag = "[object Set]", weakMapTag = "[object WeakMap]";
        var dataViewTag = "[object DataView]";
        var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap);
        var getTag = baseGetTag;
        if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map) != mapTag || Promise && getTag(Promise.resolve()) != promiseTag || Set && getTag(new Set) != setTag || WeakMap && getTag(new WeakMap) != weakMapTag) {
            getTag = function(value) {
                var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : undefined, ctorString = Ctor ? toSource(Ctor) : "";
                if (ctorString) {
                    switch (ctorString) {
                      case dataViewCtorString:
                        return dataViewTag;

                      case mapCtorString:
                        return mapTag;

                      case promiseCtorString:
                        return promiseTag;

                      case setCtorString:
                        return setTag;

                      case weakMapCtorString:
                        return weakMapTag;
                    }
                }
                return result;
            };
        }
        module.exports = getTag;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var getNative = __webpack_require__(373), root = __webpack_require__(378);
        var DataView = getNative(root, "DataView");
        module.exports = DataView;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var getNative = __webpack_require__(373), root = __webpack_require__(378);
        var Promise = getNative(root, "Promise");
        module.exports = Promise;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var getNative = __webpack_require__(373), root = __webpack_require__(378);
        var Set = getNative(root, "Set");
        module.exports = Set;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var getNative = __webpack_require__(373), root = __webpack_require__(378);
        var WeakMap = getNative(root, "WeakMap");
        module.exports = WeakMap;
    }, module => {
        var objectProto = Object.prototype;
        var hasOwnProperty = objectProto.hasOwnProperty;
        function initCloneArray(array) {
            var length = array.length, result = new array.constructor(length);
            if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) {
                result.index = array.index;
                result.input = array.input;
            }
            return result;
        }
        module.exports = initCloneArray;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var cloneArrayBuffer = __webpack_require__(452), cloneDataView = __webpack_require__(454), cloneRegExp = __webpack_require__(455), cloneSymbol = __webpack_require__(456), cloneTypedArray = __webpack_require__(457);
        var boolTag = "[object Boolean]", dateTag = "[object Date]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]";
        var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
        function initCloneByTag(object, tag, isDeep) {
            var Ctor = object.constructor;
            switch (tag) {
              case arrayBufferTag:
                return cloneArrayBuffer(object);

              case boolTag:
              case dateTag:
                return new Ctor(+object);

              case dataViewTag:
                return cloneDataView(object, isDeep);

              case float32Tag:
              case float64Tag:
              case int8Tag:
              case int16Tag:
              case int32Tag:
              case uint8Tag:
              case uint8ClampedTag:
              case uint16Tag:
              case uint32Tag:
                return cloneTypedArray(object, isDeep);

              case mapTag:
                return new Ctor;

              case numberTag:
              case stringTag:
                return new Ctor(object);

              case regexpTag:
                return cloneRegExp(object);

              case setTag:
                return new Ctor;

              case symbolTag:
                return cloneSymbol(object);
            }
        }
        module.exports = initCloneByTag;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var Uint8Array = __webpack_require__(453);
        function cloneArrayBuffer(arrayBuffer) {
            var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
            new Uint8Array(result).set(new Uint8Array(arrayBuffer));
            return result;
        }
        module.exports = cloneArrayBuffer;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var root = __webpack_require__(378);
        var Uint8Array = root.Uint8Array;
        module.exports = Uint8Array;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var cloneArrayBuffer = __webpack_require__(452);
        function cloneDataView(dataView, isDeep) {
            var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
            return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
        }
        module.exports = cloneDataView;
    }, module => {
        var reFlags = /\w*$/;
        function cloneRegExp(regexp) {
            var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
            result.lastIndex = regexp.lastIndex;
            return result;
        }
        module.exports = cloneRegExp;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var Symbol = __webpack_require__(377);
        var symbolProto = Symbol ? Symbol.prototype : undefined, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
        function cloneSymbol(symbol) {
            return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
        }
        module.exports = cloneSymbol;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var cloneArrayBuffer = __webpack_require__(452);
        function cloneTypedArray(typedArray, isDeep) {
            var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
            return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
        }
        module.exports = cloneTypedArray;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseCreate = __webpack_require__(459), getPrototype = __webpack_require__(441), isPrototype = __webpack_require__(424);
        function initCloneObject(object) {
            return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
        }
        module.exports = initCloneObject;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var isObject = __webpack_require__(382);
        var objectCreate = Object.create;
        var baseCreate = function() {
            function object() {}
            return function(proto) {
                if (!isObject(proto)) {
                    return {};
                }
                if (objectCreate) {
                    return objectCreate(proto);
                }
                object.prototype = proto;
                var result = new object;
                object.prototype = undefined;
                return result;
            };
        }();
        module.exports = baseCreate;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseIsMap = __webpack_require__(461), baseUnary = __webpack_require__(421), nodeUtil = __webpack_require__(422);
        var nodeIsMap = nodeUtil && nodeUtil.isMap;
        var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
        module.exports = isMap;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var getTag = __webpack_require__(445), isObjectLike = __webpack_require__(413);
        var mapTag = "[object Map]";
        function baseIsMap(value) {
            return isObjectLike(value) && getTag(value) == mapTag;
        }
        module.exports = baseIsMap;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseIsSet = __webpack_require__(463), baseUnary = __webpack_require__(421), nodeUtil = __webpack_require__(422);
        var nodeIsSet = nodeUtil && nodeUtil.isSet;
        var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
        module.exports = isSet;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var getTag = __webpack_require__(445), isObjectLike = __webpack_require__(413);
        var setTag = "[object Set]";
        function baseIsSet(value) {
            return isObjectLike(value) && getTag(value) == setTag;
        }
        module.exports = baseIsSet;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseMerge = __webpack_require__(465), createAssigner = __webpack_require__(474);
        var merge = createAssigner((function(object, source, srcIndex) {
            baseMerge(object, source, srcIndex);
        }));
        module.exports = merge;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var Stack = __webpack_require__(358), assignMergeValue = __webpack_require__(466), baseFor = __webpack_require__(467), baseMergeDeep = __webpack_require__(469), isObject = __webpack_require__(382), keysIn = __webpack_require__(429), safeGet = __webpack_require__(472);
        function baseMerge(object, source, srcIndex, customizer, stack) {
            if (object === source) {
                return;
            }
            baseFor(source, (function(srcValue, key) {
                stack || (stack = new Stack);
                if (isObject(srcValue)) {
                    baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
                } else {
                    var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : undefined;
                    if (newValue === undefined) {
                        newValue = srcValue;
                    }
                    assignMergeValue(object, key, newValue);
                }
            }), keysIn);
        }
        module.exports = baseMerge;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseAssignValue = __webpack_require__(404), eq = __webpack_require__(363);
        function assignMergeValue(object, key, value) {
            if (value !== undefined && !eq(object[key], value) || value === undefined && !(key in object)) {
                baseAssignValue(object, key, value);
            }
        }
        module.exports = assignMergeValue;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var createBaseFor = __webpack_require__(468);
        var baseFor = createBaseFor();
        module.exports = baseFor;
    }, module => {
        function createBaseFor(fromRight) {
            return function(object, iteratee, keysFunc) {
                var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
                while (length--) {
                    var key = props[fromRight ? length : ++index];
                    if (iteratee(iterable[key], key, iterable) === false) {
                        break;
                    }
                }
                return object;
            };
        }
        module.exports = createBaseFor;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var assignMergeValue = __webpack_require__(466), cloneBuffer = __webpack_require__(432), cloneTypedArray = __webpack_require__(457), copyArray = __webpack_require__(433), initCloneObject = __webpack_require__(458), isArguments = __webpack_require__(411), isArray = __webpack_require__(414), isArrayLikeObject = __webpack_require__(470), isBuffer = __webpack_require__(415), isFunction = __webpack_require__(375), isObject = __webpack_require__(382), isPlainObject = __webpack_require__(471), isTypedArray = __webpack_require__(418), safeGet = __webpack_require__(472), toPlainObject = __webpack_require__(473);
        function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
            var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
            if (stacked) {
                assignMergeValue(object, key, stacked);
                return;
            }
            var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : undefined;
            var isCommon = newValue === undefined;
            if (isCommon) {
                var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
                newValue = srcValue;
                if (isArr || isBuff || isTyped) {
                    if (isArray(objValue)) {
                        newValue = objValue;
                    } else if (isArrayLikeObject(objValue)) {
                        newValue = copyArray(objValue);
                    } else if (isBuff) {
                        isCommon = false;
                        newValue = cloneBuffer(srcValue, true);
                    } else if (isTyped) {
                        isCommon = false;
                        newValue = cloneTypedArray(srcValue, true);
                    } else {
                        newValue = [];
                    }
                } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
                    newValue = objValue;
                    if (isArguments(objValue)) {
                        newValue = toPlainObject(objValue);
                    } else if (!isObject(objValue) || isFunction(objValue)) {
                        newValue = initCloneObject(srcValue);
                    }
                } else {
                    isCommon = false;
                }
            }
            if (isCommon) {
                stack.set(srcValue, newValue);
                mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
                stack["delete"](srcValue);
            }
            assignMergeValue(object, key, newValue);
        }
        module.exports = baseMergeDeep;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var isArrayLike = __webpack_require__(427), isObjectLike = __webpack_require__(413);
        function isArrayLikeObject(value) {
            return isObjectLike(value) && isArrayLike(value);
        }
        module.exports = isArrayLikeObject;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseGetTag = __webpack_require__(376), getPrototype = __webpack_require__(441), isObjectLike = __webpack_require__(413);
        var objectTag = "[object Object]";
        var funcProto = Function.prototype, objectProto = Object.prototype;
        var funcToString = funcProto.toString;
        var hasOwnProperty = objectProto.hasOwnProperty;
        var objectCtorString = funcToString.call(Object);
        function isPlainObject(value) {
            if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
                return false;
            }
            var proto = getPrototype(value);
            if (proto === null) {
                return true;
            }
            var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
            return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
        }
        module.exports = isPlainObject;
    }, module => {
        function safeGet(object, key) {
            if (key === "constructor" && typeof object[key] === "function") {
                return;
            }
            if (key == "__proto__") {
                return;
            }
            return object[key];
        }
        module.exports = safeGet;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var copyObject = __webpack_require__(407), keysIn = __webpack_require__(429);
        function toPlainObject(value) {
            return copyObject(value, keysIn(value));
        }
        module.exports = toPlainObject;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseRest = __webpack_require__(475), isIterateeCall = __webpack_require__(483);
        function createAssigner(assigner) {
            return baseRest((function(object, sources) {
                var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined;
                customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, 
                customizer) : undefined;
                if (guard && isIterateeCall(sources[0], sources[1], guard)) {
                    customizer = length < 3 ? undefined : customizer;
                    length = 1;
                }
                object = Object(object);
                while (++index < length) {
                    var source = sources[index];
                    if (source) {
                        assigner(object, source, index, customizer);
                    }
                }
                return object;
            }));
        }
        module.exports = createAssigner;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var identity = __webpack_require__(476), overRest = __webpack_require__(477), setToString = __webpack_require__(479);
        function baseRest(func, start) {
            return setToString(overRest(func, start, identity), func + "");
        }
        module.exports = baseRest;
    }, module => {
        function identity(value) {
            return value;
        }
        module.exports = identity;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var apply = __webpack_require__(478);
        var nativeMax = Math.max;
        function overRest(func, start, transform) {
            start = nativeMax(start === undefined ? func.length - 1 : start, 0);
            return function() {
                var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
                while (++index < length) {
                    array[index] = args[start + index];
                }
                index = -1;
                var otherArgs = Array(start + 1);
                while (++index < start) {
                    otherArgs[index] = args[index];
                }
                otherArgs[start] = transform(array);
                return apply(func, this, otherArgs);
            };
        }
        module.exports = overRest;
    }, module => {
        function apply(func, thisArg, args) {
            switch (args.length) {
              case 0:
                return func.call(thisArg);

              case 1:
                return func.call(thisArg, args[0]);

              case 2:
                return func.call(thisArg, args[0], args[1]);

              case 3:
                return func.call(thisArg, args[0], args[1], args[2]);
            }
            return func.apply(thisArg, args);
        }
        module.exports = apply;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseSetToString = __webpack_require__(480), shortOut = __webpack_require__(482);
        var setToString = shortOut(baseSetToString);
        module.exports = setToString;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var constant = __webpack_require__(481), defineProperty = __webpack_require__(405), identity = __webpack_require__(476);
        var baseSetToString = !defineProperty ? identity : function(func, string) {
            return defineProperty(func, "toString", {
                configurable: true,
                enumerable: false,
                value: constant(string),
                writable: true
            });
        };
        module.exports = baseSetToString;
    }, module => {
        function constant(value) {
            return function() {
                return value;
            };
        }
        module.exports = constant;
    }, module => {
        var HOT_COUNT = 800, HOT_SPAN = 16;
        var nativeNow = Date.now;
        function shortOut(func) {
            var count = 0, lastCalled = 0;
            return function() {
                var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
                lastCalled = stamp;
                if (remaining > 0) {
                    if (++count >= HOT_COUNT) {
                        return arguments[0];
                    }
                } else {
                    count = 0;
                }
                return func.apply(undefined, arguments);
            };
        }
        module.exports = shortOut;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var eq = __webpack_require__(363), isArrayLike = __webpack_require__(427), isIndex = __webpack_require__(417), isObject = __webpack_require__(382);
        function isIterateeCall(value, index, object) {
            if (!isObject(object)) {
                return false;
            }
            var type = typeof index;
            if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) {
                return eq(object[index], value);
            }
            return false;
        }
        module.exports = isIterateeCall;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        function _interopDefault(ex) {
            return ex && typeof ex === "object" && "default" in ex ? ex["default"] : ex;
        }
        var React = __webpack_require__(285);
        var React__default = _interopDefault(React);
        function _defineProperty(obj, key, value) {
            if (key in obj) {
                Object.defineProperty(obj, key, {
                    value,
                    enumerable: true,
                    configurable: true,
                    writable: true
                });
            } else {
                obj[key] = value;
            }
            return obj;
        }
        function _inheritsLoose(subClass, superClass) {
            subClass.prototype = Object.create(superClass.prototype);
            subClass.prototype.constructor = subClass;
            subClass.__proto__ = superClass;
        }
        var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement);
        function withSideEffect(reducePropsToState, handleStateChangeOnClient, mapStateOnServer) {
            if (typeof reducePropsToState !== "function") {
                throw new Error("Expected reducePropsToState to be a function.");
            }
            if (typeof handleStateChangeOnClient !== "function") {
                throw new Error("Expected handleStateChangeOnClient to be a function.");
            }
            if (typeof mapStateOnServer !== "undefined" && typeof mapStateOnServer !== "function") {
                throw new Error("Expected mapStateOnServer to either be undefined or a function.");
            }
            function getDisplayName(WrappedComponent) {
                return WrappedComponent.displayName || WrappedComponent.name || "Component";
            }
            return function wrap(WrappedComponent) {
                if (typeof WrappedComponent !== "function") {
                    throw new Error("Expected WrappedComponent to be a React component.");
                }
                var mountedInstances = [];
                var state;
                function emitChange() {
                    state = reducePropsToState(mountedInstances.map((function(instance) {
                        return instance.props;
                    })));
                    if (SideEffect.canUseDOM) {
                        handleStateChangeOnClient(state);
                    } else if (mapStateOnServer) {
                        state = mapStateOnServer(state);
                    }
                }
                var SideEffect = function(_PureComponent) {
                    _inheritsLoose(SideEffect, _PureComponent);
                    function SideEffect() {
                        return _PureComponent.apply(this, arguments) || this;
                    }
                    SideEffect.peek = function peek() {
                        return state;
                    };
                    SideEffect.rewind = function rewind() {
                        if (SideEffect.canUseDOM) {
                            throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");
                        }
                        var recordedState = state;
                        state = undefined;
                        mountedInstances = [];
                        return recordedState;
                    };
                    var _proto = SideEffect.prototype;
                    _proto.UNSAFE_componentWillMount = function UNSAFE_componentWillMount() {
                        mountedInstances.push(this);
                        emitChange();
                    };
                    _proto.componentDidUpdate = function componentDidUpdate() {
                        emitChange();
                    };
                    _proto.componentWillUnmount = function componentWillUnmount() {
                        var index = mountedInstances.indexOf(this);
                        mountedInstances.splice(index, 1);
                        emitChange();
                    };
                    _proto.render = function render() {
                        return React__default.createElement(WrappedComponent, this.props);
                    };
                    return SideEffect;
                }(React.PureComponent);
                _defineProperty(SideEffect, "displayName", "SideEffect(" + getDisplayName(WrappedComponent) + ")");
                _defineProperty(SideEffect, "canUseDOM", canUseDOM);
                return SideEffect;
            };
        }
        module.exports = withSideEffect;
    }, module => {
        var hasElementType = typeof Element !== "undefined";
        var hasMap = typeof Map === "function";
        var hasSet = typeof Set === "function";
        var hasArrayBuffer = typeof ArrayBuffer === "function" && !!ArrayBuffer.isView;
        function equal(a, b) {
            if (a === b) return true;
            if (a && b && typeof a == "object" && typeof b == "object") {
                if (a.constructor !== b.constructor) return false;
                var length, i, keys;
                if (Array.isArray(a)) {
                    length = a.length;
                    if (length != b.length) return false;
                    for (i = length; i-- !== 0; ) if (!equal(a[i], b[i])) return false;
                    return true;
                }
                var it;
                if (hasMap && a instanceof Map && b instanceof Map) {
                    if (a.size !== b.size) return false;
                    it = a.entries();
                    while (!(i = it.next()).done) if (!b.has(i.value[0])) return false;
                    it = a.entries();
                    while (!(i = it.next()).done) if (!equal(i.value[1], b.get(i.value[0]))) return false;
                    return true;
                }
                if (hasSet && a instanceof Set && b instanceof Set) {
                    if (a.size !== b.size) return false;
                    it = a.entries();
                    while (!(i = it.next()).done) if (!b.has(i.value[0])) return false;
                    return true;
                }
                if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
                    length = a.length;
                    if (length != b.length) return false;
                    for (i = length; i-- !== 0; ) if (a[i] !== b[i]) return false;
                    return true;
                }
                if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
                if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
                if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
                keys = Object.keys(a);
                length = keys.length;
                if (length !== Object.keys(b).length) return false;
                for (i = length; i-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
                if (hasElementType && a instanceof Element) return false;
                for (i = length; i-- !== 0; ) {
                    if ((keys[i] === "_owner" || keys[i] === "__v" || keys[i] === "__o") && a.$$typeof) {
                        continue;
                    }
                    if (!equal(a[keys[i]], b[keys[i]])) return false;
                }
                return true;
            }
            return a !== a && b !== b;
        }
        module.exports = function isEqual(a, b) {
            try {
                return equal(a, b);
            } catch (error) {
                if ((error.message || "").match(/stack|recursion/i)) {
                    console.warn("react-fast-compare cannot handle circular refs");
                    return false;
                }
                throw error;
            }
        };
    }, (__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
        "use strict";
        __webpack_require__.r(__webpack_exports__);
        __webpack_require__.d(__webpack_exports__, {
            ServerStyleSheet: () => Ue,
            StyleSheetConsumer: () => le,
            StyleSheetContext: () => ue,
            StyleSheetManager: () => ye,
            ThemeConsumer: () => Le,
            ThemeContext: () => ze,
            ThemeProvider: () => Ge,
            __PRIVATE__: () => Ze,
            createGlobalStyle: () => $e,
            css: () => Ae,
            default: () => styled_components_browser_esm,
            isStyledComponent: () => N,
            keyframes: () => We,
            useTheme: () => Xe,
            version: () => C,
            withTheme: () => Je
        });
        var react_is = __webpack_require__(487);
        var react = __webpack_require__(285);
        var shallowequal = __webpack_require__(489);
        var shallowequal_default = __webpack_require__.n(shallowequal);
        function stylis_min(W) {
            function M(d, c, e, h, a) {
                for (var m = 0, b = 0, v = 0, n = 0, q, g, x = 0, K = 0, k, u = k = q = 0, l = 0, r = 0, I = 0, t = 0, B = e.length, J = B - 1, y, f = "", p = "", F = "", G = "", C; l < B; ) {
                    g = e.charCodeAt(l);
                    l === J && 0 !== b + n + v + m && (0 !== b && (g = 47 === b ? 10 : 47), n = v = m = 0, 
                    B++, J++);
                    if (0 === b + n + v + m) {
                        if (l === J && (0 < r && (f = f.replace(N, "")), 0 < f.trim().length)) {
                            switch (g) {
                              case 32:
                              case 9:
                              case 59:
                              case 13:
                              case 10:
                                break;

                              default:
                                f += e.charAt(l);
                            }
                            g = 59;
                        }
                        switch (g) {
                          case 123:
                            f = f.trim();
                            q = f.charCodeAt(0);
                            k = 1;
                            for (t = ++l; l < B; ) {
                                switch (g = e.charCodeAt(l)) {
                                  case 123:
                                    k++;
                                    break;

                                  case 125:
                                    k--;
                                    break;

                                  case 47:
                                    switch (g = e.charCodeAt(l + 1)) {
                                      case 42:
                                      case 47:
                                        a: {
                                            for (u = l + 1; u < J; ++u) {
                                                switch (e.charCodeAt(u)) {
                                                  case 47:
                                                    if (42 === g && 42 === e.charCodeAt(u - 1) && l + 2 !== u) {
                                                        l = u + 1;
                                                        break a;
                                                    }
                                                    break;

                                                  case 10:
                                                    if (47 === g) {
                                                        l = u + 1;
                                                        break a;
                                                    }
                                                }
                                            }
                                            l = u;
                                        }
                                    }
                                    break;

                                  case 91:
                                    g++;

                                  case 40:
                                    g++;

                                  case 34:
                                  case 39:
                                    for (;l++ < J && e.charCodeAt(l) !== g; ) {}
                                }
                                if (0 === k) break;
                                l++;
                            }
                            k = e.substring(t, l);
                            0 === q && (q = (f = f.replace(ca, "").trim()).charCodeAt(0));
                            switch (q) {
                              case 64:
                                0 < r && (f = f.replace(N, ""));
                                g = f.charCodeAt(1);
                                switch (g) {
                                  case 100:
                                  case 109:
                                  case 115:
                                  case 45:
                                    r = c;
                                    break;

                                  default:
                                    r = O;
                                }
                                k = M(c, r, k, g, a + 1);
                                t = k.length;
                                0 < A && (r = X(O, f, I), C = H(3, k, r, c, D, z, t, g, a, h), f = r.join(""), void 0 !== C && 0 === (t = (k = C.trim()).length) && (g = 0, 
                                k = ""));
                                if (0 < t) switch (g) {
                                  case 115:
                                    f = f.replace(da, ea);

                                  case 100:
                                  case 109:
                                  case 45:
                                    k = f + "{" + k + "}";
                                    break;

                                  case 107:
                                    f = f.replace(fa, "$1 $2");
                                    k = f + "{" + k + "}";
                                    k = 1 === w || 2 === w && L("@" + k, 3) ? "@-webkit-" + k + "@" + k : "@" + k;
                                    break;

                                  default:
                                    k = f + k, 112 === h && (k = (p += k, ""));
                                } else k = "";
                                break;

                              default:
                                k = M(c, X(c, f, I), k, h, a + 1);
                            }
                            F += k;
                            k = I = r = u = q = 0;
                            f = "";
                            g = e.charCodeAt(++l);
                            break;

                          case 125:
                          case 59:
                            f = (0 < r ? f.replace(N, "") : f).trim();
                            if (1 < (t = f.length)) switch (0 === u && (q = f.charCodeAt(0), 45 === q || 96 < q && 123 > q) && (t = (f = f.replace(" ", ":")).length), 
                            0 < A && void 0 !== (C = H(1, f, c, d, D, z, p.length, h, a, h)) && 0 === (t = (f = C.trim()).length) && (f = "\0\0"), 
                            q = f.charCodeAt(0), g = f.charCodeAt(1), q) {
                              case 0:
                                break;

                              case 64:
                                if (105 === g || 99 === g) {
                                    G += f + e.charAt(l);
                                    break;
                                }

                              default:
                                58 !== f.charCodeAt(t - 1) && (p += P(f, q, g, f.charCodeAt(2)));
                            }
                            I = r = u = q = 0;
                            f = "";
                            g = e.charCodeAt(++l);
                        }
                    }
                    switch (g) {
                      case 13:
                      case 10:
                        47 === b ? b = 0 : 0 === 1 + q && 107 !== h && 0 < f.length && (r = 1, f += "\0");
                        0 < A * Y && H(0, f, c, d, D, z, p.length, h, a, h);
                        z = 1;
                        D++;
                        break;

                      case 59:
                      case 125:
                        if (0 === b + n + v + m) {
                            z++;
                            break;
                        }

                      default:
                        z++;
                        y = e.charAt(l);
                        switch (g) {
                          case 9:
                          case 32:
                            if (0 === n + m + b) switch (x) {
                              case 44:
                              case 58:
                              case 9:
                              case 32:
                                y = "";
                                break;

                              default:
                                32 !== g && (y = " ");
                            }
                            break;

                          case 0:
                            y = "\\0";
                            break;

                          case 12:
                            y = "\\f";
                            break;

                          case 11:
                            y = "\\v";
                            break;

                          case 38:
                            0 === n + b + m && (r = I = 1, y = "\f" + y);
                            break;

                          case 108:
                            if (0 === n + b + m + E && 0 < u) switch (l - u) {
                              case 2:
                                112 === x && 58 === e.charCodeAt(l - 3) && (E = x);

                              case 8:
                                111 === K && (E = K);
                            }
                            break;

                          case 58:
                            0 === n + b + m && (u = l);
                            break;

                          case 44:
                            0 === b + v + n + m && (r = 1, y += "\r");
                            break;

                          case 34:
                          case 39:
                            0 === b && (n = n === g ? 0 : 0 === n ? g : n);
                            break;

                          case 91:
                            0 === n + b + v && m++;
                            break;

                          case 93:
                            0 === n + b + v && m--;
                            break;

                          case 41:
                            0 === n + b + m && v--;
                            break;

                          case 40:
                            if (0 === n + b + m) {
                                if (0 === q) switch (2 * x + 3 * K) {
                                  case 533:
                                    break;

                                  default:
                                    q = 1;
                                }
                                v++;
                            }
                            break;

                          case 64:
                            0 === b + v + n + m + u + k && (k = 1);
                            break;

                          case 42:
                          case 47:
                            if (!(0 < n + m + v)) switch (b) {
                              case 0:
                                switch (2 * g + 3 * e.charCodeAt(l + 1)) {
                                  case 235:
                                    b = 47;
                                    break;

                                  case 220:
                                    t = l, b = 42;
                                }
                                break;

                              case 42:
                                47 === g && 42 === x && t + 2 !== l && (33 === e.charCodeAt(t + 2) && (p += e.substring(t, l + 1)), 
                                y = "", b = 0);
                            }
                        }
                        0 === b && (f += y);
                    }
                    K = x;
                    x = g;
                    l++;
                }
                t = p.length;
                if (0 < t) {
                    r = c;
                    if (0 < A && (C = H(2, p, r, d, D, z, t, h, a, h), void 0 !== C && 0 === (p = C).length)) return G + p + F;
                    p = r.join(",") + "{" + p + "}";
                    if (0 !== w * E) {
                        2 !== w || L(p, 2) || (E = 0);
                        switch (E) {
                          case 111:
                            p = p.replace(ha, ":-moz-$1") + p;
                            break;

                          case 112:
                            p = p.replace(Q, "::-webkit-input-$1") + p.replace(Q, "::-moz-$1") + p.replace(Q, ":-ms-input-$1") + p;
                        }
                        E = 0;
                    }
                }
                return G + p + F;
            }
            function X(d, c, e) {
                var h = c.trim().split(ia);
                c = h;
                var a = h.length, m = d.length;
                switch (m) {
                  case 0:
                  case 1:
                    var b = 0;
                    for (d = 0 === m ? "" : d[0] + " "; b < a; ++b) {
                        c[b] = Z(d, c[b], e).trim();
                    }
                    break;

                  default:
                    var v = b = 0;
                    for (c = []; b < a; ++b) {
                        for (var n = 0; n < m; ++n) {
                            c[v++] = Z(d[n] + " ", h[b], e).trim();
                        }
                    }
                }
                return c;
            }
            function Z(d, c, e) {
                var h = c.charCodeAt(0);
                33 > h && (h = (c = c.trim()).charCodeAt(0));
                switch (h) {
                  case 38:
                    return c.replace(F, "$1" + d.trim());

                  case 58:
                    return d.trim() + c.replace(F, "$1" + d.trim());

                  default:
                    if (0 < 1 * e && 0 < c.indexOf("\f")) return c.replace(F, (58 === d.charCodeAt(0) ? "" : "$1") + d.trim());
                }
                return d + c;
            }
            function P(d, c, e, h) {
                var a = d + ";", m = 2 * c + 3 * e + 4 * h;
                if (944 === m) {
                    d = a.indexOf(":", 9) + 1;
                    var b = a.substring(d, a.length - 1).trim();
                    b = a.substring(0, d).trim() + b + ";";
                    return 1 === w || 2 === w && L(b, 1) ? "-webkit-" + b + b : b;
                }
                if (0 === w || 2 === w && !L(a, 1)) return a;
                switch (m) {
                  case 1015:
                    return 97 === a.charCodeAt(10) ? "-webkit-" + a + a : a;

                  case 951:
                    return 116 === a.charCodeAt(3) ? "-webkit-" + a + a : a;

                  case 963:
                    return 110 === a.charCodeAt(5) ? "-webkit-" + a + a : a;

                  case 1009:
                    if (100 !== a.charCodeAt(4)) break;

                  case 969:
                  case 942:
                    return "-webkit-" + a + a;

                  case 978:
                    return "-webkit-" + a + "-moz-" + a + a;

                  case 1019:
                  case 983:
                    return "-webkit-" + a + "-moz-" + a + "-ms-" + a + a;

                  case 883:
                    if (45 === a.charCodeAt(8)) return "-webkit-" + a + a;
                    if (0 < a.indexOf("image-set(", 11)) return a.replace(ja, "$1-webkit-$2") + a;
                    break;

                  case 932:
                    if (45 === a.charCodeAt(4)) switch (a.charCodeAt(5)) {
                      case 103:
                        return "-webkit-box-" + a.replace("-grow", "") + "-webkit-" + a + "-ms-" + a.replace("grow", "positive") + a;

                      case 115:
                        return "-webkit-" + a + "-ms-" + a.replace("shrink", "negative") + a;

                      case 98:
                        return "-webkit-" + a + "-ms-" + a.replace("basis", "preferred-size") + a;
                    }
                    return "-webkit-" + a + "-ms-" + a + a;

                  case 964:
                    return "-webkit-" + a + "-ms-flex-" + a + a;

                  case 1023:
                    if (99 !== a.charCodeAt(8)) break;
                    b = a.substring(a.indexOf(":", 15)).replace("flex-", "").replace("space-between", "justify");
                    return "-webkit-box-pack" + b + "-webkit-" + a + "-ms-flex-pack" + b + a;

                  case 1005:
                    return ka.test(a) ? a.replace(aa, ":-webkit-") + a.replace(aa, ":-moz-") + a : a;

                  case 1e3:
                    b = a.substring(13).trim();
                    c = b.indexOf("-") + 1;
                    switch (b.charCodeAt(0) + b.charCodeAt(c)) {
                      case 226:
                        b = a.replace(G, "tb");
                        break;

                      case 232:
                        b = a.replace(G, "tb-rl");
                        break;

                      case 220:
                        b = a.replace(G, "lr");
                        break;

                      default:
                        return a;
                    }
                    return "-webkit-" + a + "-ms-" + b + a;

                  case 1017:
                    if (-1 === a.indexOf("sticky", 9)) break;

                  case 975:
                    c = (a = d).length - 10;
                    b = (33 === a.charCodeAt(c) ? a.substring(0, c) : a).substring(d.indexOf(":", 7) + 1).trim();
                    switch (m = b.charCodeAt(0) + (b.charCodeAt(7) | 0)) {
                      case 203:
                        if (111 > b.charCodeAt(8)) break;

                      case 115:
                        a = a.replace(b, "-webkit-" + b) + ";" + a;
                        break;

                      case 207:
                      case 102:
                        a = a.replace(b, "-webkit-" + (102 < m ? "inline-" : "") + "box") + ";" + a.replace(b, "-webkit-" + b) + ";" + a.replace(b, "-ms-" + b + "box") + ";" + a;
                    }
                    return a + ";";

                  case 938:
                    if (45 === a.charCodeAt(5)) switch (a.charCodeAt(6)) {
                      case 105:
                        return b = a.replace("-items", ""), "-webkit-" + a + "-webkit-box-" + b + "-ms-flex-" + b + a;

                      case 115:
                        return "-webkit-" + a + "-ms-flex-item-" + a.replace(ba, "") + a;

                      default:
                        return "-webkit-" + a + "-ms-flex-line-pack" + a.replace("align-content", "").replace(ba, "") + a;
                    }
                    break;

                  case 973:
                  case 989:
                    if (45 !== a.charCodeAt(3) || 122 === a.charCodeAt(4)) break;

                  case 931:
                  case 953:
                    if (!0 === la.test(d)) return 115 === (b = d.substring(d.indexOf(":") + 1)).charCodeAt(0) ? P(d.replace("stretch", "fill-available"), c, e, h).replace(":fill-available", ":stretch") : a.replace(b, "-webkit-" + b) + a.replace(b, "-moz-" + b.replace("fill-", "")) + a;
                    break;

                  case 962:
                    if (a = "-webkit-" + a + (102 === a.charCodeAt(5) ? "-ms-" + a : "") + a, 211 === e + h && 105 === a.charCodeAt(13) && 0 < a.indexOf("transform", 10)) return a.substring(0, a.indexOf(";", 27) + 1).replace(ma, "$1-webkit-$2") + a;
                }
                return a;
            }
            function L(d, c) {
                var e = d.indexOf(1 === c ? ":" : "{"), h = d.substring(0, 3 !== c ? e : 10);
                e = d.substring(e + 1, d.length - 1);
                return R(2 !== c ? h : h.replace(na, "$1"), e, c);
            }
            function ea(d, c) {
                var e = P(c, c.charCodeAt(0), c.charCodeAt(1), c.charCodeAt(2));
                return e !== c + ";" ? e.replace(oa, " or ($1)").substring(4) : "(" + c + ")";
            }
            function H(d, c, e, h, a, m, b, v, n, q) {
                for (var g = 0, x = c, w; g < A; ++g) {
                    switch (w = S[g].call(B, d, x, e, h, a, m, b, v, n, q)) {
                      case void 0:
                      case !1:
                      case !0:
                      case null:
                        break;

                      default:
                        x = w;
                    }
                }
                if (x !== c) return x;
            }
            function T(d) {
                switch (d) {
                  case void 0:
                  case null:
                    A = S.length = 0;
                    break;

                  default:
                    if ("function" === typeof d) S[A++] = d; else if ("object" === typeof d) for (var c = 0, e = d.length; c < e; ++c) {
                        T(d[c]);
                    } else Y = !!d | 0;
                }
                return T;
            }
            function U(d) {
                d = d.prefix;
                void 0 !== d && (R = null, d ? "function" !== typeof d ? w = 1 : (w = 2, R = d) : w = 0);
                return U;
            }
            function B(d, c) {
                var e = d;
                33 > e.charCodeAt(0) && (e = e.trim());
                V = e;
                e = [ V ];
                if (0 < A) {
                    var h = H(-1, c, e, e, D, z, 0, 0, 0, 0);
                    void 0 !== h && "string" === typeof h && (c = h);
                }
                var a = M(O, e, c, 0, 0);
                0 < A && (h = H(-2, a, e, e, D, z, a.length, 0, 0, 0), void 0 !== h && (a = h));
                V = "";
                E = 0;
                z = D = 1;
                return a;
            }
            var ca = /^\0+/g, N = /[\0\r\f]/g, aa = /: */g, ka = /zoo|gra/, ma = /([,: ])(transform)/g, ia = /,\r+?/g, F = /([\t\r\n ])*\f?&/g, fa = /@(k\w+)\s*(\S*)\s*/, Q = /::(place)/g, ha = /:(read-only)/g, G = /[svh]\w+-[tblr]{2}/, da = /\(\s*(.*)\s*\)/g, oa = /([\s\S]*?);/g, ba = /-self|flex-/g, na = /[^]*?(:[rp][el]a[\w-]+)[^]*/, la = /stretch|:\s*\w+\-(?:conte|avail)/, ja = /([^-])(image-set\()/, z = 1, D = 1, E = 0, w = 1, O = [], S = [], A = 0, R = null, Y = 0, V = "";
            B.use = T;
            B.set = U;
            void 0 !== W && U(W);
            return B;
        }
        const stylis_browser_esm = stylis_min;
        var unitlessKeys = {
            animationIterationCount: 1,
            borderImageOutset: 1,
            borderImageSlice: 1,
            borderImageWidth: 1,
            boxFlex: 1,
            boxFlexGroup: 1,
            boxOrdinalGroup: 1,
            columnCount: 1,
            columns: 1,
            flex: 1,
            flexGrow: 1,
            flexPositive: 1,
            flexShrink: 1,
            flexNegative: 1,
            flexOrder: 1,
            gridRow: 1,
            gridRowEnd: 1,
            gridRowSpan: 1,
            gridRowStart: 1,
            gridColumn: 1,
            gridColumnEnd: 1,
            gridColumnSpan: 1,
            gridColumnStart: 1,
            msGridRow: 1,
            msGridRowSpan: 1,
            msGridColumn: 1,
            msGridColumnSpan: 1,
            fontWeight: 1,
            lineHeight: 1,
            opacity: 1,
            order: 1,
            orphans: 1,
            tabSize: 1,
            widows: 1,
            zIndex: 1,
            zoom: 1,
            WebkitLineClamp: 1,
            fillOpacity: 1,
            floodOpacity: 1,
            stopOpacity: 1,
            strokeDasharray: 1,
            strokeDashoffset: 1,
            strokeMiterlimit: 1,
            strokeOpacity: 1,
            strokeWidth: 1
        };
        const unitless_browser_esm = unitlessKeys;
        function memoize(fn) {
            var cache = {};
            return function(arg) {
                if (cache[arg] === undefined) cache[arg] = fn(arg);
                return cache[arg];
            };
        }
        const memoize_browser_esm = memoize;
        var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;
        var index = memoize_browser_esm((function(prop) {
            return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
        }));
        const is_prop_valid_browser_esm = index;
        var hoist_non_react_statics_cjs = __webpack_require__(490);
        var hoist_non_react_statics_cjs_default = __webpack_require__.n(hoist_non_react_statics_cjs);
        function v() {
            return (v = Object.assign || function(e) {
                for (var t = 1; t < arguments.length; t++) {
                    var n = arguments[t];
                    for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
                }
                return e;
            }).apply(this, arguments);
        }
        var g = function(e, t) {
            for (var n = [ e[0] ], r = 0, o = t.length; r < o; r += 1) n.push(t[r], e[r + 1]);
            return n;
        }, S = function(t) {
            return null !== t && "object" == typeof t && "[object Object]" === (t.toString ? t.toString() : Object.prototype.toString.call(t)) && !(0, 
            react_is.typeOf)(t);
        }, w = Object.freeze([]), E = Object.freeze({});
        function b(e) {
            return "function" == typeof e;
        }
        function _(e) {
            return false || e.displayName || e.name || "Component";
        }
        function N(e) {
            return e && "string" == typeof e.styledComponentId;
        }
        var A = "undefined" != typeof process && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR) || "data-styled", C = "5.2.1", I = "undefined" != typeof window && "HTMLElement" in window, P = Boolean("boolean" == typeof SC_DISABLE_SPEEDY ? SC_DISABLE_SPEEDY : "undefined" != typeof process && void 0 !== process.env.REACT_APP_SC_DISABLE_SPEEDY && "" !== process.env.REACT_APP_SC_DISABLE_SPEEDY ? "false" !== process.env.REACT_APP_SC_DISABLE_SPEEDY && process.env.REACT_APP_SC_DISABLE_SPEEDY : "undefined" != typeof process && void 0 !== process.env.SC_DISABLE_SPEEDY && "" !== process.env.SC_DISABLE_SPEEDY ? "false" !== process.env.SC_DISABLE_SPEEDY && process.env.SC_DISABLE_SPEEDY : "production" !== "production"), O = {}, R = false ? 0 : {};
        function D() {
            for (var e = arguments.length <= 0 ? void 0 : arguments[0], t = [], n = 1, r = arguments.length; n < r; n += 1) t.push(n < 0 || arguments.length <= n ? void 0 : arguments[n]);
            return t.forEach((function(t) {
                e = e.replace(/%[a-z]/, t);
            })), e;
        }
        function j(e) {
            for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++) n[r - 1] = arguments[r];
            throw true ? new Error("An error occurred. See https://git.io/JUIaE#" + e + " for more information." + (n.length > 0 ? " Args: " + n.join(", ") : "")) : 0;
        }
        var T = function() {
            function e(e) {
                this.groupSizes = new Uint32Array(512), this.length = 512, this.tag = e;
            }
            var t = e.prototype;
            return t.indexOfGroup = function(e) {
                for (var t = 0, n = 0; n < e; n++) t += this.groupSizes[n];
                return t;
            }, t.insertRules = function(e, t) {
                if (e >= this.groupSizes.length) {
                    for (var n = this.groupSizes, r = n.length, o = r; e >= o; ) (o <<= 1) < 0 && j(16, "" + e);
                    this.groupSizes = new Uint32Array(o), this.groupSizes.set(n), this.length = o;
                    for (var s = r; s < o; s++) this.groupSizes[s] = 0;
                }
                for (var i = this.indexOfGroup(e + 1), a = 0, c = t.length; a < c; a++) this.tag.insertRule(i, t[a]) && (this.groupSizes[e]++, 
                i++);
            }, t.clearGroup = function(e) {
                if (e < this.length) {
                    var t = this.groupSizes[e], n = this.indexOfGroup(e), r = n + t;
                    this.groupSizes[e] = 0;
                    for (var o = n; o < r; o++) this.tag.deleteRule(n);
                }
            }, t.getGroup = function(e) {
                var t = "";
                if (e >= this.length || 0 === this.groupSizes[e]) return t;
                for (var n = this.groupSizes[e], r = this.indexOfGroup(e), o = r + n, s = r; s < o; s++) t += this.tag.getRule(s) + "/*!sc*/\n";
                return t;
            }, e;
        }(), k = new Map, x = new Map, V = 1, B = function(e) {
            if (k.has(e)) return k.get(e);
            for (;x.has(V); ) V++;
            var t = V++;
            return false && 0, k.set(e, t), x.set(t, e), t;
        }, M = function(e) {
            return x.get(e);
        }, z = function(e, t) {
            k.set(e, t), x.set(t, e);
        }, L = "style[" + A + '][data-styled-version="5.2.1"]', G = new RegExp("^" + A + '\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'), F = function(e, t, n) {
            for (var r, o = n.split(","), s = 0, i = o.length; s < i; s++) (r = o[s]) && e.registerName(t, r);
        }, Y = function(e, t) {
            for (var n = t.innerHTML.split("/*!sc*/\n"), r = [], o = 0, s = n.length; o < s; o++) {
                var i = n[o].trim();
                if (i) {
                    var a = i.match(G);
                    if (a) {
                        var c = 0 | parseInt(a[1], 10), u = a[2];
                        0 !== c && (z(u, c), F(e, u, a[3]), e.getTag().insertRules(c, r)), r.length = 0;
                    } else r.push(i);
                }
            }
        }, q = function() {
            return true ? __webpack_require__.nc : 0;
        }, H = function(e) {
            var t = document.head, n = e || t, r = document.createElement("style"), o = function(e) {
                for (var t = e.childNodes, n = t.length; n >= 0; n--) {
                    var r = t[n];
                    if (r && 1 === r.nodeType && r.hasAttribute(A)) return r;
                }
            }(n), s = void 0 !== o ? o.nextSibling : null;
            r.setAttribute(A, "active"), r.setAttribute("data-styled-version", "5.2.1");
            var i = q();
            return i && r.setAttribute("nonce", i), n.insertBefore(r, s), r;
        }, $ = function() {
            function e(e) {
                var t = this.element = H(e);
                t.appendChild(document.createTextNode("")), this.sheet = function(e) {
                    if (e.sheet) return e.sheet;
                    for (var t = document.styleSheets, n = 0, r = t.length; n < r; n++) {
                        var o = t[n];
                        if (o.ownerNode === e) return o;
                    }
                    j(17);
                }(t), this.length = 0;
            }
            var t = e.prototype;
            return t.insertRule = function(e, t) {
                try {
                    return this.sheet.insertRule(t, e), this.length++, !0;
                } catch (e) {
                    return !1;
                }
            }, t.deleteRule = function(e) {
                this.sheet.deleteRule(e), this.length--;
            }, t.getRule = function(e) {
                var t = this.sheet.cssRules[e];
                return void 0 !== t && "string" == typeof t.cssText ? t.cssText : "";
            }, e;
        }(), W = function() {
            function e(e) {
                var t = this.element = H(e);
                this.nodes = t.childNodes, this.length = 0;
            }
            var t = e.prototype;
            return t.insertRule = function(e, t) {
                if (e <= this.length && e >= 0) {
                    var n = document.createTextNode(t), r = this.nodes[e];
                    return this.element.insertBefore(n, r || null), this.length++, !0;
                }
                return !1;
            }, t.deleteRule = function(e) {
                this.element.removeChild(this.nodes[e]), this.length--;
            }, t.getRule = function(e) {
                return e < this.length ? this.nodes[e].textContent : "";
            }, e;
        }(), U = function() {
            function e(e) {
                this.rules = [], this.length = 0;
            }
            var t = e.prototype;
            return t.insertRule = function(e, t) {
                return e <= this.length && (this.rules.splice(e, 0, t), this.length++, !0);
            }, t.deleteRule = function(e) {
                this.rules.splice(e, 1), this.length--;
            }, t.getRule = function(e) {
                return e < this.length ? this.rules[e] : "";
            }, e;
        }(), J = I, X = {
            isServer: !I,
            useCSSOMInjection: !P
        }, Z = function() {
            function e(e, t, n) {
                void 0 === e && (e = E), void 0 === t && (t = {}), this.options = v({}, X, {}, e), 
                this.gs = t, this.names = new Map(n), !this.options.isServer && I && J && (J = !1, 
                function(e) {
                    for (var t = document.querySelectorAll(L), n = 0, r = t.length; n < r; n++) {
                        var o = t[n];
                        o && "active" !== o.getAttribute(A) && (Y(e, o), o.parentNode && o.parentNode.removeChild(o));
                    }
                }(this));
            }
            e.registerId = function(e) {
                return B(e);
            };
            var t = e.prototype;
            return t.reconstructWithOptions = function(t, n) {
                return void 0 === n && (n = !0), new e(v({}, this.options, {}, t), this.gs, n && this.names || void 0);
            }, t.allocateGSInstance = function(e) {
                return this.gs[e] = (this.gs[e] || 0) + 1;
            }, t.getTag = function() {
                return this.tag || (this.tag = (n = (t = this.options).isServer, r = t.useCSSOMInjection, 
                o = t.target, e = n ? new U(o) : r ? new $(o) : new W(o), new T(e)));
                var e, t, n, r, o;
            }, t.hasNameForId = function(e, t) {
                return this.names.has(e) && this.names.get(e).has(t);
            }, t.registerName = function(e, t) {
                if (B(e), this.names.has(e)) this.names.get(e).add(t); else {
                    var n = new Set;
                    n.add(t), this.names.set(e, n);
                }
            }, t.insertRules = function(e, t, n) {
                this.registerName(e, t), this.getTag().insertRules(B(e), n);
            }, t.clearNames = function(e) {
                this.names.has(e) && this.names.get(e).clear();
            }, t.clearRules = function(e) {
                this.getTag().clearGroup(B(e)), this.clearNames(e);
            }, t.clearTag = function() {
                this.tag = void 0;
            }, t.toString = function() {
                return function(e) {
                    for (var t = e.getTag(), n = t.length, r = "", o = 0; o < n; o++) {
                        var s = M(o);
                        if (void 0 !== s) {
                            var i = e.names.get(s), a = t.getGroup(o);
                            if (void 0 !== i && 0 !== a.length) {
                                var c = A + ".g" + o + '[id="' + s + '"]', u = "";
                                void 0 !== i && i.forEach((function(e) {
                                    e.length > 0 && (u += e + ",");
                                })), r += "" + a + c + '{content:"' + u + '"}/*!sc*/\n';
                            }
                        }
                    }
                    return r;
                }(this);
            }, e;
        }(), K = /(a)(d)/gi, Q = function(e) {
            return String.fromCharCode(e + (e > 25 ? 39 : 97));
        };
        function ee(e) {
            var t, n = "";
            for (t = Math.abs(e); t > 52; t = t / 52 | 0) n = Q(t % 52) + n;
            return (Q(t % 52) + n).replace(K, "$1-$2");
        }
        var te = function(e, t) {
            for (var n = t.length; n; ) e = 33 * e ^ t.charCodeAt(--n);
            return e;
        }, ne = function(e) {
            return te(5381, e);
        };
        function re(e) {
            for (var t = 0; t < e.length; t += 1) {
                var n = e[t];
                if (b(n) && !N(n)) return !1;
            }
            return !0;
        }
        var oe = ne("5.2.1"), se = function() {
            function e(e, t, n) {
                this.rules = e, this.staticRulesId = "", this.isStatic = true && (void 0 === n || n.isStatic) && re(e), 
                this.componentId = t, this.baseHash = te(oe, t), this.baseStyle = n, Z.registerId(t);
            }
            return e.prototype.generateAndInjectStyles = function(e, t, n) {
                var r = this.componentId, o = [];
                if (this.baseStyle && o.push(this.baseStyle.generateAndInjectStyles(e, t, n)), this.isStatic && !n.hash) if (this.staticRulesId && t.hasNameForId(r, this.staticRulesId)) o.push(this.staticRulesId); else {
                    var s = Ne(this.rules, e, t, n).join(""), i = ee(te(this.baseHash, s.length) >>> 0);
                    if (!t.hasNameForId(r, i)) {
                        var a = n(s, "." + i, void 0, r);
                        t.insertRules(r, i, a);
                    }
                    o.push(i), this.staticRulesId = i;
                } else {
                    for (var c = this.rules.length, u = te(this.baseHash, n.hash), l = "", d = 0; d < c; d++) {
                        var h = this.rules[d];
                        if ("string" == typeof h) l += h, false && 0; else if (h) {
                            var p = Ne(h, e, t, n), f = Array.isArray(p) ? p.join("") : p;
                            u = te(u, f + d), l += f;
                        }
                    }
                    if (l) {
                        var m = ee(u >>> 0);
                        if (!t.hasNameForId(r, m)) {
                            var y = n(l, "." + m, void 0, r);
                            t.insertRules(r, m, y);
                        }
                        o.push(m);
                    }
                }
                return o.join(" ");
            }, e;
        }(), ie = /^\s*\/\/.*$/gm, ae = [ ":", "[", ".", "#" ];
        function ce(e) {
            var t, n, r, o, s = void 0 === e ? E : e, i = s.options, a = void 0 === i ? E : i, c = s.plugins, u = void 0 === c ? w : c, l = new stylis_browser_esm(a), d = [], h = function(e) {
                function t(t) {
                    if (t) try {
                        e(t + "}");
                    } catch (e) {}
                }
                return function(n, r, o, s, i, a, c, u, l, d) {
                    switch (n) {
                      case 1:
                        if (0 === l && 64 === r.charCodeAt(0)) return e(r + ";"), "";
                        break;

                      case 2:
                        if (0 === u) return r + "/*|*/";
                        break;

                      case 3:
                        switch (u) {
                          case 102:
                          case 112:
                            return e(o[0] + r), "";

                          default:
                            return r + (0 === d ? "/*|*/" : "");
                        }

                      case -2:
                        r.split("/*|*/}").forEach(t);
                    }
                };
            }((function(e) {
                d.push(e);
            })), f = function(e, r, s) {
                return 0 === r && ae.includes(s[n.length]) || s.match(o) ? e : "." + t;
            };
            function m(e, s, i, a) {
                void 0 === a && (a = "&");
                var c = e.replace(ie, ""), u = s && i ? i + " " + s + " { " + c + " }" : c;
                return t = a, n = s, r = new RegExp("\\" + n + "\\b", "g"), o = new RegExp("(\\" + n + "\\b){2,}"), 
                l(i || !s ? "" : s, u);
            }
            return l.use([].concat(u, [ function(e, t, o) {
                2 === e && o.length && o[0].lastIndexOf(n) > 0 && (o[0] = o[0].replace(r, f));
            }, h, function(e) {
                if (-2 === e) {
                    var t = d;
                    return d = [], t;
                }
            } ])), m.hash = u.length ? u.reduce((function(e, t) {
                return t.name || j(15), te(e, t.name);
            }), 5381).toString() : "", m;
        }
        var ue = react.createContext(), le = ue.Consumer, de = react.createContext(), he = (de.Consumer, 
        new Z), pe = ce();
        function fe() {
            return (0, react.useContext)(ue) || he;
        }
        function me() {
            return (0, react.useContext)(de) || pe;
        }
        function ye(e) {
            var t = (0, react.useState)(e.stylisPlugins), n = t[0], s = t[1], c = fe(), u = (0, 
            react.useMemo)((function() {
                var t = c;
                return e.sheet ? t = e.sheet : e.target && (t = t.reconstructWithOptions({
                    target: e.target
                }, !1)), e.disableCSSOMInjection && (t = t.reconstructWithOptions({
                    useCSSOMInjection: !1
                })), t;
            }), [ e.disableCSSOMInjection, e.sheet, e.target ]), l = (0, react.useMemo)((function() {
                return ce({
                    options: {
                        prefix: !e.disableVendorPrefixes
                    },
                    plugins: n
                });
            }), [ e.disableVendorPrefixes, n ]);
            return (0, react.useEffect)((function() {
                shallowequal_default()(n, e.stylisPlugins) || s(e.stylisPlugins);
            }), [ e.stylisPlugins ]), react.createElement(ue.Provider, {
                value: u
            }, react.createElement(de.Provider, {
                value: l
            }, false ? 0 : e.children));
        }
        var ve = function() {
            function e(e, t) {
                var n = this;
                this.inject = function(e, t) {
                    void 0 === t && (t = pe);
                    var r = n.name + t.hash;
                    e.hasNameForId(n.id, r) || e.insertRules(n.id, r, t(n.rules, r, "@keyframes"));
                }, this.toString = function() {
                    return j(12, String(n.name));
                }, this.name = e, this.id = "sc-keyframes-" + e, this.rules = t;
            }
            return e.prototype.getName = function(e) {
                return void 0 === e && (e = pe), this.name + e.hash;
            }, e;
        }(), ge = /([A-Z])/, Se = /([A-Z])/g, we = /^ms-/, Ee = function(e) {
            return "-" + e.toLowerCase();
        };
        function be(e) {
            return ge.test(e) ? e.replace(Se, Ee).replace(we, "-ms-") : e;
        }
        var _e = function(e) {
            return null == e || !1 === e || "" === e;
        };
        function Ne(e, n, r, o) {
            if (Array.isArray(e)) {
                for (var s, i = [], a = 0, c = e.length; a < c; a += 1) "" !== (s = Ne(e[a], n, r, o)) && (Array.isArray(s) ? i.push.apply(i, s) : i.push(s));
                return i;
            }
            if (_e(e)) return "";
            if (N(e)) return "." + e.styledComponentId;
            if (b(e)) {
                if ("function" != typeof (l = e) || l.prototype && l.prototype.isReactComponent || !n) return e;
                var u = e(n);
                return false && 0, Ne(u, n, r, o);
            }
            var l;
            return e instanceof ve ? r ? (e.inject(r, o), e.getName(o)) : e : S(e) ? function e(t, n) {
                var r, o, s = [];
                for (var i in t) t.hasOwnProperty(i) && !_e(t[i]) && (S(t[i]) ? s.push.apply(s, e(t[i], i)) : b(t[i]) ? s.push(be(i) + ":", t[i], ";") : s.push(be(i) + ": " + (r = i, 
                null == (o = t[i]) || "boolean" == typeof o || "" === o ? "" : "number" != typeof o || 0 === o || r in unitless_browser_esm ? String(o).trim() : o + "px") + ";"));
                return n ? [ n + " {" ].concat(s, [ "}" ]) : s;
            }(e) : e.toString();
        }
        function Ae(e) {
            for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++) n[r - 1] = arguments[r];
            return b(e) || S(e) ? Ne(g(w, [ e ].concat(n))) : 0 === n.length && 1 === e.length && "string" == typeof e[0] ? e : Ne(g(e, n));
        }
        var Ce = /invalid hook call/i, Ie = new Set, Pe = function(e, t) {
            if (false) {
                var n;
            }
        }, Oe = function(e, t, n) {
            return void 0 === n && (n = E), e.theme !== n.theme && e.theme || t || n.theme;
        }, Re = /[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g, De = /(^-|-$)/g;
        function je(e) {
            return e.replace(Re, "-").replace(De, "");
        }
        var Te = function(e) {
            return ee(ne(e) >>> 0);
        };
        function ke(e) {
            return "string" == typeof e && (true || 0);
        }
        var xe = function(e) {
            return "function" == typeof e || "object" == typeof e && null !== e && !Array.isArray(e);
        }, Ve = function(e) {
            return "__proto__" !== e && "constructor" !== e && "prototype" !== e;
        };
        function Be(e, t, n) {
            var r = e[n];
            xe(t) && xe(r) ? Me(r, t) : e[n] = t;
        }
        function Me(e) {
            for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++) n[r - 1] = arguments[r];
            for (var o = 0, s = n; o < s.length; o++) {
                var i = s[o];
                if (xe(i)) for (var a in i) Ve(a) && Be(e, i[a], a);
            }
            return e;
        }
        var ze = react.createContext(), Le = ze.Consumer;
        function Ge(e) {
            var t = (0, react.useContext)(ze), n = (0, react.useMemo)((function() {
                return function(e, t) {
                    if (!e) return j(14);
                    if (b(e)) {
                        var n = e(t);
                        return true ? n : 0;
                    }
                    return Array.isArray(e) || "object" != typeof e ? j(8) : t ? v({}, t, {}, e) : e;
                }(e.theme, t);
            }), [ e.theme, t ]);
            return e.children ? react.createElement(ze.Provider, {
                value: n
            }, e.children) : null;
        }
        var Fe = {};
        function Ye(e, t, n) {
            var o = N(e), i = !ke(e), a = t.attrs, c = void 0 === a ? w : a, d = t.componentId, h = void 0 === d ? function(e, t) {
                var n = "string" != typeof e ? "sc" : je(e);
                Fe[n] = (Fe[n] || 0) + 1;
                var r = n + "-" + Te("5.2.1" + n + Fe[n]);
                return t ? t + "-" + r : r;
            }(t.displayName, t.parentComponentId) : d, p = t.displayName, f = void 0 === p ? function(e) {
                return ke(e) ? "styled." + e : "Styled(" + _(e) + ")";
            }(e) : p, g = t.displayName && t.componentId ? je(t.displayName) + "-" + t.componentId : t.componentId || h, S = o && e.attrs ? Array.prototype.concat(e.attrs, c).filter(Boolean) : c, A = t.shouldForwardProp;
            o && e.shouldForwardProp && (A = t.shouldForwardProp ? function(n, r) {
                return e.shouldForwardProp(n, r) && t.shouldForwardProp(n, r);
            } : e.shouldForwardProp);
            var C, I = new se(n, g, o ? e.componentStyle : void 0), P = I.isStatic && 0 === c.length, O = function(e, t) {
                return function(e, t, n, r) {
                    var o = e.attrs, i = e.componentStyle, a = e.defaultProps, c = e.foldedComponentIds, d = e.shouldForwardProp, h = e.styledComponentId, p = e.target;
                    false && 0;
                    var f = function(e, t, n) {
                        void 0 === e && (e = E);
                        var r = v({}, t, {
                            theme: e
                        }), o = {};
                        return n.forEach((function(e) {
                            var t, n, s, i = e;
                            for (t in b(i) && (i = i(r)), i) r[t] = o[t] = "className" === t ? (n = o[t], s = i[t], 
                            n && s ? n + " " + s : n || s) : i[t];
                        })), [ r, o ];
                    }(Oe(t, (0, react.useContext)(ze), a) || E, t, o), y = f[0], g = f[1], S = function(e, t, n, r) {
                        var o = fe(), s = me(), i = t ? e.generateAndInjectStyles(E, o, s) : e.generateAndInjectStyles(n, o, s);
                        return false && 0, false && 0, i;
                    }(i, r, y, false ? 0 : void 0), w = n, _ = g.$as || t.$as || g.as || t.as || p, N = ke(_), A = g !== t ? v({}, t, {}, g) : t, C = {};
                    for (var I in A) "$" !== I[0] && "as" !== I && ("forwardedAs" === I ? C.as = A[I] : (d ? d(I, is_prop_valid_browser_esm) : !N || is_prop_valid_browser_esm(I)) && (C[I] = A[I]));
                    return t.style && g.style !== t.style && (C.style = v({}, t.style, {}, g.style)), 
                    C.className = Array.prototype.concat(c, h, S !== h ? S : null, t.className, g.className).filter(Boolean).join(" "), 
                    C.ref = w, (0, react.createElement)(_, C);
                }(C, e, t, P);
            };
            return O.displayName = f, (C = react.forwardRef(O)).attrs = S, C.componentStyle = I, 
            C.displayName = f, C.shouldForwardProp = A, C.foldedComponentIds = o ? Array.prototype.concat(e.foldedComponentIds, e.styledComponentId) : w, 
            C.styledComponentId = g, C.target = o ? e.target : e, C.withComponent = function(e) {
                var r = t.componentId, o = function(e, t) {
                    if (null == e) return {};
                    var n, r, o = {}, s = Object.keys(e);
                    for (r = 0; r < s.length; r++) n = s[r], t.indexOf(n) >= 0 || (o[n] = e[n]);
                    return o;
                }(t, [ "componentId" ]), s = r && r + "-" + (ke(e) ? e : je(_(e)));
                return Ye(e, v({}, o, {
                    attrs: S,
                    componentId: s
                }), n);
            }, Object.defineProperty(C, "defaultProps", {
                get: function() {
                    return this._foldedDefaultProps;
                },
                set: function(t) {
                    this._foldedDefaultProps = o ? Me({}, e.defaultProps, t) : t;
                }
            }), false && 0, C.toString = function() {
                return "." + C.styledComponentId;
            }, i && hoist_non_react_statics_cjs_default()(C, e, {
                attrs: !0,
                componentStyle: !0,
                displayName: !0,
                foldedComponentIds: !0,
                shouldForwardProp: !0,
                styledComponentId: !0,
                target: !0,
                withComponent: !0
            }), C;
        }
        var qe = function(e) {
            return function e(t, r, o) {
                if (void 0 === o && (o = E), !(0, react_is.isValidElementType)(r)) return j(1, String(r));
                var s = function() {
                    return t(r, o, Ae.apply(void 0, arguments));
                };
                return s.withConfig = function(n) {
                    return e(t, r, v({}, o, {}, n));
                }, s.attrs = function(n) {
                    return e(t, r, v({}, o, {
                        attrs: Array.prototype.concat(o.attrs, n).filter(Boolean)
                    }));
                }, s;
            }(Ye, e);
        };
        [ "a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "marquee", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "u", "ul", "var", "video", "wbr", "circle", "clipPath", "defs", "ellipse", "foreignObject", "g", "image", "line", "linearGradient", "marker", "mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "text", "tspan" ].forEach((function(e) {
            qe[e] = qe(e);
        }));
        var He = function() {
            function e(e, t) {
                this.rules = e, this.componentId = t, this.isStatic = re(e), Z.registerId(this.componentId + 1);
            }
            var t = e.prototype;
            return t.createStyles = function(e, t, n, r) {
                var o = r(Ne(this.rules, t, n, r).join(""), ""), s = this.componentId + e;
                n.insertRules(s, s, o);
            }, t.removeStyles = function(e, t) {
                t.clearRules(this.componentId + e);
            }, t.renderStyles = function(e, t, n, r) {
                e > 2 && Z.registerId(this.componentId + e), this.removeStyles(e, n), this.createStyles(e, t, n, r);
            }, e;
        }();
        function $e(e) {
            for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), o = 1; o < t; o++) n[o - 1] = arguments[o];
            var i = Ae.apply(void 0, [ e ].concat(n)), a = "sc-global-" + Te(JSON.stringify(i)), u = new He(i, a);
            function l(e) {
                var t = fe(), n = me(), o = (0, react.useContext)(ze), l = (0, react.useRef)(t.allocateGSInstance(a)).current;
                return false && 0, false && 0, (0, react.useLayoutEffect)((function() {
                    return h(l, e, t, o, n), function() {
                        return u.removeStyles(l, t);
                    };
                }), [ l, e, t, o, n ]), null;
            }
            function h(e, t, n, r, o) {
                if (u.isStatic) u.renderStyles(e, O, n, o); else {
                    var s = v({}, t, {
                        theme: Oe(t, r, l.defaultProps)
                    });
                    u.renderStyles(e, s, n, o);
                }
            }
            return false && 0, react.memo(l);
        }
        function We(e) {
            false && 0;
            for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++) n[r - 1] = arguments[r];
            var o = Ae.apply(void 0, [ e ].concat(n)).join(""), s = Te(o);
            return new ve(s, o);
        }
        var Ue = function() {
            function e() {
                var e = this;
                this._emitSheetCSS = function() {
                    var t = e.instance.toString(), n = q();
                    return "<style " + [ n && 'nonce="' + n + '"', A + '="true"', 'data-styled-version="5.2.1"' ].filter(Boolean).join(" ") + ">" + t + "</style>";
                }, this.getStyleTags = function() {
                    return e.sealed ? j(2) : e._emitSheetCSS();
                }, this.getStyleElement = function() {
                    var t;
                    if (e.sealed) return j(2);
                    var n = ((t = {})[A] = "", t["data-styled-version"] = "5.2.1", t.dangerouslySetInnerHTML = {
                        __html: e.instance.toString()
                    }, t), o = q();
                    return o && (n.nonce = o), [ react.createElement("style", v({}, n, {
                        key: "sc-0-0"
                    })) ];
                }, this.seal = function() {
                    e.sealed = !0;
                }, this.instance = new Z({
                    isServer: !0
                }), this.sealed = !1;
            }
            var t = e.prototype;
            return t.collectStyles = function(e) {
                return this.sealed ? j(2) : react.createElement(ye, {
                    sheet: this.instance
                }, e);
            }, t.interleaveWithNodeStream = function(e) {
                return j(3);
            }, e;
        }(), Je = function(e) {
            var t = react.forwardRef((function(t, n) {
                var o = (0, react.useContext)(ze), i = e.defaultProps, a = Oe(t, o, i);
                return false && 0, react.createElement(e, v({}, t, {
                    theme: a,
                    ref: n
                }));
            }));
            return hoist_non_react_statics_cjs_default()(t, e), t.displayName = "WithTheme(" + _(e) + ")", 
            t;
        }, Xe = function() {
            return (0, react.useContext)(ze);
        }, Ze = {
            StyleSheet: Z,
            masterSheet: he
        };
        false && 0, false && 0;
        const styled_components_browser_esm = qe;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        if (true) {
            module.exports = __webpack_require__(488);
        } else {}
    }, (__unused_webpack_module, exports) => {
        "use strict";
        var b = "function" === typeof Symbol && Symbol.for, c = b ? Symbol.for("react.element") : 60103, d = b ? Symbol.for("react.portal") : 60106, e = b ? Symbol.for("react.fragment") : 60107, f = b ? Symbol.for("react.strict_mode") : 60108, g = b ? Symbol.for("react.profiler") : 60114, h = b ? Symbol.for("react.provider") : 60109, k = b ? Symbol.for("react.context") : 60110, l = b ? Symbol.for("react.async_mode") : 60111, m = b ? Symbol.for("react.concurrent_mode") : 60111, n = b ? Symbol.for("react.forward_ref") : 60112, p = b ? Symbol.for("react.suspense") : 60113, q = b ? Symbol.for("react.suspense_list") : 60120, r = b ? Symbol.for("react.memo") : 60115, t = b ? Symbol.for("react.lazy") : 60116, v = b ? Symbol.for("react.block") : 60121, w = b ? Symbol.for("react.fundamental") : 60117, x = b ? Symbol.for("react.responder") : 60118, y = b ? Symbol.for("react.scope") : 60119;
        function z(a) {
            if ("object" === typeof a && null !== a) {
                var u = a.$$typeof;
                switch (u) {
                  case c:
                    switch (a = a.type, a) {
                      case l:
                      case m:
                      case e:
                      case g:
                      case f:
                      case p:
                        return a;

                      default:
                        switch (a = a && a.$$typeof, a) {
                          case k:
                          case n:
                          case t:
                          case r:
                          case h:
                            return a;

                          default:
                            return u;
                        }
                    }

                  case d:
                    return u;
                }
            }
        }
        function A(a) {
            return z(a) === m;
        }
        exports.AsyncMode = l;
        exports.ConcurrentMode = m;
        exports.ContextConsumer = k;
        exports.ContextProvider = h;
        exports.Element = c;
        exports.ForwardRef = n;
        exports.Fragment = e;
        exports.Lazy = t;
        exports.Memo = r;
        exports.Portal = d;
        exports.Profiler = g;
        exports.StrictMode = f;
        exports.Suspense = p;
        exports.isAsyncMode = function(a) {
            return A(a) || z(a) === l;
        };
        exports.isConcurrentMode = A;
        exports.isContextConsumer = function(a) {
            return z(a) === k;
        };
        exports.isContextProvider = function(a) {
            return z(a) === h;
        };
        exports.isElement = function(a) {
            return "object" === typeof a && null !== a && a.$$typeof === c;
        };
        exports.isForwardRef = function(a) {
            return z(a) === n;
        };
        exports.isFragment = function(a) {
            return z(a) === e;
        };
        exports.isLazy = function(a) {
            return z(a) === t;
        };
        exports.isMemo = function(a) {
            return z(a) === r;
        };
        exports.isPortal = function(a) {
            return z(a) === d;
        };
        exports.isProfiler = function(a) {
            return z(a) === g;
        };
        exports.isStrictMode = function(a) {
            return z(a) === f;
        };
        exports.isSuspense = function(a) {
            return z(a) === p;
        };
        exports.isValidElementType = function(a) {
            return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
        };
        exports.typeOf = z;
    }, module => {
        module.exports = function shallowEqual(objA, objB, compare, compareContext) {
            var ret = compare ? compare.call(compareContext, objA, objB) : void 0;
            if (ret !== void 0) {
                return !!ret;
            }
            if (objA === objB) {
                return true;
            }
            if (typeof objA !== "object" || !objA || typeof objB !== "object" || !objB) {
                return false;
            }
            var keysA = Object.keys(objA);
            var keysB = Object.keys(objB);
            if (keysA.length !== keysB.length) {
                return false;
            }
            var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
            for (var idx = 0; idx < keysA.length; idx++) {
                var key = keysA[idx];
                if (!bHasOwnProperty(key)) {
                    return false;
                }
                var valueA = objA[key];
                var valueB = objB[key];
                ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;
                if (ret === false || ret === void 0 && valueA !== valueB) {
                    return false;
                }
            }
            return true;
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var reactIs = __webpack_require__(487);
        var REACT_STATICS = {
            childContextTypes: true,
            contextType: true,
            contextTypes: true,
            defaultProps: true,
            displayName: true,
            getDefaultProps: true,
            getDerivedStateFromError: true,
            getDerivedStateFromProps: true,
            mixins: true,
            propTypes: true,
            type: true
        };
        var KNOWN_STATICS = {
            name: true,
            length: true,
            prototype: true,
            caller: true,
            callee: true,
            arguments: true,
            arity: true
        };
        var FORWARD_REF_STATICS = {
            $$typeof: true,
            render: true,
            defaultProps: true,
            displayName: true,
            propTypes: true
        };
        var MEMO_STATICS = {
            $$typeof: true,
            compare: true,
            defaultProps: true,
            displayName: true,
            propTypes: true,
            type: true
        };
        var TYPE_STATICS = {};
        TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
        TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
        function getStatics(component) {
            if (reactIs.isMemo(component)) {
                return MEMO_STATICS;
            }
            return TYPE_STATICS[component["$$typeof"]] || REACT_STATICS;
        }
        var defineProperty = Object.defineProperty;
        var getOwnPropertyNames = Object.getOwnPropertyNames;
        var getOwnPropertySymbols = Object.getOwnPropertySymbols;
        var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
        var getPrototypeOf = Object.getPrototypeOf;
        var objectPrototype = Object.prototype;
        function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
            if (typeof sourceComponent !== "string") {
                if (objectPrototype) {
                    var inheritedComponent = getPrototypeOf(sourceComponent);
                    if (inheritedComponent && inheritedComponent !== objectPrototype) {
                        hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
                    }
                }
                var keys = getOwnPropertyNames(sourceComponent);
                if (getOwnPropertySymbols) {
                    keys = keys.concat(getOwnPropertySymbols(sourceComponent));
                }
                var targetStatics = getStatics(targetComponent);
                var sourceStatics = getStatics(sourceComponent);
                for (var i = 0; i < keys.length; ++i) {
                    var key = keys[i];
                    if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
                        var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
                        try {
                            defineProperty(targetComponent, key, descriptor);
                        } catch (e) {}
                    }
                }
            }
            return targetComponent;
        }
        module.exports = hoistNonReactStatics;
    }, (__unused_webpack_module, exports) => {
        "use strict";
        exports.__esModule = true;
        exports.base = void 0;
        var base = {
            global: {
                colors: {
                    icon: "#666666"
                }
            },
            icon: {
                size: {
                    small: "12px",
                    medium: "24px",
                    large: "48px",
                    xlarge: "96px"
                }
            }
        };
        exports.base = base;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        var __webpack_unused_export__;
        __webpack_unused_export__ = true;
        exports.R = void 0;
        var _react = _interopRequireDefault(__webpack_require__(285));
        var _StyledIcon = __webpack_require__(493);
        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                default: obj
            };
        }
        function _extends() {
            _extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return _extends.apply(this, arguments);
        }
        var FormUp = function FormUp(props) {
            return _react["default"].createElement(_StyledIcon.StyledIcon, _extends({
                viewBox: "0 0 24 24",
                a11yTitle: "FormUp"
            }, props), _react["default"].createElement("polyline", {
                fill: "none",
                stroke: "#000",
                strokeWidth: "2",
                points: "18 9 12 15 6 9",
                transform: "matrix(1 0 0 -1 0 24)"
            }));
        };
        exports.R = FormUp;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        exports.__esModule = true;
        exports.StyledIcon = void 0;
        var _react = _interopRequireDefault(__webpack_require__(285));
        var _styledComponents = _interopRequireWildcard(__webpack_require__(486));
        var _grommetStyles = __webpack_require__(494);
        var _defaultProps = __webpack_require__(495);
        function _getRequireWildcardCache() {
            if (typeof WeakMap !== "function") return null;
            var cache = new WeakMap;
            _getRequireWildcardCache = function _getRequireWildcardCache() {
                return cache;
            };
            return cache;
        }
        function _interopRequireWildcard(obj) {
            if (obj && obj.__esModule) {
                return obj;
            }
            if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
                return {
                    default: obj
                };
            }
            var cache = _getRequireWildcardCache();
            if (cache && cache.has(obj)) {
                return cache.get(obj);
            }
            var newObj = {};
            var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
            for (var key in obj) {
                if (Object.prototype.hasOwnProperty.call(obj, key)) {
                    var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
                    if (desc && (desc.get || desc.set)) {
                        Object.defineProperty(newObj, key, desc);
                    } else {
                        newObj[key] = obj[key];
                    }
                }
            }
            newObj["default"] = obj;
            if (cache) {
                cache.set(obj, newObj);
            }
            return newObj;
        }
        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                default: obj
            };
        }
        function _extends() {
            _extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return _extends.apply(this, arguments);
        }
        function _objectWithoutPropertiesLoose(source, excluded) {
            if (source == null) return {};
            var target = {};
            var sourceKeys = Object.keys(source);
            var key, i;
            for (i = 0; i < sourceKeys.length; i++) {
                key = sourceKeys[i];
                if (excluded.indexOf(key) >= 0) continue;
                target[key] = source[key];
            }
            return target;
        }
        var colorCss = (0, _styledComponents.css)([ "", " ", ' g{fill:inherit;stroke:inherit;}*:not([stroke]){&[fill="none"]{stroke-width:0;}}*[stroke*="#"],*[STROKE*="#"]{stroke:inherit;fill:none;}*[fill-rule],*[FILL-RULE],*[fill*="#"],*[FILL*="#"]{fill:inherit;stroke:none;}' ], (function(props) {
            return (0, _grommetStyles.colorStyle)("fill", props.color || props.theme.global.colors.icon, props.theme);
        }), (function(props) {
            return (0, _grommetStyles.colorStyle)("stroke", props.color || props.theme.global.colors.icon, props.theme);
        }));
        var IconInner = function IconInner(_ref) {
            var a11yTitle = _ref.a11yTitle, color = _ref.color, size = _ref.size, theme = _ref.theme, rest = _objectWithoutPropertiesLoose(_ref, [ "a11yTitle", "color", "size", "theme" ]);
            return _react["default"].createElement("svg", _extends({
                "aria-label": a11yTitle
            }, rest));
        };
        IconInner.displayName = "Icon";
        var parseMetricToNum = function parseMetricToNum(string) {
            return parseFloat(string.match(/\d+(\.\d+)?/), 10);
        };
        var StyledIcon = (0, _styledComponents["default"])(IconInner).withConfig({
            displayName: "StyledIcon",
            componentId: "ofa7kd-0"
        })([ "display:inline-block;flex:0 0 auto;", " ", " ", "" ], (function(_ref2) {
            var _ref2$size = _ref2.size, size = _ref2$size === void 0 ? "medium" : _ref2$size, theme = _ref2.theme, viewBox = _ref2.viewBox;
            var _split = (viewBox || "0 0 24 24").split(" "), w = _split[2], h = _split[3];
            var scale = w / h;
            var dimension = parseMetricToNum(theme.icon.size[size] || size);
            if (w < h) {
                return "\n      width: " + dimension + "px;\n      height: " + dimension / scale + "px;\n    ";
            }
            if (h < w) {
                return "\n      width: " + dimension * scale + "px;\n      height: " + dimension + "px;\n    ";
            }
            return "\n      width: " + dimension + "px;\n      height: " + dimension + "px;\n    ";
        }), (function(_ref3) {
            var color = _ref3.color;
            return color !== "plain" && colorCss;
        }), (function(_ref4) {
            var theme = _ref4.theme;
            return theme && theme.icon.extend;
        }));
        exports.StyledIcon = StyledIcon;
        StyledIcon.defaultProps = {};
        Object.setPrototypeOf(StyledIcon.defaultProps, _defaultProps.defaultProps);
    }, (__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
        "use strict";
        __webpack_require__.r(__webpack_exports__);
        __webpack_require__.d(__webpack_exports__, {
            colorIsDark: () => colorIsDark,
            colorStyle: () => colorStyle,
            normalizeColor: () => normalizeColor,
            sizeStyle: () => sizeStyle
        });
        var styled_components_browser_esm = __webpack_require__(486);
        var parseHexToRGB = function parseHexToRGB(color) {
            return color.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (function(m, r, g, b) {
                return "#" + r + r + g + g + b + b;
            })).substring(1).match(/.{2}/g).map((function(x) {
                return parseInt(x, 16);
            }));
        };
        var getRGBArray = function getRGBArray(color) {
            if (/^#/.test(color)) {
                return parseHexToRGB(color);
            }
            if (/^rgb/.test(color)) {
                return color.match(/rgba?\((\s?[0-9]*\s?),(\s?[0-9]*\s?),(\s?[0-9]*\s?).*?\)/).splice(1);
            }
            return color;
        };
        var colorIsDark = function colorIsDark(color) {
            var _getRGBArray = getRGBArray(color), red = _getRGBArray[0], green = _getRGBArray[1], blue = _getRGBArray[2];
            var brightness = (299 * red + 587 * green + 114 * blue) / 1e3;
            return brightness < 125;
        };
        var normalizeColor = function normalizeColor(color, theme) {
            var colorSpec = theme.global.colors[color] || color;
            var result = colorSpec;
            if (theme.dark && colorSpec.dark) {
                result = colorSpec.dark;
            } else if (!theme.dark && colorSpec.light) {
                result = colorSpec.light;
            }
            if (result && theme.global.colors[result] && theme.global.colors[result] !== result) {
                result = normalizeColor(result, theme);
            }
            return result;
        };
        var colorStyle = function colorStyle(name, value, theme, required) {
            return (0, styled_components_browser_esm.css)([ "", ":", ";" ], name, normalizeColor(value, theme, required));
        };
        var sizeStyle = function sizeStyle(name, value, theme) {
            return (0, styled_components_browser_esm.css)([ "", ":", ";" ], name, theme.global.size[value] || value);
        };
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        exports.__esModule = true;
        exports.extendDefaultTheme = exports.defaultProps = void 0;
        var _utils = __webpack_require__(496);
        var _themes = __webpack_require__(497);
        var defaultProps = {
            theme: _themes.base
        };
        exports.defaultProps = defaultProps;
        var extendDefaultTheme = function extendDefaultTheme(theme) {
            defaultProps.theme = (0, _utils.deepMerge)(_themes.base, theme);
        };
        exports.extendDefaultTheme = extendDefaultTheme;
    }, (__unused_webpack_module, exports) => {
        "use strict";
        exports.__esModule = true;
        exports.isObject = isObject;
        exports.deepMerge = deepMerge;
        exports.default = void 0;
        function _extends() {
            _extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return _extends.apply(this, arguments);
        }
        function isObject(item) {
            return item && typeof item === "object" && !Array.isArray(item);
        }
        function deepMerge(target) {
            for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
                sources[_key - 1] = arguments[_key];
            }
            if (!sources.length) {
                return target;
            }
            var output = _extends({}, target);
            sources.forEach((function(source) {
                if (isObject(source)) {
                    Object.keys(source).forEach((function(key) {
                        if (isObject(source[key])) {
                            if (!output[key]) {
                                output[key] = _extends({}, source[key]);
                            } else {
                                output[key] = deepMerge(output[key], source[key]);
                            }
                        } else {
                            output[key] = source[key];
                        }
                    }));
                }
            }));
            return output;
        }
        var _default = {
            deepMerge,
            isObject
        };
        exports.default = _default;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        exports.__esModule = true;
        exports.base = void 0;
        var _base = __webpack_require__(491);
        exports.base = _base.base;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        var __webpack_unused_export__;
        __webpack_unused_export__ = true;
        exports.I = void 0;
        var _react = _interopRequireDefault(__webpack_require__(285));
        var _StyledIcon = __webpack_require__(493);
        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                default: obj
            };
        }
        function _extends() {
            _extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return _extends.apply(this, arguments);
        }
        var FormDown = function FormDown(props) {
            return _react["default"].createElement(_StyledIcon.StyledIcon, _extends({
                viewBox: "0 0 24 24",
                a11yTitle: "FormDown"
            }, props), _react["default"].createElement("polyline", {
                fill: "none",
                stroke: "#000",
                strokeWidth: "2",
                points: "18 9 12 15 6 9"
            }));
        };
        exports.I = FormDown;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        var __webpack_unused_export__;
        __webpack_unused_export__ = true;
        exports.L = void 0;
        var _react = _interopRequireDefault(__webpack_require__(285));
        var _StyledIcon = __webpack_require__(493);
        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                default: obj
            };
        }
        function _extends() {
            _extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return _extends.apply(this, arguments);
        }
        var Previous = function Previous(props) {
            return _react["default"].createElement(_StyledIcon.StyledIcon, _extends({
                viewBox: "0 0 24 24",
                a11yTitle: "Previous"
            }, props), _react["default"].createElement("polyline", {
                fill: "none",
                stroke: "#000",
                strokeWidth: "2",
                points: "7 2 17 12 7 22",
                transform: "matrix(-1 0 0 1 24 0)"
            }));
        };
        exports.L = Previous;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        var __webpack_unused_export__;
        __webpack_unused_export__ = true;
        exports.o = void 0;
        var _react = _interopRequireDefault(__webpack_require__(285));
        var _StyledIcon = __webpack_require__(493);
        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                default: obj
            };
        }
        function _extends() {
            _extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return _extends.apply(this, arguments);
        }
        var Next = function Next(props) {
            return _react["default"].createElement(_StyledIcon.StyledIcon, _extends({
                viewBox: "0 0 24 24",
                a11yTitle: "Next"
            }, props), _react["default"].createElement("polyline", {
                fill: "none",
                stroke: "#000",
                strokeWidth: "2",
                points: "7 2 17 12 7 22"
            }));
        };
        exports.o = Next;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        var __webpack_unused_export__;
        __webpack_unused_export__ = true;
        exports.x = void 0;
        var _react = _interopRequireDefault(__webpack_require__(285));
        var _StyledIcon = __webpack_require__(493);
        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                default: obj
            };
        }
        function _extends() {
            _extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return _extends.apply(this, arguments);
        }
        var FormPrevious = function FormPrevious(props) {
            return _react["default"].createElement(_StyledIcon.StyledIcon, _extends({
                viewBox: "0 0 24 24",
                a11yTitle: "FormPrevious"
            }, props), _react["default"].createElement("polyline", {
                fill: "none",
                stroke: "#000",
                strokeWidth: "2",
                points: "9 6 15 12 9 18",
                transform: "matrix(-1 0 0 1 24 0)"
            }));
        };
        exports.x = FormPrevious;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        var __webpack_unused_export__;
        __webpack_unused_export__ = true;
        exports.M = void 0;
        var _react = _interopRequireDefault(__webpack_require__(285));
        var _StyledIcon = __webpack_require__(493);
        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                default: obj
            };
        }
        function _extends() {
            _extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return _extends.apply(this, arguments);
        }
        var FormNext = function FormNext(props) {
            return _react["default"].createElement(_StyledIcon.StyledIcon, _extends({
                viewBox: "0 0 24 24",
                a11yTitle: "FormNext"
            }, props), _react["default"].createElement("polyline", {
                fill: "none",
                stroke: "#000",
                strokeWidth: "2",
                points: "9 6 15 12 9 18"
            }));
        };
        exports.M = FormNext;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        var __webpack_unused_export__;
        __webpack_unused_export__ = true;
        exports.L = void 0;
        var _react = _interopRequireDefault(__webpack_require__(285));
        var _StyledIcon = __webpack_require__(493);
        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                default: obj
            };
        }
        function _extends() {
            _extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return _extends.apply(this, arguments);
        }
        var Subtract = function Subtract(props) {
            return _react["default"].createElement(_StyledIcon.StyledIcon, _extends({
                viewBox: "0 0 24 24",
                a11yTitle: "Subtract"
            }, props), _react["default"].createElement("path", {
                fill: "none",
                stroke: "#000",
                strokeWidth: "2",
                d: "M2,12 L22,12"
            }));
        };
        exports.L = Subtract;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        var __webpack_unused_export__;
        __webpack_unused_export__ = true;
        exports.V = void 0;
        var _react = _interopRequireDefault(__webpack_require__(285));
        var _StyledIcon = __webpack_require__(493);
        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                default: obj
            };
        }
        function _extends() {
            _extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return _extends.apply(this, arguments);
        }
        var ClosedCaption = function ClosedCaption(props) {
            return _react["default"].createElement(_StyledIcon.StyledIcon, _extends({
                viewBox: "0 0 24 24",
                a11yTitle: "ClosedCaption"
            }, props), _react["default"].createElement("path", {
                fill: "none",
                stroke: "#000",
                strokeWidth: "2",
                d: "M1,12 C1,5 2.5,4 12,4 C21.5,4 23,5 23,12 C23,19 21.5,20 12,20 C2.5,20 1,19 1,12 Z M5.25,14 C5.25,15.5 6,16 7.75,16 C9.5,16 10.25,15.5 10.25,14 L9.97861679,14 C9.97861671,15.25 8.97905547,16 7.75,16 C6.52094453,16 5.52138329,15.25 5.52138321,14 L5.52138321,10 C5.5,8.75 6.5,8 7.75,8 C9,8 10,8.75 9.97861679,10 L10.25,10 C10.25,8.75 9.2286998,8 7.75,8 C6.2713002,8 5.25,8.75 5.25,10 L5.25,14 Z M13.25,14 C13.25,15.5 14,16 15.75,16 C17.5,16 18.25,15.5 18.25,14 L17.9786168,14 C17.9786167,15.25 16.9790555,16 15.75,16 C14.5209445,16 13.5213833,15.25 13.5213832,14 L13.5213832,10 C13.5,8.75 14.5,8 15.75,8 C17,8 18,8.75 17.9786168,10 L18.25,10 C18.25,8.75 17.2286998,8 15.75,8 C14.2713002,8 13.25,8.75 13.25,10 L13.25,14 Z"
            }));
        };
        exports.V = ClosedCaption;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        var __webpack_unused_export__;
        __webpack_unused_export__ = true;
        exports.e = void 0;
        var _react = _interopRequireDefault(__webpack_require__(285));
        var _StyledIcon = __webpack_require__(493);
        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                default: obj
            };
        }
        function _extends() {
            _extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return _extends.apply(this, arguments);
        }
        var Actions = function Actions(props) {
            return _react["default"].createElement(_StyledIcon.StyledIcon, _extends({
                viewBox: "0 0 24 24",
                a11yTitle: "Actions"
            }, props), _react["default"].createElement("path", {
                fill: "none",
                stroke: "#000",
                strokeWidth: "2",
                d: "M12,17.5 C15.0375661,17.5 17.5,15.0375661 17.5,12 C17.5,8.96243388 15.0375661,6.5 12,6.5 C8.96243388,6.5 6.5,8.96243388 6.5,12 C6.5,15.0375661 8.96243388,17.5 12,17.5 Z M12,6.5 L12,1 M12,23 L12,17.5 M1,12 L6.5,12 M17.5,12 L23,12 M4.4375,4.4375 L8.5625,8.5625 M15.4375,15.4375 L19.5625,19.5625 M19.5625,4.4375 L15.4375,8.5625 M8.5625,15.4375 L4.4375,19.5625"
            }));
        };
        exports.e = Actions;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        var __webpack_unused_export__;
        __webpack_unused_export__ = true;
        exports.M = void 0;
        var _react = _interopRequireDefault(__webpack_require__(285));
        var _StyledIcon = __webpack_require__(493);
        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                default: obj
            };
        }
        function _extends() {
            _extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return _extends.apply(this, arguments);
        }
        var Expand = function Expand(props) {
            return _react["default"].createElement(_StyledIcon.StyledIcon, _extends({
                viewBox: "0 0 24 24",
                a11yTitle: "Expand"
            }, props), _react["default"].createElement("path", {
                fill: "none",
                stroke: "#000",
                strokeWidth: "2",
                d: "M10,14 L2,22 M1,15 L1,23 L9,23 M22,2 L14,10 M15,1 L23,1 L23,9"
            }));
        };
        exports.M = Expand;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        var __webpack_unused_export__;
        __webpack_unused_export__ = true;
        exports.d = void 0;
        var _react = _interopRequireDefault(__webpack_require__(285));
        var _StyledIcon = __webpack_require__(493);
        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                default: obj
            };
        }
        function _extends() {
            _extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return _extends.apply(this, arguments);
        }
        var Pause = function Pause(props) {
            return _react["default"].createElement(_StyledIcon.StyledIcon, _extends({
                viewBox: "0 0 24 24",
                a11yTitle: "Pause"
            }, props), _react["default"].createElement("path", {
                fill: "none",
                stroke: "#000",
                strokeWidth: "2",
                d: "M3,21 L9,21 L9,3 L3,3 L3,21 Z M15,21 L21,21 L21,3 L15,3 L15,21 Z"
            }));
        };
        exports.d = Pause;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        var __webpack_unused_export__;
        __webpack_unused_export__ = true;
        exports.s = void 0;
        var _react = _interopRequireDefault(__webpack_require__(285));
        var _StyledIcon = __webpack_require__(493);
        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                default: obj
            };
        }
        function _extends() {
            _extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return _extends.apply(this, arguments);
        }
        var Play = function Play(props) {
            return _react["default"].createElement(_StyledIcon.StyledIcon, _extends({
                viewBox: "0 0 24 24",
                a11yTitle: "Play"
            }, props), _react["default"].createElement("polygon", {
                fill: "none",
                stroke: "#000",
                strokeWidth: "2",
                points: "3 22 21 12 3 2"
            }));
        };
        exports.s = Play;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        var __webpack_unused_export__;
        __webpack_unused_export__ = true;
        exports.t = void 0;
        var _react = _interopRequireDefault(__webpack_require__(285));
        var _StyledIcon = __webpack_require__(493);
        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                default: obj
            };
        }
        function _extends() {
            _extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return _extends.apply(this, arguments);
        }
        var VolumeLow = function VolumeLow(props) {
            return _react["default"].createElement(_StyledIcon.StyledIcon, _extends({
                viewBox: "0 0 24 24",
                a11yTitle: "VolumeLow"
            }, props), _react["default"].createElement("path", {
                fill: "none",
                stroke: "#000",
                strokeWidth: "2",
                d: "M1,8 L1,16 L6.09901951,16 L12,21 L12,3 L6,8 L1,8 Z M15,16 L15,16 C17.209139,16 19,14.209139 19,12 C19,9.790861 17.209139,8 15,8"
            }));
        };
        exports.t = VolumeLow;
    }, (__unused_webpack_module, exports, __webpack_require__) => {
        "use strict";
        var __webpack_unused_export__;
        __webpack_unused_export__ = true;
        exports.f = void 0;
        var _react = _interopRequireDefault(__webpack_require__(285));
        var _StyledIcon = __webpack_require__(493);
        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                default: obj
            };
        }
        function _extends() {
            _extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return _extends.apply(this, arguments);
        }
        var Volume = function Volume(props) {
            return _react["default"].createElement(_StyledIcon.StyledIcon, _extends({
                viewBox: "0 0 24 24",
                a11yTitle: "Volume"
            }, props), _react["default"].createElement("path", {
                fill: "none",
                stroke: "#000",
                strokeWidth: "2",
                d: "M15,16 C17.209,16 19,14.209 19,12 C19,9.791 17.209,8 15,8 M15,20 C20,20 23,16.411 23,12 C23,7.589 19.411,4 15,4 M1,12 L1,8 L6,8 L12,3 L12,21 L6,16 L1,16 L1,12"
            }));
        };
        exports.f = Volume;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var isObject = __webpack_require__(382), now = __webpack_require__(512), toNumber = __webpack_require__(513);
        var FUNC_ERROR_TEXT = "Expected a function";
        var nativeMax = Math.max, nativeMin = Math.min;
        function debounce(func, wait, options) {
            var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
            if (typeof func != "function") {
                throw new TypeError(FUNC_ERROR_TEXT);
            }
            wait = toNumber(wait) || 0;
            if (isObject(options)) {
                leading = !!options.leading;
                maxing = "maxWait" in options;
                maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
                trailing = "trailing" in options ? !!options.trailing : trailing;
            }
            function invokeFunc(time) {
                var args = lastArgs, thisArg = lastThis;
                lastArgs = lastThis = undefined;
                lastInvokeTime = time;
                result = func.apply(thisArg, args);
                return result;
            }
            function leadingEdge(time) {
                lastInvokeTime = time;
                timerId = setTimeout(timerExpired, wait);
                return leading ? invokeFunc(time) : result;
            }
            function remainingWait(time) {
                var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
                return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
            }
            function shouldInvoke(time) {
                var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
                return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
            }
            function timerExpired() {
                var time = now();
                if (shouldInvoke(time)) {
                    return trailingEdge(time);
                }
                timerId = setTimeout(timerExpired, remainingWait(time));
            }
            function trailingEdge(time) {
                timerId = undefined;
                if (trailing && lastArgs) {
                    return invokeFunc(time);
                }
                lastArgs = lastThis = undefined;
                return result;
            }
            function cancel() {
                if (timerId !== undefined) {
                    clearTimeout(timerId);
                }
                lastInvokeTime = 0;
                lastArgs = lastCallTime = lastThis = timerId = undefined;
            }
            function flush() {
                return timerId === undefined ? result : trailingEdge(now());
            }
            function debounced() {
                var time = now(), isInvoking = shouldInvoke(time);
                lastArgs = arguments;
                lastThis = this;
                lastCallTime = time;
                if (isInvoking) {
                    if (timerId === undefined) {
                        return leadingEdge(lastCallTime);
                    }
                    if (maxing) {
                        clearTimeout(timerId);
                        timerId = setTimeout(timerExpired, wait);
                        return invokeFunc(lastCallTime);
                    }
                }
                if (timerId === undefined) {
                    timerId = setTimeout(timerExpired, wait);
                }
                return result;
            }
            debounced.cancel = cancel;
            debounced.flush = flush;
            return debounced;
        }
        module.exports = debounce;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var root = __webpack_require__(378);
        var now = function() {
            return root.Date.now();
        };
        module.exports = now;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var isObject = __webpack_require__(382), isSymbol = __webpack_require__(514);
        var NAN = 0 / 0;
        var reTrim = /^\s+|\s+$/g;
        var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
        var reIsBinary = /^0b[01]+$/i;
        var reIsOctal = /^0o[0-7]+$/i;
        var freeParseInt = parseInt;
        function toNumber(value) {
            if (typeof value == "number") {
                return value;
            }
            if (isSymbol(value)) {
                return NAN;
            }
            if (isObject(value)) {
                var other = typeof value.valueOf == "function" ? value.valueOf() : value;
                value = isObject(other) ? other + "" : other;
            }
            if (typeof value != "string") {
                return value === 0 ? value : +value;
            }
            value = value.replace(reTrim, "");
            var isBinary = reIsBinary.test(value);
            return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
        }
        module.exports = toNumber;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseGetTag = __webpack_require__(376), isObjectLike = __webpack_require__(413);
        var symbolTag = "[object Symbol]";
        function isSymbol(value) {
            return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
        }
        module.exports = isSymbol;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var colorString = __webpack_require__(516);
        var convert = __webpack_require__(520);
        var _slice = [].slice;
        var skippedModels = [ "keyword", "gray", "hex" ];
        var hashedModelKeys = {};
        Object.keys(convert).forEach((function(model) {
            hashedModelKeys[_slice.call(convert[model].labels).sort().join("")] = model;
        }));
        var limiters = {};
        function Color(obj, model) {
            if (!(this instanceof Color)) {
                return new Color(obj, model);
            }
            if (model && model in skippedModels) {
                model = null;
            }
            if (model && !(model in convert)) {
                throw new Error("Unknown model: " + model);
            }
            var i;
            var channels;
            if (obj == null) {
                this.model = "rgb";
                this.color = [ 0, 0, 0 ];
                this.valpha = 1;
            } else if (obj instanceof Color) {
                this.model = obj.model;
                this.color = obj.color.slice();
                this.valpha = obj.valpha;
            } else if (typeof obj === "string") {
                var result = colorString.get(obj);
                if (result === null) {
                    throw new Error("Unable to parse color from string: " + obj);
                }
                this.model = result.model;
                channels = convert[this.model].channels;
                this.color = result.value.slice(0, channels);
                this.valpha = typeof result.value[channels] === "number" ? result.value[channels] : 1;
            } else if (obj.length) {
                this.model = model || "rgb";
                channels = convert[this.model].channels;
                var newArr = _slice.call(obj, 0, channels);
                this.color = zeroArray(newArr, channels);
                this.valpha = typeof obj[channels] === "number" ? obj[channels] : 1;
            } else if (typeof obj === "number") {
                obj &= 16777215;
                this.model = "rgb";
                this.color = [ obj >> 16 & 255, obj >> 8 & 255, obj & 255 ];
                this.valpha = 1;
            } else {
                this.valpha = 1;
                var keys = Object.keys(obj);
                if ("alpha" in obj) {
                    keys.splice(keys.indexOf("alpha"), 1);
                    this.valpha = typeof obj.alpha === "number" ? obj.alpha : 0;
                }
                var hashedKeys = keys.sort().join("");
                if (!(hashedKeys in hashedModelKeys)) {
                    throw new Error("Unable to parse color from object: " + JSON.stringify(obj));
                }
                this.model = hashedModelKeys[hashedKeys];
                var labels = convert[this.model].labels;
                var color = [];
                for (i = 0; i < labels.length; i++) {
                    color.push(obj[labels[i]]);
                }
                this.color = zeroArray(color);
            }
            if (limiters[this.model]) {
                channels = convert[this.model].channels;
                for (i = 0; i < channels; i++) {
                    var limit = limiters[this.model][i];
                    if (limit) {
                        this.color[i] = limit(this.color[i]);
                    }
                }
            }
            this.valpha = Math.max(0, Math.min(1, this.valpha));
            if (Object.freeze) {
                Object.freeze(this);
            }
        }
        Color.prototype = {
            toString: function() {
                return this.string();
            },
            toJSON: function() {
                return this[this.model]();
            },
            string: function(places) {
                var self = this.model in colorString.to ? this : this.rgb();
                self = self.round(typeof places === "number" ? places : 1);
                var args = self.valpha === 1 ? self.color : self.color.concat(this.valpha);
                return colorString.to[self.model](args);
            },
            percentString: function(places) {
                var self = this.rgb().round(typeof places === "number" ? places : 1);
                var args = self.valpha === 1 ? self.color : self.color.concat(this.valpha);
                return colorString.to.rgb.percent(args);
            },
            array: function() {
                return this.valpha === 1 ? this.color.slice() : this.color.concat(this.valpha);
            },
            object: function() {
                var result = {};
                var channels = convert[this.model].channels;
                var labels = convert[this.model].labels;
                for (var i = 0; i < channels; i++) {
                    result[labels[i]] = this.color[i];
                }
                if (this.valpha !== 1) {
                    result.alpha = this.valpha;
                }
                return result;
            },
            unitArray: function() {
                var rgb = this.rgb().color;
                rgb[0] /= 255;
                rgb[1] /= 255;
                rgb[2] /= 255;
                if (this.valpha !== 1) {
                    rgb.push(this.valpha);
                }
                return rgb;
            },
            unitObject: function() {
                var rgb = this.rgb().object();
                rgb.r /= 255;
                rgb.g /= 255;
                rgb.b /= 255;
                if (this.valpha !== 1) {
                    rgb.alpha = this.valpha;
                }
                return rgb;
            },
            round: function(places) {
                places = Math.max(places || 0, 0);
                return new Color(this.color.map(roundToPlace(places)).concat(this.valpha), this.model);
            },
            alpha: function(val) {
                if (arguments.length) {
                    return new Color(this.color.concat(Math.max(0, Math.min(1, val))), this.model);
                }
                return this.valpha;
            },
            red: getset("rgb", 0, maxfn(255)),
            green: getset("rgb", 1, maxfn(255)),
            blue: getset("rgb", 2, maxfn(255)),
            hue: getset([ "hsl", "hsv", "hsl", "hwb", "hcg" ], 0, (function(val) {
                return (val % 360 + 360) % 360;
            })),
            saturationl: getset("hsl", 1, maxfn(100)),
            lightness: getset("hsl", 2, maxfn(100)),
            saturationv: getset("hsv", 1, maxfn(100)),
            value: getset("hsv", 2, maxfn(100)),
            chroma: getset("hcg", 1, maxfn(100)),
            gray: getset("hcg", 2, maxfn(100)),
            white: getset("hwb", 1, maxfn(100)),
            wblack: getset("hwb", 2, maxfn(100)),
            cyan: getset("cmyk", 0, maxfn(100)),
            magenta: getset("cmyk", 1, maxfn(100)),
            yellow: getset("cmyk", 2, maxfn(100)),
            black: getset("cmyk", 3, maxfn(100)),
            x: getset("xyz", 0, maxfn(100)),
            y: getset("xyz", 1, maxfn(100)),
            z: getset("xyz", 2, maxfn(100)),
            l: getset("lab", 0, maxfn(100)),
            a: getset("lab", 1),
            b: getset("lab", 2),
            keyword: function(val) {
                if (arguments.length) {
                    return new Color(val);
                }
                return convert[this.model].keyword(this.color);
            },
            hex: function(val) {
                if (arguments.length) {
                    return new Color(val);
                }
                return colorString.to.hex(this.rgb().round().color);
            },
            rgbNumber: function() {
                var rgb = this.rgb().color;
                return (rgb[0] & 255) << 16 | (rgb[1] & 255) << 8 | rgb[2] & 255;
            },
            luminosity: function() {
                var rgb = this.rgb().color;
                var lum = [];
                for (var i = 0; i < rgb.length; i++) {
                    var chan = rgb[i] / 255;
                    lum[i] = chan <= .03928 ? chan / 12.92 : Math.pow((chan + .055) / 1.055, 2.4);
                }
                return .2126 * lum[0] + .7152 * lum[1] + .0722 * lum[2];
            },
            contrast: function(color2) {
                var lum1 = this.luminosity();
                var lum2 = color2.luminosity();
                if (lum1 > lum2) {
                    return (lum1 + .05) / (lum2 + .05);
                }
                return (lum2 + .05) / (lum1 + .05);
            },
            level: function(color2) {
                var contrastRatio = this.contrast(color2);
                if (contrastRatio >= 7.1) {
                    return "AAA";
                }
                return contrastRatio >= 4.5 ? "AA" : "";
            },
            isDark: function() {
                var rgb = this.rgb().color;
                var yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1e3;
                return yiq < 128;
            },
            isLight: function() {
                return !this.isDark();
            },
            negate: function() {
                var rgb = this.rgb();
                for (var i = 0; i < 3; i++) {
                    rgb.color[i] = 255 - rgb.color[i];
                }
                return rgb;
            },
            lighten: function(ratio) {
                var hsl = this.hsl();
                hsl.color[2] += hsl.color[2] * ratio;
                return hsl;
            },
            darken: function(ratio) {
                var hsl = this.hsl();
                hsl.color[2] -= hsl.color[2] * ratio;
                return hsl;
            },
            saturate: function(ratio) {
                var hsl = this.hsl();
                hsl.color[1] += hsl.color[1] * ratio;
                return hsl;
            },
            desaturate: function(ratio) {
                var hsl = this.hsl();
                hsl.color[1] -= hsl.color[1] * ratio;
                return hsl;
            },
            whiten: function(ratio) {
                var hwb = this.hwb();
                hwb.color[1] += hwb.color[1] * ratio;
                return hwb;
            },
            blacken: function(ratio) {
                var hwb = this.hwb();
                hwb.color[2] += hwb.color[2] * ratio;
                return hwb;
            },
            grayscale: function() {
                var rgb = this.rgb().color;
                var val = rgb[0] * .3 + rgb[1] * .59 + rgb[2] * .11;
                return Color.rgb(val, val, val);
            },
            fade: function(ratio) {
                return this.alpha(this.valpha - this.valpha * ratio);
            },
            opaquer: function(ratio) {
                return this.alpha(this.valpha + this.valpha * ratio);
            },
            rotate: function(degrees) {
                var hsl = this.hsl();
                var hue = hsl.color[0];
                hue = (hue + degrees) % 360;
                hue = hue < 0 ? 360 + hue : hue;
                hsl.color[0] = hue;
                return hsl;
            },
            mix: function(mixinColor, weight) {
                if (!mixinColor || !mixinColor.rgb) {
                    throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor);
                }
                var color1 = mixinColor.rgb();
                var color2 = this.rgb();
                var p = weight === undefined ? .5 : weight;
                var w = 2 * p - 1;
                var a = color1.alpha() - color2.alpha();
                var w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2;
                var w2 = 1 - w1;
                return Color.rgb(w1 * color1.red() + w2 * color2.red(), w1 * color1.green() + w2 * color2.green(), w1 * color1.blue() + w2 * color2.blue(), color1.alpha() * p + color2.alpha() * (1 - p));
            }
        };
        Object.keys(convert).forEach((function(model) {
            if (skippedModels.indexOf(model) !== -1) {
                return;
            }
            var channels = convert[model].channels;
            Color.prototype[model] = function() {
                if (this.model === model) {
                    return new Color(this);
                }
                if (arguments.length) {
                    return new Color(arguments, model);
                }
                var newAlpha = typeof arguments[channels] === "number" ? channels : this.valpha;
                return new Color(assertArray(convert[this.model][model].raw(this.color)).concat(newAlpha), model);
            };
            Color[model] = function(color) {
                if (typeof color === "number") {
                    color = zeroArray(_slice.call(arguments), channels);
                }
                return new Color(color, model);
            };
        }));
        function roundTo(num, places) {
            return Number(num.toFixed(places));
        }
        function roundToPlace(places) {
            return function(num) {
                return roundTo(num, places);
            };
        }
        function getset(model, channel, modifier) {
            model = Array.isArray(model) ? model : [ model ];
            model.forEach((function(m) {
                (limiters[m] || (limiters[m] = []))[channel] = modifier;
            }));
            model = model[0];
            return function(val) {
                var result;
                if (arguments.length) {
                    if (modifier) {
                        val = modifier(val);
                    }
                    result = this[model]();
                    result.color[channel] = val;
                    return result;
                }
                result = this[model]().color[channel];
                if (modifier) {
                    result = modifier(result);
                }
                return result;
            };
        }
        function maxfn(max) {
            return function(v) {
                return Math.max(0, Math.min(max, v));
            };
        }
        function assertArray(val) {
            return Array.isArray(val) ? val : [ val ];
        }
        function zeroArray(arr, length) {
            for (var i = 0; i < length; i++) {
                if (typeof arr[i] !== "number") {
                    arr[i] = 0;
                }
            }
            return arr;
        }
        module.exports = Color;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var colorNames = __webpack_require__(517);
        var swizzle = __webpack_require__(518);
        var reverseNames = {};
        for (var name in colorNames) {
            if (colorNames.hasOwnProperty(name)) {
                reverseNames[colorNames[name]] = name;
            }
        }
        var cs = module.exports = {
            to: {},
            get: {}
        };
        cs.get = function(string) {
            var prefix = string.substring(0, 3).toLowerCase();
            var val;
            var model;
            switch (prefix) {
              case "hsl":
                val = cs.get.hsl(string);
                model = "hsl";
                break;

              case "hwb":
                val = cs.get.hwb(string);
                model = "hwb";
                break;

              default:
                val = cs.get.rgb(string);
                model = "rgb";
                break;
            }
            if (!val) {
                return null;
            }
            return {
                model,
                value: val
            };
        };
        cs.get.rgb = function(string) {
            if (!string) {
                return null;
            }
            var abbr = /^#([a-f0-9]{3,4})$/i;
            var hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i;
            var rgba = /^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/;
            var per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/;
            var keyword = /(\D+)/;
            var rgb = [ 0, 0, 0, 1 ];
            var match;
            var i;
            var hexAlpha;
            if (match = string.match(hex)) {
                hexAlpha = match[2];
                match = match[1];
                for (i = 0; i < 3; i++) {
                    var i2 = i * 2;
                    rgb[i] = parseInt(match.slice(i2, i2 + 2), 16);
                }
                if (hexAlpha) {
                    rgb[3] = parseInt(hexAlpha, 16) / 255;
                }
            } else if (match = string.match(abbr)) {
                match = match[1];
                hexAlpha = match[3];
                for (i = 0; i < 3; i++) {
                    rgb[i] = parseInt(match[i] + match[i], 16);
                }
                if (hexAlpha) {
                    rgb[3] = parseInt(hexAlpha + hexAlpha, 16) / 255;
                }
            } else if (match = string.match(rgba)) {
                for (i = 0; i < 3; i++) {
                    rgb[i] = parseInt(match[i + 1], 0);
                }
                if (match[4]) {
                    rgb[3] = parseFloat(match[4]);
                }
            } else if (match = string.match(per)) {
                for (i = 0; i < 3; i++) {
                    rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);
                }
                if (match[4]) {
                    rgb[3] = parseFloat(match[4]);
                }
            } else if (match = string.match(keyword)) {
                if (match[1] === "transparent") {
                    return [ 0, 0, 0, 0 ];
                }
                rgb = colorNames[match[1]];
                if (!rgb) {
                    return null;
                }
                rgb[3] = 1;
                return rgb;
            } else {
                return null;
            }
            for (i = 0; i < 3; i++) {
                rgb[i] = clamp(rgb[i], 0, 255);
            }
            rgb[3] = clamp(rgb[3], 0, 1);
            return rgb;
        };
        cs.get.hsl = function(string) {
            if (!string) {
                return null;
            }
            var hsl = /^hsla?\(\s*([+-]?(?:\d*\.)?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/;
            var match = string.match(hsl);
            if (match) {
                var alpha = parseFloat(match[4]);
                var h = (parseFloat(match[1]) + 360) % 360;
                var s = clamp(parseFloat(match[2]), 0, 100);
                var l = clamp(parseFloat(match[3]), 0, 100);
                var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
                return [ h, s, l, a ];
            }
            return null;
        };
        cs.get.hwb = function(string) {
            if (!string) {
                return null;
            }
            var hwb = /^hwb\(\s*([+-]?\d*[\.]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/;
            var match = string.match(hwb);
            if (match) {
                var alpha = parseFloat(match[4]);
                var h = (parseFloat(match[1]) % 360 + 360) % 360;
                var w = clamp(parseFloat(match[2]), 0, 100);
                var b = clamp(parseFloat(match[3]), 0, 100);
                var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
                return [ h, w, b, a ];
            }
            return null;
        };
        cs.to.hex = function() {
            var rgba = swizzle(arguments);
            return "#" + hexDouble(rgba[0]) + hexDouble(rgba[1]) + hexDouble(rgba[2]) + (rgba[3] < 1 ? hexDouble(Math.round(rgba[3] * 255)) : "");
        };
        cs.to.rgb = function() {
            var rgba = swizzle(arguments);
            return rgba.length < 4 || rgba[3] === 1 ? "rgb(" + Math.round(rgba[0]) + ", " + Math.round(rgba[1]) + ", " + Math.round(rgba[2]) + ")" : "rgba(" + Math.round(rgba[0]) + ", " + Math.round(rgba[1]) + ", " + Math.round(rgba[2]) + ", " + rgba[3] + ")";
        };
        cs.to.rgb.percent = function() {
            var rgba = swizzle(arguments);
            var r = Math.round(rgba[0] / 255 * 100);
            var g = Math.round(rgba[1] / 255 * 100);
            var b = Math.round(rgba[2] / 255 * 100);
            return rgba.length < 4 || rgba[3] === 1 ? "rgb(" + r + "%, " + g + "%, " + b + "%)" : "rgba(" + r + "%, " + g + "%, " + b + "%, " + rgba[3] + ")";
        };
        cs.to.hsl = function() {
            var hsla = swizzle(arguments);
            return hsla.length < 4 || hsla[3] === 1 ? "hsl(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%)" : "hsla(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%, " + hsla[3] + ")";
        };
        cs.to.hwb = function() {
            var hwba = swizzle(arguments);
            var a = "";
            if (hwba.length >= 4 && hwba[3] !== 1) {
                a = ", " + hwba[3];
            }
            return "hwb(" + hwba[0] + ", " + hwba[1] + "%, " + hwba[2] + "%" + a + ")";
        };
        cs.to.keyword = function(rgb) {
            return reverseNames[rgb.slice(0, 3)];
        };
        function clamp(num, min, max) {
            return Math.min(Math.max(min, num), max);
        }
        function hexDouble(num) {
            var str = num.toString(16).toUpperCase();
            return str.length < 2 ? "0" + str : str;
        }
    }, module => {
        "use strict";
        module.exports = {
            aliceblue: [ 240, 248, 255 ],
            antiquewhite: [ 250, 235, 215 ],
            aqua: [ 0, 255, 255 ],
            aquamarine: [ 127, 255, 212 ],
            azure: [ 240, 255, 255 ],
            beige: [ 245, 245, 220 ],
            bisque: [ 255, 228, 196 ],
            black: [ 0, 0, 0 ],
            blanchedalmond: [ 255, 235, 205 ],
            blue: [ 0, 0, 255 ],
            blueviolet: [ 138, 43, 226 ],
            brown: [ 165, 42, 42 ],
            burlywood: [ 222, 184, 135 ],
            cadetblue: [ 95, 158, 160 ],
            chartreuse: [ 127, 255, 0 ],
            chocolate: [ 210, 105, 30 ],
            coral: [ 255, 127, 80 ],
            cornflowerblue: [ 100, 149, 237 ],
            cornsilk: [ 255, 248, 220 ],
            crimson: [ 220, 20, 60 ],
            cyan: [ 0, 255, 255 ],
            darkblue: [ 0, 0, 139 ],
            darkcyan: [ 0, 139, 139 ],
            darkgoldenrod: [ 184, 134, 11 ],
            darkgray: [ 169, 169, 169 ],
            darkgreen: [ 0, 100, 0 ],
            darkgrey: [ 169, 169, 169 ],
            darkkhaki: [ 189, 183, 107 ],
            darkmagenta: [ 139, 0, 139 ],
            darkolivegreen: [ 85, 107, 47 ],
            darkorange: [ 255, 140, 0 ],
            darkorchid: [ 153, 50, 204 ],
            darkred: [ 139, 0, 0 ],
            darksalmon: [ 233, 150, 122 ],
            darkseagreen: [ 143, 188, 143 ],
            darkslateblue: [ 72, 61, 139 ],
            darkslategray: [ 47, 79, 79 ],
            darkslategrey: [ 47, 79, 79 ],
            darkturquoise: [ 0, 206, 209 ],
            darkviolet: [ 148, 0, 211 ],
            deeppink: [ 255, 20, 147 ],
            deepskyblue: [ 0, 191, 255 ],
            dimgray: [ 105, 105, 105 ],
            dimgrey: [ 105, 105, 105 ],
            dodgerblue: [ 30, 144, 255 ],
            firebrick: [ 178, 34, 34 ],
            floralwhite: [ 255, 250, 240 ],
            forestgreen: [ 34, 139, 34 ],
            fuchsia: [ 255, 0, 255 ],
            gainsboro: [ 220, 220, 220 ],
            ghostwhite: [ 248, 248, 255 ],
            gold: [ 255, 215, 0 ],
            goldenrod: [ 218, 165, 32 ],
            gray: [ 128, 128, 128 ],
            green: [ 0, 128, 0 ],
            greenyellow: [ 173, 255, 47 ],
            grey: [ 128, 128, 128 ],
            honeydew: [ 240, 255, 240 ],
            hotpink: [ 255, 105, 180 ],
            indianred: [ 205, 92, 92 ],
            indigo: [ 75, 0, 130 ],
            ivory: [ 255, 255, 240 ],
            khaki: [ 240, 230, 140 ],
            lavender: [ 230, 230, 250 ],
            lavenderblush: [ 255, 240, 245 ],
            lawngreen: [ 124, 252, 0 ],
            lemonchiffon: [ 255, 250, 205 ],
            lightblue: [ 173, 216, 230 ],
            lightcoral: [ 240, 128, 128 ],
            lightcyan: [ 224, 255, 255 ],
            lightgoldenrodyellow: [ 250, 250, 210 ],
            lightgray: [ 211, 211, 211 ],
            lightgreen: [ 144, 238, 144 ],
            lightgrey: [ 211, 211, 211 ],
            lightpink: [ 255, 182, 193 ],
            lightsalmon: [ 255, 160, 122 ],
            lightseagreen: [ 32, 178, 170 ],
            lightskyblue: [ 135, 206, 250 ],
            lightslategray: [ 119, 136, 153 ],
            lightslategrey: [ 119, 136, 153 ],
            lightsteelblue: [ 176, 196, 222 ],
            lightyellow: [ 255, 255, 224 ],
            lime: [ 0, 255, 0 ],
            limegreen: [ 50, 205, 50 ],
            linen: [ 250, 240, 230 ],
            magenta: [ 255, 0, 255 ],
            maroon: [ 128, 0, 0 ],
            mediumaquamarine: [ 102, 205, 170 ],
            mediumblue: [ 0, 0, 205 ],
            mediumorchid: [ 186, 85, 211 ],
            mediumpurple: [ 147, 112, 219 ],
            mediumseagreen: [ 60, 179, 113 ],
            mediumslateblue: [ 123, 104, 238 ],
            mediumspringgreen: [ 0, 250, 154 ],
            mediumturquoise: [ 72, 209, 204 ],
            mediumvioletred: [ 199, 21, 133 ],
            midnightblue: [ 25, 25, 112 ],
            mintcream: [ 245, 255, 250 ],
            mistyrose: [ 255, 228, 225 ],
            moccasin: [ 255, 228, 181 ],
            navajowhite: [ 255, 222, 173 ],
            navy: [ 0, 0, 128 ],
            oldlace: [ 253, 245, 230 ],
            olive: [ 128, 128, 0 ],
            olivedrab: [ 107, 142, 35 ],
            orange: [ 255, 165, 0 ],
            orangered: [ 255, 69, 0 ],
            orchid: [ 218, 112, 214 ],
            palegoldenrod: [ 238, 232, 170 ],
            palegreen: [ 152, 251, 152 ],
            paleturquoise: [ 175, 238, 238 ],
            palevioletred: [ 219, 112, 147 ],
            papayawhip: [ 255, 239, 213 ],
            peachpuff: [ 255, 218, 185 ],
            peru: [ 205, 133, 63 ],
            pink: [ 255, 192, 203 ],
            plum: [ 221, 160, 221 ],
            powderblue: [ 176, 224, 230 ],
            purple: [ 128, 0, 128 ],
            rebeccapurple: [ 102, 51, 153 ],
            red: [ 255, 0, 0 ],
            rosybrown: [ 188, 143, 143 ],
            royalblue: [ 65, 105, 225 ],
            saddlebrown: [ 139, 69, 19 ],
            salmon: [ 250, 128, 114 ],
            sandybrown: [ 244, 164, 96 ],
            seagreen: [ 46, 139, 87 ],
            seashell: [ 255, 245, 238 ],
            sienna: [ 160, 82, 45 ],
            silver: [ 192, 192, 192 ],
            skyblue: [ 135, 206, 235 ],
            slateblue: [ 106, 90, 205 ],
            slategray: [ 112, 128, 144 ],
            slategrey: [ 112, 128, 144 ],
            snow: [ 255, 250, 250 ],
            springgreen: [ 0, 255, 127 ],
            steelblue: [ 70, 130, 180 ],
            tan: [ 210, 180, 140 ],
            teal: [ 0, 128, 128 ],
            thistle: [ 216, 191, 216 ],
            tomato: [ 255, 99, 71 ],
            turquoise: [ 64, 224, 208 ],
            violet: [ 238, 130, 238 ],
            wheat: [ 245, 222, 179 ],
            white: [ 255, 255, 255 ],
            whitesmoke: [ 245, 245, 245 ],
            yellow: [ 255, 255, 0 ],
            yellowgreen: [ 154, 205, 50 ]
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var isArrayish = __webpack_require__(519);
        var concat = Array.prototype.concat;
        var slice = Array.prototype.slice;
        var swizzle = module.exports = function swizzle(args) {
            var results = [];
            for (var i = 0, len = args.length; i < len; i++) {
                var arg = args[i];
                if (isArrayish(arg)) {
                    results = concat.call(results, slice.call(arg));
                } else {
                    results.push(arg);
                }
            }
            return results;
        };
        swizzle.wrap = function(fn) {
            return function() {
                return fn(swizzle(arguments));
            };
        };
    }, module => {
        module.exports = function isArrayish(obj) {
            if (!obj || typeof obj === "string") {
                return false;
            }
            return obj instanceof Array || Array.isArray(obj) || obj.length >= 0 && (obj.splice instanceof Function || Object.getOwnPropertyDescriptor(obj, obj.length - 1) && obj.constructor.name !== "String");
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var conversions = __webpack_require__(521);
        var route = __webpack_require__(522);
        var convert = {};
        var models = Object.keys(conversions);
        function wrapRaw(fn) {
            var wrappedFn = function(args) {
                if (args === undefined || args === null) {
                    return args;
                }
                if (arguments.length > 1) {
                    args = Array.prototype.slice.call(arguments);
                }
                return fn(args);
            };
            if ("conversion" in fn) {
                wrappedFn.conversion = fn.conversion;
            }
            return wrappedFn;
        }
        function wrapRounded(fn) {
            var wrappedFn = function(args) {
                if (args === undefined || args === null) {
                    return args;
                }
                if (arguments.length > 1) {
                    args = Array.prototype.slice.call(arguments);
                }
                var result = fn(args);
                if (typeof result === "object") {
                    for (var len = result.length, i = 0; i < len; i++) {
                        result[i] = Math.round(result[i]);
                    }
                }
                return result;
            };
            if ("conversion" in fn) {
                wrappedFn.conversion = fn.conversion;
            }
            return wrappedFn;
        }
        models.forEach((function(fromModel) {
            convert[fromModel] = {};
            Object.defineProperty(convert[fromModel], "channels", {
                value: conversions[fromModel].channels
            });
            Object.defineProperty(convert[fromModel], "labels", {
                value: conversions[fromModel].labels
            });
            var routes = route(fromModel);
            var routeModels = Object.keys(routes);
            routeModels.forEach((function(toModel) {
                var fn = routes[toModel];
                convert[fromModel][toModel] = wrapRounded(fn);
                convert[fromModel][toModel].raw = wrapRaw(fn);
            }));
        }));
        module.exports = convert;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var cssKeywords = __webpack_require__(517);
        var reverseKeywords = {};
        for (var key in cssKeywords) {
            if (cssKeywords.hasOwnProperty(key)) {
                reverseKeywords[cssKeywords[key]] = key;
            }
        }
        var convert = module.exports = {
            rgb: {
                channels: 3,
                labels: "rgb"
            },
            hsl: {
                channels: 3,
                labels: "hsl"
            },
            hsv: {
                channels: 3,
                labels: "hsv"
            },
            hwb: {
                channels: 3,
                labels: "hwb"
            },
            cmyk: {
                channels: 4,
                labels: "cmyk"
            },
            xyz: {
                channels: 3,
                labels: "xyz"
            },
            lab: {
                channels: 3,
                labels: "lab"
            },
            lch: {
                channels: 3,
                labels: "lch"
            },
            hex: {
                channels: 1,
                labels: [ "hex" ]
            },
            keyword: {
                channels: 1,
                labels: [ "keyword" ]
            },
            ansi16: {
                channels: 1,
                labels: [ "ansi16" ]
            },
            ansi256: {
                channels: 1,
                labels: [ "ansi256" ]
            },
            hcg: {
                channels: 3,
                labels: [ "h", "c", "g" ]
            },
            apple: {
                channels: 3,
                labels: [ "r16", "g16", "b16" ]
            },
            gray: {
                channels: 1,
                labels: [ "gray" ]
            }
        };
        for (var model in convert) {
            if (convert.hasOwnProperty(model)) {
                if (!("channels" in convert[model])) {
                    throw new Error("missing channels property: " + model);
                }
                if (!("labels" in convert[model])) {
                    throw new Error("missing channel labels property: " + model);
                }
                if (convert[model].labels.length !== convert[model].channels) {
                    throw new Error("channel and label counts mismatch: " + model);
                }
                var channels = convert[model].channels;
                var labels = convert[model].labels;
                delete convert[model].channels;
                delete convert[model].labels;
                Object.defineProperty(convert[model], "channels", {
                    value: channels
                });
                Object.defineProperty(convert[model], "labels", {
                    value: labels
                });
            }
        }
        convert.rgb.hsl = function(rgb) {
            var r = rgb[0] / 255;
            var g = rgb[1] / 255;
            var b = rgb[2] / 255;
            var min = Math.min(r, g, b);
            var max = Math.max(r, g, b);
            var delta = max - min;
            var h;
            var s;
            var l;
            if (max === min) {
                h = 0;
            } else if (r === max) {
                h = (g - b) / delta;
            } else if (g === max) {
                h = 2 + (b - r) / delta;
            } else if (b === max) {
                h = 4 + (r - g) / delta;
            }
            h = Math.min(h * 60, 360);
            if (h < 0) {
                h += 360;
            }
            l = (min + max) / 2;
            if (max === min) {
                s = 0;
            } else if (l <= .5) {
                s = delta / (max + min);
            } else {
                s = delta / (2 - max - min);
            }
            return [ h, s * 100, l * 100 ];
        };
        convert.rgb.hsv = function(rgb) {
            var rdif;
            var gdif;
            var bdif;
            var h;
            var s;
            var r = rgb[0] / 255;
            var g = rgb[1] / 255;
            var b = rgb[2] / 255;
            var v = Math.max(r, g, b);
            var diff = v - Math.min(r, g, b);
            var diffc = function(c) {
                return (v - c) / 6 / diff + 1 / 2;
            };
            if (diff === 0) {
                h = s = 0;
            } else {
                s = diff / v;
                rdif = diffc(r);
                gdif = diffc(g);
                bdif = diffc(b);
                if (r === v) {
                    h = bdif - gdif;
                } else if (g === v) {
                    h = 1 / 3 + rdif - bdif;
                } else if (b === v) {
                    h = 2 / 3 + gdif - rdif;
                }
                if (h < 0) {
                    h += 1;
                } else if (h > 1) {
                    h -= 1;
                }
            }
            return [ h * 360, s * 100, v * 100 ];
        };
        convert.rgb.hwb = function(rgb) {
            var r = rgb[0];
            var g = rgb[1];
            var b = rgb[2];
            var h = convert.rgb.hsl(rgb)[0];
            var w = 1 / 255 * Math.min(r, Math.min(g, b));
            b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
            return [ h, w * 100, b * 100 ];
        };
        convert.rgb.cmyk = function(rgb) {
            var r = rgb[0] / 255;
            var g = rgb[1] / 255;
            var b = rgb[2] / 255;
            var c;
            var m;
            var y;
            var k;
            k = Math.min(1 - r, 1 - g, 1 - b);
            c = (1 - r - k) / (1 - k) || 0;
            m = (1 - g - k) / (1 - k) || 0;
            y = (1 - b - k) / (1 - k) || 0;
            return [ c * 100, m * 100, y * 100, k * 100 ];
        };
        function comparativeDistance(x, y) {
            return Math.pow(x[0] - y[0], 2) + Math.pow(x[1] - y[1], 2) + Math.pow(x[2] - y[2], 2);
        }
        convert.rgb.keyword = function(rgb) {
            var reversed = reverseKeywords[rgb];
            if (reversed) {
                return reversed;
            }
            var currentClosestDistance = Infinity;
            var currentClosestKeyword;
            for (var keyword in cssKeywords) {
                if (cssKeywords.hasOwnProperty(keyword)) {
                    var value = cssKeywords[keyword];
                    var distance = comparativeDistance(rgb, value);
                    if (distance < currentClosestDistance) {
                        currentClosestDistance = distance;
                        currentClosestKeyword = keyword;
                    }
                }
            }
            return currentClosestKeyword;
        };
        convert.keyword.rgb = function(keyword) {
            return cssKeywords[keyword];
        };
        convert.rgb.xyz = function(rgb) {
            var r = rgb[0] / 255;
            var g = rgb[1] / 255;
            var b = rgb[2] / 255;
            r = r > .04045 ? Math.pow((r + .055) / 1.055, 2.4) : r / 12.92;
            g = g > .04045 ? Math.pow((g + .055) / 1.055, 2.4) : g / 12.92;
            b = b > .04045 ? Math.pow((b + .055) / 1.055, 2.4) : b / 12.92;
            var x = r * .4124 + g * .3576 + b * .1805;
            var y = r * .2126 + g * .7152 + b * .0722;
            var z = r * .0193 + g * .1192 + b * .9505;
            return [ x * 100, y * 100, z * 100 ];
        };
        convert.rgb.lab = function(rgb) {
            var xyz = convert.rgb.xyz(rgb);
            var x = xyz[0];
            var y = xyz[1];
            var z = xyz[2];
            var l;
            var a;
            var b;
            x /= 95.047;
            y /= 100;
            z /= 108.883;
            x = x > .008856 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116;
            y = y > .008856 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116;
            z = z > .008856 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116;
            l = 116 * y - 16;
            a = 500 * (x - y);
            b = 200 * (y - z);
            return [ l, a, b ];
        };
        convert.hsl.rgb = function(hsl) {
            var h = hsl[0] / 360;
            var s = hsl[1] / 100;
            var l = hsl[2] / 100;
            var t1;
            var t2;
            var t3;
            var rgb;
            var val;
            if (s === 0) {
                val = l * 255;
                return [ val, val, val ];
            }
            if (l < .5) {
                t2 = l * (1 + s);
            } else {
                t2 = l + s - l * s;
            }
            t1 = 2 * l - t2;
            rgb = [ 0, 0, 0 ];
            for (var i = 0; i < 3; i++) {
                t3 = h + 1 / 3 * -(i - 1);
                if (t3 < 0) {
                    t3++;
                }
                if (t3 > 1) {
                    t3--;
                }
                if (6 * t3 < 1) {
                    val = t1 + (t2 - t1) * 6 * t3;
                } else if (2 * t3 < 1) {
                    val = t2;
                } else if (3 * t3 < 2) {
                    val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
                } else {
                    val = t1;
                }
                rgb[i] = val * 255;
            }
            return rgb;
        };
        convert.hsl.hsv = function(hsl) {
            var h = hsl[0];
            var s = hsl[1] / 100;
            var l = hsl[2] / 100;
            var smin = s;
            var lmin = Math.max(l, .01);
            var sv;
            var v;
            l *= 2;
            s *= l <= 1 ? l : 2 - l;
            smin *= lmin <= 1 ? lmin : 2 - lmin;
            v = (l + s) / 2;
            sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
            return [ h, sv * 100, v * 100 ];
        };
        convert.hsv.rgb = function(hsv) {
            var h = hsv[0] / 60;
            var s = hsv[1] / 100;
            var v = hsv[2] / 100;
            var hi = Math.floor(h) % 6;
            var f = h - Math.floor(h);
            var p = 255 * v * (1 - s);
            var q = 255 * v * (1 - s * f);
            var t = 255 * v * (1 - s * (1 - f));
            v *= 255;
            switch (hi) {
              case 0:
                return [ v, t, p ];

              case 1:
                return [ q, v, p ];

              case 2:
                return [ p, v, t ];

              case 3:
                return [ p, q, v ];

              case 4:
                return [ t, p, v ];

              case 5:
                return [ v, p, q ];
            }
        };
        convert.hsv.hsl = function(hsv) {
            var h = hsv[0];
            var s = hsv[1] / 100;
            var v = hsv[2] / 100;
            var vmin = Math.max(v, .01);
            var lmin;
            var sl;
            var l;
            l = (2 - s) * v;
            lmin = (2 - s) * vmin;
            sl = s * vmin;
            sl /= lmin <= 1 ? lmin : 2 - lmin;
            sl = sl || 0;
            l /= 2;
            return [ h, sl * 100, l * 100 ];
        };
        convert.hwb.rgb = function(hwb) {
            var h = hwb[0] / 360;
            var wh = hwb[1] / 100;
            var bl = hwb[2] / 100;
            var ratio = wh + bl;
            var i;
            var v;
            var f;
            var n;
            if (ratio > 1) {
                wh /= ratio;
                bl /= ratio;
            }
            i = Math.floor(6 * h);
            v = 1 - bl;
            f = 6 * h - i;
            if ((i & 1) !== 0) {
                f = 1 - f;
            }
            n = wh + f * (v - wh);
            var r;
            var g;
            var b;
            switch (i) {
              default:
              case 6:
              case 0:
                r = v;
                g = n;
                b = wh;
                break;

              case 1:
                r = n;
                g = v;
                b = wh;
                break;

              case 2:
                r = wh;
                g = v;
                b = n;
                break;

              case 3:
                r = wh;
                g = n;
                b = v;
                break;

              case 4:
                r = n;
                g = wh;
                b = v;
                break;

              case 5:
                r = v;
                g = wh;
                b = n;
                break;
            }
            return [ r * 255, g * 255, b * 255 ];
        };
        convert.cmyk.rgb = function(cmyk) {
            var c = cmyk[0] / 100;
            var m = cmyk[1] / 100;
            var y = cmyk[2] / 100;
            var k = cmyk[3] / 100;
            var r;
            var g;
            var b;
            r = 1 - Math.min(1, c * (1 - k) + k);
            g = 1 - Math.min(1, m * (1 - k) + k);
            b = 1 - Math.min(1, y * (1 - k) + k);
            return [ r * 255, g * 255, b * 255 ];
        };
        convert.xyz.rgb = function(xyz) {
            var x = xyz[0] / 100;
            var y = xyz[1] / 100;
            var z = xyz[2] / 100;
            var r;
            var g;
            var b;
            r = x * 3.2406 + y * -1.5372 + z * -.4986;
            g = x * -.9689 + y * 1.8758 + z * .0415;
            b = x * .0557 + y * -.204 + z * 1.057;
            r = r > .0031308 ? 1.055 * Math.pow(r, 1 / 2.4) - .055 : r * 12.92;
            g = g > .0031308 ? 1.055 * Math.pow(g, 1 / 2.4) - .055 : g * 12.92;
            b = b > .0031308 ? 1.055 * Math.pow(b, 1 / 2.4) - .055 : b * 12.92;
            r = Math.min(Math.max(0, r), 1);
            g = Math.min(Math.max(0, g), 1);
            b = Math.min(Math.max(0, b), 1);
            return [ r * 255, g * 255, b * 255 ];
        };
        convert.xyz.lab = function(xyz) {
            var x = xyz[0];
            var y = xyz[1];
            var z = xyz[2];
            var l;
            var a;
            var b;
            x /= 95.047;
            y /= 100;
            z /= 108.883;
            x = x > .008856 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116;
            y = y > .008856 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116;
            z = z > .008856 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116;
            l = 116 * y - 16;
            a = 500 * (x - y);
            b = 200 * (y - z);
            return [ l, a, b ];
        };
        convert.lab.xyz = function(lab) {
            var l = lab[0];
            var a = lab[1];
            var b = lab[2];
            var x;
            var y;
            var z;
            y = (l + 16) / 116;
            x = a / 500 + y;
            z = y - b / 200;
            var y2 = Math.pow(y, 3);
            var x2 = Math.pow(x, 3);
            var z2 = Math.pow(z, 3);
            y = y2 > .008856 ? y2 : (y - 16 / 116) / 7.787;
            x = x2 > .008856 ? x2 : (x - 16 / 116) / 7.787;
            z = z2 > .008856 ? z2 : (z - 16 / 116) / 7.787;
            x *= 95.047;
            y *= 100;
            z *= 108.883;
            return [ x, y, z ];
        };
        convert.lab.lch = function(lab) {
            var l = lab[0];
            var a = lab[1];
            var b = lab[2];
            var hr;
            var h;
            var c;
            hr = Math.atan2(b, a);
            h = hr * 360 / 2 / Math.PI;
            if (h < 0) {
                h += 360;
            }
            c = Math.sqrt(a * a + b * b);
            return [ l, c, h ];
        };
        convert.lch.lab = function(lch) {
            var l = lch[0];
            var c = lch[1];
            var h = lch[2];
            var a;
            var b;
            var hr;
            hr = h / 360 * 2 * Math.PI;
            a = c * Math.cos(hr);
            b = c * Math.sin(hr);
            return [ l, a, b ];
        };
        convert.rgb.ansi16 = function(args) {
            var r = args[0];
            var g = args[1];
            var b = args[2];
            var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2];
            value = Math.round(value / 50);
            if (value === 0) {
                return 30;
            }
            var ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
            if (value === 2) {
                ansi += 60;
            }
            return ansi;
        };
        convert.hsv.ansi16 = function(args) {
            return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
        };
        convert.rgb.ansi256 = function(args) {
            var r = args[0];
            var g = args[1];
            var b = args[2];
            if (r === g && g === b) {
                if (r < 8) {
                    return 16;
                }
                if (r > 248) {
                    return 231;
                }
                return Math.round((r - 8) / 247 * 24) + 232;
            }
            var ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
            return ansi;
        };
        convert.ansi16.rgb = function(args) {
            var color = args % 10;
            if (color === 0 || color === 7) {
                if (args > 50) {
                    color += 3.5;
                }
                color = color / 10.5 * 255;
                return [ color, color, color ];
            }
            var mult = (~~(args > 50) + 1) * .5;
            var r = (color & 1) * mult * 255;
            var g = (color >> 1 & 1) * mult * 255;
            var b = (color >> 2 & 1) * mult * 255;
            return [ r, g, b ];
        };
        convert.ansi256.rgb = function(args) {
            if (args >= 232) {
                var c = (args - 232) * 10 + 8;
                return [ c, c, c ];
            }
            args -= 16;
            var rem;
            var r = Math.floor(args / 36) / 5 * 255;
            var g = Math.floor((rem = args % 36) / 6) / 5 * 255;
            var b = rem % 6 / 5 * 255;
            return [ r, g, b ];
        };
        convert.rgb.hex = function(args) {
            var integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
            var string = integer.toString(16).toUpperCase();
            return "000000".substring(string.length) + string;
        };
        convert.hex.rgb = function(args) {
            var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
            if (!match) {
                return [ 0, 0, 0 ];
            }
            var colorString = match[0];
            if (match[0].length === 3) {
                colorString = colorString.split("").map((function(char) {
                    return char + char;
                })).join("");
            }
            var integer = parseInt(colorString, 16);
            var r = integer >> 16 & 255;
            var g = integer >> 8 & 255;
            var b = integer & 255;
            return [ r, g, b ];
        };
        convert.rgb.hcg = function(rgb) {
            var r = rgb[0] / 255;
            var g = rgb[1] / 255;
            var b = rgb[2] / 255;
            var max = Math.max(Math.max(r, g), b);
            var min = Math.min(Math.min(r, g), b);
            var chroma = max - min;
            var grayscale;
            var hue;
            if (chroma < 1) {
                grayscale = min / (1 - chroma);
            } else {
                grayscale = 0;
            }
            if (chroma <= 0) {
                hue = 0;
            } else if (max === r) {
                hue = (g - b) / chroma % 6;
            } else if (max === g) {
                hue = 2 + (b - r) / chroma;
            } else {
                hue = 4 + (r - g) / chroma + 4;
            }
            hue /= 6;
            hue %= 1;
            return [ hue * 360, chroma * 100, grayscale * 100 ];
        };
        convert.hsl.hcg = function(hsl) {
            var s = hsl[1] / 100;
            var l = hsl[2] / 100;
            var c = 1;
            var f = 0;
            if (l < .5) {
                c = 2 * s * l;
            } else {
                c = 2 * s * (1 - l);
            }
            if (c < 1) {
                f = (l - .5 * c) / (1 - c);
            }
            return [ hsl[0], c * 100, f * 100 ];
        };
        convert.hsv.hcg = function(hsv) {
            var s = hsv[1] / 100;
            var v = hsv[2] / 100;
            var c = s * v;
            var f = 0;
            if (c < 1) {
                f = (v - c) / (1 - c);
            }
            return [ hsv[0], c * 100, f * 100 ];
        };
        convert.hcg.rgb = function(hcg) {
            var h = hcg[0] / 360;
            var c = hcg[1] / 100;
            var g = hcg[2] / 100;
            if (c === 0) {
                return [ g * 255, g * 255, g * 255 ];
            }
            var pure = [ 0, 0, 0 ];
            var hi = h % 1 * 6;
            var v = hi % 1;
            var w = 1 - v;
            var mg = 0;
            switch (Math.floor(hi)) {
              case 0:
                pure[0] = 1;
                pure[1] = v;
                pure[2] = 0;
                break;

              case 1:
                pure[0] = w;
                pure[1] = 1;
                pure[2] = 0;
                break;

              case 2:
                pure[0] = 0;
                pure[1] = 1;
                pure[2] = v;
                break;

              case 3:
                pure[0] = 0;
                pure[1] = w;
                pure[2] = 1;
                break;

              case 4:
                pure[0] = v;
                pure[1] = 0;
                pure[2] = 1;
                break;

              default:
                pure[0] = 1;
                pure[1] = 0;
                pure[2] = w;
            }
            mg = (1 - c) * g;
            return [ (c * pure[0] + mg) * 255, (c * pure[1] + mg) * 255, (c * pure[2] + mg) * 255 ];
        };
        convert.hcg.hsv = function(hcg) {
            var c = hcg[1] / 100;
            var g = hcg[2] / 100;
            var v = c + g * (1 - c);
            var f = 0;
            if (v > 0) {
                f = c / v;
            }
            return [ hcg[0], f * 100, v * 100 ];
        };
        convert.hcg.hsl = function(hcg) {
            var c = hcg[1] / 100;
            var g = hcg[2] / 100;
            var l = g * (1 - c) + .5 * c;
            var s = 0;
            if (l > 0 && l < .5) {
                s = c / (2 * l);
            } else if (l >= .5 && l < 1) {
                s = c / (2 * (1 - l));
            }
            return [ hcg[0], s * 100, l * 100 ];
        };
        convert.hcg.hwb = function(hcg) {
            var c = hcg[1] / 100;
            var g = hcg[2] / 100;
            var v = c + g * (1 - c);
            return [ hcg[0], (v - c) * 100, (1 - v) * 100 ];
        };
        convert.hwb.hcg = function(hwb) {
            var w = hwb[1] / 100;
            var b = hwb[2] / 100;
            var v = 1 - b;
            var c = v - w;
            var g = 0;
            if (c < 1) {
                g = (v - c) / (1 - c);
            }
            return [ hwb[0], c * 100, g * 100 ];
        };
        convert.apple.rgb = function(apple) {
            return [ apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255 ];
        };
        convert.rgb.apple = function(rgb) {
            return [ rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535 ];
        };
        convert.gray.rgb = function(args) {
            return [ args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255 ];
        };
        convert.gray.hsl = convert.gray.hsv = function(args) {
            return [ 0, 0, args[0] ];
        };
        convert.gray.hwb = function(gray) {
            return [ 0, 100, gray[0] ];
        };
        convert.gray.cmyk = function(gray) {
            return [ 0, 0, 0, gray[0] ];
        };
        convert.gray.lab = function(gray) {
            return [ gray[0], 0, 0 ];
        };
        convert.gray.hex = function(gray) {
            var val = Math.round(gray[0] / 100 * 255) & 255;
            var integer = (val << 16) + (val << 8) + val;
            var string = integer.toString(16).toUpperCase();
            return "000000".substring(string.length) + string;
        };
        convert.rgb.gray = function(rgb) {
            var val = (rgb[0] + rgb[1] + rgb[2]) / 3;
            return [ val / 255 * 100 ];
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var conversions = __webpack_require__(521);
        function buildGraph() {
            var graph = {};
            var models = Object.keys(conversions);
            for (var len = models.length, i = 0; i < len; i++) {
                graph[models[i]] = {
                    distance: -1,
                    parent: null
                };
            }
            return graph;
        }
        function deriveBFS(fromModel) {
            var graph = buildGraph();
            var queue = [ fromModel ];
            graph[fromModel].distance = 0;
            while (queue.length) {
                var current = queue.pop();
                var adjacents = Object.keys(conversions[current]);
                for (var len = adjacents.length, i = 0; i < len; i++) {
                    var adjacent = adjacents[i];
                    var node = graph[adjacent];
                    if (node.distance === -1) {
                        node.distance = graph[current].distance + 1;
                        node.parent = current;
                        queue.unshift(adjacent);
                    }
                }
            }
            return graph;
        }
        function link(from, to) {
            return function(args) {
                return to(from(args));
            };
        }
        function wrapConversion(toModel, graph) {
            var path = [ graph[toModel].parent, toModel ];
            var fn = conversions[graph[toModel].parent][toModel];
            var cur = graph[toModel].parent;
            while (graph[cur].parent) {
                path.unshift(graph[cur].parent);
                fn = link(conversions[graph[cur].parent][cur], fn);
                cur = graph[cur].parent;
            }
            fn.conversion = path;
            return fn;
        }
        module.exports = function(fromModel) {
            var graph = deriveBFS(fromModel);
            var conversion = {};
            var models = Object.keys(graph);
            for (var len = models.length, i = 0; i < len; i++) {
                var toModel = models[i];
                var node = graph[toModel];
                if (node.parent === null) {
                    continue;
                }
                conversion[toModel] = wrapConversion(toModel, graph);
            }
            return conversion;
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var BKDRHash = __webpack_require__(524);
        var RGB2HEX = function(RGBArray) {
            var hex = "#";
            RGBArray.forEach((function(value) {
                if (value < 16) {
                    hex += 0;
                }
                hex += value.toString(16);
            }));
            return hex;
        };
        var HSL2RGB = function(H, S, L) {
            H /= 360;
            var q = L < .5 ? L * (1 + S) : L + S - L * S;
            var p = 2 * L - q;
            return [ H + 1 / 3, H, H - 1 / 3 ].map((function(color) {
                if (color < 0) {
                    color++;
                }
                if (color > 1) {
                    color--;
                }
                if (color < 1 / 6) {
                    color = p + (q - p) * 6 * color;
                } else if (color < .5) {
                    color = q;
                } else if (color < 2 / 3) {
                    color = p + (q - p) * 6 * (2 / 3 - color);
                } else {
                    color = p;
                }
                return Math.round(color * 255);
            }));
        };
        var ColorHash = function(options) {
            options = options || {};
            var LS = [ options.lightness, options.saturation ].map((function(param) {
                param = param || [ .35, .5, .65 ];
                return Object.prototype.toString.call(param) === "[object Array]" ? param.concat() : [ param ];
            }));
            this.L = LS[0];
            this.S = LS[1];
            this.hash = options.hash || BKDRHash;
        };
        ColorHash.prototype.hsl = function(str) {
            var H, S, L;
            var hash = this.hash(str);
            H = hash % 359;
            hash = parseInt(hash / 360);
            S = this.S[hash % this.S.length];
            hash = parseInt(hash / this.S.length);
            L = this.L[hash % this.L.length];
            return [ H, S, L ];
        };
        ColorHash.prototype.rgb = function(str) {
            var hsl = this.hsl(str);
            return HSL2RGB.apply(this, hsl);
        };
        ColorHash.prototype.hex = function(str) {
            var rgb = this.rgb(str);
            return RGB2HEX(rgb);
        };
        module.exports = ColorHash;
    }, module => {
        var BKDRHash = function(str) {
            var seed = 131;
            var seed2 = 137;
            var hash = 0;
            str += "x";
            var MAX_SAFE_INTEGER = parseInt(9007199254740991 / seed2);
            for (var i = 0; i < str.length; i++) {
                if (hash > MAX_SAFE_INTEGER) {
                    hash = parseInt(hash / seed2);
                }
                hash = hash * seed + str.charCodeAt(i);
            }
            return hash;
        };
        module.exports = BKDRHash;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var createFind = __webpack_require__(526), findIndex = __webpack_require__(563);
        var find = createFind(findIndex);
        module.exports = find;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseIteratee = __webpack_require__(527), isArrayLike = __webpack_require__(427), keys = __webpack_require__(408);
        function createFind(findIndexFunc) {
            return function(collection, predicate, fromIndex) {
                var iterable = Object(collection);
                if (!isArrayLike(collection)) {
                    var iteratee = baseIteratee(predicate, 3);
                    collection = keys(collection);
                    predicate = function(key) {
                        return iteratee(iterable[key], key, iterable);
                    };
                }
                var index = findIndexFunc(collection, predicate, fromIndex);
                return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
            };
        }
        module.exports = createFind;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseMatches = __webpack_require__(528), baseMatchesProperty = __webpack_require__(545), identity = __webpack_require__(476), isArray = __webpack_require__(414), property = __webpack_require__(560);
        function baseIteratee(value) {
            if (typeof value == "function") {
                return value;
            }
            if (value == null) {
                return identity;
            }
            if (typeof value == "object") {
                return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
            }
            return property(value);
        }
        module.exports = baseIteratee;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseIsMatch = __webpack_require__(529), getMatchData = __webpack_require__(542), matchesStrictComparable = __webpack_require__(544);
        function baseMatches(source) {
            var matchData = getMatchData(source);
            if (matchData.length == 1 && matchData[0][2]) {
                return matchesStrictComparable(matchData[0][0], matchData[0][1]);
            }
            return function(object) {
                return object === source || baseIsMatch(object, source, matchData);
            };
        }
        module.exports = baseMatches;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var Stack = __webpack_require__(358), baseIsEqual = __webpack_require__(530);
        var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
        function baseIsMatch(object, source, matchData, customizer) {
            var index = matchData.length, length = index, noCustomizer = !customizer;
            if (object == null) {
                return !length;
            }
            object = Object(object);
            while (index--) {
                var data = matchData[index];
                if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
                    return false;
                }
            }
            while (++index < length) {
                data = matchData[index];
                var key = data[0], objValue = object[key], srcValue = data[1];
                if (noCustomizer && data[2]) {
                    if (objValue === undefined && !(key in object)) {
                        return false;
                    }
                } else {
                    var stack = new Stack;
                    if (customizer) {
                        var result = customizer(objValue, srcValue, key, object, source, stack);
                    }
                    if (!(result === undefined ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result)) {
                        return false;
                    }
                }
            }
            return true;
        }
        module.exports = baseIsMatch;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseIsEqualDeep = __webpack_require__(531), isObjectLike = __webpack_require__(413);
        function baseIsEqual(value, other, bitmask, customizer, stack) {
            if (value === other) {
                return true;
            }
            if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
                return value !== value && other !== other;
            }
            return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
        }
        module.exports = baseIsEqual;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var Stack = __webpack_require__(358), equalArrays = __webpack_require__(532), equalByTag = __webpack_require__(538), equalObjects = __webpack_require__(541), getTag = __webpack_require__(445), isArray = __webpack_require__(414), isBuffer = __webpack_require__(415), isTypedArray = __webpack_require__(418);
        var COMPARE_PARTIAL_FLAG = 1;
        var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
        var objectProto = Object.prototype;
        var hasOwnProperty = objectProto.hasOwnProperty;
        function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
            var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
            objTag = objTag == argsTag ? objectTag : objTag;
            othTag = othTag == argsTag ? objectTag : othTag;
            var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
            if (isSameTag && isBuffer(object)) {
                if (!isBuffer(other)) {
                    return false;
                }
                objIsArr = true;
                objIsObj = false;
            }
            if (isSameTag && !objIsObj) {
                stack || (stack = new Stack);
                return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
            }
            if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
                var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
                if (objIsWrapped || othIsWrapped) {
                    var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
                    stack || (stack = new Stack);
                    return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
                }
            }
            if (!isSameTag) {
                return false;
            }
            stack || (stack = new Stack);
            return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
        }
        module.exports = baseIsEqualDeep;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var SetCache = __webpack_require__(533), arraySome = __webpack_require__(536), cacheHas = __webpack_require__(537);
        var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
        function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
            var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
            if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
                return false;
            }
            var arrStacked = stack.get(array);
            var othStacked = stack.get(other);
            if (arrStacked && othStacked) {
                return arrStacked == other && othStacked == array;
            }
            var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache : undefined;
            stack.set(array, other);
            stack.set(other, array);
            while (++index < arrLength) {
                var arrValue = array[index], othValue = other[index];
                if (customizer) {
                    var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
                }
                if (compared !== undefined) {
                    if (compared) {
                        continue;
                    }
                    result = false;
                    break;
                }
                if (seen) {
                    if (!arraySome(other, (function(othValue, othIndex) {
                        if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
                            return seen.push(othIndex);
                        }
                    }))) {
                        result = false;
                        break;
                    }
                } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
                    result = false;
                    break;
                }
            }
            stack["delete"](array);
            stack["delete"](other);
            return result;
        }
        module.exports = equalArrays;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var MapCache = __webpack_require__(387), setCacheAdd = __webpack_require__(534), setCacheHas = __webpack_require__(535);
        function SetCache(values) {
            var index = -1, length = values == null ? 0 : values.length;
            this.__data__ = new MapCache;
            while (++index < length) {
                this.add(values[index]);
            }
        }
        SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
        SetCache.prototype.has = setCacheHas;
        module.exports = SetCache;
    }, module => {
        var HASH_UNDEFINED = "__lodash_hash_undefined__";
        function setCacheAdd(value) {
            this.__data__.set(value, HASH_UNDEFINED);
            return this;
        }
        module.exports = setCacheAdd;
    }, module => {
        function setCacheHas(value) {
            return this.__data__.has(value);
        }
        module.exports = setCacheHas;
    }, module => {
        function arraySome(array, predicate) {
            var index = -1, length = array == null ? 0 : array.length;
            while (++index < length) {
                if (predicate(array[index], index, array)) {
                    return true;
                }
            }
            return false;
        }
        module.exports = arraySome;
    }, module => {
        function cacheHas(cache, key) {
            return cache.has(key);
        }
        module.exports = cacheHas;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var Symbol = __webpack_require__(377), Uint8Array = __webpack_require__(453), eq = __webpack_require__(363), equalArrays = __webpack_require__(532), mapToArray = __webpack_require__(539), setToArray = __webpack_require__(540);
        var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
        var boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]";
        var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]";
        var symbolProto = Symbol ? Symbol.prototype : undefined, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
        function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
            switch (tag) {
              case dataViewTag:
                if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
                    return false;
                }
                object = object.buffer;
                other = other.buffer;

              case arrayBufferTag:
                if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
                    return false;
                }
                return true;

              case boolTag:
              case dateTag:
              case numberTag:
                return eq(+object, +other);

              case errorTag:
                return object.name == other.name && object.message == other.message;

              case regexpTag:
              case stringTag:
                return object == other + "";

              case mapTag:
                var convert = mapToArray;

              case setTag:
                var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
                convert || (convert = setToArray);
                if (object.size != other.size && !isPartial) {
                    return false;
                }
                var stacked = stack.get(object);
                if (stacked) {
                    return stacked == other;
                }
                bitmask |= COMPARE_UNORDERED_FLAG;
                stack.set(object, other);
                var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
                stack["delete"](object);
                return result;

              case symbolTag:
                if (symbolValueOf) {
                    return symbolValueOf.call(object) == symbolValueOf.call(other);
                }
            }
            return false;
        }
        module.exports = equalByTag;
    }, module => {
        function mapToArray(map) {
            var index = -1, result = Array(map.size);
            map.forEach((function(value, key) {
                result[++index] = [ key, value ];
            }));
            return result;
        }
        module.exports = mapToArray;
    }, module => {
        function setToArray(set) {
            var index = -1, result = Array(set.size);
            set.forEach((function(value) {
                result[++index] = value;
            }));
            return result;
        }
        module.exports = setToArray;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var getAllKeys = __webpack_require__(442);
        var COMPARE_PARTIAL_FLAG = 1;
        var objectProto = Object.prototype;
        var hasOwnProperty = objectProto.hasOwnProperty;
        function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
            var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
            if (objLength != othLength && !isPartial) {
                return false;
            }
            var index = objLength;
            while (index--) {
                var key = objProps[index];
                if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
                    return false;
                }
            }
            var objStacked = stack.get(object);
            var othStacked = stack.get(other);
            if (objStacked && othStacked) {
                return objStacked == other && othStacked == object;
            }
            var result = true;
            stack.set(object, other);
            stack.set(other, object);
            var skipCtor = isPartial;
            while (++index < objLength) {
                key = objProps[index];
                var objValue = object[key], othValue = other[key];
                if (customizer) {
                    var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
                }
                if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
                    result = false;
                    break;
                }
                skipCtor || (skipCtor = key == "constructor");
            }
            if (result && !skipCtor) {
                var objCtor = object.constructor, othCtor = other.constructor;
                if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
                    result = false;
                }
            }
            stack["delete"](object);
            stack["delete"](other);
            return result;
        }
        module.exports = equalObjects;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var isStrictComparable = __webpack_require__(543), keys = __webpack_require__(408);
        function getMatchData(object) {
            var result = keys(object), length = result.length;
            while (length--) {
                var key = result[length], value = object[key];
                result[length] = [ key, value, isStrictComparable(value) ];
            }
            return result;
        }
        module.exports = getMatchData;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var isObject = __webpack_require__(382);
        function isStrictComparable(value) {
            return value === value && !isObject(value);
        }
        module.exports = isStrictComparable;
    }, module => {
        function matchesStrictComparable(key, srcValue) {
            return function(object) {
                if (object == null) {
                    return false;
                }
                return object[key] === srcValue && (srcValue !== undefined || key in Object(object));
            };
        }
        module.exports = matchesStrictComparable;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseIsEqual = __webpack_require__(530), get = __webpack_require__(546), hasIn = __webpack_require__(557), isKey = __webpack_require__(549), isStrictComparable = __webpack_require__(543), matchesStrictComparable = __webpack_require__(544), toKey = __webpack_require__(556);
        var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
        function baseMatchesProperty(path, srcValue) {
            if (isKey(path) && isStrictComparable(srcValue)) {
                return matchesStrictComparable(toKey(path), srcValue);
            }
            return function(object) {
                var objValue = get(object, path);
                return objValue === undefined && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
            };
        }
        module.exports = baseMatchesProperty;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseGet = __webpack_require__(547);
        function get(object, path, defaultValue) {
            var result = object == null ? undefined : baseGet(object, path);
            return result === undefined ? defaultValue : result;
        }
        module.exports = get;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var castPath = __webpack_require__(548), toKey = __webpack_require__(556);
        function baseGet(object, path) {
            path = castPath(path, object);
            var index = 0, length = path.length;
            while (object != null && index < length) {
                object = object[toKey(path[index++])];
            }
            return index && index == length ? object : undefined;
        }
        module.exports = baseGet;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var isArray = __webpack_require__(414), isKey = __webpack_require__(549), stringToPath = __webpack_require__(550), toString = __webpack_require__(553);
        function castPath(value, object) {
            if (isArray(value)) {
                return value;
            }
            return isKey(value, object) ? [ value ] : stringToPath(toString(value));
        }
        module.exports = castPath;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var isArray = __webpack_require__(414), isSymbol = __webpack_require__(514);
        var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/;
        function isKey(value, object) {
            if (isArray(value)) {
                return false;
            }
            var type = typeof value;
            if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
                return true;
            }
            return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
        }
        module.exports = isKey;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var memoizeCapped = __webpack_require__(551);
        var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
        var reEscapeChar = /\\(\\)?/g;
        var stringToPath = memoizeCapped((function(string) {
            var result = [];
            if (string.charCodeAt(0) === 46) {
                result.push("");
            }
            string.replace(rePropName, (function(match, number, quote, subString) {
                result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
            }));
            return result;
        }));
        module.exports = stringToPath;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var memoize = __webpack_require__(552);
        var MAX_MEMOIZE_SIZE = 500;
        function memoizeCapped(func) {
            var result = memoize(func, (function(key) {
                if (cache.size === MAX_MEMOIZE_SIZE) {
                    cache.clear();
                }
                return key;
            }));
            var cache = result.cache;
            return result;
        }
        module.exports = memoizeCapped;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var MapCache = __webpack_require__(387);
        var FUNC_ERROR_TEXT = "Expected a function";
        function memoize(func, resolver) {
            if (typeof func != "function" || resolver != null && typeof resolver != "function") {
                throw new TypeError(FUNC_ERROR_TEXT);
            }
            var memoized = function() {
                var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
                if (cache.has(key)) {
                    return cache.get(key);
                }
                var result = func.apply(this, args);
                memoized.cache = cache.set(key, result) || cache;
                return result;
            };
            memoized.cache = new (memoize.Cache || MapCache);
            return memoized;
        }
        memoize.Cache = MapCache;
        module.exports = memoize;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseToString = __webpack_require__(554);
        function toString(value) {
            return value == null ? "" : baseToString(value);
        }
        module.exports = toString;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var Symbol = __webpack_require__(377), arrayMap = __webpack_require__(555), isArray = __webpack_require__(414), isSymbol = __webpack_require__(514);
        var INFINITY = 1 / 0;
        var symbolProto = Symbol ? Symbol.prototype : undefined, symbolToString = symbolProto ? symbolProto.toString : undefined;
        function baseToString(value) {
            if (typeof value == "string") {
                return value;
            }
            if (isArray(value)) {
                return arrayMap(value, baseToString) + "";
            }
            if (isSymbol(value)) {
                return symbolToString ? symbolToString.call(value) : "";
            }
            var result = value + "";
            return result == "0" && 1 / value == -INFINITY ? "-0" : result;
        }
        module.exports = baseToString;
    }, module => {
        function arrayMap(array, iteratee) {
            var index = -1, length = array == null ? 0 : array.length, result = Array(length);
            while (++index < length) {
                result[index] = iteratee(array[index], index, array);
            }
            return result;
        }
        module.exports = arrayMap;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var isSymbol = __webpack_require__(514);
        var INFINITY = 1 / 0;
        function toKey(value) {
            if (typeof value == "string" || isSymbol(value)) {
                return value;
            }
            var result = value + "";
            return result == "0" && 1 / value == -INFINITY ? "-0" : result;
        }
        module.exports = toKey;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseHasIn = __webpack_require__(558), hasPath = __webpack_require__(559);
        function hasIn(object, path) {
            return object != null && hasPath(object, path, baseHasIn);
        }
        module.exports = hasIn;
    }, module => {
        function baseHasIn(object, key) {
            return object != null && key in Object(object);
        }
        module.exports = baseHasIn;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var castPath = __webpack_require__(548), isArguments = __webpack_require__(411), isArray = __webpack_require__(414), isIndex = __webpack_require__(417), isLength = __webpack_require__(420), toKey = __webpack_require__(556);
        function hasPath(object, path, hasFunc) {
            path = castPath(path, object);
            var index = -1, length = path.length, result = false;
            while (++index < length) {
                var key = toKey(path[index]);
                if (!(result = object != null && hasFunc(object, key))) {
                    break;
                }
                object = object[key];
            }
            if (result || ++index != length) {
                return result;
            }
            length = object == null ? 0 : object.length;
            return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
        }
        module.exports = hasPath;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseProperty = __webpack_require__(561), basePropertyDeep = __webpack_require__(562), isKey = __webpack_require__(549), toKey = __webpack_require__(556);
        function property(path) {
            return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
        }
        module.exports = property;
    }, module => {
        function baseProperty(key) {
            return function(object) {
                return object == null ? undefined : object[key];
            };
        }
        module.exports = baseProperty;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseGet = __webpack_require__(547);
        function basePropertyDeep(path) {
            return function(object) {
                return baseGet(object, path);
            };
        }
        module.exports = basePropertyDeep;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseFindIndex = __webpack_require__(564), baseIteratee = __webpack_require__(527), toInteger = __webpack_require__(565);
        var nativeMax = Math.max;
        function findIndex(array, predicate, fromIndex) {
            var length = array == null ? 0 : array.length;
            if (!length) {
                return -1;
            }
            var index = fromIndex == null ? 0 : toInteger(fromIndex);
            if (index < 0) {
                index = nativeMax(length + index, 0);
            }
            return baseFindIndex(array, baseIteratee(predicate, 3), index);
        }
        module.exports = findIndex;
    }, module => {
        function baseFindIndex(array, predicate, fromIndex, fromRight) {
            var length = array.length, index = fromIndex + (fromRight ? 1 : -1);
            while (fromRight ? index-- : ++index < length) {
                if (predicate(array[index], index, array)) {
                    return index;
                }
            }
            return -1;
        }
        module.exports = baseFindIndex;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var toFinite = __webpack_require__(566);
        function toInteger(value) {
            var result = toFinite(value), remainder = result % 1;
            return result === result ? remainder ? result - remainder : result : 0;
        }
        module.exports = toInteger;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var toNumber = __webpack_require__(513);
        var INFINITY = 1 / 0, MAX_INTEGER = 17976931348623157e292;
        function toFinite(value) {
            if (!value) {
                return value === 0 ? value : 0;
            }
            value = toNumber(value);
            if (value === INFINITY || value === -INFINITY) {
                var sign = value < 0 ? -1 : 1;
                return sign * MAX_INTEGER;
            }
            return value === value ? value : 0;
        }
        module.exports = toFinite;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseDifference = __webpack_require__(568), baseFlatten = __webpack_require__(574), baseRest = __webpack_require__(475), isArrayLikeObject = __webpack_require__(470);
        var difference = baseRest((function(array, values) {
            return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) : [];
        }));
        module.exports = difference;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var SetCache = __webpack_require__(533), arrayIncludes = __webpack_require__(569), arrayIncludesWith = __webpack_require__(573), arrayMap = __webpack_require__(555), baseUnary = __webpack_require__(421), cacheHas = __webpack_require__(537);
        var LARGE_ARRAY_SIZE = 200;
        function baseDifference(array, values, iteratee, comparator) {
            var index = -1, includes = arrayIncludes, isCommon = true, length = array.length, result = [], valuesLength = values.length;
            if (!length) {
                return result;
            }
            if (iteratee) {
                values = arrayMap(values, baseUnary(iteratee));
            }
            if (comparator) {
                includes = arrayIncludesWith;
                isCommon = false;
            } else if (values.length >= LARGE_ARRAY_SIZE) {
                includes = cacheHas;
                isCommon = false;
                values = new SetCache(values);
            }
            outer: while (++index < length) {
                var value = array[index], computed = iteratee == null ? value : iteratee(value);
                value = comparator || value !== 0 ? value : 0;
                if (isCommon && computed === computed) {
                    var valuesIndex = valuesLength;
                    while (valuesIndex--) {
                        if (values[valuesIndex] === computed) {
                            continue outer;
                        }
                    }
                    result.push(value);
                } else if (!includes(values, computed, comparator)) {
                    result.push(value);
                }
            }
            return result;
        }
        module.exports = baseDifference;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseIndexOf = __webpack_require__(570);
        function arrayIncludes(array, value) {
            var length = array == null ? 0 : array.length;
            return !!length && baseIndexOf(array, value, 0) > -1;
        }
        module.exports = arrayIncludes;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseFindIndex = __webpack_require__(564), baseIsNaN = __webpack_require__(571), strictIndexOf = __webpack_require__(572);
        function baseIndexOf(array, value, fromIndex) {
            return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
        }
        module.exports = baseIndexOf;
    }, module => {
        function baseIsNaN(value) {
            return value !== value;
        }
        module.exports = baseIsNaN;
    }, module => {
        function strictIndexOf(array, value, fromIndex) {
            var index = fromIndex - 1, length = array.length;
            while (++index < length) {
                if (array[index] === value) {
                    return index;
                }
            }
            return -1;
        }
        module.exports = strictIndexOf;
    }, module => {
        function arrayIncludesWith(array, value, comparator) {
            var index = -1, length = array == null ? 0 : array.length;
            while (++index < length) {
                if (comparator(value, array[index])) {
                    return true;
                }
            }
            return false;
        }
        module.exports = arrayIncludesWith;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var arrayPush = __webpack_require__(440), isFlattenable = __webpack_require__(575);
        function baseFlatten(array, depth, predicate, isStrict, result) {
            var index = -1, length = array.length;
            predicate || (predicate = isFlattenable);
            result || (result = []);
            while (++index < length) {
                var value = array[index];
                if (depth > 0 && predicate(value)) {
                    if (depth > 1) {
                        baseFlatten(value, depth - 1, predicate, isStrict, result);
                    } else {
                        arrayPush(result, value);
                    }
                } else if (!isStrict) {
                    result[result.length] = value;
                }
            }
            return result;
        }
        module.exports = baseFlatten;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var Symbol = __webpack_require__(377), isArguments = __webpack_require__(411), isArray = __webpack_require__(414);
        var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
        function isFlattenable(value) {
            return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
        }
        module.exports = isFlattenable;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var arrayMap = __webpack_require__(555), baseClone = __webpack_require__(357), baseUnset = __webpack_require__(577), castPath = __webpack_require__(548), copyObject = __webpack_require__(407), customOmitClone = __webpack_require__(581), flatRest = __webpack_require__(582), getAllKeysIn = __webpack_require__(444);
        var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
        var omit = flatRest((function(object, paths) {
            var result = {};
            if (object == null) {
                return result;
            }
            var isDeep = false;
            paths = arrayMap(paths, (function(path) {
                path = castPath(path, object);
                isDeep || (isDeep = path.length > 1);
                return path;
            }));
            copyObject(object, getAllKeysIn(object), result);
            if (isDeep) {
                result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
            }
            var length = paths.length;
            while (length--) {
                baseUnset(result, paths[length]);
            }
            return result;
        }));
        module.exports = omit;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var castPath = __webpack_require__(548), last = __webpack_require__(578), parent = __webpack_require__(579), toKey = __webpack_require__(556);
        function baseUnset(object, path) {
            path = castPath(path, object);
            object = parent(object, path);
            return object == null || delete object[toKey(last(path))];
        }
        module.exports = baseUnset;
    }, module => {
        function last(array) {
            var length = array == null ? 0 : array.length;
            return length ? array[length - 1] : undefined;
        }
        module.exports = last;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseGet = __webpack_require__(547), baseSlice = __webpack_require__(580);
        function parent(object, path) {
            return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
        }
        module.exports = parent;
    }, module => {
        function baseSlice(array, start, end) {
            var index = -1, length = array.length;
            if (start < 0) {
                start = -start > length ? 0 : length + start;
            }
            end = end > length ? length : end;
            if (end < 0) {
                end += length;
            }
            length = start > end ? 0 : end - start >>> 0;
            start >>>= 0;
            var result = Array(length);
            while (++index < length) {
                result[index] = array[index + start];
            }
            return result;
        }
        module.exports = baseSlice;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var isPlainObject = __webpack_require__(471);
        function customOmitClone(value) {
            return isPlainObject(value) ? undefined : value;
        }
        module.exports = customOmitClone;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var flatten = __webpack_require__(583), overRest = __webpack_require__(477), setToString = __webpack_require__(479);
        function flatRest(func) {
            return setToString(overRest(func, undefined, flatten), func + "");
        }
        module.exports = flatRest;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseFlatten = __webpack_require__(574);
        function flatten(array) {
            var length = array == null ? 0 : array.length;
            return length ? baseFlatten(array, 1) : [];
        }
        module.exports = flatten;
    }, module => {
        "use strict";
        var hasOwnProperty = Object.prototype.hasOwnProperty;
        function is(x, y) {
            if (x === y) {
                return x !== 0 || y !== 0 || 1 / x === 1 / y;
            } else {
                return x !== x && y !== y;
            }
        }
        function shallowEqual(objA, objB) {
            if (is(objA, objB)) {
                return true;
            }
            if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) {
                return false;
            }
            var keysA = Object.keys(objA);
            var keysB = Object.keys(objB);
            if (keysA.length !== keysB.length) {
                return false;
            }
            for (var i = 0; i < keysA.length; i++) {
                if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
                    return false;
                }
            }
            return true;
        }
        module.exports = shallowEqual;
    }, module => {
        "use strict";
        var REACT_STATICS = {
            childContextTypes: true,
            contextTypes: true,
            defaultProps: true,
            displayName: true,
            getDefaultProps: true,
            getDerivedStateFromProps: true,
            mixins: true,
            propTypes: true,
            type: true
        };
        var KNOWN_STATICS = {
            name: true,
            length: true,
            prototype: true,
            caller: true,
            callee: true,
            arguments: true,
            arity: true
        };
        var defineProperty = Object.defineProperty;
        var getOwnPropertyNames = Object.getOwnPropertyNames;
        var getOwnPropertySymbols = Object.getOwnPropertySymbols;
        var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
        var getPrototypeOf = Object.getPrototypeOf;
        var objectPrototype = getPrototypeOf && getPrototypeOf(Object);
        function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
            if (typeof sourceComponent !== "string") {
                if (objectPrototype) {
                    var inheritedComponent = getPrototypeOf(sourceComponent);
                    if (inheritedComponent && inheritedComponent !== objectPrototype) {
                        hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
                    }
                }
                var keys = getOwnPropertyNames(sourceComponent);
                if (getOwnPropertySymbols) {
                    keys = keys.concat(getOwnPropertySymbols(sourceComponent));
                }
                for (var i = 0; i < keys.length; ++i) {
                    var key = keys[i];
                    if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {
                        var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
                        try {
                            defineProperty(targetComponent, key, descriptor);
                        } catch (e) {}
                    }
                }
                return targetComponent;
            }
            return targetComponent;
        }
        module.exports = hoistNonReactStatics;
    }, (__unused_webpack_module, exports) => {
        "use strict";
        var __webpack_unused_export__;
        __webpack_unused_export__ = {
            value: true
        };
        var createChangeEmitter = exports.E = function createChangeEmitter() {
            var currentListeners = [];
            var nextListeners = currentListeners;
            function ensureCanMutateNextListeners() {
                if (nextListeners === currentListeners) {
                    nextListeners = currentListeners.slice();
                }
            }
            function listen(listener) {
                if (typeof listener !== "function") {
                    throw new Error("Expected listener to be a function.");
                }
                var isSubscribed = true;
                ensureCanMutateNextListeners();
                nextListeners.push(listener);
                return function() {
                    if (!isSubscribed) {
                        return;
                    }
                    isSubscribed = false;
                    ensureCanMutateNextListeners();
                    var index = nextListeners.indexOf(listener);
                    nextListeners.splice(index, 1);
                };
            }
            function emit() {
                currentListeners = nextListeners;
                var listeners = currentListeners;
                for (var i = 0; i < listeners.length; i++) {
                    listeners[i].apply(listeners, arguments);
                }
            }
            return {
                listen,
                emit
            };
        };
    }, module => {
        function noop() {}
        module.exports = noop;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var basePick = __webpack_require__(589), flatRest = __webpack_require__(582);
        var pick = flatRest((function(object, paths) {
            return object == null ? {} : basePick(object, paths);
        }));
        module.exports = pick;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var basePickBy = __webpack_require__(590), hasIn = __webpack_require__(557);
        function basePick(object, paths) {
            return basePickBy(object, paths, (function(value, path) {
                return hasIn(object, path);
            }));
        }
        module.exports = basePick;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseGet = __webpack_require__(547), baseSet = __webpack_require__(591), castPath = __webpack_require__(548);
        function basePickBy(object, paths, predicate) {
            var index = -1, length = paths.length, result = {};
            while (++index < length) {
                var path = paths[index], value = baseGet(object, path);
                if (predicate(value, path)) {
                    baseSet(result, castPath(path, object), value);
                }
            }
            return result;
        }
        module.exports = basePickBy;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var assignValue = __webpack_require__(403), castPath = __webpack_require__(548), isIndex = __webpack_require__(417), isObject = __webpack_require__(382), toKey = __webpack_require__(556);
        function baseSet(object, path, value, customizer) {
            if (!isObject(object)) {
                return object;
            }
            path = castPath(path, object);
            var index = -1, length = path.length, lastIndex = length - 1, nested = object;
            while (nested != null && ++index < length) {
                var key = toKey(path[index]), newValue = value;
                if (key === "__proto__" || key === "constructor" || key === "prototype") {
                    return object;
                }
                if (index != lastIndex) {
                    var objValue = nested[key];
                    newValue = customizer ? customizer(objValue, key, nested) : undefined;
                    if (newValue === undefined) {
                        newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
                    }
                }
                assignValue(nested, key, newValue);
                nested = nested[key];
            }
            return object;
        }
        module.exports = baseSet;
    }, (__unused_webpack_module, exports) => {
        "use strict";
        var __webpack_unused_export__;
        __webpack_unused_export__ = {
            value: true
        };
        var prefix = "fas";
        var iconName = "ban";
        var width = 512;
        var height = 512;
        var ligatures = [];
        var unicode = "f05e";
        var svgPathData = "M256 8C119.034 8 8 119.033 8 256s111.034 248 248 248 248-111.034 248-248S392.967 8 256 8zm130.108 117.892c65.448 65.448 70 165.481 20.677 235.637L150.47 105.216c70.204-49.356 170.226-44.735 235.638 20.676zM125.892 386.108c-65.448-65.448-70-165.481-20.677-235.637L361.53 406.784c-70.203 49.356-170.226 44.736-235.638-20.676z";
        exports.DF = {
            prefix,
            iconName,
            icon: [ width, height, ligatures, unicode, svgPathData ]
        };
        exports.gP = exports.DF;
        __webpack_unused_export__ = prefix;
        __webpack_unused_export__ = iconName;
        __webpack_unused_export__ = width;
        __webpack_unused_export__ = height;
        __webpack_unused_export__ = ligatures;
        __webpack_unused_export__ = unicode;
        __webpack_unused_export__ = svgPathData;
    }, (__unused_webpack_module, exports) => {
        "use strict";
        var __webpack_unused_export__;
        __webpack_unused_export__ = {
            value: true
        };
        var prefix = "fas";
        var iconName = "exclamation-triangle";
        var width = 576;
        var height = 512;
        var ligatures = [];
        var unicode = "f071";
        var svgPathData = "M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z";
        exports.DF = {
            prefix,
            iconName,
            icon: [ width, height, ligatures, unicode, svgPathData ]
        };
        exports.eH = exports.DF;
        __webpack_unused_export__ = prefix;
        __webpack_unused_export__ = iconName;
        __webpack_unused_export__ = width;
        __webpack_unused_export__ = height;
        __webpack_unused_export__ = ligatures;
        __webpack_unused_export__ = unicode;
        __webpack_unused_export__ = svgPathData;
    }, (__unused_webpack_module, exports) => {
        "use strict";
        var __webpack_unused_export__;
        __webpack_unused_export__ = {
            value: true
        };
        var prefix = "fas";
        var iconName = "check-circle";
        var width = 512;
        var height = 512;
        var ligatures = [];
        var unicode = "f058";
        var svgPathData = "M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z";
        exports.DF = {
            prefix,
            iconName,
            icon: [ width, height, ligatures, unicode, svgPathData ]
        };
        exports.f8 = exports.DF;
        __webpack_unused_export__ = prefix;
        __webpack_unused_export__ = iconName;
        __webpack_unused_export__ = width;
        __webpack_unused_export__ = height;
        __webpack_unused_export__ = ligatures;
        __webpack_unused_export__ = unicode;
        __webpack_unused_export__ = svgPathData;
    }, (__unused_webpack_module, exports) => {
        "use strict";
        var __webpack_unused_export__;
        __webpack_unused_export__ = {
            value: true
        };
        var prefix = "fas";
        var iconName = "lightbulb";
        var width = 352;
        var height = 512;
        var ligatures = [];
        var unicode = "f0eb";
        var svgPathData = "M96.06 454.35c.01 6.29 1.87 12.45 5.36 17.69l17.09 25.69a31.99 31.99 0 0 0 26.64 14.28h61.71a31.99 31.99 0 0 0 26.64-14.28l17.09-25.69a31.989 31.989 0 0 0 5.36-17.69l.04-38.35H96.01l.05 38.35zM0 176c0 44.37 16.45 84.85 43.56 115.78 16.52 18.85 42.36 58.23 52.21 91.45.04.26.07.52.11.78h160.24c.04-.26.07-.51.11-.78 9.85-33.22 35.69-72.6 52.21-91.45C335.55 260.85 352 220.37 352 176 352 78.61 272.91-.3 175.45 0 73.44.31 0 82.97 0 176zm176-80c-44.11 0-80 35.89-80 80 0 8.84-7.16 16-16 16s-16-7.16-16-16c0-61.76 50.24-112 112-112 8.84 0 16 7.16 16 16s-7.16 16-16 16z";
        exports.DF = {
            prefix,
            iconName,
            icon: [ width, height, ligatures, unicode, svgPathData ]
        };
        exports.X8 = exports.DF;
        __webpack_unused_export__ = prefix;
        __webpack_unused_export__ = iconName;
        __webpack_unused_export__ = width;
        __webpack_unused_export__ = height;
        __webpack_unused_export__ = ligatures;
        __webpack_unused_export__ = unicode;
        __webpack_unused_export__ = svgPathData;
    }, (__unused_webpack_module, exports) => {
        "use strict";
        var __webpack_unused_export__;
        __webpack_unused_export__ = {
            value: true
        };
        var prefix = "fas";
        var iconName = "times";
        var width = 352;
        var height = 512;
        var ligatures = [];
        var unicode = "f00d";
        var svgPathData = "M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z";
        exports.DF = {
            prefix,
            iconName,
            icon: [ width, height, ligatures, unicode, svgPathData ]
        };
        exports.NB = exports.DF;
        __webpack_unused_export__ = prefix;
        __webpack_unused_export__ = iconName;
        __webpack_unused_export__ = width;
        __webpack_unused_export__ = height;
        __webpack_unused_export__ = ligatures;
        __webpack_unused_export__ = unicode;
        __webpack_unused_export__ = svgPathData;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var arrayEvery = __webpack_require__(598), baseEvery = __webpack_require__(599), baseIteratee = __webpack_require__(527), isArray = __webpack_require__(414), isIterateeCall = __webpack_require__(483);
        function every(collection, predicate, guard) {
            var func = isArray(collection) ? arrayEvery : baseEvery;
            if (guard && isIterateeCall(collection, predicate, guard)) {
                predicate = undefined;
            }
            return func(collection, baseIteratee(predicate, 3));
        }
        module.exports = every;
    }, module => {
        function arrayEvery(array, predicate) {
            var index = -1, length = array == null ? 0 : array.length;
            while (++index < length) {
                if (!predicate(array[index], index, array)) {
                    return false;
                }
            }
            return true;
        }
        module.exports = arrayEvery;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseEach = __webpack_require__(600);
        function baseEvery(collection, predicate) {
            var result = true;
            baseEach(collection, (function(value, index, collection) {
                result = !!predicate(value, index, collection);
                return result;
            }));
            return result;
        }
        module.exports = baseEvery;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseForOwn = __webpack_require__(601), createBaseEach = __webpack_require__(602);
        var baseEach = createBaseEach(baseForOwn);
        module.exports = baseEach;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseFor = __webpack_require__(467), keys = __webpack_require__(408);
        function baseForOwn(object, iteratee) {
            return object && baseFor(object, iteratee, keys);
        }
        module.exports = baseForOwn;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var isArrayLike = __webpack_require__(427);
        function createBaseEach(eachFunc, fromRight) {
            return function(collection, iteratee) {
                if (collection == null) {
                    return collection;
                }
                if (!isArrayLike(collection)) {
                    return eachFunc(collection, iteratee);
                }
                var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection);
                while (fromRight ? index-- : ++index < length) {
                    if (iteratee(iterable[index], index, iterable) === false) {
                        break;
                    }
                }
                return collection;
            };
        }
        module.exports = createBaseEach;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var arrayFilter = __webpack_require__(436), baseFilter = __webpack_require__(604), baseIteratee = __webpack_require__(527), isArray = __webpack_require__(414);
        function filter(collection, predicate) {
            var func = isArray(collection) ? arrayFilter : baseFilter;
            return func(collection, baseIteratee(predicate, 3));
        }
        module.exports = filter;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseEach = __webpack_require__(600);
        function baseFilter(collection, predicate) {
            var result = [];
            baseEach(collection, (function(value, index, collection) {
                if (predicate(value, index, collection)) {
                    result.push(value);
                }
            }));
            return result;
        }
        module.exports = baseFilter;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseIndexOf = __webpack_require__(570), isArrayLike = __webpack_require__(427), isString = __webpack_require__(606), toInteger = __webpack_require__(565), values = __webpack_require__(607);
        var nativeMax = Math.max;
        function includes(collection, value, fromIndex, guard) {
            collection = isArrayLike(collection) ? collection : values(collection);
            fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0;
            var length = collection.length;
            if (fromIndex < 0) {
                fromIndex = nativeMax(length + fromIndex, 0);
            }
            return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
        }
        module.exports = includes;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseGetTag = __webpack_require__(376), isArray = __webpack_require__(414), isObjectLike = __webpack_require__(413);
        var stringTag = "[object String]";
        function isString(value) {
            return typeof value == "string" || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
        }
        module.exports = isString;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseValues = __webpack_require__(608), keys = __webpack_require__(408);
        function values(object) {
            return object == null ? [] : baseValues(object, keys(object));
        }
        module.exports = values;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var arrayMap = __webpack_require__(555);
        function baseValues(object, props) {
            return arrayMap(props, (function(key) {
                return object[key];
            }));
        }
        module.exports = baseValues;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseIsEqual = __webpack_require__(530);
        function isEqual(value, other) {
            return baseIsEqual(value, other);
        }
        module.exports = isEqual;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var arrayMap = __webpack_require__(555), baseIteratee = __webpack_require__(527), baseMap = __webpack_require__(611), isArray = __webpack_require__(414);
        function map(collection, iteratee) {
            var func = isArray(collection) ? arrayMap : baseMap;
            return func(collection, baseIteratee(iteratee, 3));
        }
        module.exports = map;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseEach = __webpack_require__(600), isArrayLike = __webpack_require__(427);
        function baseMap(collection, iteratee) {
            var index = -1, result = isArrayLike(collection) ? Array(collection.length) : [];
            baseEach(collection, (function(value, key, collection) {
                result[++index] = iteratee(value, key, collection);
            }));
            return result;
        }
        module.exports = baseMap;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var arrayFilter = __webpack_require__(436), baseFilter = __webpack_require__(604), baseIteratee = __webpack_require__(527), isArray = __webpack_require__(414), negate = __webpack_require__(613);
        function reject(collection, predicate) {
            var func = isArray(collection) ? arrayFilter : baseFilter;
            return func(collection, negate(baseIteratee(predicate, 3)));
        }
        module.exports = reject;
    }, module => {
        var FUNC_ERROR_TEXT = "Expected a function";
        function negate(predicate) {
            if (typeof predicate != "function") {
                throw new TypeError(FUNC_ERROR_TEXT);
            }
            return function() {
                var args = arguments;
                switch (args.length) {
                  case 0:
                    return !predicate.call(this);

                  case 1:
                    return !predicate.call(this, args[0]);

                  case 2:
                    return !predicate.call(this, args[0], args[1]);

                  case 3:
                    return !predicate.call(this, args[0], args[1], args[2]);
                }
                return !predicate.apply(this, args);
            };
        }
        module.exports = negate;
    }, module => {
        var arrayProto = Array.prototype;
        var nativeReverse = arrayProto.reverse;
        function reverse(array) {
            return array == null ? array : nativeReverse.call(array);
        }
        module.exports = reverse;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var arraySome = __webpack_require__(536), baseIteratee = __webpack_require__(527), baseSome = __webpack_require__(616), isArray = __webpack_require__(414), isIterateeCall = __webpack_require__(483);
        function some(collection, predicate, guard) {
            var func = isArray(collection) ? arraySome : baseSome;
            if (guard && isIterateeCall(collection, predicate, guard)) {
                predicate = undefined;
            }
            return func(collection, baseIteratee(predicate, 3));
        }
        module.exports = some;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseEach = __webpack_require__(600);
        function baseSome(collection, predicate) {
            var result;
            baseEach(collection, (function(value, index, collection) {
                result = predicate(value, index, collection);
                return !result;
            }));
            return !!result;
        }
        module.exports = baseSome;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var baseFlatten = __webpack_require__(574), baseOrderBy = __webpack_require__(618), baseRest = __webpack_require__(475), isIterateeCall = __webpack_require__(483);
        var sortBy = baseRest((function(collection, iteratees) {
            if (collection == null) {
                return [];
            }
            var length = iteratees.length;
            if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
                iteratees = [];
            } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
                iteratees = [ iteratees[0] ];
            }
            return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
        }));
        module.exports = sortBy;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var arrayMap = __webpack_require__(555), baseGet = __webpack_require__(547), baseIteratee = __webpack_require__(527), baseMap = __webpack_require__(611), baseSortBy = __webpack_require__(619), baseUnary = __webpack_require__(421), compareMultiple = __webpack_require__(620), identity = __webpack_require__(476), isArray = __webpack_require__(414);
        function baseOrderBy(collection, iteratees, orders) {
            if (iteratees.length) {
                iteratees = arrayMap(iteratees, (function(iteratee) {
                    if (isArray(iteratee)) {
                        return function(value) {
                            return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
                        };
                    }
                    return iteratee;
                }));
            } else {
                iteratees = [ identity ];
            }
            var index = -1;
            iteratees = arrayMap(iteratees, baseUnary(baseIteratee));
            var result = baseMap(collection, (function(value, key, collection) {
                var criteria = arrayMap(iteratees, (function(iteratee) {
                    return iteratee(value);
                }));
                return {
                    criteria,
                    index: ++index,
                    value
                };
            }));
            return baseSortBy(result, (function(object, other) {
                return compareMultiple(object, other, orders);
            }));
        }
        module.exports = baseOrderBy;
    }, module => {
        function baseSortBy(array, comparer) {
            var length = array.length;
            array.sort(comparer);
            while (length--) {
                array[length] = array[length].value;
            }
            return array;
        }
        module.exports = baseSortBy;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var compareAscending = __webpack_require__(621);
        function compareMultiple(object, other, orders) {
            var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
            while (++index < length) {
                var result = compareAscending(objCriteria[index], othCriteria[index]);
                if (result) {
                    if (index >= ordersLength) {
                        return result;
                    }
                    var order = orders[index];
                    return result * (order == "desc" ? -1 : 1);
                }
            }
            return object.index - other.index;
        }
        module.exports = compareMultiple;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var isSymbol = __webpack_require__(514);
        function compareAscending(value, other) {
            if (value !== other) {
                var valIsDefined = value !== undefined, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value);
                var othIsDefined = other !== undefined, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other);
                if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
                    return 1;
                }
                if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
                    return -1;
                }
            }
            return 0;
        }
        module.exports = compareAscending;
    }, (__unused_webpack_module, exports) => {
        "use strict";
        var __webpack_unused_export__;
        __webpack_unused_export__ = {
            value: true
        };
        var prefix = "fas";
        var iconName = "chevron-left";
        var width = 320;
        var height = 512;
        var ligatures = [];
        var unicode = "f053";
        var svgPathData = "M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z";
        exports.DF = {
            prefix,
            iconName,
            icon: [ width, height, ligatures, unicode, svgPathData ]
        };
        exports.A3 = exports.DF;
        __webpack_unused_export__ = prefix;
        __webpack_unused_export__ = iconName;
        __webpack_unused_export__ = width;
        __webpack_unused_export__ = height;
        __webpack_unused_export__ = ligatures;
        __webpack_unused_export__ = unicode;
        __webpack_unused_export__ = svgPathData;
    }, (__unused_webpack_module, exports) => {
        "use strict";
        var __webpack_unused_export__;
        __webpack_unused_export__ = {
            value: true
        };
        var prefix = "fas";
        var iconName = "chevron-right";
        var width = 320;
        var height = 512;
        var ligatures = [];
        var unicode = "f054";
        var svgPathData = "M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z";
        exports.DF = {
            prefix,
            iconName,
            icon: [ width, height, ligatures, unicode, svgPathData ]
        };
        exports._t = exports.DF;
        __webpack_unused_export__ = prefix;
        __webpack_unused_export__ = iconName;
        __webpack_unused_export__ = width;
        __webpack_unused_export__ = height;
        __webpack_unused_export__ = ligatures;
        __webpack_unused_export__ = unicode;
        __webpack_unused_export__ = svgPathData;
    }, (__unused_webpack_module, exports) => {
        "use strict";
        var __webpack_unused_export__;
        __webpack_unused_export__ = {
            value: true
        };
        var prefix = "fas";
        var iconName = "sort";
        var width = 320;
        var height = 512;
        var ligatures = [];
        var unicode = "f0dc";
        var svgPathData = "M41 288h238c21.4 0 32.1 25.9 17 41L177 448c-9.4 9.4-24.6 9.4-33.9 0L24 329c-15.1-15.1-4.4-41 17-41zm255-105L177 64c-9.4-9.4-24.6-9.4-33.9 0L24 183c-15.1 15.1-4.4 41 17 41h238c21.4 0 32.1-25.9 17-41z";
        exports.DF = {
            prefix,
            iconName,
            icon: [ width, height, ligatures, unicode, svgPathData ]
        };
        exports.Cm = exports.DF;
        __webpack_unused_export__ = prefix;
        __webpack_unused_export__ = iconName;
        __webpack_unused_export__ = width;
        __webpack_unused_export__ = height;
        __webpack_unused_export__ = ligatures;
        __webpack_unused_export__ = unicode;
        __webpack_unused_export__ = svgPathData;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        const IPC = __webpack_require__(626);
        class IPCModule extends IPC {
            constructor() {
                super();
                Object.defineProperty(this, "IPC", {
                    enumerable: true,
                    writable: false,
                    value: IPC
                });
            }
        }
        module.exports = new IPCModule;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        const Defaults = __webpack_require__(627), Client = __webpack_require__(628), Server = __webpack_require__(637), util = __webpack_require__(58);
        class IPC {
            constructor() {
                Object.defineProperties(this, {
                    config: {
                        enumerable: true,
                        writable: true,
                        value: new Defaults
                    },
                    connectTo: {
                        enumerable: true,
                        writable: false,
                        value: connect
                    },
                    connectToNet: {
                        enumerable: true,
                        writable: false,
                        value: connectNet
                    },
                    disconnect: {
                        enumerable: true,
                        writable: false,
                        value: disconnect
                    },
                    serve: {
                        enumerable: true,
                        writable: false,
                        value: serve
                    },
                    serveNet: {
                        enumerable: true,
                        writable: false,
                        value: serveNet
                    },
                    of: {
                        enumerable: true,
                        writable: true,
                        value: {}
                    },
                    server: {
                        enumerable: true,
                        writable: true,
                        configurable: true,
                        value: false
                    },
                    log: {
                        enumerable: true,
                        writable: false,
                        value: log
                    }
                });
            }
        }
        function log(...args) {
            if (this.config.silent) {
                return;
            }
            for (let i = 0, count = args.length; i < count; i++) {
                if (typeof args[i] != "object") {
                    continue;
                }
                args[i] = util.inspect(args[i], {
                    depth: this.config.logDepth,
                    colors: this.config.logInColor
                });
            }
            this.config.logger(args.join(" "));
        }
        function disconnect(id) {
            if (!this.of[id]) {
                return;
            }
            this.of[id].explicitlyDisconnected = true;
            this.of[id].off("*", "*");
            if (this.of[id].socket) {
                if (this.of[id].socket.destroy) {
                    this.of[id].socket.destroy();
                }
            }
            delete this.of[id];
        }
        function serve(path, callback) {
            if (typeof path == "function") {
                callback = path;
                path = false;
            }
            if (!path) {
                this.log("Server path not specified, so defaulting to", "ipc.config.socketRoot + ipc.config.appspace + ipc.config.id", this.config.socketRoot + this.config.appspace + this.config.id);
                path = this.config.socketRoot + this.config.appspace + this.config.id;
            }
            if (!callback) {
                callback = emptyCallback;
            }
            this.server = new Server(path, this.config, log);
            this.server.on("start", callback);
        }
        function emptyCallback() {}
        function serveNet(host, port, UDPType, callback) {
            if (typeof host == "number") {
                callback = UDPType;
                UDPType = port;
                port = host;
                host = false;
            }
            if (typeof host == "function") {
                callback = host;
                UDPType = false;
                host = false;
                port = false;
            }
            if (!host) {
                this.log("Server host not specified, so defaulting to", "ipc.config.networkHost", this.config.networkHost);
                host = this.config.networkHost;
            }
            if (host.toLowerCase() == "udp4" || host.toLowerCase() == "udp6") {
                callback = port;
                UDPType = host.toLowerCase();
                port = false;
                host = this.config.networkHost;
            }
            if (typeof port == "string") {
                callback = UDPType;
                UDPType = port;
                port = false;
            }
            if (typeof port == "function") {
                callback = port;
                UDPType = false;
                port = false;
            }
            if (!port) {
                this.log("Server port not specified, so defaulting to", "ipc.config.networkPort", this.config.networkPort);
                port = this.config.networkPort;
            }
            if (typeof UDPType == "function") {
                callback = UDPType;
                UDPType = false;
            }
            if (!callback) {
                callback = emptyCallback;
            }
            this.server = new Server(host, this.config, log, port);
            if (UDPType) {
                this.server[UDPType] = true;
                if (UDPType === "udp4" && host === "::1") {
                    this.server.path = "127.0.0.1";
                }
            }
            this.server.on("start", callback);
        }
        function connect(id, path, callback) {
            if (typeof path == "function") {
                callback = path;
                path = false;
            }
            if (!callback) {
                callback = emptyCallback;
            }
            if (!id) {
                this.log("Service id required", "Requested service connection without specifying service id. Aborting connection attempt");
                return;
            }
            if (!path) {
                this.log("Service path not specified, so defaulting to", "ipc.config.socketRoot + ipc.config.appspace + id", (this.config.socketRoot + this.config.appspace + id).data);
                path = this.config.socketRoot + this.config.appspace + id;
            }
            if (this.of[id]) {
                if (!this.of[id].socket.destroyed) {
                    this.log("Already Connected to", id, "- So executing success without connection");
                    callback();
                    return;
                }
                this.of[id].socket.destroy();
            }
            this.of[id] = new Client(this.config, this.log);
            this.of[id].id = id;
            this.of[id].path = path;
            this.of[id].connect();
            callback(this);
        }
        function connectNet(id, host, port, callback) {
            if (!id) {
                this.log("Service id required", "Requested service connection without specifying service id. Aborting connection attempt");
                return;
            }
            if (typeof host == "number") {
                callback = port;
                port = host;
                host = false;
            }
            if (typeof host == "function") {
                callback = host;
                host = false;
                port = false;
            }
            if (!host) {
                this.log("Server host not specified, so defaulting to", "ipc.config.networkHost", this.config.networkHost);
                host = this.config.networkHost;
            }
            if (typeof port == "function") {
                callback = port;
                port = false;
            }
            if (!port) {
                this.log("Server port not specified, so defaulting to", "ipc.config.networkPort", this.config.networkPort);
                port = this.config.networkPort;
            }
            if (typeof callback == "string") {
                UDPType = callback;
                callback = false;
            }
            if (!callback) {
                callback = emptyCallback;
            }
            if (this.of[id]) {
                if (!this.of[id].socket.destroyed) {
                    this.log("Already Connected to", id, "- So executing success without connection");
                    callback();
                    return;
                }
                this.of[id].socket.destroy();
            }
            this.of[id] = new Client(this.config, this.log);
            this.of[id].id = id;
            this.of[id].path = host;
            this.of[id].port = port;
            this.of[id].connect();
            callback(this);
        }
        module.exports = IPC;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        const os = __webpack_require__(93);
        class Defaults {
            constructor() {
                this.appspace = "app.";
                this.socketRoot = "/tmp/";
                this.id = os.hostname();
                this.encoding = "utf8";
                this.rawBuffer = false;
                this.sync = false;
                this.unlink = true;
                this.delimiter = "\f";
                this.silent = false;
                this.logDepth = 5;
                this.logInColor = true;
                this.logger = console.log.bind(console);
                this.maxConnections = 100;
                this.retry = 500;
                this.maxRetries = Infinity;
                this.stopRetrying = false;
                this.IPType = getIPType();
                this.tls = false;
                this.networkHost = this.IPType == "IPv6" ? "::1" : "127.0.0.1";
                this.networkPort = 8e3;
                this.interface = {
                    localAddress: false,
                    localPort: false,
                    family: false,
                    hints: false,
                    lookup: false
                };
            }
        }
        function getIPType() {
            const networkInterfaces = os.networkInterfaces();
            let IPType = "";
            if (networkInterfaces && Array.isArray(networkInterfaces) && networkInterfaces.length > 0) {
                IPType = networkInterfaces[Object.keys(networkInterfaces)[0]][0].family;
            }
            return IPType;
        }
        module.exports = Defaults;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        const net = __webpack_require__(629), tls = __webpack_require__(630), EventParser = __webpack_require__(631), Message = __webpack_require__(632), fs = __webpack_require__(14), Queue = __webpack_require__(633), Events = __webpack_require__(634);
        let eventParser = new EventParser;
        class Client extends Events {
            constructor(config, log) {
                super();
                Object.assign(this, {
                    Client,
                    config,
                    queue: new Queue,
                    socket: false,
                    connect,
                    emit,
                    log,
                    retriesRemaining: config.maxRetries || 0,
                    explicitlyDisconnected: false
                });
                eventParser = new EventParser(this.config);
            }
        }
        function emit(type, data) {
            this.log("dispatching event to ", this.id, this.path, " : ", type, ",", data);
            let message = new Message;
            message.type = type;
            message.data = data;
            if (this.config.rawBuffer) {
                message = Buffer.from(type, this.config.encoding);
            } else {
                message = eventParser.format(message);
            }
            if (!this.config.sync) {
                this.socket.write(message);
                return;
            }
            this.queue.add(syncEmit.bind(this, message));
        }
        function syncEmit(message) {
            this.log("dispatching event to ", this.id, this.path, " : ", message);
            this.socket.write(message);
        }
        function connect() {
            let client = this;
            client.log("requested connection to ", client.id, client.path);
            if (!this.path) {
                client.log("\n\n######\nerror: ", client.id, " client has not specified socket path it wishes to connect to.");
                return;
            }
            const options = {};
            if (!client.port) {
                client.log("Connecting client on Unix Socket :", client.path);
                options.path = client.path;
                if (process.platform === "win32" && !client.path.startsWith("\\\\.\\pipe\\")) {
                    options.path = options.path.replace(/^\//, "");
                    options.path = options.path.replace(/\//g, "-");
                    options.path = `\\\\.\\pipe\\${options.path}`;
                }
                client.socket = net.connect(options);
            } else {
                options.host = client.path;
                options.port = client.port;
                if (client.config.interface.localAddress) {
                    options.localAddress = client.config.interface.localAddress;
                }
                if (client.config.interface.localPort) {
                    options.localPort = client.config.interface.localPort;
                }
                if (client.config.interface.family) {
                    options.family = client.config.interface.family;
                }
                if (client.config.interface.hints) {
                    options.hints = client.config.interface.hints;
                }
                if (client.config.interface.lookup) {
                    options.lookup = client.config.interface.lookup;
                }
                if (!client.config.tls) {
                    client.log("Connecting client via TCP to", options);
                    client.socket = net.connect(options);
                } else {
                    client.log("Connecting client via TLS to", client.path, client.port, client.config.tls);
                    if (client.config.tls.private) {
                        client.config.tls.key = fs.readFileSync(client.config.tls.private);
                    }
                    if (client.config.tls.public) {
                        client.config.tls.cert = fs.readFileSync(client.config.tls.public);
                    }
                    if (client.config.tls.trustedConnections) {
                        if (typeof client.config.tls.trustedConnections === "string") {
                            client.config.tls.trustedConnections = [ client.config.tls.trustedConnections ];
                        }
                        client.config.tls.ca = [];
                        for (let i = 0; i < client.config.tls.trustedConnections.length; i++) {
                            client.config.tls.ca.push(fs.readFileSync(client.config.tls.trustedConnections[i]));
                        }
                    }
                    Object.assign(client.config.tls, options);
                    client.socket = tls.connect(client.config.tls);
                }
            }
            client.socket.setEncoding(this.config.encoding);
            client.socket.on("error", (function(err) {
                client.log("\n\n######\nerror: ", err);
                client.publish("error", err);
            }));
            client.socket.on("connect", (function connectionMade() {
                client.publish("connect");
                client.retriesRemaining = client.config.maxRetries;
                client.log("retrying reset");
            }));
            client.socket.on("close", (function connectionClosed() {
                client.log("connection closed", client.id, client.path, client.retriesRemaining, "tries remaining of", client.config.maxRetries);
                if (client.config.stopRetrying || client.retriesRemaining < 1 || client.explicitlyDisconnected) {
                    client.publish("disconnect");
                    client.log(client.config.id, "exceeded connection rety amount of", " or stopRetrying flag set.");
                    client.socket.destroy();
                    client.publish("destroy");
                    client = undefined;
                    return;
                }
                setTimeout(function retryTimeout() {
                    client.retriesRemaining--;
                    client.connect();
                }.bind(null, client), client.config.retry);
                client.publish("disconnect");
            }));
            client.socket.on("data", (function(data) {
                client.log("## received events ##");
                if (client.config.rawBuffer) {
                    client.publish("data", Buffer.from(data, client.config.encoding));
                    if (!client.config.sync) {
                        return;
                    }
                    client.queue.next();
                    return;
                }
                if (!this.ipcBuffer) {
                    this.ipcBuffer = "";
                }
                data = this.ipcBuffer += data;
                if (data.slice(-1) != eventParser.delimiter || data.indexOf(eventParser.delimiter) == -1) {
                    client.log("Messages are large, You may want to consider smaller messages.");
                    return;
                }
                this.ipcBuffer = "";
                const events = eventParser.parse(data);
                const eCount = events.length;
                for (let i = 0; i < eCount; i++) {
                    let message = new Message;
                    message.load(events[i]);
                    client.log("detected event", message.type, message.data);
                    client.publish(message.type, message.data);
                }
                if (!client.config.sync) {
                    return;
                }
                client.queue.next();
            }));
        }
        module.exports = Client;
    }, module => {
        "use strict";
        module.exports = require("net");
    }, module => {
        "use strict";
        module.exports = require("tls");
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        const Defaults = __webpack_require__(627);
        class Parser {
            constructor(config) {
                if (!config) {
                    config = new Defaults;
                }
                this.delimiter = config.delimiter;
            }
            format(message) {
                if (!message.data && message.data !== false && message.data !== 0) {
                    message.data = {};
                }
                if (message.data["_maxListeners"]) {
                    message.data = {};
                }
                message = message.JSON + this.delimiter;
                return message;
            }
            parse(data) {
                let events = data.split(this.delimiter);
                events.pop();
                return events;
            }
        }
        module.exports = Parser;
    }, module => {
        function Message() {
            Object.defineProperties(this, {
                data: {
                    enumerable: true,
                    get: getData,
                    set: setData
                },
                type: {
                    enumerable: true,
                    get: getType,
                    set: setType
                },
                load: {
                    enumerable: true,
                    writable: false,
                    value: parse
                },
                JSON: {
                    enumerable: true,
                    get: getJSON
                }
            });
            var type = "";
            var data = {};
            function getType() {
                return type;
            }
            function getData() {
                return data;
            }
            function getJSON() {
                return JSON.stringify({
                    type,
                    data
                });
            }
            function setType(value) {
                type = value;
            }
            function setData(value) {
                data = value;
            }
            function parse(message) {
                try {
                    var message = JSON.parse(message);
                    type = message.type;
                    data = message.data;
                } catch (err) {
                    var badMessage = message;
                    type = "error", data = {
                        message: "Invalid JSON response format",
                        err,
                        response: badMessage
                    };
                }
            }
        }
        module.exports = Message;
    }, module => {
        function Queue(asStack) {
            Object.defineProperties(this, {
                add: {
                    enumerable: true,
                    writable: false,
                    value: addToQueue
                },
                next: {
                    enumerable: true,
                    writable: false,
                    value: run
                },
                clear: {
                    enumerable: true,
                    writable: false,
                    value: clearQueue
                },
                contents: {
                    enumerable: false,
                    get: getQueue,
                    set: setQueue
                },
                autoRun: {
                    enumerable: true,
                    writable: true,
                    value: true
                },
                stop: {
                    enumerable: true,
                    writable: true,
                    value: false
                }
            });
            var queue = [];
            var running = false;
            var stop = false;
            function clearQueue() {
                queue = [];
                return queue;
            }
            function getQueue() {
                return queue;
            }
            function setQueue(val) {
                queue = val;
                return queue;
            }
            function addToQueue() {
                for (var i in arguments) {
                    queue.push(arguments[i]);
                }
                if (!running && !this.stop && this.autoRun) {
                    this.next();
                }
            }
            function run() {
                running = true;
                if (queue.length < 1 || this.stop) {
                    running = false;
                    return;
                }
                queue.shift().bind(this)();
            }
        }
        module.exports = Queue;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        let EventPubSub = __webpack_require__(635);
        if (process.version[1] > 5) {
            EventPubSub = __webpack_require__(636);
        }
        module.exports = EventPubSub;
    }, module => {
        "use strict";
        function EventPubSub() {
            this._events_ = {};
            this.publish = this.trigger = this.emit = emit;
            this.subscribe = this.on = on;
            this.once = once;
            this.unSubscribe = this.off = off;
            this.emit$ = emit$;
            function on(type, handler, once) {
                if (!handler) {
                    throw new ReferenceError("handler not defined.");
                }
                if (!this._events_[type]) {
                    this._events_[type] = [];
                }
                if (once) {
                    handler._once_ = once;
                }
                this._events_[type].push(handler);
                return this;
            }
            function once(type, handler) {
                return this.on(type, handler, true);
            }
            function off(type, handler) {
                if (!this._events_[type]) {
                    return this;
                }
                if (!handler) {
                    throw new ReferenceError('handler not defined. if you wish to remove all handlers from the event please pass "*" as the handler');
                }
                if (handler == "*") {
                    delete this._events_[type];
                    return this;
                }
                var handlers = this._events_[type];
                while (handlers.includes(handler)) {
                    handlers.splice(handlers.indexOf(handler), 1);
                }
                if (handlers.length < 1) {
                    delete this._events_[type];
                }
                return this;
            }
            function emit(type) {
                this.emit$.apply(this, arguments);
                if (!this._events_[type]) {
                    return this;
                }
                arguments.splice = Array.prototype.splice;
                arguments.splice(0, 1);
                var handlers = this._events_[type];
                var onceHandled = [];
                for (var i in handlers) {
                    var handler = handlers[i];
                    handler.apply(this, arguments);
                    if (handler._once_) {
                        onceHandled.push(handler);
                    }
                }
                for (var i in onceHandled) {
                    this.off(type, onceHandled[i]);
                }
                return this;
            }
            function emit$(type, args) {
                if (!this._events_["*"]) {
                    return this;
                }
                var catchAll = this._events_["*"];
                args.shift = Array.prototype.shift;
                args.shift(type);
                for (var handler of catchAll) {
                    handler.apply(this, args);
                }
                return this;
            }
            return this;
        }
        if (!Array.prototype.includes) {
            Array.prototype.includes = function(searchElement) {
                "use strict";
                if (this == null) {
                    throw new TypeError("Array.prototype.includes called on null or undefined");
                }
                var O = Object(this);
                var len = parseInt(O.length, 10) || 0;
                if (len === 0) {
                    return false;
                }
                var n = parseInt(arguments[1], 10) || 0;
                var k;
                if (n >= 0) {
                    k = n;
                } else {
                    k = len + n;
                    if (k < 0) {
                        k = 0;
                    }
                }
                var currentElement;
                while (k < len) {
                    currentElement = O[k];
                    if (searchElement === currentElement || searchElement !== searchElement && currentElement !== currentElement) {
                        return true;
                    }
                    k++;
                }
                return false;
            };
        }
        module.exports = EventPubSub;
    }, module => {
        "use strict";
        class EventPubSub {
            constructor(scope) {
                this._events_ = {};
                this.publish = this.trigger = this.emit;
                this.subscribe = this.on;
                this.unSubscribe = this.off;
            }
            on(type, handler, once) {
                if (!handler) {
                    throw new ReferenceError("handler not defined.");
                }
                if (!this._events_[type]) {
                    this._events_[type] = [];
                }
                if (once) {
                    handler._once_ = once;
                }
                this._events_[type].push(handler);
                return this;
            }
            once(type, handler) {
                return this.on(type, handler, true);
            }
            off(type, handler) {
                if (!this._events_[type]) {
                    return this;
                }
                if (!handler) {
                    throw new ReferenceError('handler not defined. if you wish to remove all handlers from the event please pass "*" as the handler');
                }
                if (handler == "*") {
                    delete this._events_[type];
                    return this;
                }
                const handlers = this._events_[type];
                while (handlers.includes(handler)) {
                    handlers.splice(handlers.indexOf(handler), 1);
                }
                if (handlers.length < 1) {
                    delete this._events_[type];
                }
                return this;
            }
            emit(type, ...args) {
                if (!this._events_[type]) {
                    return this.emit$(type, ...args);
                }
                const handlers = this._events_[type];
                const onceHandled = [];
                for (let handler of handlers) {
                    handler.apply(this, args);
                    if (handler._once_) {
                        onceHandled.push(handler);
                    }
                }
                for (let handler of onceHandled) {
                    this.off(type, handler);
                }
                return this.emit$(type, ...args);
            }
            emit$(type, ...args) {
                if (!this._events_["*"]) {
                    return this;
                }
                const catchAll = this._events_["*"];
                for (let handler of catchAll) {
                    handler.call(this, type, ...args);
                }
                return this;
            }
        }
        module.exports = EventPubSub;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var __dirname = "node_modules\\node-ipc\\dao";
        const net = __webpack_require__(629), tls = __webpack_require__(630), fs = __webpack_require__(14), dgram = __webpack_require__(638), EventParser = __webpack_require__(631), Message = __webpack_require__(632), Events = __webpack_require__(634);
        let eventParser = new EventParser;
        class Server extends Events {
            constructor(path, config, log, port) {
                super();
                Object.assign(this, {
                    config,
                    path,
                    port,
                    udp4: false,
                    udp6: false,
                    log,
                    server: false,
                    sockets: [],
                    emit,
                    broadcast
                });
                eventParser = new EventParser(this.config);
                this.on("close", serverClosed.bind(this));
            }
            onStart(socket) {
                this.trigger("start", socket);
            }
            stop() {
                this.server.close();
            }
            start() {
                if (!this.path) {
                    this.log("Socket Server Path not specified, refusing to start");
                    return;
                }
                if (this.config.unlink) {
                    fs.unlink(this.path, startServer.bind(this));
                } else {
                    startServer.bind(this)();
                }
            }
        }
        function emit(socket, type, data) {
            this.log("dispatching event to socket", " : ", type, data);
            let message = new Message;
            message.type = type;
            message.data = data;
            if (this.config.rawBuffer) {
                this.log(this.config.encoding);
                message = Buffer.from(type, this.config.encoding);
            } else {
                message = eventParser.format(message);
            }
            if (this.udp4 || this.udp6) {
                if (!socket.address || !socket.port) {
                    this.log("Attempting to emit to a single UDP socket without supplying socket address or port. Redispatching event as broadcast to all connected sockets");
                    this.broadcast(type, data);
                    return;
                }
                this.server.write(message, socket);
                return;
            }
            socket.write(message);
        }
        function broadcast(type, data) {
            this.log("broadcasting event to all known sockets listening to ", this.path, " : ", this.port ? this.port : "", type, data);
            let message = new Message;
            message.type = type;
            message.data = data;
            if (this.config.rawBuffer) {
                message = Buffer.from(type, this.config.encoding);
            } else {
                message = eventParser.format(message);
            }
            if (this.udp4 || this.udp6) {
                for (let i = 1, count = this.sockets.length; i < count; i++) {
                    this.server.write(message, this.sockets[i]);
                }
            } else {
                for (let i = 0, count = this.sockets.length; i < count; i++) {
                    this.sockets[i].write(message);
                }
            }
        }
        function serverClosed() {
            for (let i = 0, count = this.sockets.length; i < count; i++) {
                let socket = this.sockets[i];
                let destroyedSocketId = false;
                if (socket) {
                    if (socket.readable) {
                        continue;
                    }
                }
                if (socket.id) {
                    destroyedSocketId = socket.id;
                }
                this.log("socket disconnected", destroyedSocketId.toString());
                if (socket && socket.destroy) {
                    socket.destroy();
                }
                this.sockets.splice(i, 1);
                this.publish("socket.disconnected", socket, destroyedSocketId);
                return;
            }
        }
        function gotData(socket, data, UDPSocket) {
            let sock = this.udp4 || this.udp6 ? UDPSocket : socket;
            if (this.config.rawBuffer) {
                data = Buffer.from(data, this.config.encoding);
                this.publish("data", data, sock);
                return;
            }
            if (!sock.ipcBuffer) {
                sock.ipcBuffer = "";
            }
            data = sock.ipcBuffer += data;
            if (data.slice(-1) != eventParser.delimiter || data.indexOf(eventParser.delimiter) == -1) {
                this.log("Messages are large, You may want to consider smaller messages.");
                return;
            }
            sock.ipcBuffer = "";
            data = eventParser.parse(data);
            while (data.length > 0) {
                let message = new Message;
                message.load(data.shift());
                if (message.data && message.data.id) {
                    sock.id = message.data.id;
                }
                this.log("received event of : ", message.type, message.data);
                this.publish(message.type, message.data, sock);
            }
        }
        function socketClosed(socket) {
            this.publish("close", socket);
        }
        function serverCreated(socket) {
            this.sockets.push(socket);
            if (socket.setEncoding) {
                socket.setEncoding(this.config.encoding);
            }
            this.log("## socket connection to server detected ##");
            socket.on("close", socketClosed.bind(this));
            socket.on("error", function(err) {
                this.log("server socket error", err);
                this.publish("error", err);
            }.bind(this));
            socket.on("data", gotData.bind(this, socket));
            socket.on("message", function(msg, rinfo) {
                if (!rinfo) {
                    return;
                }
                this.log("Received UDP message from ", rinfo.address, rinfo.port);
                let data;
                if (this.config.rawSocket) {
                    data = Buffer.from(msg, this.config.encoding);
                } else {
                    data = msg.toString();
                }
                socket.emit("data", data, rinfo);
            }.bind(this));
            this.publish("connect", socket);
            if (this.config.rawBuffer) {
                return;
            }
        }
        function startServer() {
            this.log("starting server on ", this.path, this.port ? `:${this.port}` : "");
            if (!this.udp4 && !this.udp6) {
                this.log("starting TLS server", this.config.tls);
                if (!this.config.tls) {
                    this.server = net.createServer(serverCreated.bind(this));
                } else {
                    startTLSServer.bind(this)();
                }
            } else {
                this.server = dgram.createSocket(this.udp4 ? "udp4" : "udp6");
                this.server.write = UDPWrite.bind(this);
                this.server.on("listening", function UDPServerStarted() {
                    serverCreated.bind(this)(this.server);
                }.bind(this));
            }
            this.server.on("error", function(err) {
                this.log("server error", err);
                this.publish("error", err);
            }.bind(this));
            this.server.maxConnections = this.config.maxConnections;
            if (!this.port) {
                this.log("starting server as", "Unix || Windows Socket");
                if (process.platform === "win32") {
                    this.path = this.path.replace(/^\//, "");
                    this.path = this.path.replace(/\//g, "-");
                    this.path = `\\\\.\\pipe\\${this.path}`;
                }
                this.server.listen(this.path, this.onStart.bind(this));
                return;
            }
            if (!this.udp4 && !this.udp6) {
                this.log("starting server as", this.config.tls ? "TLS" : "TCP");
                this.server.listen(this.port, this.path, this.onStart.bind(this));
                return;
            }
            this.log("starting server as", this.udp4 ? "udp4" : "udp6");
            this.server.bind(this.port, this.path);
            this.onStart({
                address: this.path,
                port: this.port
            });
        }
        function startTLSServer() {
            this.log("starting TLS server", this.config.tls);
            if (this.config.tls.private) {
                this.config.tls.key = fs.readFileSync(this.config.tls.private);
            } else {
                this.config.tls.key = fs.readFileSync(`${__dirname}/../local-node-ipc-certs/private/server.key`);
            }
            if (this.config.tls.public) {
                this.config.tls.cert = fs.readFileSync(this.config.tls.public);
            } else {
                this.config.tls.cert = fs.readFileSync(`${__dirname}/../local-node-ipc-certs/server.pub`);
            }
            if (this.config.tls.dhparam) {
                this.config.tls.dhparam = fs.readFileSync(this.config.tls.dhparam);
            }
            if (this.config.tls.trustedConnections) {
                if (typeof this.config.tls.trustedConnections === "string") {
                    this.config.tls.trustedConnections = [ this.config.tls.trustedConnections ];
                }
                this.config.tls.ca = [];
                for (let i = 0; i < this.config.tls.trustedConnections.length; i++) {
                    this.config.tls.ca.push(fs.readFileSync(this.config.tls.trustedConnections[i]));
                }
            }
            this.server = tls.createServer(this.config.tls, serverCreated.bind(this));
        }
        function UDPWrite(message, socket) {
            let data = Buffer.from(message, this.config.encoding);
            this.server.send(data, 0, data.length, socket.port, socket.address, (function(err, bytes) {
                if (err) {
                    this.log("error writing data to socket", err);
                    this.publish("error", (function(err) {
                        this.publish("error", err);
                    }));
                }
            }));
        }
        module.exports = Server;
    }, module => {
        "use strict";
        module.exports = require("dgram");
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const internalRe = __webpack_require__(640);
        module.exports = {
            re: internalRe.re,
            src: internalRe.src,
            tokens: internalRe.t,
            SEMVER_SPEC_VERSION: __webpack_require__(641).SEMVER_SPEC_VERSION,
            SemVer: __webpack_require__(643),
            compareIdentifiers: __webpack_require__(645).compareIdentifiers,
            rcompareIdentifiers: __webpack_require__(645).rcompareIdentifiers,
            parse: __webpack_require__(646),
            valid: __webpack_require__(647),
            clean: __webpack_require__(648),
            inc: __webpack_require__(649),
            diff: __webpack_require__(650),
            major: __webpack_require__(653),
            minor: __webpack_require__(654),
            patch: __webpack_require__(655),
            prerelease: __webpack_require__(656),
            compare: __webpack_require__(652),
            rcompare: __webpack_require__(657),
            compareLoose: __webpack_require__(658),
            compareBuild: __webpack_require__(659),
            sort: __webpack_require__(660),
            rsort: __webpack_require__(661),
            gt: __webpack_require__(662),
            lt: __webpack_require__(663),
            eq: __webpack_require__(651),
            neq: __webpack_require__(664),
            gte: __webpack_require__(665),
            lte: __webpack_require__(666),
            cmp: __webpack_require__(667),
            coerce: __webpack_require__(668),
            Comparator: __webpack_require__(669),
            Range: __webpack_require__(670),
            satisfies: __webpack_require__(674),
            toComparators: __webpack_require__(675),
            maxSatisfying: __webpack_require__(676),
            minSatisfying: __webpack_require__(677),
            minVersion: __webpack_require__(678),
            validRange: __webpack_require__(679),
            outside: __webpack_require__(680),
            gtr: __webpack_require__(681),
            ltr: __webpack_require__(682),
            intersects: __webpack_require__(683),
            simplifyRange: __webpack_require__(684),
            subset: __webpack_require__(685)
        };
    }, (module, exports, __webpack_require__) => {
        const {MAX_SAFE_COMPONENT_LENGTH} = __webpack_require__(641);
        const debug = __webpack_require__(642);
        exports = module.exports = {};
        const re = exports.re = [];
        const src = exports.src = [];
        const t = exports.t = {};
        let R = 0;
        const createToken = (name, value, isGlobal) => {
            const index = R++;
            debug(index, value);
            t[name] = index;
            src[index] = value;
            re[index] = new RegExp(value, isGlobal ? "g" : undefined);
        };
        createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
        createToken("NUMERICIDENTIFIERLOOSE", "[0-9]+");
        createToken("NONNUMERICIDENTIFIER", "\\d*[a-zA-Z-][a-zA-Z0-9-]*");
        createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.` + `(${src[t.NUMERICIDENTIFIER]})\\.` + `(${src[t.NUMERICIDENTIFIER]})`);
        createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})`);
        createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`);
        createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`);
        createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
        createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
        createToken("BUILDIDENTIFIER", "[0-9A-Za-z-]+");
        createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
        createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
        createToken("FULL", `^${src[t.FULLPLAIN]}$`);
        createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
        createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
        createToken("GTLT", "((?:<|>)?=?)");
        createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
        createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
        createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + `(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?` + `)?)?`);
        createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?` + `)?)?`);
        createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
        createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
        createToken("COERCE", `${"(^|[^\\d])" + "(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})` + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + `(?:$|[^\\d])`);
        createToken("COERCERTL", src[t.COERCE], true);
        createToken("LONETILDE", "(?:~>?)");
        createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
        exports.tildeTrimReplace = "$1~";
        createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
        createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
        createToken("LONECARET", "(?:\\^)");
        createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
        exports.caretTrimReplace = "$1^";
        createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
        createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
        createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
        createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
        createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
        exports.comparatorTrimReplace = "$1$2$3";
        createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})` + `\\s+-\\s+` + `(${src[t.XRANGEPLAIN]})` + `\\s*$`);
        createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + `\\s+-\\s+` + `(${src[t.XRANGEPLAINLOOSE]})` + `\\s*$`);
        createToken("STAR", "(<|>)?=?\\s*\\*");
        createToken("GTE0", "^\\s*>=\\s*0.0.0\\s*$");
        createToken("GTE0PRE", "^\\s*>=\\s*0.0.0-0\\s*$");
    }, module => {
        const SEMVER_SPEC_VERSION = "2.0.0";
        const MAX_LENGTH = 256;
        const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
        const MAX_SAFE_COMPONENT_LENGTH = 16;
        module.exports = {
            SEMVER_SPEC_VERSION,
            MAX_LENGTH,
            MAX_SAFE_INTEGER,
            MAX_SAFE_COMPONENT_LENGTH
        };
    }, module => {
        const debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {};
        module.exports = debug;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const debug = __webpack_require__(642);
        const {MAX_LENGTH, MAX_SAFE_INTEGER} = __webpack_require__(641);
        const {re, t} = __webpack_require__(640);
        const parseOptions = __webpack_require__(644);
        const {compareIdentifiers} = __webpack_require__(645);
        class SemVer {
            constructor(version, options) {
                options = parseOptions(options);
                if (version instanceof SemVer) {
                    if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
                        return version;
                    } else {
                        version = version.version;
                    }
                } else if (typeof version !== "string") {
                    throw new TypeError(`Invalid Version: ${version}`);
                }
                if (version.length > MAX_LENGTH) {
                    throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
                }
                debug("SemVer", version, options);
                this.options = options;
                this.loose = !!options.loose;
                this.includePrerelease = !!options.includePrerelease;
                const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
                if (!m) {
                    throw new TypeError(`Invalid Version: ${version}`);
                }
                this.raw = version;
                this.major = +m[1];
                this.minor = +m[2];
                this.patch = +m[3];
                if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
                    throw new TypeError("Invalid major version");
                }
                if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
                    throw new TypeError("Invalid minor version");
                }
                if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
                    throw new TypeError("Invalid patch version");
                }
                if (!m[4]) {
                    this.prerelease = [];
                } else {
                    this.prerelease = m[4].split(".").map((id => {
                        if (/^[0-9]+$/.test(id)) {
                            const num = +id;
                            if (num >= 0 && num < MAX_SAFE_INTEGER) {
                                return num;
                            }
                        }
                        return id;
                    }));
                }
                this.build = m[5] ? m[5].split(".") : [];
                this.format();
            }
            format() {
                this.version = `${this.major}.${this.minor}.${this.patch}`;
                if (this.prerelease.length) {
                    this.version += `-${this.prerelease.join(".")}`;
                }
                return this.version;
            }
            toString() {
                return this.version;
            }
            compare(other) {
                debug("SemVer.compare", this.version, this.options, other);
                if (!(other instanceof SemVer)) {
                    if (typeof other === "string" && other === this.version) {
                        return 0;
                    }
                    other = new SemVer(other, this.options);
                }
                if (other.version === this.version) {
                    return 0;
                }
                return this.compareMain(other) || this.comparePre(other);
            }
            compareMain(other) {
                if (!(other instanceof SemVer)) {
                    other = new SemVer(other, this.options);
                }
                return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
            }
            comparePre(other) {
                if (!(other instanceof SemVer)) {
                    other = new SemVer(other, this.options);
                }
                if (this.prerelease.length && !other.prerelease.length) {
                    return -1;
                } else if (!this.prerelease.length && other.prerelease.length) {
                    return 1;
                } else if (!this.prerelease.length && !other.prerelease.length) {
                    return 0;
                }
                let i = 0;
                do {
                    const a = this.prerelease[i];
                    const b = other.prerelease[i];
                    debug("prerelease compare", i, a, b);
                    if (a === undefined && b === undefined) {
                        return 0;
                    } else if (b === undefined) {
                        return 1;
                    } else if (a === undefined) {
                        return -1;
                    } else if (a === b) {
                        continue;
                    } else {
                        return compareIdentifiers(a, b);
                    }
                } while (++i);
            }
            compareBuild(other) {
                if (!(other instanceof SemVer)) {
                    other = new SemVer(other, this.options);
                }
                let i = 0;
                do {
                    const a = this.build[i];
                    const b = other.build[i];
                    debug("prerelease compare", i, a, b);
                    if (a === undefined && b === undefined) {
                        return 0;
                    } else if (b === undefined) {
                        return 1;
                    } else if (a === undefined) {
                        return -1;
                    } else if (a === b) {
                        continue;
                    } else {
                        return compareIdentifiers(a, b);
                    }
                } while (++i);
            }
            inc(release, identifier) {
                switch (release) {
                  case "premajor":
                    this.prerelease.length = 0;
                    this.patch = 0;
                    this.minor = 0;
                    this.major++;
                    this.inc("pre", identifier);
                    break;

                  case "preminor":
                    this.prerelease.length = 0;
                    this.patch = 0;
                    this.minor++;
                    this.inc("pre", identifier);
                    break;

                  case "prepatch":
                    this.prerelease.length = 0;
                    this.inc("patch", identifier);
                    this.inc("pre", identifier);
                    break;

                  case "prerelease":
                    if (this.prerelease.length === 0) {
                        this.inc("patch", identifier);
                    }
                    this.inc("pre", identifier);
                    break;

                  case "major":
                    if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
                        this.major++;
                    }
                    this.minor = 0;
                    this.patch = 0;
                    this.prerelease = [];
                    break;

                  case "minor":
                    if (this.patch !== 0 || this.prerelease.length === 0) {
                        this.minor++;
                    }
                    this.patch = 0;
                    this.prerelease = [];
                    break;

                  case "patch":
                    if (this.prerelease.length === 0) {
                        this.patch++;
                    }
                    this.prerelease = [];
                    break;

                  case "pre":
                    if (this.prerelease.length === 0) {
                        this.prerelease = [ 0 ];
                    } else {
                        let i = this.prerelease.length;
                        while (--i >= 0) {
                            if (typeof this.prerelease[i] === "number") {
                                this.prerelease[i]++;
                                i = -2;
                            }
                        }
                        if (i === -1) {
                            this.prerelease.push(0);
                        }
                    }
                    if (identifier) {
                        if (this.prerelease[0] === identifier) {
                            if (isNaN(this.prerelease[1])) {
                                this.prerelease = [ identifier, 0 ];
                            }
                        } else {
                            this.prerelease = [ identifier, 0 ];
                        }
                    }
                    break;

                  default:
                    throw new Error(`invalid increment argument: ${release}`);
                }
                this.format();
                this.raw = this.version;
                return this;
            }
        }
        module.exports = SemVer;
    }, module => {
        const opts = [ "includePrerelease", "loose", "rtl" ];
        const parseOptions = options => !options ? {} : typeof options !== "object" ? {
            loose: true
        } : opts.filter((k => options[k])).reduce(((options, k) => {
            options[k] = true;
            return options;
        }), {});
        module.exports = parseOptions;
    }, module => {
        const numeric = /^[0-9]+$/;
        const compareIdentifiers = (a, b) => {
            const anum = numeric.test(a);
            const bnum = numeric.test(b);
            if (anum && bnum) {
                a = +a;
                b = +b;
            }
            return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
        };
        const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
        module.exports = {
            compareIdentifiers,
            rcompareIdentifiers
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const {MAX_LENGTH} = __webpack_require__(641);
        const {re, t} = __webpack_require__(640);
        const SemVer = __webpack_require__(643);
        const parseOptions = __webpack_require__(644);
        const parse = (version, options) => {
            options = parseOptions(options);
            if (version instanceof SemVer) {
                return version;
            }
            if (typeof version !== "string") {
                return null;
            }
            if (version.length > MAX_LENGTH) {
                return null;
            }
            const r = options.loose ? re[t.LOOSE] : re[t.FULL];
            if (!r.test(version)) {
                return null;
            }
            try {
                return new SemVer(version, options);
            } catch (er) {
                return null;
            }
        };
        module.exports = parse;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const parse = __webpack_require__(646);
        const valid = (version, options) => {
            const v = parse(version, options);
            return v ? v.version : null;
        };
        module.exports = valid;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const parse = __webpack_require__(646);
        const clean = (version, options) => {
            const s = parse(version.trim().replace(/^[=v]+/, ""), options);
            return s ? s.version : null;
        };
        module.exports = clean;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const SemVer = __webpack_require__(643);
        const inc = (version, release, options, identifier) => {
            if (typeof options === "string") {
                identifier = options;
                options = undefined;
            }
            try {
                return new SemVer(version, options).inc(release, identifier).version;
            } catch (er) {
                return null;
            }
        };
        module.exports = inc;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const parse = __webpack_require__(646);
        const eq = __webpack_require__(651);
        const diff = (version1, version2) => {
            if (eq(version1, version2)) {
                return null;
            } else {
                const v1 = parse(version1);
                const v2 = parse(version2);
                const hasPre = v1.prerelease.length || v2.prerelease.length;
                const prefix = hasPre ? "pre" : "";
                const defaultResult = hasPre ? "prerelease" : "";
                for (const key in v1) {
                    if (key === "major" || key === "minor" || key === "patch") {
                        if (v1[key] !== v2[key]) {
                            return prefix + key;
                        }
                    }
                }
                return defaultResult;
            }
        };
        module.exports = diff;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const compare = __webpack_require__(652);
        const eq = (a, b, loose) => compare(a, b, loose) === 0;
        module.exports = eq;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const SemVer = __webpack_require__(643);
        const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
        module.exports = compare;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const SemVer = __webpack_require__(643);
        const major = (a, loose) => new SemVer(a, loose).major;
        module.exports = major;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const SemVer = __webpack_require__(643);
        const minor = (a, loose) => new SemVer(a, loose).minor;
        module.exports = minor;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const SemVer = __webpack_require__(643);
        const patch = (a, loose) => new SemVer(a, loose).patch;
        module.exports = patch;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const parse = __webpack_require__(646);
        const prerelease = (version, options) => {
            const parsed = parse(version, options);
            return parsed && parsed.prerelease.length ? parsed.prerelease : null;
        };
        module.exports = prerelease;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const compare = __webpack_require__(652);
        const rcompare = (a, b, loose) => compare(b, a, loose);
        module.exports = rcompare;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const compare = __webpack_require__(652);
        const compareLoose = (a, b) => compare(a, b, true);
        module.exports = compareLoose;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const SemVer = __webpack_require__(643);
        const compareBuild = (a, b, loose) => {
            const versionA = new SemVer(a, loose);
            const versionB = new SemVer(b, loose);
            return versionA.compare(versionB) || versionA.compareBuild(versionB);
        };
        module.exports = compareBuild;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const compareBuild = __webpack_require__(659);
        const sort = (list, loose) => list.sort(((a, b) => compareBuild(a, b, loose)));
        module.exports = sort;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const compareBuild = __webpack_require__(659);
        const rsort = (list, loose) => list.sort(((a, b) => compareBuild(b, a, loose)));
        module.exports = rsort;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const compare = __webpack_require__(652);
        const gt = (a, b, loose) => compare(a, b, loose) > 0;
        module.exports = gt;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const compare = __webpack_require__(652);
        const lt = (a, b, loose) => compare(a, b, loose) < 0;
        module.exports = lt;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const compare = __webpack_require__(652);
        const neq = (a, b, loose) => compare(a, b, loose) !== 0;
        module.exports = neq;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const compare = __webpack_require__(652);
        const gte = (a, b, loose) => compare(a, b, loose) >= 0;
        module.exports = gte;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const compare = __webpack_require__(652);
        const lte = (a, b, loose) => compare(a, b, loose) <= 0;
        module.exports = lte;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const eq = __webpack_require__(651);
        const neq = __webpack_require__(664);
        const gt = __webpack_require__(662);
        const gte = __webpack_require__(665);
        const lt = __webpack_require__(663);
        const lte = __webpack_require__(666);
        const cmp = (a, op, b, loose) => {
            switch (op) {
              case "===":
                if (typeof a === "object") a = a.version;
                if (typeof b === "object") b = b.version;
                return a === b;

              case "!==":
                if (typeof a === "object") a = a.version;
                if (typeof b === "object") b = b.version;
                return a !== b;

              case "":
              case "=":
              case "==":
                return eq(a, b, loose);

              case "!=":
                return neq(a, b, loose);

              case ">":
                return gt(a, b, loose);

              case ">=":
                return gte(a, b, loose);

              case "<":
                return lt(a, b, loose);

              case "<=":
                return lte(a, b, loose);

              default:
                throw new TypeError(`Invalid operator: ${op}`);
            }
        };
        module.exports = cmp;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const SemVer = __webpack_require__(643);
        const parse = __webpack_require__(646);
        const {re, t} = __webpack_require__(640);
        const coerce = (version, options) => {
            if (version instanceof SemVer) {
                return version;
            }
            if (typeof version === "number") {
                version = String(version);
            }
            if (typeof version !== "string") {
                return null;
            }
            options = options || {};
            let match = null;
            if (!options.rtl) {
                match = version.match(re[t.COERCE]);
            } else {
                let next;
                while ((next = re[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) {
                    if (!match || next.index + next[0].length !== match.index + match[0].length) {
                        match = next;
                    }
                    re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length;
                }
                re[t.COERCERTL].lastIndex = -1;
            }
            if (match === null) return null;
            return parse(`${match[2]}.${match[3] || "0"}.${match[4] || "0"}`, options);
        };
        module.exports = coerce;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const ANY = Symbol("SemVer ANY");
        class Comparator {
            static get ANY() {
                return ANY;
            }
            constructor(comp, options) {
                options = parseOptions(options);
                if (comp instanceof Comparator) {
                    if (comp.loose === !!options.loose) {
                        return comp;
                    } else {
                        comp = comp.value;
                    }
                }
                debug("comparator", comp, options);
                this.options = options;
                this.loose = !!options.loose;
                this.parse(comp);
                if (this.semver === ANY) {
                    this.value = "";
                } else {
                    this.value = this.operator + this.semver.version;
                }
                debug("comp", this);
            }
            parse(comp) {
                const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
                const m = comp.match(r);
                if (!m) {
                    throw new TypeError(`Invalid comparator: ${comp}`);
                }
                this.operator = m[1] !== undefined ? m[1] : "";
                if (this.operator === "=") {
                    this.operator = "";
                }
                if (!m[2]) {
                    this.semver = ANY;
                } else {
                    this.semver = new SemVer(m[2], this.options.loose);
                }
            }
            toString() {
                return this.value;
            }
            test(version) {
                debug("Comparator.test", version, this.options.loose);
                if (this.semver === ANY || version === ANY) {
                    return true;
                }
                if (typeof version === "string") {
                    try {
                        version = new SemVer(version, this.options);
                    } catch (er) {
                        return false;
                    }
                }
                return cmp(version, this.operator, this.semver, this.options);
            }
            intersects(comp, options) {
                if (!(comp instanceof Comparator)) {
                    throw new TypeError("a Comparator is required");
                }
                if (!options || typeof options !== "object") {
                    options = {
                        loose: !!options,
                        includePrerelease: false
                    };
                }
                if (this.operator === "") {
                    if (this.value === "") {
                        return true;
                    }
                    return new Range(comp.value, options).test(this.value);
                } else if (comp.operator === "") {
                    if (comp.value === "") {
                        return true;
                    }
                    return new Range(this.value, options).test(comp.semver);
                }
                const sameDirectionIncreasing = (this.operator === ">=" || this.operator === ">") && (comp.operator === ">=" || comp.operator === ">");
                const sameDirectionDecreasing = (this.operator === "<=" || this.operator === "<") && (comp.operator === "<=" || comp.operator === "<");
                const sameSemVer = this.semver.version === comp.semver.version;
                const differentDirectionsInclusive = (this.operator === ">=" || this.operator === "<=") && (comp.operator === ">=" || comp.operator === "<=");
                const oppositeDirectionsLessThan = cmp(this.semver, "<", comp.semver, options) && (this.operator === ">=" || this.operator === ">") && (comp.operator === "<=" || comp.operator === "<");
                const oppositeDirectionsGreaterThan = cmp(this.semver, ">", comp.semver, options) && (this.operator === "<=" || this.operator === "<") && (comp.operator === ">=" || comp.operator === ">");
                return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan;
            }
        }
        module.exports = Comparator;
        const parseOptions = __webpack_require__(644);
        const {re, t} = __webpack_require__(640);
        const cmp = __webpack_require__(667);
        const debug = __webpack_require__(642);
        const SemVer = __webpack_require__(643);
        const Range = __webpack_require__(670);
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        class Range {
            constructor(range, options) {
                options = parseOptions(options);
                if (range instanceof Range) {
                    if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
                        return range;
                    } else {
                        return new Range(range.raw, options);
                    }
                }
                if (range instanceof Comparator) {
                    this.raw = range.value;
                    this.set = [ [ range ] ];
                    this.format();
                    return this;
                }
                this.options = options;
                this.loose = !!options.loose;
                this.includePrerelease = !!options.includePrerelease;
                this.raw = range;
                this.set = range.split(/\s*\|\|\s*/).map((range => this.parseRange(range.trim()))).filter((c => c.length));
                if (!this.set.length) {
                    throw new TypeError(`Invalid SemVer Range: ${range}`);
                }
                if (this.set.length > 1) {
                    const first = this.set[0];
                    this.set = this.set.filter((c => !isNullSet(c[0])));
                    if (this.set.length === 0) this.set = [ first ]; else if (this.set.length > 1) {
                        for (const c of this.set) {
                            if (c.length === 1 && isAny(c[0])) {
                                this.set = [ c ];
                                break;
                            }
                        }
                    }
                }
                this.format();
            }
            format() {
                this.range = this.set.map((comps => comps.join(" ").trim())).join("||").trim();
                return this.range;
            }
            toString() {
                return this.range;
            }
            parseRange(range) {
                range = range.trim();
                const memoOpts = Object.keys(this.options).join(",");
                const memoKey = `parseRange:${memoOpts}:${range}`;
                const cached = cache.get(memoKey);
                if (cached) return cached;
                const loose = this.options.loose;
                const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
                range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
                debug("hyphen replace", range);
                range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
                debug("comparator trim", range, re[t.COMPARATORTRIM]);
                range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
                range = range.replace(re[t.CARETTRIM], caretTrimReplace);
                range = range.split(/\s+/).join(" ");
                const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
                const rangeList = range.split(" ").map((comp => parseComparator(comp, this.options))).join(" ").split(/\s+/).map((comp => replaceGTE0(comp, this.options))).filter(this.options.loose ? comp => !!comp.match(compRe) : () => true).map((comp => new Comparator(comp, this.options)));
                const l = rangeList.length;
                const rangeMap = new Map;
                for (const comp of rangeList) {
                    if (isNullSet(comp)) return [ comp ];
                    rangeMap.set(comp.value, comp);
                }
                if (rangeMap.size > 1 && rangeMap.has("")) rangeMap.delete("");
                const result = [ ...rangeMap.values() ];
                cache.set(memoKey, result);
                return result;
            }
            intersects(range, options) {
                if (!(range instanceof Range)) {
                    throw new TypeError("a Range is required");
                }
                return this.set.some((thisComparators => isSatisfiable(thisComparators, options) && range.set.some((rangeComparators => isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator => rangeComparators.every((rangeComparator => thisComparator.intersects(rangeComparator, options)))))))));
            }
            test(version) {
                if (!version) {
                    return false;
                }
                if (typeof version === "string") {
                    try {
                        version = new SemVer(version, this.options);
                    } catch (er) {
                        return false;
                    }
                }
                for (let i = 0; i < this.set.length; i++) {
                    if (testSet(this.set[i], version, this.options)) {
                        return true;
                    }
                }
                return false;
            }
        }
        module.exports = Range;
        const LRU = __webpack_require__(671);
        const cache = new LRU({
            max: 1e3
        });
        const parseOptions = __webpack_require__(644);
        const Comparator = __webpack_require__(669);
        const debug = __webpack_require__(642);
        const SemVer = __webpack_require__(643);
        const {re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace} = __webpack_require__(640);
        const isNullSet = c => c.value === "<0.0.0-0";
        const isAny = c => c.value === "";
        const isSatisfiable = (comparators, options) => {
            let result = true;
            const remainingComparators = comparators.slice();
            let testComparator = remainingComparators.pop();
            while (result && remainingComparators.length) {
                result = remainingComparators.every((otherComparator => testComparator.intersects(otherComparator, options)));
                testComparator = remainingComparators.pop();
            }
            return result;
        };
        const parseComparator = (comp, options) => {
            debug("comp", comp, options);
            comp = replaceCarets(comp, options);
            debug("caret", comp);
            comp = replaceTildes(comp, options);
            debug("tildes", comp);
            comp = replaceXRanges(comp, options);
            debug("xrange", comp);
            comp = replaceStars(comp, options);
            debug("stars", comp);
            return comp;
        };
        const isX = id => !id || id.toLowerCase() === "x" || id === "*";
        const replaceTildes = (comp, options) => comp.trim().split(/\s+/).map((comp => replaceTilde(comp, options))).join(" ");
        const replaceTilde = (comp, options) => {
            const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
            return comp.replace(r, ((_, M, m, p, pr) => {
                debug("tilde", comp, _, M, m, p, pr);
                let ret;
                if (isX(M)) {
                    ret = "";
                } else if (isX(m)) {
                    ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
                } else if (isX(p)) {
                    ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
                } else if (pr) {
                    debug("replaceTilde pr", pr);
                    ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
                } else {
                    ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
                }
                debug("tilde return", ret);
                return ret;
            }));
        };
        const replaceCarets = (comp, options) => comp.trim().split(/\s+/).map((comp => replaceCaret(comp, options))).join(" ");
        const replaceCaret = (comp, options) => {
            debug("caret", comp, options);
            const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
            const z = options.includePrerelease ? "-0" : "";
            return comp.replace(r, ((_, M, m, p, pr) => {
                debug("caret", comp, _, M, m, p, pr);
                let ret;
                if (isX(M)) {
                    ret = "";
                } else if (isX(m)) {
                    ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
                } else if (isX(p)) {
                    if (M === "0") {
                        ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
                    } else {
                        ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
                    }
                } else if (pr) {
                    debug("replaceCaret pr", pr);
                    if (M === "0") {
                        if (m === "0") {
                            ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
                        } else {
                            ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
                        }
                    } else {
                        ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
                    }
                } else {
                    debug("no pr");
                    if (M === "0") {
                        if (m === "0") {
                            ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
                        } else {
                            ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
                        }
                    } else {
                        ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
                    }
                }
                debug("caret return", ret);
                return ret;
            }));
        };
        const replaceXRanges = (comp, options) => {
            debug("replaceXRanges", comp, options);
            return comp.split(/\s+/).map((comp => replaceXRange(comp, options))).join(" ");
        };
        const replaceXRange = (comp, options) => {
            comp = comp.trim();
            const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
            return comp.replace(r, ((ret, gtlt, M, m, p, pr) => {
                debug("xRange", comp, ret, gtlt, M, m, p, pr);
                const xM = isX(M);
                const xm = xM || isX(m);
                const xp = xm || isX(p);
                const anyX = xp;
                if (gtlt === "=" && anyX) {
                    gtlt = "";
                }
                pr = options.includePrerelease ? "-0" : "";
                if (xM) {
                    if (gtlt === ">" || gtlt === "<") {
                        ret = "<0.0.0-0";
                    } else {
                        ret = "*";
                    }
                } else if (gtlt && anyX) {
                    if (xm) {
                        m = 0;
                    }
                    p = 0;
                    if (gtlt === ">") {
                        gtlt = ">=";
                        if (xm) {
                            M = +M + 1;
                            m = 0;
                            p = 0;
                        } else {
                            m = +m + 1;
                            p = 0;
                        }
                    } else if (gtlt === "<=") {
                        gtlt = "<";
                        if (xm) {
                            M = +M + 1;
                        } else {
                            m = +m + 1;
                        }
                    }
                    if (gtlt === "<") pr = "-0";
                    ret = `${gtlt + M}.${m}.${p}${pr}`;
                } else if (xm) {
                    ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
                } else if (xp) {
                    ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
                }
                debug("xRange return", ret);
                return ret;
            }));
        };
        const replaceStars = (comp, options) => {
            debug("replaceStars", comp, options);
            return comp.trim().replace(re[t.STAR], "");
        };
        const replaceGTE0 = (comp, options) => {
            debug("replaceGTE0", comp, options);
            return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
        };
        const hyphenReplace = incPr => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) => {
            if (isX(fM)) {
                from = "";
            } else if (isX(fm)) {
                from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
            } else if (isX(fp)) {
                from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
            } else if (fpr) {
                from = `>=${from}`;
            } else {
                from = `>=${from}${incPr ? "-0" : ""}`;
            }
            if (isX(tM)) {
                to = "";
            } else if (isX(tm)) {
                to = `<${+tM + 1}.0.0-0`;
            } else if (isX(tp)) {
                to = `<${tM}.${+tm + 1}.0-0`;
            } else if (tpr) {
                to = `<=${tM}.${tm}.${tp}-${tpr}`;
            } else if (incPr) {
                to = `<${tM}.${tm}.${+tp + 1}-0`;
            } else {
                to = `<=${to}`;
            }
            return `${from} ${to}`.trim();
        };
        const testSet = (set, version, options) => {
            for (let i = 0; i < set.length; i++) {
                if (!set[i].test(version)) {
                    return false;
                }
            }
            if (version.prerelease.length && !options.includePrerelease) {
                for (let i = 0; i < set.length; i++) {
                    debug(set[i].semver);
                    if (set[i].semver === Comparator.ANY) {
                        continue;
                    }
                    if (set[i].semver.prerelease.length > 0) {
                        const allowed = set[i].semver;
                        if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
                            return true;
                        }
                    }
                }
                return false;
            }
            return true;
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        const Yallist = __webpack_require__(672);
        const MAX = Symbol("max");
        const LENGTH = Symbol("length");
        const LENGTH_CALCULATOR = Symbol("lengthCalculator");
        const ALLOW_STALE = Symbol("allowStale");
        const MAX_AGE = Symbol("maxAge");
        const DISPOSE = Symbol("dispose");
        const NO_DISPOSE_ON_SET = Symbol("noDisposeOnSet");
        const LRU_LIST = Symbol("lruList");
        const CACHE = Symbol("cache");
        const UPDATE_AGE_ON_GET = Symbol("updateAgeOnGet");
        const naiveLength = () => 1;
        class LRUCache {
            constructor(options) {
                if (typeof options === "number") options = {
                    max: options
                };
                if (!options) options = {};
                if (options.max && (typeof options.max !== "number" || options.max < 0)) throw new TypeError("max must be a non-negative number");
                const max = this[MAX] = options.max || Infinity;
                const lc = options.length || naiveLength;
                this[LENGTH_CALCULATOR] = typeof lc !== "function" ? naiveLength : lc;
                this[ALLOW_STALE] = options.stale || false;
                if (options.maxAge && typeof options.maxAge !== "number") throw new TypeError("maxAge must be a number");
                this[MAX_AGE] = options.maxAge || 0;
                this[DISPOSE] = options.dispose;
                this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
                this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
                this.reset();
            }
            set max(mL) {
                if (typeof mL !== "number" || mL < 0) throw new TypeError("max must be a non-negative number");
                this[MAX] = mL || Infinity;
                trim(this);
            }
            get max() {
                return this[MAX];
            }
            set allowStale(allowStale) {
                this[ALLOW_STALE] = !!allowStale;
            }
            get allowStale() {
                return this[ALLOW_STALE];
            }
            set maxAge(mA) {
                if (typeof mA !== "number") throw new TypeError("maxAge must be a non-negative number");
                this[MAX_AGE] = mA;
                trim(this);
            }
            get maxAge() {
                return this[MAX_AGE];
            }
            set lengthCalculator(lC) {
                if (typeof lC !== "function") lC = naiveLength;
                if (lC !== this[LENGTH_CALCULATOR]) {
                    this[LENGTH_CALCULATOR] = lC;
                    this[LENGTH] = 0;
                    this[LRU_LIST].forEach((hit => {
                        hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
                        this[LENGTH] += hit.length;
                    }));
                }
                trim(this);
            }
            get lengthCalculator() {
                return this[LENGTH_CALCULATOR];
            }
            get length() {
                return this[LENGTH];
            }
            get itemCount() {
                return this[LRU_LIST].length;
            }
            rforEach(fn, thisp) {
                thisp = thisp || this;
                for (let walker = this[LRU_LIST].tail; walker !== null; ) {
                    const prev = walker.prev;
                    forEachStep(this, fn, walker, thisp);
                    walker = prev;
                }
            }
            forEach(fn, thisp) {
                thisp = thisp || this;
                for (let walker = this[LRU_LIST].head; walker !== null; ) {
                    const next = walker.next;
                    forEachStep(this, fn, walker, thisp);
                    walker = next;
                }
            }
            keys() {
                return this[LRU_LIST].toArray().map((k => k.key));
            }
            values() {
                return this[LRU_LIST].toArray().map((k => k.value));
            }
            reset() {
                if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
                    this[LRU_LIST].forEach((hit => this[DISPOSE](hit.key, hit.value)));
                }
                this[CACHE] = new Map;
                this[LRU_LIST] = new Yallist;
                this[LENGTH] = 0;
            }
            dump() {
                return this[LRU_LIST].map((hit => isStale(this, hit) ? false : {
                    k: hit.key,
                    v: hit.value,
                    e: hit.now + (hit.maxAge || 0)
                })).toArray().filter((h => h));
            }
            dumpLru() {
                return this[LRU_LIST];
            }
            set(key, value, maxAge) {
                maxAge = maxAge || this[MAX_AGE];
                if (maxAge && typeof maxAge !== "number") throw new TypeError("maxAge must be a number");
                const now = maxAge ? Date.now() : 0;
                const len = this[LENGTH_CALCULATOR](value, key);
                if (this[CACHE].has(key)) {
                    if (len > this[MAX]) {
                        del(this, this[CACHE].get(key));
                        return false;
                    }
                    const node = this[CACHE].get(key);
                    const item = node.value;
                    if (this[DISPOSE]) {
                        if (!this[NO_DISPOSE_ON_SET]) this[DISPOSE](key, item.value);
                    }
                    item.now = now;
                    item.maxAge = maxAge;
                    item.value = value;
                    this[LENGTH] += len - item.length;
                    item.length = len;
                    this.get(key);
                    trim(this);
                    return true;
                }
                const hit = new Entry(key, value, len, now, maxAge);
                if (hit.length > this[MAX]) {
                    if (this[DISPOSE]) this[DISPOSE](key, value);
                    return false;
                }
                this[LENGTH] += hit.length;
                this[LRU_LIST].unshift(hit);
                this[CACHE].set(key, this[LRU_LIST].head);
                trim(this);
                return true;
            }
            has(key) {
                if (!this[CACHE].has(key)) return false;
                const hit = this[CACHE].get(key).value;
                return !isStale(this, hit);
            }
            get(key) {
                return get(this, key, true);
            }
            peek(key) {
                return get(this, key, false);
            }
            pop() {
                const node = this[LRU_LIST].tail;
                if (!node) return null;
                del(this, node);
                return node.value;
            }
            del(key) {
                del(this, this[CACHE].get(key));
            }
            load(arr) {
                this.reset();
                const now = Date.now();
                for (let l = arr.length - 1; l >= 0; l--) {
                    const hit = arr[l];
                    const expiresAt = hit.e || 0;
                    if (expiresAt === 0) this.set(hit.k, hit.v); else {
                        const maxAge = expiresAt - now;
                        if (maxAge > 0) {
                            this.set(hit.k, hit.v, maxAge);
                        }
                    }
                }
            }
            prune() {
                this[CACHE].forEach(((value, key) => get(this, key, false)));
            }
        }
        const get = (self, key, doUse) => {
            const node = self[CACHE].get(key);
            if (node) {
                const hit = node.value;
                if (isStale(self, hit)) {
                    del(self, node);
                    if (!self[ALLOW_STALE]) return undefined;
                } else {
                    if (doUse) {
                        if (self[UPDATE_AGE_ON_GET]) node.value.now = Date.now();
                        self[LRU_LIST].unshiftNode(node);
                    }
                }
                return hit.value;
            }
        };
        const isStale = (self, hit) => {
            if (!hit || !hit.maxAge && !self[MAX_AGE]) return false;
            const diff = Date.now() - hit.now;
            return hit.maxAge ? diff > hit.maxAge : self[MAX_AGE] && diff > self[MAX_AGE];
        };
        const trim = self => {
            if (self[LENGTH] > self[MAX]) {
                for (let walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null; ) {
                    const prev = walker.prev;
                    del(self, walker);
                    walker = prev;
                }
            }
        };
        const del = (self, node) => {
            if (node) {
                const hit = node.value;
                if (self[DISPOSE]) self[DISPOSE](hit.key, hit.value);
                self[LENGTH] -= hit.length;
                self[CACHE].delete(hit.key);
                self[LRU_LIST].removeNode(node);
            }
        };
        class Entry {
            constructor(key, value, length, now, maxAge) {
                this.key = key;
                this.value = value;
                this.length = length;
                this.now = now;
                this.maxAge = maxAge || 0;
            }
        }
        const forEachStep = (self, fn, node, thisp) => {
            let hit = node.value;
            if (isStale(self, hit)) {
                del(self, node);
                if (!self[ALLOW_STALE]) hit = undefined;
            }
            if (hit) fn.call(thisp, hit.value, hit.key, self);
        };
        module.exports = LRUCache;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        module.exports = Yallist;
        Yallist.Node = Node;
        Yallist.create = Yallist;
        function Yallist(list) {
            var self = this;
            if (!(self instanceof Yallist)) {
                self = new Yallist;
            }
            self.tail = null;
            self.head = null;
            self.length = 0;
            if (list && typeof list.forEach === "function") {
                list.forEach((function(item) {
                    self.push(item);
                }));
            } else if (arguments.length > 0) {
                for (var i = 0, l = arguments.length; i < l; i++) {
                    self.push(arguments[i]);
                }
            }
            return self;
        }
        Yallist.prototype.removeNode = function(node) {
            if (node.list !== this) {
                throw new Error("removing node which does not belong to this list");
            }
            var next = node.next;
            var prev = node.prev;
            if (next) {
                next.prev = prev;
            }
            if (prev) {
                prev.next = next;
            }
            if (node === this.head) {
                this.head = next;
            }
            if (node === this.tail) {
                this.tail = prev;
            }
            node.list.length--;
            node.next = null;
            node.prev = null;
            node.list = null;
            return next;
        };
        Yallist.prototype.unshiftNode = function(node) {
            if (node === this.head) {
                return;
            }
            if (node.list) {
                node.list.removeNode(node);
            }
            var head = this.head;
            node.list = this;
            node.next = head;
            if (head) {
                head.prev = node;
            }
            this.head = node;
            if (!this.tail) {
                this.tail = node;
            }
            this.length++;
        };
        Yallist.prototype.pushNode = function(node) {
            if (node === this.tail) {
                return;
            }
            if (node.list) {
                node.list.removeNode(node);
            }
            var tail = this.tail;
            node.list = this;
            node.prev = tail;
            if (tail) {
                tail.next = node;
            }
            this.tail = node;
            if (!this.head) {
                this.head = node;
            }
            this.length++;
        };
        Yallist.prototype.push = function() {
            for (var i = 0, l = arguments.length; i < l; i++) {
                push(this, arguments[i]);
            }
            return this.length;
        };
        Yallist.prototype.unshift = function() {
            for (var i = 0, l = arguments.length; i < l; i++) {
                unshift(this, arguments[i]);
            }
            return this.length;
        };
        Yallist.prototype.pop = function() {
            if (!this.tail) {
                return undefined;
            }
            var res = this.tail.value;
            this.tail = this.tail.prev;
            if (this.tail) {
                this.tail.next = null;
            } else {
                this.head = null;
            }
            this.length--;
            return res;
        };
        Yallist.prototype.shift = function() {
            if (!this.head) {
                return undefined;
            }
            var res = this.head.value;
            this.head = this.head.next;
            if (this.head) {
                this.head.prev = null;
            } else {
                this.tail = null;
            }
            this.length--;
            return res;
        };
        Yallist.prototype.forEach = function(fn, thisp) {
            thisp = thisp || this;
            for (var walker = this.head, i = 0; walker !== null; i++) {
                fn.call(thisp, walker.value, i, this);
                walker = walker.next;
            }
        };
        Yallist.prototype.forEachReverse = function(fn, thisp) {
            thisp = thisp || this;
            for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
                fn.call(thisp, walker.value, i, this);
                walker = walker.prev;
            }
        };
        Yallist.prototype.get = function(n) {
            for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
                walker = walker.next;
            }
            if (i === n && walker !== null) {
                return walker.value;
            }
        };
        Yallist.prototype.getReverse = function(n) {
            for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
                walker = walker.prev;
            }
            if (i === n && walker !== null) {
                return walker.value;
            }
        };
        Yallist.prototype.map = function(fn, thisp) {
            thisp = thisp || this;
            var res = new Yallist;
            for (var walker = this.head; walker !== null; ) {
                res.push(fn.call(thisp, walker.value, this));
                walker = walker.next;
            }
            return res;
        };
        Yallist.prototype.mapReverse = function(fn, thisp) {
            thisp = thisp || this;
            var res = new Yallist;
            for (var walker = this.tail; walker !== null; ) {
                res.push(fn.call(thisp, walker.value, this));
                walker = walker.prev;
            }
            return res;
        };
        Yallist.prototype.reduce = function(fn, initial) {
            var acc;
            var walker = this.head;
            if (arguments.length > 1) {
                acc = initial;
            } else if (this.head) {
                walker = this.head.next;
                acc = this.head.value;
            } else {
                throw new TypeError("Reduce of empty list with no initial value");
            }
            for (var i = 0; walker !== null; i++) {
                acc = fn(acc, walker.value, i);
                walker = walker.next;
            }
            return acc;
        };
        Yallist.prototype.reduceReverse = function(fn, initial) {
            var acc;
            var walker = this.tail;
            if (arguments.length > 1) {
                acc = initial;
            } else if (this.tail) {
                walker = this.tail.prev;
                acc = this.tail.value;
            } else {
                throw new TypeError("Reduce of empty list with no initial value");
            }
            for (var i = this.length - 1; walker !== null; i--) {
                acc = fn(acc, walker.value, i);
                walker = walker.prev;
            }
            return acc;
        };
        Yallist.prototype.toArray = function() {
            var arr = new Array(this.length);
            for (var i = 0, walker = this.head; walker !== null; i++) {
                arr[i] = walker.value;
                walker = walker.next;
            }
            return arr;
        };
        Yallist.prototype.toArrayReverse = function() {
            var arr = new Array(this.length);
            for (var i = 0, walker = this.tail; walker !== null; i++) {
                arr[i] = walker.value;
                walker = walker.prev;
            }
            return arr;
        };
        Yallist.prototype.slice = function(from, to) {
            to = to || this.length;
            if (to < 0) {
                to += this.length;
            }
            from = from || 0;
            if (from < 0) {
                from += this.length;
            }
            var ret = new Yallist;
            if (to < from || to < 0) {
                return ret;
            }
            if (from < 0) {
                from = 0;
            }
            if (to > this.length) {
                to = this.length;
            }
            for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
                walker = walker.next;
            }
            for (;walker !== null && i < to; i++, walker = walker.next) {
                ret.push(walker.value);
            }
            return ret;
        };
        Yallist.prototype.sliceReverse = function(from, to) {
            to = to || this.length;
            if (to < 0) {
                to += this.length;
            }
            from = from || 0;
            if (from < 0) {
                from += this.length;
            }
            var ret = new Yallist;
            if (to < from || to < 0) {
                return ret;
            }
            if (from < 0) {
                from = 0;
            }
            if (to > this.length) {
                to = this.length;
            }
            for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
                walker = walker.prev;
            }
            for (;walker !== null && i > from; i--, walker = walker.prev) {
                ret.push(walker.value);
            }
            return ret;
        };
        Yallist.prototype.splice = function(start, deleteCount, ...nodes) {
            if (start > this.length) {
                start = this.length - 1;
            }
            if (start < 0) {
                start = this.length + start;
            }
            for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
                walker = walker.next;
            }
            var ret = [];
            for (var i = 0; walker && i < deleteCount; i++) {
                ret.push(walker.value);
                walker = this.removeNode(walker);
            }
            if (walker === null) {
                walker = this.tail;
            }
            if (walker !== this.head && walker !== this.tail) {
                walker = walker.prev;
            }
            for (var i = 0; i < nodes.length; i++) {
                walker = insert(this, walker, nodes[i]);
            }
            return ret;
        };
        Yallist.prototype.reverse = function() {
            var head = this.head;
            var tail = this.tail;
            for (var walker = head; walker !== null; walker = walker.prev) {
                var p = walker.prev;
                walker.prev = walker.next;
                walker.next = p;
            }
            this.head = tail;
            this.tail = head;
            return this;
        };
        function insert(self, node, value) {
            var inserted = node === self.head ? new Node(value, null, node, self) : new Node(value, node, node.next, self);
            if (inserted.next === null) {
                self.tail = inserted;
            }
            if (inserted.prev === null) {
                self.head = inserted;
            }
            self.length++;
            return inserted;
        }
        function push(self, item) {
            self.tail = new Node(item, self.tail, null, self);
            if (!self.head) {
                self.head = self.tail;
            }
            self.length++;
        }
        function unshift(self, item) {
            self.head = new Node(item, null, self.head, self);
            if (!self.tail) {
                self.tail = self.head;
            }
            self.length++;
        }
        function Node(value, prev, next, list) {
            if (!(this instanceof Node)) {
                return new Node(value, prev, next, list);
            }
            this.list = list;
            this.value = value;
            if (prev) {
                prev.next = this;
                this.prev = prev;
            } else {
                this.prev = null;
            }
            if (next) {
                next.prev = this;
                this.next = next;
            } else {
                this.next = null;
            }
        }
        try {
            __webpack_require__(673)(Yallist);
        } catch (er) {}
    }, module => {
        "use strict";
        module.exports = function(Yallist) {
            Yallist.prototype[Symbol.iterator] = function*() {
                for (let walker = this.head; walker; walker = walker.next) {
                    yield walker.value;
                }
            };
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const Range = __webpack_require__(670);
        const satisfies = (version, range, options) => {
            try {
                range = new Range(range, options);
            } catch (er) {
                return false;
            }
            return range.test(version);
        };
        module.exports = satisfies;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const Range = __webpack_require__(670);
        const toComparators = (range, options) => new Range(range, options).set.map((comp => comp.map((c => c.value)).join(" ").trim().split(" ")));
        module.exports = toComparators;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const SemVer = __webpack_require__(643);
        const Range = __webpack_require__(670);
        const maxSatisfying = (versions, range, options) => {
            let max = null;
            let maxSV = null;
            let rangeObj = null;
            try {
                rangeObj = new Range(range, options);
            } catch (er) {
                return null;
            }
            versions.forEach((v => {
                if (rangeObj.test(v)) {
                    if (!max || maxSV.compare(v) === -1) {
                        max = v;
                        maxSV = new SemVer(max, options);
                    }
                }
            }));
            return max;
        };
        module.exports = maxSatisfying;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const SemVer = __webpack_require__(643);
        const Range = __webpack_require__(670);
        const minSatisfying = (versions, range, options) => {
            let min = null;
            let minSV = null;
            let rangeObj = null;
            try {
                rangeObj = new Range(range, options);
            } catch (er) {
                return null;
            }
            versions.forEach((v => {
                if (rangeObj.test(v)) {
                    if (!min || minSV.compare(v) === 1) {
                        min = v;
                        minSV = new SemVer(min, options);
                    }
                }
            }));
            return min;
        };
        module.exports = minSatisfying;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const SemVer = __webpack_require__(643);
        const Range = __webpack_require__(670);
        const gt = __webpack_require__(662);
        const minVersion = (range, loose) => {
            range = new Range(range, loose);
            let minver = new SemVer("0.0.0");
            if (range.test(minver)) {
                return minver;
            }
            minver = new SemVer("0.0.0-0");
            if (range.test(minver)) {
                return minver;
            }
            minver = null;
            for (let i = 0; i < range.set.length; ++i) {
                const comparators = range.set[i];
                let setMin = null;
                comparators.forEach((comparator => {
                    const compver = new SemVer(comparator.semver.version);
                    switch (comparator.operator) {
                      case ">":
                        if (compver.prerelease.length === 0) {
                            compver.patch++;
                        } else {
                            compver.prerelease.push(0);
                        }
                        compver.raw = compver.format();

                      case "":
                      case ">=":
                        if (!setMin || gt(compver, setMin)) {
                            setMin = compver;
                        }
                        break;

                      case "<":
                      case "<=":
                        break;

                      default:
                        throw new Error(`Unexpected operation: ${comparator.operator}`);
                    }
                }));
                if (setMin && (!minver || gt(minver, setMin))) minver = setMin;
            }
            if (minver && range.test(minver)) {
                return minver;
            }
            return null;
        };
        module.exports = minVersion;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const Range = __webpack_require__(670);
        const validRange = (range, options) => {
            try {
                return new Range(range, options).range || "*";
            } catch (er) {
                return null;
            }
        };
        module.exports = validRange;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const SemVer = __webpack_require__(643);
        const Comparator = __webpack_require__(669);
        const {ANY} = Comparator;
        const Range = __webpack_require__(670);
        const satisfies = __webpack_require__(674);
        const gt = __webpack_require__(662);
        const lt = __webpack_require__(663);
        const lte = __webpack_require__(666);
        const gte = __webpack_require__(665);
        const outside = (version, range, hilo, options) => {
            version = new SemVer(version, options);
            range = new Range(range, options);
            let gtfn, ltefn, ltfn, comp, ecomp;
            switch (hilo) {
              case ">":
                gtfn = gt;
                ltefn = lte;
                ltfn = lt;
                comp = ">";
                ecomp = ">=";
                break;

              case "<":
                gtfn = lt;
                ltefn = gte;
                ltfn = gt;
                comp = "<";
                ecomp = "<=";
                break;

              default:
                throw new TypeError('Must provide a hilo val of "<" or ">"');
            }
            if (satisfies(version, range, options)) {
                return false;
            }
            for (let i = 0; i < range.set.length; ++i) {
                const comparators = range.set[i];
                let high = null;
                let low = null;
                comparators.forEach((comparator => {
                    if (comparator.semver === ANY) {
                        comparator = new Comparator(">=0.0.0");
                    }
                    high = high || comparator;
                    low = low || comparator;
                    if (gtfn(comparator.semver, high.semver, options)) {
                        high = comparator;
                    } else if (ltfn(comparator.semver, low.semver, options)) {
                        low = comparator;
                    }
                }));
                if (high.operator === comp || high.operator === ecomp) {
                    return false;
                }
                if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
                    return false;
                } else if (low.operator === ecomp && ltfn(version, low.semver)) {
                    return false;
                }
            }
            return true;
        };
        module.exports = outside;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const outside = __webpack_require__(680);
        const gtr = (version, range, options) => outside(version, range, ">", options);
        module.exports = gtr;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const outside = __webpack_require__(680);
        const ltr = (version, range, options) => outside(version, range, "<", options);
        module.exports = ltr;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const Range = __webpack_require__(670);
        const intersects = (r1, r2, options) => {
            r1 = new Range(r1, options);
            r2 = new Range(r2, options);
            return r1.intersects(r2);
        };
        module.exports = intersects;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const satisfies = __webpack_require__(674);
        const compare = __webpack_require__(652);
        module.exports = (versions, range, options) => {
            const set = [];
            let min = null;
            let prev = null;
            const v = versions.sort(((a, b) => compare(a, b, options)));
            for (const version of v) {
                const included = satisfies(version, range, options);
                if (included) {
                    prev = version;
                    if (!min) min = version;
                } else {
                    if (prev) {
                        set.push([ min, prev ]);
                    }
                    prev = null;
                    min = null;
                }
            }
            if (min) set.push([ min, null ]);
            const ranges = [];
            for (const [min, max] of set) {
                if (min === max) ranges.push(min); else if (!max && min === v[0]) ranges.push("*"); else if (!max) ranges.push(`>=${min}`); else if (min === v[0]) ranges.push(`<=${max}`); else ranges.push(`${min} - ${max}`);
            }
            const simplified = ranges.join(" || ");
            const original = typeof range.raw === "string" ? range.raw : String(range);
            return simplified.length < original.length ? simplified : range;
        };
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        const Range = __webpack_require__(670);
        const {ANY} = __webpack_require__(669);
        const satisfies = __webpack_require__(674);
        const compare = __webpack_require__(652);
        const subset = (sub, dom, options) => {
            if (sub === dom) return true;
            sub = new Range(sub, options);
            dom = new Range(dom, options);
            let sawNonNull = false;
            OUTER: for (const simpleSub of sub.set) {
                for (const simpleDom of dom.set) {
                    const isSub = simpleSubset(simpleSub, simpleDom, options);
                    sawNonNull = sawNonNull || isSub !== null;
                    if (isSub) continue OUTER;
                }
                if (sawNonNull) return false;
            }
            return true;
        };
        const simpleSubset = (sub, dom, options) => {
            if (sub === dom) return true;
            if (sub.length === 1 && sub[0].semver === ANY) return dom.length === 1 && dom[0].semver === ANY;
            const eqSet = new Set;
            let gt, lt;
            for (const c of sub) {
                if (c.operator === ">" || c.operator === ">=") gt = higherGT(gt, c, options); else if (c.operator === "<" || c.operator === "<=") lt = lowerLT(lt, c, options); else eqSet.add(c.semver);
            }
            if (eqSet.size > 1) return null;
            let gtltComp;
            if (gt && lt) {
                gtltComp = compare(gt.semver, lt.semver, options);
                if (gtltComp > 0) return null; else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) return null;
            }
            for (const eq of eqSet) {
                if (gt && !satisfies(eq, String(gt), options)) return null;
                if (lt && !satisfies(eq, String(lt), options)) return null;
                for (const c of dom) {
                    if (!satisfies(eq, String(c), options)) return false;
                }
                return true;
            }
            let higher, lower;
            let hasDomLT, hasDomGT;
            for (const c of dom) {
                hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
                hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
                if (gt) {
                    if (c.operator === ">" || c.operator === ">=") {
                        higher = higherGT(gt, c, options);
                        if (higher === c && higher !== gt) return false;
                    } else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) return false;
                }
                if (lt) {
                    if (c.operator === "<" || c.operator === "<=") {
                        lower = lowerLT(lt, c, options);
                        if (lower === c && lower !== lt) return false;
                    } else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) return false;
                }
                if (!c.operator && (lt || gt) && gtltComp !== 0) return false;
            }
            if (gt && hasDomLT && !lt && gtltComp !== 0) return false;
            if (lt && hasDomGT && !gt && gtltComp !== 0) return false;
            return true;
        };
        const higherGT = (a, b, options) => {
            if (!a) return b;
            const comp = compare(a.semver, b.semver, options);
            return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
        };
        const lowerLT = (a, b, options) => {
            if (!a) return b;
            const comp = compare(a.semver, b.semver, options);
            return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
        };
        module.exports = subset;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        var Node = {
            child: __webpack_require__(96),
            crypto: __webpack_require__(56),
            fs: __webpack_require__(14),
            os: __webpack_require__(93),
            path: __webpack_require__(15),
            process,
            util: __webpack_require__(58)
        };
        function Attempt(instance, end) {
            var platform = Node.process.platform;
            if (platform === "darwin") return Mac(instance, end);
            if (platform === "linux") return Linux(instance, end);
            if (platform === "win32") return Windows(instance, end);
            end(new Error("Platform not yet supported."));
        }
        function EscapeDoubleQuotes(string) {
            if (typeof string !== "string") throw new Error("Expected a string.");
            return string.replace(/"/g, '\\"');
        }
        function Exec() {
            if (arguments.length < 1 || arguments.length > 3) {
                throw new Error("Wrong number of arguments.");
            }
            var command = arguments[0];
            var options = {};
            var end = function() {};
            if (typeof command !== "string") {
                throw new Error("Command should be a string.");
            }
            if (arguments.length === 2) {
                if (Node.util.isObject(arguments[1])) {
                    options = arguments[1];
                } else if (Node.util.isFunction(arguments[1])) {
                    end = arguments[1];
                } else {
                    throw new Error("Expected options or callback.");
                }
            } else if (arguments.length === 3) {
                if (Node.util.isObject(arguments[1])) {
                    options = arguments[1];
                } else {
                    throw new Error("Expected options to be an object.");
                }
                if (Node.util.isFunction(arguments[2])) {
                    end = arguments[2];
                } else {
                    throw new Error("Expected callback to be a function.");
                }
            }
            if (/^sudo/i.test(command)) {
                return end(new Error('Command should not be prefixed with "sudo".'));
            }
            if (typeof options.name === "undefined") {
                var title = Node.process.title;
                if (ValidName(title)) {
                    options.name = title;
                } else {
                    return end(new Error("process.title cannot be used as a valid name."));
                }
            } else if (!ValidName(options.name)) {
                var error = "";
                error += "options.name must be alphanumeric only ";
                error += "(spaces are allowed) and <= 70 characters.";
                return end(new Error(error));
            }
            if (typeof options.icns !== "undefined") {
                if (typeof options.icns !== "string") {
                    return end(new Error("options.icns must be a string if provided."));
                } else if (options.icns.trim().length === 0) {
                    return end(new Error("options.icns must not be empty if provided."));
                }
            }
            if (typeof options.env !== "undefined") {
                if (typeof options.env !== "object") {
                    return end(new Error("options.env must be an object if provided."));
                } else if (Object.keys(options.env).length === 0) {
                    return end(new Error("options.env must not be empty if provided."));
                } else {
                    for (var key in options.env) {
                        var value = options.env[key];
                        if (typeof key !== "string" || typeof value !== "string") {
                            return end(new Error("options.env environment variables must be strings."));
                        }
                        if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(key)) {
                            return end(new Error("options.env has an invalid environment variable name: " + JSON.stringify(key)));
                        }
                        if (/[\r\n]/.test(value)) {
                            return end(new Error("options.env has an invalid environment variable value: " + JSON.stringify(value)));
                        }
                    }
                }
            }
            var platform = Node.process.platform;
            if (platform !== "darwin" && platform !== "linux" && platform !== "win32") {
                return end(new Error("Platform not yet supported."));
            }
            var instance = {
                command,
                options,
                uuid: undefined,
                path: undefined
            };
            Attempt(instance, end);
        }
        function Linux(instance, end) {
            LinuxBinary(instance, (function(error, binary) {
                if (error) return end(error);
                var command = [];
                command.push('cd "' + EscapeDoubleQuotes(Node.process.cwd()) + '";');
                for (var key in instance.options.env) {
                    var value = instance.options.env[key];
                    command.push("export " + key + '="' + EscapeDoubleQuotes(value) + '";');
                }
                command.push('"' + EscapeDoubleQuotes(binary) + '"');
                if (/kdesudo/i.test(binary)) {
                    command.push("--comment", '"' + instance.options.name + " wants to make changes. " + 'Enter your password to allow this."');
                    command.push("-d");
                    command.push("--");
                } else if (/pkexec/i.test(binary)) {
                    command.push("--disable-internal-agent");
                }
                var magic = "SUDOPROMPT\n";
                command.push('/bin/bash -c "echo ' + EscapeDoubleQuotes(magic.trim()) + "; " + EscapeDoubleQuotes(instance.command) + '"');
                command = command.join(" ");
                Node.child.exec(command, {
                    encoding: "utf-8",
                    maxBuffer: MAX_BUFFER
                }, (function(error, stdout, stderr) {
                    var elevated = stdout && stdout.slice(0, magic.length) === magic;
                    if (elevated) stdout = stdout.slice(magic.length);
                    if (error && !elevated) {
                        if (/No authentication agent found/.test(stderr)) {
                            error.message = NO_POLKIT_AGENT;
                        } else {
                            error.message = PERMISSION_DENIED;
                        }
                    }
                    end(error, stdout, stderr);
                }));
            }));
        }
        function LinuxBinary(instance, end) {
            var index = 0;
            var paths = [ "/usr/bin/kdesudo", "/usr/bin/pkexec" ];
            function test() {
                if (index === paths.length) {
                    return end(new Error("Unable to find pkexec or kdesudo."));
                }
                var path = paths[index++];
                Node.fs.stat(path, (function(error) {
                    if (error) {
                        if (error.code === "ENOTDIR") return test();
                        if (error.code === "ENOENT") return test();
                        end(error);
                    } else {
                        end(undefined, path);
                    }
                }));
            }
            test();
        }
        function Mac(instance, callback) {
            var temp = Node.os.tmpdir();
            if (!temp) return callback(new Error("os.tmpdir() not defined."));
            var user = Node.process.env.USER;
            if (!user) return callback(new Error("env['USER'] not defined."));
            UUID(instance, (function(error, uuid) {
                if (error) return callback(error);
                instance.uuid = uuid;
                instance.path = Node.path.join(temp, instance.uuid, instance.options.name + ".app");
                function end(error, stdout, stderr) {
                    Remove(Node.path.dirname(instance.path), (function(errorRemove) {
                        if (error) return callback(error);
                        if (errorRemove) return callback(errorRemove);
                        callback(undefined, stdout, stderr);
                    }));
                }
                MacApplet(instance, (function(error, stdout, stderr) {
                    if (error) return end(error, stdout, stderr);
                    MacIcon(instance, (function(error) {
                        if (error) return end(error);
                        MacPropertyList(instance, (function(error, stdout, stderr) {
                            if (error) return end(error, stdout, stderr);
                            MacCommand(instance, (function(error) {
                                if (error) return end(error);
                                MacOpen(instance, (function(error, stdout, stderr) {
                                    if (error) return end(error, stdout, stderr);
                                    MacResult(instance, end);
                                }));
                            }));
                        }));
                    }));
                }));
            }));
        }
        function MacApplet(instance, end) {
            var parent = Node.path.dirname(instance.path);
            Node.fs.mkdir(parent, (function(error) {
                if (error) return end(error);
                var zip = Node.path.join(parent, "sudo-prompt-applet.zip");
                Node.fs.writeFile(zip, APPLET, "base64", (function(error) {
                    if (error) return end(error);
                    var command = [];
                    command.push("/usr/bin/unzip");
                    command.push("-o");
                    command.push('"' + EscapeDoubleQuotes(zip) + '"');
                    command.push('-d "' + EscapeDoubleQuotes(instance.path) + '"');
                    command = command.join(" ");
                    Node.child.exec(command, {
                        encoding: "utf-8"
                    }, end);
                }));
            }));
        }
        function MacCommand(instance, end) {
            var path = Node.path.join(instance.path, "Contents", "MacOS", "sudo-prompt-command");
            var script = [];
            script.push('cd "' + EscapeDoubleQuotes(Node.process.cwd()) + '"');
            for (var key in instance.options.env) {
                var value = instance.options.env[key];
                script.push("export " + key + '="' + EscapeDoubleQuotes(value) + '"');
            }
            script.push(instance.command);
            script = script.join("\n");
            Node.fs.writeFile(path, script, "utf-8", end);
        }
        function MacIcon(instance, end) {
            if (!instance.options.icns) return end();
            Node.fs.readFile(instance.options.icns, (function(error, buffer) {
                if (error) return end(error);
                var icns = Node.path.join(instance.path, "Contents", "Resources", "applet.icns");
                Node.fs.writeFile(icns, buffer, end);
            }));
        }
        function MacOpen(instance, end) {
            var binary = Node.path.join(instance.path, "Contents", "MacOS", "applet");
            var options = {
                cwd: Node.path.dirname(binary),
                encoding: "utf-8"
            };
            Node.child.exec("./" + Node.path.basename(binary), options, end);
        }
        function MacPropertyList(instance, end) {
            var plist = Node.path.join(instance.path, "Contents", "Info.plist");
            var path = EscapeDoubleQuotes(plist);
            var key = EscapeDoubleQuotes("CFBundleName");
            var value = instance.options.name + " Password Prompt";
            if (/'/.test(value)) {
                return end(new Error("Value should not contain single quotes."));
            }
            var command = [];
            command.push("/usr/bin/defaults");
            command.push("write");
            command.push('"' + path + '"');
            command.push('"' + key + '"');
            command.push("'" + value + "'");
            command = command.join(" ");
            Node.child.exec(command, {
                encoding: "utf-8"
            }, end);
        }
        function MacResult(instance, end) {
            var cwd = Node.path.join(instance.path, "Contents", "MacOS");
            Node.fs.readFile(Node.path.join(cwd, "code"), "utf-8", (function(error, code) {
                if (error) {
                    if (error.code === "ENOENT") return end(new Error(PERMISSION_DENIED));
                    end(error);
                } else {
                    Node.fs.readFile(Node.path.join(cwd, "stdout"), "utf-8", (function(error, stdout) {
                        if (error) return end(error);
                        Node.fs.readFile(Node.path.join(cwd, "stderr"), "utf-8", (function(error, stderr) {
                            if (error) return end(error);
                            code = parseInt(code.trim(), 10);
                            if (code === 0) {
                                end(undefined, stdout, stderr);
                            } else {
                                error = new Error("Command failed: " + instance.command + "\n" + stderr);
                                error.code = code;
                                end(error, stdout, stderr);
                            }
                        }));
                    }));
                }
            }));
        }
        function Remove(path, end) {
            if (typeof path !== "string" || !path.trim()) {
                return end(new Error("Argument path not defined."));
            }
            var command = [];
            if (Node.process.platform === "win32") {
                if (/"/.test(path)) {
                    return end(new Error("Argument path cannot contain double-quotes."));
                }
                command.push('rmdir /s /q "' + path + '"');
            } else {
                command.push("/bin/rm");
                command.push("-rf");
                command.push('"' + EscapeDoubleQuotes(Node.path.normalize(path)) + '"');
            }
            command = command.join(" ");
            Node.child.exec(command, {
                encoding: "utf-8"
            }, end);
        }
        function UUID(instance, end) {
            Node.crypto.randomBytes(256, (function(error, random) {
                if (error) random = Date.now() + "" + Math.random();
                var hash = Node.crypto.createHash("SHA256");
                hash.update("sudo-prompt-3");
                hash.update(instance.options.name);
                hash.update(instance.command);
                hash.update(random);
                var uuid = hash.digest("hex").slice(-32);
                if (!uuid || typeof uuid !== "string" || uuid.length !== 32) {
                    return end(new Error("Expected a valid UUID."));
                }
                end(undefined, uuid);
            }));
        }
        function ValidName(string) {
            if (!/^[a-z0-9 ]+$/i.test(string)) return false;
            if (string.trim().length === 0) return false;
            if (string.length > 70) return false;
            return true;
        }
        function Windows(instance, callback) {
            var temp = Node.os.tmpdir();
            if (!temp) return callback(new Error("os.tmpdir() not defined."));
            UUID(instance, (function(error, uuid) {
                if (error) return callback(error);
                instance.uuid = uuid;
                instance.path = Node.path.join(temp, instance.uuid);
                if (/"/.test(instance.path)) {
                    return callback(new Error("instance.path cannot contain double-quotes."));
                }
                instance.pathElevate = Node.path.join(instance.path, "elevate.vbs");
                instance.pathExecute = Node.path.join(instance.path, "execute.bat");
                instance.pathCommand = Node.path.join(instance.path, "command.bat");
                instance.pathStdout = Node.path.join(instance.path, "stdout");
                instance.pathStderr = Node.path.join(instance.path, "stderr");
                instance.pathStatus = Node.path.join(instance.path, "status");
                Node.fs.mkdir(instance.path, (function(error) {
                    if (error) return callback(error);
                    function end(error, stdout, stderr) {
                        Remove(instance.path, (function(errorRemove) {
                            if (error) return callback(error);
                            if (errorRemove) return callback(errorRemove);
                            callback(undefined, stdout, stderr);
                        }));
                    }
                    WindowsWriteExecuteScript(instance, (function(error) {
                        if (error) return end(error);
                        WindowsWriteCommandScript(instance, (function(error) {
                            if (error) return end(error);
                            WindowsCopyCmd(instance, (function(error) {
                                if (error) return end(error);
                                WindowsElevate(instance, (function(error, stdout, stderr) {
                                    if (error) return end(error, stdout, stderr);
                                    WindowsWaitForStatus(instance, (function(error) {
                                        if (error) return end(error);
                                        WindowsResult(instance, end);
                                    }));
                                }));
                            }));
                        }));
                    }));
                }));
            }));
        }
        function WindowsNeedsCopyCmd(instance) {
            const specialChars = [ "&", "`", "'", '"', "<", ">", "|", "^" ];
            for (const specialChar of specialChars) {
                if (instance.path.includes(specialChar)) {
                    return true;
                }
            }
            return false;
        }
        function WindowsCopyCmd(instance, end) {
            if (!WindowsNeedsCopyCmd(instance)) {
                end();
                return;
            }
            Node.fs.copyFile(Node.path.join(Node.process.env.SystemRoot, "System32", "cmd.exe"), Node.path.join(instance.path, "cmd.exe"), end);
        }
        function WindowsElevate(instance, end) {
            var command = [];
            command.push("powershell.exe");
            command.push("Start-Process");
            command.push("-FilePath");
            var options = {
                encoding: "utf8"
            };
            if (WindowsNeedsCopyCmd(instance)) {
                command.push([ ".", "cmd.exe" ].join(Node.path.sep));
                command.push("-ArgumentList");
                command.push('"/C","execute.bat"');
                options.cwd = instance.path;
            } else {
                command.push("\"'" + instance.pathExecute.replace(/'/g, "`'") + "'\"");
            }
            command.push("-WindowStyle hidden");
            command.push("-Verb runAs");
            command = command.join(" ");
            var child = Node.child.exec(command, options, (function(error, stdout, stderr) {
                if (error) return end(new Error(PERMISSION_DENIED), stdout, stderr);
                end();
            }));
            child.stdin.end();
        }
        function WindowsResult(instance, end) {
            Node.fs.readFile(instance.pathStatus, "utf-8", (function(error, code) {
                if (error) return end(error);
                Node.fs.readFile(instance.pathStdout, "utf-8", (function(error, stdout) {
                    if (error) return end(error);
                    Node.fs.readFile(instance.pathStderr, "utf-8", (function(error, stderr) {
                        if (error) return end(error);
                        code = parseInt(code.trim(), 10);
                        if (code === 0) {
                            end(undefined, stdout, stderr);
                        } else {
                            error = new Error("Command failed: " + instance.command + "\r\n" + stderr);
                            error.code = code;
                            end(error, stdout, stderr);
                        }
                    }));
                }));
            }));
        }
        function WindowsWaitForStatus(instance, end) {
            Node.fs.stat(instance.pathStatus, (function(error, stats) {
                if (error && error.code === "ENOENT" || stats.size < 2) {
                    setTimeout((function() {
                        Node.fs.stat(instance.pathStdout, (function(error) {
                            if (error) return end(new Error(PERMISSION_DENIED));
                            WindowsWaitForStatus(instance, end);
                        }));
                    }), 1e3);
                } else if (error) {
                    end(error);
                } else {
                    end();
                }
            }));
        }
        function WindowsWriteCommandScript(instance, end) {
            var cwd = Node.process.cwd();
            if (/"/.test(cwd)) {
                return end(new Error("process.cwd() cannot contain double-quotes."));
            }
            var script = [];
            script.push("@echo off");
            script.push("chcp 65001>nul");
            script.push('cd /d "' + cwd + '"');
            for (var key in instance.options.env) {
                var value = instance.options.env[key];
                script.push("set " + key + "=" + value.replace(/([<>\\|&^])/g, "^$1"));
            }
            script.push(instance.command);
            script = script.join("\r\n");
            Node.fs.writeFile(instance.pathCommand, script, "utf-8", end);
        }
        function WindowsWriteElevateScript(instance, end) {}
        function WindowsWriteExecuteScript(instance, end) {
            var script = [];
            script.push("@echo off");
            script.push('call "' + instance.pathCommand + '"' + ' > "' + instance.pathStdout + '" 2> "' + instance.pathStderr + '"');
            script.push('(echo %ERRORLEVEL%) > "' + instance.pathStatus + '"');
            script = script.join("\r\n");
            Node.fs.writeFile(instance.pathExecute, script, "utf-8", end);
        }
        module.exports.G = Exec;
        var APPLET = " ";
        var PERMISSION_DENIED = "User did not grant permission.";
        var NO_POLKIT_AGENT = "No polkit authentication agent found.";
        var MAX_BUFFER = 134217728;
    }, (module, __unused_webpack_exports, __webpack_require__) => {
        "use strict";
        var isOldIE = function isOldIE() {
            var memo;
            return function memorize() {
                if (typeof memo === "undefined") {
                    memo = Boolean(window && document && document.all && !window.atob);
                }
                return memo;
            };
        }();
        var getTarget = function getTarget() {
            var memo = {};
            return function memorize(target) {
                if (typeof memo[target] === "undefined") {
                    var styleTarget = document.querySelector(target);
                    if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
                        try {
                            styleTarget = styleTarget.contentDocument.head;
                        } catch (e) {
                            styleTarget = null;
                        }
                    }
                    memo[target] = styleTarget;
                }
                return memo[target];
            };
        }();
        var stylesInDom = [];
        function getIndexByIdentifier(identifier) {
            var result = -1;
            for (var i = 0; i < stylesInDom.length; i++) {
                if (stylesInDom[i].identifier === identifier) {
                    result = i;
                    break;
                }
            }
            return result;
        }
        function modulesToDom(list, options) {
            var idCountMap = {};
            var identifiers = [];
            for (var i = 0; i < list.length; i++) {
                var item = list[i];
                var id = options.base ? item[0] + options.base : item[0];
                var count = idCountMap[id] || 0;
                var identifier = "".concat(id, " ").concat(count);
                idCountMap[id] = count + 1;
                var index = getIndexByIdentifier(identifier);
                var obj = {
                    css: item[1],
                    media: item[2],
                    sourceMap: item[3]
                };
                if (index !== -1) {
                    stylesInDom[index].references++;
                    stylesInDom[index].updater(obj);
                } else {
                    stylesInDom.push({
                        identifier,
                        updater: addStyle(obj, options),
                        references: 1
                    });
                }
                identifiers.push(identifier);
            }
            return identifiers;
        }
        function insertStyleElement(options) {
            var style = document.createElement("style");
            var attributes = options.attributes || {};
            if (typeof attributes.nonce === "undefined") {
                var nonce = true ? __webpack_require__.nc : 0;
                if (nonce) {
                    attributes.nonce = nonce;
                }
            }
            Object.keys(attributes).forEach((function(key) {
                style.setAttribute(key, attributes[key]);
            }));
            if (typeof options.insert === "function") {
                options.insert(style);
            } else {
                var target = getTarget(options.insert || "head");
                if (!target) {
                    throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
                }
                target.appendChild(style);
            }
            return style;
        }
        function removeStyleElement(style) {
            if (style.parentNode === null) {
                return false;
            }
            style.parentNode.removeChild(style);
        }
        var replaceText = function replaceText() {
            var textStore = [];
            return function replace(index, replacement) {
                textStore[index] = replacement;
                return textStore.filter(Boolean).join("\n");
            };
        }();
        function applyToSingletonTag(style, index, remove, obj) {
            var css = remove ? "" : obj.media ? "@media ".concat(obj.media, " {").concat(obj.css, "}") : obj.css;
            if (style.styleSheet) {
                style.styleSheet.cssText = replaceText(index, css);
            } else {
                var cssNode = document.createTextNode(css);
                var childNodes = style.childNodes;
                if (childNodes[index]) {
                    style.removeChild(childNodes[index]);
                }
                if (childNodes.length) {
                    style.insertBefore(cssNode, childNodes[index]);
                } else {
                    style.appendChild(cssNode);
                }
            }
        }
        function applyToTag(style, options, obj) {
            var css = obj.css;
            var media = obj.media;
            var sourceMap = obj.sourceMap;
            if (media) {
                style.setAttribute("media", media);
            } else {
                style.removeAttribute("media");
            }
            if (sourceMap && typeof btoa !== "undefined") {
                css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
            }
            if (style.styleSheet) {
                style.styleSheet.cssText = css;
            } else {
                while (style.firstChild) {
                    style.removeChild(style.firstChild);
                }
                style.appendChild(document.createTextNode(css));
            }
        }
        var singleton = null;
        var singletonCounter = 0;
        function addStyle(obj, options) {
            var style;
            var update;
            var remove;
            if (options.singleton) {
                var styleIndex = singletonCounter++;
                style = singleton || (singleton = insertStyleElement(options));
                update = applyToSingletonTag.bind(null, style, styleIndex, false);
                remove = applyToSingletonTag.bind(null, style, styleIndex, true);
            } else {
                style = insertStyleElement(options);
                update = applyToTag.bind(null, style, options);
                remove = function remove() {
                    removeStyleElement(style);
                };
            }
            update(obj);
            return function updateStyle(newObj) {
                if (newObj) {
                    if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {
                        return;
                    }
                    update(obj = newObj);
                } else {
                    remove();
                }
            };
        }
        module.exports = function(list, options) {
            options = options || {};
            if (!options.singleton && typeof options.singleton !== "boolean") {
                options.singleton = isOldIE();
            }
            list = list || [];
            var lastIdentifiers = modulesToDom(list, options);
            return function update(newList) {
                newList = newList || [];
                if (Object.prototype.toString.call(newList) !== "[object Array]") {
                    return;
                }
                for (var i = 0; i < lastIdentifiers.length; i++) {
                    var identifier = lastIdentifiers[i];
                    var index = getIndexByIdentifier(identifier);
                    stylesInDom[index].references--;
                }
                var newLastIdentifiers = modulesToDom(newList, options);
                for (var _i = 0; _i < lastIdentifiers.length; _i++) {
                    var _identifier = lastIdentifiers[_i];
                    var _index = getIndexByIdentifier(_identifier);
                    if (stylesInDom[_index].references === 0) {
                        stylesInDom[_index].updater();
                        stylesInDom.splice(_index, 1);
                    }
                }
                lastIdentifiers = newLastIdentifiers;
            };
        };
    }, (module, __webpack_exports__, __webpack_require__) => {
        "use strict";
        __webpack_require__.d(__webpack_exports__, {
            Z: () => __WEBPACK_DEFAULT_EXPORT__
        });
        var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(689);
        var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
        var _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(690);
        var _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_1__);
        var _fonts_SourceSansPro_Regular_ttf__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(691);
        var _fonts_SourceSansPro_SemiBold_ttf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(692);
        var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()((function(i) {
            return i[1];
        }));
        var ___CSS_LOADER_URL_REPLACEMENT_0___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_1___default()(_fonts_SourceSansPro_Regular_ttf__WEBPACK_IMPORTED_MODULE_2__.Z);
        var ___CSS_LOADER_URL_REPLACEMENT_1___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_1___default()(_fonts_SourceSansPro_SemiBold_ttf__WEBPACK_IMPORTED_MODULE_3__.Z);
        ___CSS_LOADER_EXPORT___.push([ module.id, '/*\n * Copyright 2016 balena.io\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n@font-face {\n  font-family: "SourceSansPro";\n  src: url(' + ___CSS_LOADER_URL_REPLACEMENT_0___ + ') format("truetype");\n  font-weight: 500;\n  font-style: normal;\n}\n\n@font-face {\n  font-family: "SourceSansPro";\n  src: url(' + ___CSS_LOADER_URL_REPLACEMENT_1___ + ') format("truetype");\n  font-weight: 600;\n  font-style: normal;\n}\n\nhtml,\nbody {\n  margin: 0;\n  overflow: hidden;\n\n  /* Prevent white flash when running application */\n  background-color: #4d5057;\n\n  /* Prevent WebView bounce effect in OS X */\n  height: 100%;\n  width: 100%;\n}\n\n/* Prevent text selection */\nbody {\n  -webkit-user-select: none;\n  -webkit-overflow-scrolling: touch;\n}\n\n/* Prevent blue outline */\na:focus,\ninput:focus,\nbutton:focus,\n[tabindex]:focus,\ninput[type="checkbox"] + div {\n  outline: none !important;\n  box-shadow: none !important;\n}\n\n.disabled {\n  opacity: 0.4;\n}\n\n#rendition-tooltip-root > div {\n  font-family: "SourceSansPro", sans-serif;\n}\n', "" ]);
        const __WEBPACK_DEFAULT_EXPORT__ = ___CSS_LOADER_EXPORT___;
    }, module => {
        "use strict";
        module.exports = function(cssWithMappingToString) {
            var list = [];
            list.toString = function toString() {
                return this.map((function(item) {
                    var content = cssWithMappingToString(item);
                    if (item[2]) {
                        return "@media ".concat(item[2], " {").concat(content, "}");
                    }
                    return content;
                })).join("");
            };
            list.i = function(modules, mediaQuery, dedupe) {
                if (typeof modules === "string") {
                    modules = [ [ null, modules, "" ] ];
                }
                var alreadyImportedModules = {};
                if (dedupe) {
                    for (var i = 0; i < this.length; i++) {
                        var id = this[i][0];
                        if (id != null) {
                            alreadyImportedModules[id] = true;
                        }
                    }
                }
                for (var _i = 0; _i < modules.length; _i++) {
                    var item = [].concat(modules[_i]);
                    if (dedupe && alreadyImportedModules[item[0]]) {
                        continue;
                    }
                    if (mediaQuery) {
                        if (!item[2]) {
                            item[2] = mediaQuery;
                        } else {
                            item[2] = "".concat(mediaQuery, " and ").concat(item[2]);
                        }
                    }
                    list.push(item);
                }
            };
            return list;
        };
    }, module => {
        "use strict";
        module.exports = function(url, options) {
            if (!options) {
                options = {};
            }
            url = url && url.__esModule ? url.default : url;
            if (typeof url !== "string") {
                return url;
            }
            if (/^['"].*['"]$/.test(url)) {
                url = url.slice(1, -1);
            }
            if (options.hash) {
                url += options.hash;
            }
            if (/["'() \t\n]/.test(url) || options.needQuotes) {
                return '"'.concat(url.replace(/"/g, '\\"').replace(/\n/g, "\\n"), '"');
            }
            return url;
        };
    }, (__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
        "use strict";
        __webpack_require__.d(__webpack_exports__, {
            Z: () => __WEBPACK_DEFAULT_EXPORT__
        });
        const __WEBPACK_DEFAULT_EXPORT__ = __webpack_require__.p + "lib/gui/app/css/fonts/SourceSansPro-Regular.ttf";
    }, (__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
        "use strict";
        __webpack_require__.d(__webpack_exports__, {
            Z: () => __WEBPACK_DEFAULT_EXPORT__
        });
        const __WEBPACK_DEFAULT_EXPORT__ = __webpack_require__.p + "lib/gui/app/css/fonts/SourceSansPro-SemiBold.ttf";
    } ];
    var __webpack_module_cache__ = {};
    function __webpack_require__(moduleId) {
        if (__webpack_module_cache__[moduleId]) {
            return __webpack_module_cache__[moduleId].exports;
        }
        var module = __webpack_module_cache__[moduleId] = {
            id: moduleId,
            loaded: false,
            exports: {}
        };
        __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
        module.loaded = true;
        return module.exports;
    }
    (() => {
        __webpack_require__.n = module => {
            var getter = module && module.__esModule ? () => module["default"] : () => module;
            __webpack_require__.d(getter, {
                a: getter
            });
            return getter;
        };
    })();
    (() => {
        __webpack_require__.d = (exports, definition) => {
            for (var key in definition) {
                if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
                    Object.defineProperty(exports, key, {
                        enumerable: true,
                        get: definition[key]
                    });
                }
            }
        };
    })();
    (() => {
        __webpack_require__.g = function() {
            if (typeof globalThis === "object") return globalThis;
            try {
                return this || new Function("return this")();
            } catch (e) {
                if (typeof window === "object") return window;
            }
        }();
    })();
    (() => {
        __webpack_require__.hmd = module => {
            module = Object.create(module);
            if (!module.children) module.children = [];
            Object.defineProperty(module, "exports", {
                enumerable: true,
                set: () => {
                    throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: " + module.id);
                }
            });
            return module;
        };
    })();
    (() => {
        __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
    })();
    (() => {
        __webpack_require__.r = exports => {
            if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
                Object.defineProperty(exports, Symbol.toStringTag, {
                    value: "Module"
                });
            }
            Object.defineProperty(exports, "__esModule", {
                value: true
            });
        };
    })();
    (() => {
        __webpack_require__.nmd = module => {
            module.paths = [];
            if (!module.children) module.children = [];
            return module;
        };
    })();
    (() => {
        var scriptUrl;
        if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
        var document = __webpack_require__.g.document;
        if (!scriptUrl && document) {
            if (document.currentScript) scriptUrl = document.currentScript.src;
            if (!scriptUrl) {
                var scripts = document.getElementsByTagName("script");
                if (scripts.length) scriptUrl = scripts[scripts.length - 1].src;
            }
        }
        if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
        scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
        __webpack_require__.p = scriptUrl;
    })();
    var __webpack_exports__ = {};
    (() => {
        "use strict";
        var external_electron_ = __webpack_require__(1);
        var build = __webpack_require__(2);
        var lodash = __webpack_require__(284);
        var lib_module = __webpack_require__(103);
        var react = __webpack_require__(285);
        var react_dom = __webpack_require__(288);
        var getRandomValues;
        var rnds8 = new Uint8Array(16);
        function rng() {
            if (!getRandomValues) {
                getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== "undefined" && typeof msCrypto.getRandomValues === "function" && msCrypto.getRandomValues.bind(msCrypto);
                if (!getRandomValues) {
                    throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
                }
            }
            return getRandomValues(rnds8);
        }
        const regex = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
        function validate(uuid) {
            return typeof uuid === "string" && regex.test(uuid);
        }
        const esm_browser_validate = validate;
        var byteToHex = [];
        for (var i = 0; i < 256; ++i) {
            byteToHex.push((i + 256).toString(16).substr(1));
        }
        function stringify(arr) {
            var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
            var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
            if (!esm_browser_validate(uuid)) {
                throw TypeError("Stringified UUID is invalid");
            }
            return uuid;
        }
        const esm_browser_stringify = stringify;
        function v4(options, buf, offset) {
            options = options || {};
            var rnds = options.random || (options.rng || rng)();
            rnds[6] = rnds[6] & 15 | 64;
            rnds[8] = rnds[8] & 63 | 128;
            if (buf) {
                offset = offset || 0;
                for (var i = 0; i < 16; ++i) {
                    buf[offset + i] = rnds[i];
                }
                return buf;
            }
            return esm_browser_stringify(rnds);
        }
        const esm_browser_v4 = v4;
        var external_package_json_ = __webpack_require__(199);
        var path_is_inside = __webpack_require__(292);
        var pretty_bytes = __webpack_require__(293);
        const progress = {
            successful: quantity => {
                const plural = quantity === 1 ? "" : "s";
                return `Successful target${plural}`;
            },
            failed: quantity => {
                const plural = quantity === 1 ? "" : "s";
                return `Failed target${plural}`;
            }
        };
        const info = {
            flashComplete: (imageBasename, [drive], {failed, successful}) => {
                const targets = [];
                if (failed + successful === 1) {
                    targets.push(`to ${drive.description} (${drive.displayName})`);
                } else {
                    if (successful) {
                        const plural = successful === 1 ? "" : "s";
                        targets.push(`to ${successful} target${plural}`);
                    }
                    if (failed) {
                        const plural = failed === 1 ? "" : "s";
                        targets.push(`and failed to be flashed to ${failed} target${plural}`);
                    }
                }
                return `${imageBasename} was successfully flashed ${targets.join(" ")}`;
            }
        };
        const compatibility = {
            sizeNotRecommended: () => "Not recommended",
            tooSmall: () => "Too small",
            locked: () => "Locked",
            system: () => "System drive",
            containsImage: () => "Source drive",
            largeDrive: () => "Large drive"
        };
        const warning = {
            tooSmall: (source, target) => (0, lib_module.outdent)({
                newline: " "
            })`
			The selected source is ${pretty_bytes(source.size - target.size)}
			larger than this drive.
		`,
            exitWhileFlashing: () => [ "You are currently flashing a drive.", "Closing Etcher may leave your drive in an unusable state." ].join(" "),
            looksLikeWindowsImage: () => [ "It looks like you are trying to burn a Windows image.\n\n", "Unlike other images, Windows images require special processing to be made bootable.", "We suggest you use a tool specially designed for this purpose, such as", '<a href="https://rufus.akeo.ie">Rufus</a> (Windows),', '<a href="https://github.com/slacka/WoeUSB">WoeUSB</a> (Linux),', "or Boot Camp Assistant (macOS)." ].join(" "),
            missingPartitionTable: () => [ "It looks like this is not a bootable image.\n\n", "The image does not appear to contain a partition table,", "and might not be recognized or bootable by your device." ].join(" "),
            driveMissingPartitionTable: () => (0, lib_module.outdent)({
                newline: " "
            })`
			It looks like this is not a bootable drive.
			The drive does not appear to contain a partition table,
			and might not be recognized or bootable by your device.
		`,
            largeDriveSize: () => "This is a large drive! Make sure it doesn't contain files that you want to keep.",
            systemDrive: () => "Selecting your system drive is dangerous and will erase your drive!",
            sourceDrive: () => "Contains the image you chose to flash"
        };
        const messages_error = {
            notEnoughSpaceInDrive: () => [ "Not enough space on the drive.", "Please insert larger one and try again." ].join(" "),
            genericFlashError: err => `Something went wrong. If it is a compressed image, please check that the archive is not corrupted.\n${err.message}`,
            validation: () => [ "The write has been completed successfully but Etcher detected potential", "corruption issues when reading the image back from the drive.", "\n\nPlease consider writing the image to a different drive." ].join(" "),
            openSource: (sourceName, errorMessage) => lib_module.outdent`
			Something went wrong while opening ${sourceName}

			Error: ${errorMessage}
		`,
            flashFailure: (imageBasename, drives) => {
                const target = drives.length === 1 ? `${drives[0].description} (${drives[0].displayName})` : `${drives.length} targets`;
                return `Something went wrong while writing ${imageBasename} to ${target}.`;
            },
            driveUnplugged: () => [ "Looks like Etcher lost access to the drive.", "Did it get unplugged accidentally?", "\n\nSometimes this error is caused by faulty readers that don't provide stable access to the drive." ].join(" "),
            inputOutput: () => [ "Looks like Etcher is not able to write to this location of the drive.", "This error is usually caused by a faulty drive, reader, or port.", "\n\nPlease try again with another drive, reader, or port." ].join(" "),
            childWriterDied: () => [ "The writer process ended unexpectedly.", "Please try again, and contact the Etcher team if the problem persists." ].join(" "),
            unsupportedProtocol: () => "Only http:// and https:// URLs are supported."
        };
        const UNKNOWN_SIZE = 0;
        function isSystemDrive(drive) {
            return Boolean(drive.isSystem);
        }
        function sourceIsInsideDrive(source, drive) {
            for (const mountpoint of drive.mountpoints || []) {
                if (path_is_inside(source, mountpoint.path)) {
                    return true;
                }
            }
            return false;
        }
        function isSourceDrive(drive, selection) {
            if (selection) {
                if (selection.drive) {
                    return selection.drive.device === drive.device;
                }
                if (selection.path) {
                    return sourceIsInsideDrive(selection.path, drive);
                }
            }
            return false;
        }
        function isDriveLargeEnough(drive, image) {
            const driveSize = drive.size || UNKNOWN_SIZE;
            if (image === undefined) {
                return true;
            }
            if (image.isSizeEstimated) {
                if (driveSize < (image.compressedSize || UNKNOWN_SIZE)) {
                    return false;
                }
                return true;
            }
            return driveSize >= (image.size || UNKNOWN_SIZE);
        }
        function isDriveValid(drive, image, write = true) {
            return !write || !drive.disabled && isDriveLargeEnough(drive, image) && !isSourceDrive(drive, image);
        }
        function isDriveSizeRecommended(drive, image) {
            const driveSize = drive.size || UNKNOWN_SIZE;
            return driveSize >= ((image === null || image === void 0 ? void 0 : image.recommendedDriveSize) || UNKNOWN_SIZE);
        }
        const LARGE_DRIVE_SIZE = 128e9;
        function isDriveSizeLarge(drive) {
            const driveSize = drive.size || UNKNOWN_SIZE;
            return driveSize > LARGE_DRIVE_SIZE;
        }
        const COMPATIBILITY_STATUS_TYPES = {
            WARNING: 1,
            ERROR: 2
        };
        const statuses = {
            locked: {
                type: COMPATIBILITY_STATUS_TYPES.ERROR,
                message: compatibility.locked()
            },
            system: {
                type: COMPATIBILITY_STATUS_TYPES.WARNING,
                message: compatibility.system()
            },
            containsImage: {
                type: COMPATIBILITY_STATUS_TYPES.ERROR,
                message: compatibility.containsImage()
            },
            large: {
                type: COMPATIBILITY_STATUS_TYPES.WARNING,
                message: compatibility.largeDrive()
            },
            small: {
                type: COMPATIBILITY_STATUS_TYPES.ERROR,
                message: compatibility.tooSmall()
            },
            sizeNotRecommended: {
                type: COMPATIBILITY_STATUS_TYPES.WARNING,
                message: compatibility.sizeNotRecommended()
            }
        };
        function getDriveImageCompatibilityStatuses(drive, image, write) {
            const statusList = [];
            if (drive.isReadOnly && write) {
                statusList.push({
                    type: COMPATIBILITY_STATUS_TYPES.ERROR,
                    message: compatibility.locked()
                });
            }
            if (!lodash.isNil(drive) && !lodash.isNil(drive.size) && !isDriveLargeEnough(drive, image)) {
                statusList.push(statuses.small);
            } else {
                if (isSystemDrive(drive)) {
                    statusList.push(statuses.system);
                } else if (isDriveSizeLarge(drive)) {
                    statusList.push(statuses.large);
                }
                if (isSourceDrive(drive, image)) {
                    statusList.push(statuses.containsImage);
                }
                if (image !== undefined && !lodash.isNil(drive) && !isDriveSizeRecommended(drive, image)) {
                    statusList.push(statuses.sizeNotRecommended);
                }
            }
            return statusList;
        }
        function getListDriveImageCompatibilityStatuses(drives, image, write) {
            return drives.flatMap((drive => getDriveImageCompatibilityStatuses(drive, image, write)));
        }
        function hasDriveImageCompatibilityStatus(drive, image, write) {
            return Boolean(getDriveImageCompatibilityStatuses(drive, image, write).length);
        }
        const SUCCESS = 0;
        const GENERAL_ERROR = 1;
        const VALIDATION_ERROR = 2;
        const CANCELLED = 3;
        var immutable = __webpack_require__(294);
        var external_path_ = __webpack_require__(15);
        var es = __webpack_require__(295);
        var randomString = function randomString() {
            return Math.random().toString(36).substring(7).split("").join(".");
        };
        var ActionTypes = {
            INIT: "@@redux/INIT" + randomString(),
            REPLACE: "@@redux/REPLACE" + randomString(),
            PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
                return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
            }
        };
        function isPlainObject(obj) {
            if (typeof obj !== "object" || obj === null) return false;
            var proto = obj;
            while (Object.getPrototypeOf(proto) !== null) {
                proto = Object.getPrototypeOf(proto);
            }
            return Object.getPrototypeOf(obj) === proto;
        }
        function createStore(reducer, preloadedState, enhancer) {
            var _ref2;
            if (typeof preloadedState === "function" && typeof enhancer === "function" || typeof enhancer === "function" && typeof arguments[3] === "function") {
                throw new Error("It looks like you are passing several store enhancers to " + "createStore(). This is not supported. Instead, compose them " + "together to a single function.");
            }
            if (typeof preloadedState === "function" && typeof enhancer === "undefined") {
                enhancer = preloadedState;
                preloadedState = undefined;
            }
            if (typeof enhancer !== "undefined") {
                if (typeof enhancer !== "function") {
                    throw new Error("Expected the enhancer to be a function.");
                }
                return enhancer(createStore)(reducer, preloadedState);
            }
            if (typeof reducer !== "function") {
                throw new Error("Expected the reducer to be a function.");
            }
            var currentReducer = reducer;
            var currentState = preloadedState;
            var currentListeners = [];
            var nextListeners = currentListeners;
            var isDispatching = false;
            function ensureCanMutateNextListeners() {
                if (nextListeners === currentListeners) {
                    nextListeners = currentListeners.slice();
                }
            }
            function getState() {
                if (isDispatching) {
                    throw new Error("You may not call store.getState() while the reducer is executing. " + "The reducer has already received the state as an argument. " + "Pass it down from the top reducer instead of reading it from the store.");
                }
                return currentState;
            }
            function subscribe(listener) {
                if (typeof listener !== "function") {
                    throw new Error("Expected the listener to be a function.");
                }
                if (isDispatching) {
                    throw new Error("You may not call store.subscribe() while the reducer is executing. " + "If you would like to be notified after the store has been updated, subscribe from a " + "component and invoke store.getState() in the callback to access the latest state. " + "See https://redux.js.org/api-reference/store#subscribelistener for more details.");
                }
                var isSubscribed = true;
                ensureCanMutateNextListeners();
                nextListeners.push(listener);
                return function unsubscribe() {
                    if (!isSubscribed) {
                        return;
                    }
                    if (isDispatching) {
                        throw new Error("You may not unsubscribe from a store listener while the reducer is executing. " + "See https://redux.js.org/api-reference/store#subscribelistener for more details.");
                    }
                    isSubscribed = false;
                    ensureCanMutateNextListeners();
                    var index = nextListeners.indexOf(listener);
                    nextListeners.splice(index, 1);
                    currentListeners = null;
                };
            }
            function dispatch(action) {
                if (!isPlainObject(action)) {
                    throw new Error("Actions must be plain objects. " + "Use custom middleware for async actions.");
                }
                if (typeof action.type === "undefined") {
                    throw new Error('Actions may not have an undefined "type" property. ' + "Have you misspelled a constant?");
                }
                if (isDispatching) {
                    throw new Error("Reducers may not dispatch actions.");
                }
                try {
                    isDispatching = true;
                    currentState = currentReducer(currentState, action);
                } finally {
                    isDispatching = false;
                }
                var listeners = currentListeners = nextListeners;
                for (var i = 0; i < listeners.length; i++) {
                    var listener = listeners[i];
                    listener();
                }
                return action;
            }
            function replaceReducer(nextReducer) {
                if (typeof nextReducer !== "function") {
                    throw new Error("Expected the nextReducer to be a function.");
                }
                currentReducer = nextReducer;
                dispatch({
                    type: ActionTypes.REPLACE
                });
            }
            function observable() {
                var _ref;
                var outerSubscribe = subscribe;
                return _ref = {
                    subscribe: function subscribe(observer) {
                        if (typeof observer !== "object" || observer === null) {
                            throw new TypeError("Expected the observer to be an object.");
                        }
                        function observeState() {
                            if (observer.next) {
                                observer.next(getState());
                            }
                        }
                        observeState();
                        var unsubscribe = outerSubscribe(observeState);
                        return {
                            unsubscribe
                        };
                    }
                }, _ref[es.Z] = function() {
                    return this;
                }, _ref;
            }
            dispatch({
                type: ActionTypes.INIT
            });
            return _ref2 = {
                dispatch,
                subscribe,
                getState,
                replaceReducer
            }, _ref2[es.Z] = observable, _ref2;
        }
        function redux_warning(message) {
            if (typeof console !== "undefined" && typeof console.error === "function") {
                console.error(message);
            }
            try {
                throw new Error(message);
            } catch (e) {}
        }
        function getUndefinedStateErrorMessage(key, action) {
            var actionType = action && action.type;
            var actionDescription = actionType && 'action "' + String(actionType) + '"' || "an action";
            return "Given " + actionDescription + ', reducer "' + key + '" returned undefined. ' + "To ignore an action, you must explicitly return the previous state. " + "If you want this reducer to hold no value, you can return null instead of undefined.";
        }
        function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
            var reducerKeys = Object.keys(reducers);
            var argumentName = action && action.type === ActionTypes.INIT ? "preloadedState argument passed to createStore" : "previous state received by the reducer";
            if (reducerKeys.length === 0) {
                return "Store does not have a valid reducer. Make sure the argument passed " + "to combineReducers is an object whose values are reducers.";
            }
            if (!isPlainObject(inputState)) {
                return "The " + argumentName + ' has unexpected type of "' + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + '". Expected argument to be an object with the following ' + ('keys: "' + reducerKeys.join('", "') + '"');
            }
            var unexpectedKeys = Object.keys(inputState).filter((function(key) {
                return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
            }));
            unexpectedKeys.forEach((function(key) {
                unexpectedKeyCache[key] = true;
            }));
            if (action && action.type === ActionTypes.REPLACE) return;
            if (unexpectedKeys.length > 0) {
                return "Unexpected " + (unexpectedKeys.length > 1 ? "keys" : "key") + " " + ('"' + unexpectedKeys.join('", "') + '" found in ' + argumentName + ". ") + "Expected to find one of the known reducer keys instead: " + ('"' + reducerKeys.join('", "') + '". Unexpected keys will be ignored.');
            }
        }
        function assertReducerShape(reducers) {
            Object.keys(reducers).forEach((function(key) {
                var reducer = reducers[key];
                var initialState = reducer(undefined, {
                    type: ActionTypes.INIT
                });
                if (typeof initialState === "undefined") {
                    throw new Error('Reducer "' + key + '" returned undefined during initialization. ' + "If the state passed to the reducer is undefined, you must " + "explicitly return the initial state. The initial state may " + "not be undefined. If you don't want to set a value for this reducer, " + "you can use null instead of undefined.");
                }
                if (typeof reducer(undefined, {
                    type: ActionTypes.PROBE_UNKNOWN_ACTION()
                }) === "undefined") {
                    throw new Error('Reducer "' + key + '" returned undefined when probed with a random type. ' + ("Don't try to handle " + ActionTypes.INIT + ' or other actions in "redux/*" ') + "namespace. They are considered private. Instead, you must return the " + "current state for any unknown actions, unless it is undefined, " + "in which case you must return the initial state, regardless of the " + "action type. The initial state may not be undefined, but can be null.");
                }
            }));
        }
        function combineReducers(reducers) {
            var reducerKeys = Object.keys(reducers);
            var finalReducers = {};
            for (var i = 0; i < reducerKeys.length; i++) {
                var key = reducerKeys[i];
                if (false) {}
                if (typeof reducers[key] === "function") {
                    finalReducers[key] = reducers[key];
                }
            }
            var finalReducerKeys = Object.keys(finalReducers);
            var unexpectedKeyCache;
            if (false) {}
            var shapeAssertionError;
            try {
                assertReducerShape(finalReducers);
            } catch (e) {
                shapeAssertionError = e;
            }
            return function combination(state, action) {
                if (state === void 0) {
                    state = {};
                }
                if (shapeAssertionError) {
                    throw shapeAssertionError;
                }
                if (false) {
                    var warningMessage;
                }
                var hasChanged = false;
                var nextState = {};
                for (var _i = 0; _i < finalReducerKeys.length; _i++) {
                    var _key = finalReducerKeys[_i];
                    var reducer = finalReducers[_key];
                    var previousStateForKey = state[_key];
                    var nextStateForKey = reducer(previousStateForKey, action);
                    if (typeof nextStateForKey === "undefined") {
                        var errorMessage = getUndefinedStateErrorMessage(_key, action);
                        throw new Error(errorMessage);
                    }
                    nextState[_key] = nextStateForKey;
                    hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
                }
                hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
                return hasChanged ? nextState : state;
            };
        }
        function bindActionCreator(actionCreator, dispatch) {
            return function() {
                return dispatch(actionCreator.apply(this, arguments));
            };
        }
        function bindActionCreators(actionCreators, dispatch) {
            if (typeof actionCreators === "function") {
                return bindActionCreator(actionCreators, dispatch);
            }
            if (typeof actionCreators !== "object" || actionCreators === null) {
                throw new Error("bindActionCreators expected an object or a function, instead received " + (actionCreators === null ? "null" : typeof actionCreators) + ". " + 'Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');
            }
            var boundActionCreators = {};
            for (var key in actionCreators) {
                var actionCreator = actionCreators[key];
                if (typeof actionCreator === "function") {
                    boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
                }
            }
            return boundActionCreators;
        }
        function _defineProperty(obj, key, value) {
            if (key in obj) {
                Object.defineProperty(obj, key, {
                    value,
                    enumerable: true,
                    configurable: true,
                    writable: true
                });
            } else {
                obj[key] = value;
            }
            return obj;
        }
        function ownKeys(object, enumerableOnly) {
            var keys = Object.keys(object);
            if (Object.getOwnPropertySymbols) {
                keys.push.apply(keys, Object.getOwnPropertySymbols(object));
            }
            if (enumerableOnly) keys = keys.filter((function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            }));
            return keys;
        }
        function _objectSpread2(target) {
            for (var i = 1; i < arguments.length; i++) {
                var source = arguments[i] != null ? arguments[i] : {};
                if (i % 2) {
                    ownKeys(source, true).forEach((function(key) {
                        _defineProperty(target, key, source[key]);
                    }));
                } else if (Object.getOwnPropertyDescriptors) {
                    Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
                } else {
                    ownKeys(source).forEach((function(key) {
                        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
                    }));
                }
            }
            return target;
        }
        function compose() {
            for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
                funcs[_key] = arguments[_key];
            }
            if (funcs.length === 0) {
                return function(arg) {
                    return arg;
                };
            }
            if (funcs.length === 1) {
                return funcs[0];
            }
            return funcs.reduce((function(a, b) {
                return function() {
                    return a(b.apply(void 0, arguments));
                };
            }));
        }
        function applyMiddleware() {
            for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
                middlewares[_key] = arguments[_key];
            }
            return function(createStore) {
                return function() {
                    var store = createStore.apply(void 0, arguments);
                    var _dispatch = function dispatch() {
                        throw new Error("Dispatching while constructing your middleware is not allowed. " + "Other middleware would not be applied to this dispatch.");
                    };
                    var middlewareAPI = {
                        getState: store.getState,
                        dispatch: function dispatch() {
                            return _dispatch.apply(void 0, arguments);
                        }
                    };
                    var chain = middlewares.map((function(middleware) {
                        return middleware(middlewareAPI);
                    }));
                    _dispatch = compose.apply(void 0, chain)(store.dispatch);
                    return _objectSpread2({}, store, {
                        dispatch: _dispatch
                    });
                };
            };
        }
        function isCrushed() {}
        if (false) {}
        const HUMAN_FRIENDLY = {
            ENOENT: {
                title: error => `No such file or directory: ${error.path}`,
                description: () => "The file you're trying to access doesn't exist"
            },
            EPERM: {
                title: () => "You're not authorized to perform this operation",
                description: () => "Please ensure you have necessary permissions for this task"
            },
            EACCES: {
                title: () => "You don't have access to this resource",
                description: () => "Please ensure you have necessary permissions to access this resource"
            },
            ENOMEM: {
                title: () => "Your system ran out of memory",
                description: () => "Please make sure your system has enough available memory for this task"
            }
        };
        function getUserFriendlyMessageProperty(error, property) {
            var _a, _b;
            if (typeof error.code !== "string") {
                return undefined;
            }
            return (_b = (_a = HUMAN_FRIENDLY[error.code]) === null || _a === void 0 ? void 0 : _a[property]) === null || _b === void 0 ? void 0 : _b.call(_a, error);
        }
        function isBlank(s) {
            if (typeof s === "number") {
                s = s.toString();
            }
            return (s !== null && s !== void 0 ? s : "").trim() === "";
        }
        function getTitle(error) {
            const codeTitle = getUserFriendlyMessageProperty(error, "title");
            if (codeTitle !== undefined) {
                return codeTitle;
            }
            const message = error.message;
            if (!isBlank(message)) {
                return message;
            }
            const code = error.code;
            if (!isBlank(code)) {
                return `Error code: ${code}`;
            }
            return "An error ocurred";
        }
        function getDescription(error) {
            if (!isBlank(error.description)) {
                return error.description;
            }
            const codeDescription = getUserFriendlyMessageProperty(error, "description");
            if (codeDescription !== undefined) {
                return codeDescription;
            }
            if (error.stack) {
                return error.stack;
            }
            return JSON.stringify(error, null, 2);
        }
        function createError(options) {
            if (isBlank(options.title)) {
                throw new Error(`Invalid error title: ${options.title}`);
            }
            const error = new Error(options.title);
            error.description = options.description;
            if (options.report === false) {
                error.report = false;
            }
            if (options.code !== undefined) {
                error.code = options.code;
            }
            return error;
        }
        function createUserError(options) {
            return createError({
                title: options.title,
                description: options.description,
                report: false,
                code: options.code
            });
        }
        function toJSON(error) {
            return {
                name: error.name,
                message: error.message,
                description: error.description,
                stack: error.stack,
                report: error.report,
                code: error.code,
                syscall: error.syscall,
                errno: error.errno,
                stdout: error.stdout,
                stderr: error.stderr,
                device: error.device
            };
        }
        function fromJSON(json) {
            return Object.assign(new Error(json.message), json);
        }
        var axios = __webpack_require__(175);
        var axios_default = __webpack_require__.n(axios);
        function isValidPercentage(percentage) {
            return typeof percentage === "number" && percentage >= 0 && percentage <= 100;
        }
        function percentageToFloat(percentage) {
            if (!isValidPercentage(percentage)) {
                throw createError({
                    title: `Invalid percentage: ${percentage}`
                });
            }
            return percentage / 100;
        }
        async function getConfig(configUrl) {
            configUrl = configUrl !== null && configUrl !== void 0 ? configUrl : "https://balena.io/etcher/static/config.json";
            const response = await axios_default().get(configUrl, {
                responseType: "json"
            });
            return response.data;
        }
        async function delay(duration) {
            await new Promise((resolve => {
                setTimeout(resolve, duration);
            }));
        }
        function getAppPath() {
            return (external_electron_.app || external_electron_.remote.app).getAppPath().replace(/\.asar$/, (() => process.platform === "darwin" ? "-" + process.arch : ""));
        }
        var browser = __webpack_require__(63);
        var external_fs_ = __webpack_require__(14);
        const debug = browser("etcher:models:settings");
        const JSON_INDENT = 2;
        const DEFAULT_WIDTH = 800;
        const DEFAULT_HEIGHT = 480;
        const app = external_electron_.app || external_electron_.remote.app;
        const USER_DATA_DIR = app.getPath("userData");
        const CONFIG_PATH = (0, external_path_.join)(USER_DATA_DIR, "config.json");
        async function readConfigFile(filename) {
            let contents = "{}";
            try {
                contents = await external_fs_.promises.readFile(filename, {
                    encoding: "utf8"
                });
            } catch (error) {}
            try {
                return JSON.parse(contents);
            } catch (parseError) {
                console.error(parseError);
                return {};
            }
        }
        async function readAll() {
            return await readConfigFile(CONFIG_PATH);
        }
        async function writeConfigFile(filename, data) {
            await external_fs_.promises.writeFile(filename, JSON.stringify(data, null, JSON_INDENT));
        }
        const DEFAULT_SETTINGS = {
            errorReporting: true,
            updatesEnabled: [ "appimage", "nsis", "dmg" ].includes(external_package_json_.packageType),
            desktopNotifications: true,
            autoBlockmapping: true,
            decompressFirst: true
        };
        const settings = lodash.cloneDeep(DEFAULT_SETTINGS);
        async function load() {
            debug("load");
            const loadedSettings = await readAll();
            lodash.assign(settings, loadedSettings);
        }
        const loaded = load();
        async function set(key, value, writeConfigFileFn = writeConfigFile) {
            debug("set", key, value);
            await loaded;
            const previousValue = settings[key];
            settings[key] = value;
            try {
                await writeConfigFileFn(CONFIG_PATH, settings);
            } catch (error) {
                settings[key] = previousValue;
                throw error;
            }
        }
        async function get(key) {
            await loaded;
            return getSync(key);
        }
        function getSync(key) {
            return lodash.cloneDeep(settings[key]);
        }
        async function getAll() {
            debug("getAll");
            await loaded;
            return lodash.cloneDeep(settings);
        }
        function verifyNoNilFields(object, fields, name) {
            const nilFields = lodash.filter(fields, (field => lodash.isNil(lodash.get(object, field))));
            if (nilFields.length) {
                throw new Error(`Missing ${name} fields: ${nilFields.join(", ")}`);
            }
        }
        const flashStateNoNilFields = [ "speed" ];
        const selectImageNoNilFields = [ "path", "extension" ];
        const DEFAULT_STATE = immutable.fromJS({
            applicationSessionUuid: "",
            flashingWorkflowUuid: "",
            availableDrives: [],
            selection: {
                devices: immutable.OrderedSet()
            },
            isFlashing: false,
            devicePaths: [],
            failedDeviceErrors: [],
            flashResults: {},
            flashState: {
                active: 0,
                failed: 0,
                percentage: 0,
                speed: null,
                averageSpeed: null
            },
            lastAverageFlashingSpeed: null
        });
        var Actions;
        (function(Actions) {
            Actions[Actions["SET_DEVICE_PATHS"] = 0] = "SET_DEVICE_PATHS";
            Actions[Actions["SET_FAILED_DEVICE_ERRORS"] = 1] = "SET_FAILED_DEVICE_ERRORS";
            Actions[Actions["SET_AVAILABLE_TARGETS"] = 2] = "SET_AVAILABLE_TARGETS";
            Actions[Actions["SET_FLASH_STATE"] = 3] = "SET_FLASH_STATE";
            Actions[Actions["RESET_FLASH_STATE"] = 4] = "RESET_FLASH_STATE";
            Actions[Actions["SET_FLASHING_FLAG"] = 5] = "SET_FLASHING_FLAG";
            Actions[Actions["UNSET_FLASHING_FLAG"] = 6] = "UNSET_FLASHING_FLAG";
            Actions[Actions["SELECT_TARGET"] = 7] = "SELECT_TARGET";
            Actions[Actions["SELECT_SOURCE"] = 8] = "SELECT_SOURCE";
            Actions[Actions["DESELECT_TARGET"] = 9] = "DESELECT_TARGET";
            Actions[Actions["DESELECT_SOURCE"] = 10] = "DESELECT_SOURCE";
            Actions[Actions["SET_APPLICATION_SESSION_UUID"] = 11] = "SET_APPLICATION_SESSION_UUID";
            Actions[Actions["SET_FLASHING_WORKFLOW_UUID"] = 12] = "SET_FLASHING_WORKFLOW_UUID";
        })(Actions || (Actions = {}));
        function getAvailableDrives(state) {
            return state.get("availableDrives").toJS();
        }
        function storeReducer(state = DEFAULT_STATE, action) {
            var _a;
            switch (action.type) {
              case Actions.SET_AVAILABLE_TARGETS:
                {
                    if (!action.data) {
                        throw createError({
                            title: "Missing drives"
                        });
                    }
                    let drives = action.data;
                    if (!lodash.isArray(drives) || !lodash.every(drives, lodash.isObject)) {
                        throw createError({
                            title: `Invalid drives: ${drives}`
                        });
                    }
                    const drivesOrder = (_a = getSync("drivesOrder")) !== null && _a !== void 0 ? _a : [];
                    drives = lodash.sortBy(drives, [ d => !!d.isSystem, d => !!d.devicePath, d => drivesOrder.indexOf((0, 
                    external_path_.basename)(d.devicePath || "")), d => d.devicePath || d.device ]);
                    const newState = state.set("availableDrives", immutable.fromJS(drives));
                    const selectedDevices = newState.getIn([ "selection", "devices" ]).toJS();
                    const nonStaleNewState = lodash.reduce(selectedDevices, ((accState, device) => {
                        if (device && !lodash.find(drives, {
                            device
                        })) {
                            return storeReducer(accState, {
                                type: Actions.DESELECT_TARGET,
                                data: device
                            });
                        }
                        return accState;
                    }), newState);
                    const shouldAutoselectAll = Boolean(getSync("autoSelectAllDrives"));
                    const AUTOSELECT_DRIVE_COUNT = 1;
                    const nonStaleSelectedDevices = nonStaleNewState.getIn([ "selection", "devices" ]).toJS();
                    const hasSelectedDevices = nonStaleSelectedDevices.length >= AUTOSELECT_DRIVE_COUNT;
                    const shouldAutoselectOne = drives.length === AUTOSELECT_DRIVE_COUNT && !hasSelectedDevices;
                    if (shouldAutoselectOne || shouldAutoselectAll) {
                        const image = state.getIn([ "selection", "image" ], immutable.fromJS({})).toJS();
                        return lodash.reduce(drives, ((accState, drive) => {
                            if (isDriveValid(drive, image) && !drive.isReadOnly && isDriveSizeRecommended(drive, image) && (!isDriveSizeLarge(drive) || shouldAutoselectAll) && !isSystemDrive(drive)) {
                                return storeReducer(accState, {
                                    type: Actions.SELECT_TARGET,
                                    data: drive.device
                                });
                            }
                            return storeReducer(accState, {
                                type: Actions.DESELECT_TARGET,
                                data: drive.device
                            });
                        }), nonStaleNewState);
                    }
                    return nonStaleNewState;
                }

              case Actions.SET_FLASH_STATE:
                {
                    if (!state.get("isFlashing")) {
                        throw createError({
                            title: "Can't set the flashing state when not flashing"
                        });
                    }
                    verifyNoNilFields(action.data, flashStateNoNilFields, "flash");
                    if (!lodash.every(lodash.pick(action.data, [ "active", "failed" ]), lodash.isFinite)) {
                        throw createError({
                            title: "State quantity field(s) not finite number"
                        });
                    }
                    if (!lodash.isUndefined(action.data.percentage) && !isValidPercentage(action.data.percentage)) {
                        throw createError({
                            title: `Invalid state percentage: ${action.data.percentage}`
                        });
                    }
                    if (!lodash.isUndefined(action.data.eta) && !lodash.isNumber(action.data.eta)) {
                        throw createError({
                            title: `Invalid state eta: ${action.data.eta}`
                        });
                    }
                    let ret = state.set("flashState", immutable.fromJS(action.data));
                    if (action.data.type === "flashing") {
                        ret = ret.set("lastAverageFlashingSpeed", action.data.averageSpeed);
                    }
                    return ret;
                }

              case Actions.RESET_FLASH_STATE:
                {
                    return state.set("isFlashing", false).set("flashState", DEFAULT_STATE.get("flashState")).set("flashResults", DEFAULT_STATE.get("flashResults")).set("devicePaths", DEFAULT_STATE.get("devicePaths")).set("failedDeviceErrors", DEFAULT_STATE.get("failedDeviceErrors")).set("lastAverageFlashingSpeed", DEFAULT_STATE.get("lastAverageFlashingSpeed")).delete("flashUuid");
                }

              case Actions.SET_FLASHING_FLAG:
                {
                    return state.set("isFlashing", true).set("flashUuid", esm_browser_v4()).set("flashResults", DEFAULT_STATE.get("flashResults"));
                }

              case Actions.UNSET_FLASHING_FLAG:
                {
                    if (!action.data) {
                        throw createError({
                            title: "Missing results"
                        });
                    }
                    lodash.defaults(action.data, {
                        cancelled: false,
                        skip: false
                    });
                    if (!lodash.isBoolean(action.data.cancelled)) {
                        throw createError({
                            title: `Invalid results cancelled: ${action.data.cancelled}`
                        });
                    }
                    if (action.data.cancelled && action.data.sourceChecksum) {
                        throw createError({
                            title: "The sourceChecksum value can't exist if the flashing was cancelled"
                        });
                    }
                    if (action.data.sourceChecksum && !lodash.isString(action.data.sourceChecksum)) {
                        throw createError({
                            title: `Invalid results sourceChecksum: ${action.data.sourceChecksum}`
                        });
                    }
                    if (action.data.errorCode && !lodash.isString(action.data.errorCode) && !lodash.isNumber(action.data.errorCode)) {
                        throw createError({
                            title: `Invalid results errorCode: ${action.data.errorCode}`
                        });
                    }
                    if (action.data.results) {
                        action.data.results.averageFlashingSpeed = state.get("lastAverageFlashingSpeed");
                    }
                    if (action.data.skip) {
                        return state.set("isFlashing", false).set("flashResults", immutable.fromJS(action.data));
                    }
                    return state.set("isFlashing", false).set("flashResults", immutable.fromJS(action.data)).set("flashState", DEFAULT_STATE.get("flashState"));
                }

              case Actions.SELECT_TARGET:
                {
                    const device = action.data;
                    if (!device) {
                        throw createError({
                            title: "Missing drive"
                        });
                    }
                    if (!lodash.isString(device)) {
                        throw createError({
                            title: `Invalid drive: ${device}`
                        });
                    }
                    const selectedDrive = lodash.find(getAvailableDrives(state), {
                        device
                    });
                    if (!selectedDrive) {
                        throw createError({
                            title: `The drive is not available: ${device}`
                        });
                    }
                    if (selectedDrive.isReadOnly) {
                        throw createError({
                            title: "The drive is write-protected"
                        });
                    }
                    const image = state.getIn([ "selection", "image" ]);
                    if (image && !isDriveLargeEnough(selectedDrive, image.toJS())) {
                        throw createError({
                            title: "The drive is not large enough"
                        });
                    }
                    const selectedDevices = state.getIn([ "selection", "devices" ]);
                    return state.setIn([ "selection", "devices" ], selectedDevices.add(device));
                }

              case Actions.SELECT_SOURCE:
                {
                    if (!action.data.drive) {
                        verifyNoNilFields(action.data, selectImageNoNilFields, "image");
                    }
                    if (!lodash.isString(action.data.path)) {
                        throw createError({
                            title: `Invalid image path: ${action.data.path}`
                        });
                    }
                    const MINIMUM_IMAGE_SIZE = 0;
                    if (action.data.size !== undefined) {
                        if (action.data.size < MINIMUM_IMAGE_SIZE || !lodash.isInteger(action.data.size)) {
                            throw createError({
                                title: `Invalid image size: ${action.data.size}`
                            });
                        }
                    }
                    if (!lodash.isUndefined(action.data.compressedSize)) {
                        if (action.data.compressedSize < MINIMUM_IMAGE_SIZE || !lodash.isInteger(action.data.compressedSize)) {
                            throw createError({
                                title: `Invalid image compressed size: ${action.data.compressedSize}`
                            });
                        }
                    }
                    if (action.data.url && !lodash.isString(action.data.url)) {
                        throw createError({
                            title: `Invalid image url: ${action.data.url}`
                        });
                    }
                    if (action.data.name && !lodash.isString(action.data.name)) {
                        throw createError({
                            title: `Invalid image name: ${action.data.name}`
                        });
                    }
                    if (action.data.logo && !lodash.isString(action.data.logo)) {
                        throw createError({
                            title: `Invalid image logo: ${action.data.logo}`
                        });
                    }
                    const selectedDevices = state.getIn([ "selection", "devices" ]);
                    return lodash.reduce(selectedDevices.toJS(), ((accState, device) => {
                        const drive = lodash.find(getAvailableDrives(state), {
                            device
                        });
                        if (!isDriveValid(drive, action.data) || !isDriveSizeRecommended(drive, action.data)) {
                            return storeReducer(accState, {
                                type: Actions.DESELECT_TARGET,
                                data: device
                            });
                        }
                        return accState;
                    }), state).setIn([ "selection", "image" ], immutable.fromJS(action.data));
                }

              case Actions.DESELECT_TARGET:
                {
                    if (!action.data) {
                        throw createError({
                            title: "Missing drive"
                        });
                    }
                    if (!lodash.isString(action.data)) {
                        throw createError({
                            title: `Invalid drive: ${action.data}`
                        });
                    }
                    const selectedDevices = state.getIn([ "selection", "devices" ]);
                    return state.setIn([ "selection", "devices" ], selectedDevices.delete(action.data));
                }

              case Actions.DESELECT_SOURCE:
                {
                    return state.deleteIn([ "selection", "image" ]);
                }

              case Actions.SET_APPLICATION_SESSION_UUID:
                {
                    return state.set("applicationSessionUuid", action.data);
                }

              case Actions.SET_FLASHING_WORKFLOW_UUID:
                {
                    return state.set("flashingWorkflowUuid", action.data);
                }

              case Actions.SET_DEVICE_PATHS:
                {
                    return state.set("devicePaths", action.data);
                }

              case Actions.SET_FAILED_DEVICE_ERRORS:
                {
                    return state.set("failedDeviceErrors", action.data);
                }

              default:
                {
                    return state;
                }
            }
        }
        const store = createStore(storeReducer, DEFAULT_STATE);
        function observe(onChange) {
            let currentState = null;
            const changeHandler = () => {
                const nextState = store.getState();
                if (!lodash.isEqual(nextState, currentState)) {
                    currentState = nextState;
                    onChange(currentState);
                }
            };
            changeHandler();
            return store.subscribe(changeHandler);
        }
        function hasAvailableDrives() {
            return getDrives().length > 0;
        }
        function setDrives(drives) {
            store.dispatch({
                type: Actions.SET_AVAILABLE_TARGETS,
                data: drives
            });
        }
        function getDrives() {
            return store.getState().toJS().availableDrives;
        }
        const MEGABYTE_TO_BYTE_RATIO = 1e6;
        function bytesToMegabytes(bytes) {
            return bytes / MEGABYTE_TO_BYTE_RATIO;
        }
        function resetState() {
            store.dispatch({
                type: Actions.RESET_FLASH_STATE,
                data: {}
            });
        }
        function isFlashing() {
            return store.getState().toJS().isFlashing;
        }
        function setFlashingFlag() {
            external_electron_.ipcRenderer.send("disable-screensaver");
            store.dispatch({
                type: Actions.SET_FLASHING_FLAG,
                data: {}
            });
        }
        function unsetFlashingFlag(results) {
            store.dispatch({
                type: Actions.UNSET_FLASHING_FLAG,
                data: results
            });
            external_electron_.ipcRenderer.send("enable-screensaver");
        }
        function setDevicePaths(devicePaths) {
            store.dispatch({
                type: Actions.SET_DEVICE_PATHS,
                data: devicePaths
            });
        }
        function addFailedDeviceError({device, error}) {
            const failedDeviceErrorsMap = new Map(store.getState().toJS().failedDeviceErrors);
            if (failedDeviceErrorsMap.has(device.device)) {
                return;
            }
            failedDeviceErrorsMap.set(device.device, {
                description: device.description,
                device: device.device,
                devicePath: device.devicePath,
                ...error
            });
            store.dispatch({
                type: Actions.SET_FAILED_DEVICE_ERRORS,
                data: Array.from(failedDeviceErrorsMap)
            });
        }
        function setProgressState(state) {
            const PRECISION = 1;
            const data = {
                ...state,
                percentage: state.percentage !== undefined && lodash.isFinite(state.percentage) ? Math.floor(state.percentage) : undefined,
                speed: lodash.attempt((() => {
                    if (lodash.isFinite(state.speed)) {
                        return lodash.round(bytesToMegabytes(state.speed), PRECISION);
                    }
                    return null;
                }))
            };
            store.dispatch({
                type: Actions.SET_FLASH_STATE,
                data
            });
        }
        function getFlashResults() {
            return store.getState().toJS().flashResults;
        }
        function getFlashState() {
            return store.getState().get("flashState").toJS();
        }
        function wasLastFlashCancelled() {
            return lodash.get(getFlashResults(), [ "cancelled" ], false);
        }
        function getLastFlashSourceChecksum() {
            return getFlashResults().sourceChecksum;
        }
        function getLastFlashErrorCode() {
            return getFlashResults().errorCode;
        }
        function getFlashUuid() {
            return store.getState().toJS().flashUuid;
        }
        var sys_class_rgb_led_build = __webpack_require__(296);
        function selectDrive(driveDevice) {
            store.dispatch({
                type: Actions.SELECT_TARGET,
                data: driveDevice
            });
        }
        function toggleDrive(driveDevice) {
            if (isDriveSelected(driveDevice)) {
                deselectDrive(driveDevice);
            } else {
                selectDrive(driveDevice);
            }
        }
        function selectSource(source) {
            store.dispatch({
                type: Actions.SELECT_SOURCE,
                data: source
            });
        }
        function getSelectedDevices() {
            return store.getState().getIn([ "selection", "devices" ]).toJS();
        }
        function getSelectedDrives() {
            const selectedDevices = getSelectedDevices();
            return getDrives().filter((drive => selectedDevices.includes(drive.device)));
        }
        function getImage() {
            return store.getState().toJS().selection.image;
        }
        function hasDrive() {
            return Boolean(getSelectedDevices().length);
        }
        function hasImage() {
            return getImage() !== undefined;
        }
        function deselectDrive(driveDevice) {
            store.dispatch({
                type: Actions.DESELECT_TARGET,
                data: driveDevice
            });
        }
        function deselectImage() {
            store.dispatch({
                type: Actions.DESELECT_SOURCE,
                data: {}
            });
        }
        function deselectAllDrives() {
            getSelectedDevices().forEach(deselectDrive);
        }
        function clear() {
            deselectImage();
            deselectAllDrives();
        }
        function isDriveSelected(driveDevice) {
            if (!driveDevice) {
                return false;
            }
            const selectedDriveDevices = getSelectedDevices();
            return selectedDriveDevices.includes(driveDevice);
        }
        const leds = new Map;
        const animator = new sys_class_rgb_led_build.LH([], 10);
        function createAnimationFunction(intensityFunction, color) {
            return t => {
                const intensity = intensityFunction(t);
                return color.map((v => v * intensity));
            };
        }
        function blink(t) {
            return Math.floor(t) % 2;
        }
        function one(_t) {
            return 1;
        }
        let ledColors;
        let ledAnimationFunctions;
        function setLeds(animation, drivesPaths) {
            const rgbLeds = [];
            for (const path of drivesPaths) {
                const led = leds.get(path);
                if (led) {
                    rgbLeds.push(led);
                }
            }
            return {
                animation,
                rgbLeds
            };
        }
        function updateLeds({step, sourceDrive, availableDrives, selectedDrives, failedDrives}) {
            const unplugged = new Set(leds.keys());
            const plugged = new Set(availableDrives);
            const selectedOk = new Set(selectedDrives);
            const selectedFailed = new Set(failedDrives);
            for (const d of selectedOk) {
                plugged.delete(d);
                unplugged.delete(d);
            }
            for (const d of plugged) {
                unplugged.delete(d);
            }
            for (const d of selectedFailed) {
                selectedOk.delete(d);
            }
            const mapping = [];
            if (sourceDrive !== undefined) {
                if (plugged.has(sourceDrive)) {
                    plugged.delete(sourceDrive);
                    mapping.push(setLeds(ledAnimationFunctions.staticBlue, new Set([ sourceDrive ])));
                }
            }
            if (step === "main") {
                mapping.push(setLeds(ledAnimationFunctions.staticBlack, new Set([ ...unplugged, ...plugged ])), setLeds(ledAnimationFunctions.staticWhite, new Set([ ...selectedOk, ...selectedFailed ])));
            } else if (step === "flashing") {
                mapping.push(setLeds(ledAnimationFunctions.staticBlack, new Set([ ...unplugged, ...plugged ])), setLeds(ledAnimationFunctions.blinkPurple, selectedOk), setLeds(ledAnimationFunctions.staticRed, selectedFailed));
            } else if (step === "verifying") {
                mapping.push(setLeds(ledAnimationFunctions.staticBlack, new Set([ ...unplugged, ...plugged ])), setLeds(ledAnimationFunctions.blinkGreen, selectedOk), setLeds(ledAnimationFunctions.staticRed, selectedFailed));
            } else if (step === "finish") {
                mapping.push(setLeds(ledAnimationFunctions.staticBlack, new Set([ ...unplugged, ...plugged ])), setLeds(ledAnimationFunctions.staticGreen, selectedOk), setLeds(ledAnimationFunctions.staticRed, selectedFailed));
            }
            animator.mapping = mapping;
        }
        let ledsState;
        function stateObserver() {
            var _a;
            const s = store.getState().toJS();
            let step;
            if (s.isFlashing) {
                step = s.flashState.type;
            } else {
                step = s.lastAverageFlashingSpeed == null ? "main" : "finish";
            }
            const availableDrives = getDrives().filter((d => d.devicePath));
            const sourceDrivePath = (_a = availableDrives.filter((d => isSourceDrive(d, s.selection.image)))[0]) === null || _a === void 0 ? void 0 : _a.devicePath;
            const availableDrivesPaths = availableDrives.map((d => d.devicePath));
            let selectedDrivesPaths;
            if (step === "main") {
                selectedDrivesPaths = getSelectedDrives().filter((drive => drive.devicePath !== null)).map((drive => drive.devicePath));
            } else {
                selectedDrivesPaths = s.devicePaths;
            }
            const failedDevicePaths = s.failedDeviceErrors.map((([, {devicePath}]) => devicePath));
            const newLedsState = {
                step,
                sourceDrive: sourceDrivePath,
                availableDrives: availableDrivesPaths,
                selectedDrives: selectedDrivesPaths,
                failedDrives: failedDevicePaths
            };
            if (!lodash.isEqual(newLedsState, ledsState)) {
                updateLeds(newLedsState);
                ledsState = newLedsState;
            }
        }
        async function init() {
            const ledsMapping = await get("ledsMapping") || {};
            if (!lodash.isEmpty(ledsMapping)) {
                for (const [drivePath, ledsNames] of Object.entries(ledsMapping)) {
                    leds.set("/dev/disk/by-path/" + drivePath, new sys_class_rgb_led_build.Sq(ledsNames));
                }
            }
            ledColors = await get("ledColors") || {};
            ledAnimationFunctions = {
                blinkGreen: createAnimationFunction(blink, ledColors["green"]),
                blinkPurple: createAnimationFunction(blink, ledColors["purple"]),
                staticRed: createAnimationFunction(one, ledColors["red"]),
                staticGreen: createAnimationFunction(one, ledColors["green"]),
                staticBlue: createAnimationFunction(one, ledColors["blue"]),
                staticWhite: createAnimationFunction(one, ledColors["white"]),
                staticBlack: createAnimationFunction(one, ledColors["black"])
            };
            observe(lodash.debounce(stateObserver, 1e3, {
                maxWait: 1e3
            }));
        }
        var resin_corvus_browser = __webpack_require__(297);
        const DEFAULT_PROBABILITY = .1;
        async function installCorvus() {
            const sentryToken = await get("analyticsSentryToken") || lodash.get(external_package_json_, [ "analytics", "sentry", "token" ]);
            const mixpanelToken = await get("analyticsMixpanelToken") || lodash.get(external_package_json_, [ "analytics", "mixpanel", "token" ]);
            resin_corvus_browser.install({
                services: {
                    sentry: sentryToken,
                    mixpanel: mixpanelToken
                },
                options: {
                    release: external_package_json_.version,
                    shouldReport: () => getSync("errorReporting"),
                    mixpanelDeferred: true
                }
            });
        }
        let mixpanelSample = DEFAULT_PROBABILITY;
        async function initConfig() {
            await installCorvus();
            let validatedConfig = null;
            try {
                const configUrl = await get("configUrl");
                const config = await getConfig(configUrl);
                const mixpanel = lodash.get(config, [ "analytics", "mixpanel" ], {});
                mixpanelSample = mixpanel.probability || DEFAULT_PROBABILITY;
                if (isClientEligible(mixpanelSample)) {
                    validatedConfig = validateMixpanelConfig(mixpanel);
                }
            } catch (err) {
                resin_corvus_browser.logException(err);
            }
            resin_corvus_browser.setConfigs({
                mixpanel: validatedConfig
            });
        }
        initConfig();
        function isClientEligible(probability) {
            return Math.random() < probability;
        }
        function validateMixpanelConfig(config) {
            const mixpanelConfig = {
                api_host: "https://api.mixpanel.com"
            };
            if (config.HTTP_PROTOCOL !== undefined && config.api_host !== undefined) {
                mixpanelConfig.api_host = `${config.HTTP_PROTOCOL}://${config.api_host}`;
            }
            return mixpanelConfig;
        }
        function logEvent(message, data = {}) {
            const {applicationSessionUuid, flashingWorkflowUuid} = store.getState().toJS();
            resin_corvus_browser.logEvent(message, {
                ...data,
                sample: mixpanelSample,
                applicationSessionUuid,
                flashingWorkflowUuid
            });
        }
        const logException = resin_corvus_browser.logException;
        var external_process_ = __webpack_require__(5);
        const adapters = [ new build.et.adapters.BlockDeviceAdapter({
            includeSystemDrives: () => true
        }) ];
        if (external_process_.platform !== "linux" || (0, external_process_.geteuid)() === 0) {
            adapters.push(new build.et.adapters.UsbbootDeviceAdapter);
        }
        if (external_process_.platform === "win32" && build.et.adapters.DriverlessDeviceAdapter !== undefined) {
            adapters.push(new build.et.adapters.DriverlessDeviceAdapter);
        }
        const scanner = new build.et.Scanner(adapters);
        const SUPPORTED_EXTENSIONS = [ "bin", "bz2", "dmg", "dsk", "etch", "gz", "hddimg", "img", "iso", "raw", "rpi-sdimg", "sdcard", "vhd", "wic", "xz", "zip" ];
        function looksLikeWindowsImage(imagePath) {
            const regex = /windows|win7|win8|win10|winxp/i;
            return regex.test((0, external_path_.basename)(imagePath));
        }
        async function mountSourceDrive() {
            const sourceDrivePath = await get("automountOnFileSelect");
            if (sourceDrivePath) {
                try {
                    await external_electron_.ipcRenderer.invoke("mount-drive", sourceDrivePath);
                } catch (error) {}
            }
        }
        async function selectImage() {
            await mountSourceDrive();
            const options = {
                defaultPath: process.env.OWD,
                properties: [ "openFile", "treatPackageAsDirectory" ],
                filters: [ {
                    name: "OS Images",
                    extensions: SUPPORTED_EXTENSIONS
                }, {
                    name: "All",
                    extensions: [ "*" ]
                } ]
            };
            const currentWindow = external_electron_.remote.getCurrentWindow();
            const [file] = (await external_electron_.remote.dialog.showOpenDialog(currentWindow, options)).filePaths;
            return file;
        }
        async function showWarning(options) {
            lodash.defaults(options, {
                confirmationLabel: "OK",
                rejectionLabel: "Cancel"
            });
            const BUTTONS = [ options.confirmationLabel, options.rejectionLabel ];
            const BUTTON_CONFIRMATION_INDEX = lodash.indexOf(BUTTONS, options.confirmationLabel);
            const BUTTON_REJECTION_INDEX = lodash.indexOf(BUTTONS, options.rejectionLabel);
            const {response} = await external_electron_.remote.dialog.showMessageBox(external_electron_.remote.getCurrentWindow(), {
                type: "warning",
                buttons: BUTTONS,
                defaultId: BUTTON_REJECTION_INDEX,
                cancelId: BUTTON_REJECTION_INDEX,
                title: "Attention",
                message: options.title,
                detail: options.description
            });
            return response === BUTTON_CONFIRMATION_INDEX;
        }
        function showError(error) {
            const title = getTitle(error);
            const message = getDescription(error);
            external_electron_.remote.dialog.showErrorBox(title, message);
        }
        function report(exception) {
            if (exception === undefined) {
                return;
            }
            showError(exception);
            logException(exception);
        }
        function fromFlashState({type, percentage, position}) {
            if (type === undefined) {
                return {
                    status: "Starting..."
                };
            } else if (type === "decompressing") {
                if (percentage == null) {
                    return {
                        status: "Decompressing..."
                    };
                } else {
                    return {
                        position: `${percentage}%`,
                        status: "Decompressing..."
                    };
                }
            } else if (type === "flashing") {
                if (percentage != null) {
                    if (percentage < 100) {
                        return {
                            position: `${percentage}%`,
                            status: "Flashing..."
                        };
                    } else {
                        return {
                            status: "Finishing..."
                        };
                    }
                } else {
                    return {
                        status: "Flashing...",
                        position: `${position ? pretty_bytes(position) : ""}`
                    };
                }
            } else if (type === "verifying") {
                if (percentage == null) {
                    return {
                        status: "Validating..."
                    };
                } else if (percentage < 100) {
                    return {
                        position: `${percentage}%`,
                        status: "Validating..."
                    };
                } else {
                    return {
                        status: "Finishing..."
                    };
                }
            }
            return {
                status: "Failed"
            };
        }
        function titleFromFlashState(state) {
            const {status, position} = fromFlashState(state);
            if (position !== undefined) {
                return `${position} ${status}`;
            }
            return status;
        }
        const INITIAL_TITLE = document.title;
        function getWindowTitle(state) {
            if (state) {
                return `${INITIAL_TITLE} – ${titleFromFlashState(state)}`;
            }
            return INITIAL_TITLE;
        }
        const currentWindow = external_electron_.remote.getCurrentWindow();
        function window_progress_set(state) {
            if (state.percentage != null) {
                currentWindow.setProgressBar(percentageToFloat(state.percentage));
            }
            currentWindow.setTitle(getWindowTitle(state));
        }
        function window_progress_clear() {
            currentWindow.setProgressBar(-1);
            currentWindow.setTitle(getWindowTitle(undefined));
        }
        function cog_extends() {
            cog_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return cog_extends.apply(this, arguments);
        }
        var _ref = react.createElement("path", {
            d: "M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z"
        });
        function SvgCog(props) {
            return react.createElement("svg", cog_extends({
                xmlns: "http://www.w3.org/2000/svg",
                viewBox: "0 0 512 512"
            }, props), _ref);
        }
        const cog = SvgCog;
        function question_circle_extends() {
            question_circle_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return question_circle_extends.apply(this, arguments);
        }
        var question_circle_ref = react.createElement("path", {
            d: "M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z"
        });
        function SvgQuestionCircle(props) {
            return react.createElement("svg", question_circle_extends({
                xmlns: "http://www.w3.org/2000/svg",
                viewBox: "0 0 512 512"
            }, props), question_circle_ref);
        }
        const question_circle = SvgQuestionCircle;
        var tslib_es6 = __webpack_require__(108);
        var styled_components_browser_esm = __webpack_require__(486);
        function extends_extends() {
            extends_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return extends_extends.apply(this, arguments);
        }
        var prop_types = __webpack_require__(353);
        var prop_types_default = __webpack_require__.n(prop_types);
        var compare = function compare(a, b) {
            if (a < b) return -1;
            if (a > b) return 1;
            return 0;
        };
        var defaultBreakpoints = [ 40, 52, 64 ].map((function(n) {
            return n + "em";
        }));
        var propType = prop_types_default().oneOfType([ prop_types_default().number, prop_types_default().string, prop_types_default().array, prop_types_default().object ]);
        var cloneFunction = function cloneFunction(fn) {
            return function() {
                return fn.apply(void 0, arguments);
            };
        };
        var index_esm_get = function get(obj) {
            for (var _len = arguments.length, paths = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
                paths[_key - 1] = arguments[_key];
            }
            var value = paths.reduce((function(a, path) {
                if (is(a)) return a;
                var keys = typeof path === "string" ? path.split(".") : [ path ];
                return keys.reduce((function(a, key) {
                    return a && is(a[key]) ? a[key] : null;
                }), obj);
            }), null);
            return is(value) ? value : paths[paths.length - 1];
        };
        var themeGet = function themeGet(path, fallback) {
            if (fallback === void 0) {
                fallback = null;
            }
            return function(props) {
                return index_esm_get(props.theme, path, fallback);
            };
        };
        var is = function is(n) {
            return n !== undefined && n !== null;
        };
        var isObject = function isObject(n) {
            return typeof n === "object" && n !== null;
        };
        var num = function num(n) {
            return typeof n === "number" && !isNaN(n);
        };
        var px = function px(n) {
            return num(n) && n !== 0 ? n + "px" : n;
        };
        var createMediaQuery = function createMediaQuery(n) {
            return "@media screen and (min-width: " + px(n) + ")";
        };
        var getValue = function getValue(n, scale) {
            return index_esm_get(scale, n);
        };
        var merge = function merge(a, b) {
            var result = {};
            for (var key in a) {
                result[key] = a[key];
            }
            for (var _key2 in b) {
                if (!a[_key2] || typeof a[_key2] !== "object") {
                    result[_key2] = b[_key2];
                } else {
                    result[_key2] = merge(a[_key2], b[_key2]);
                }
            }
            return result;
        };
        var mergeAll = function mergeAll() {
            var result = {};
            for (var i = 0; i < arguments.length; i++) {
                result = merge(result, i < 0 || arguments.length <= i ? undefined : arguments[i]);
            }
            return result;
        };
        var style = function style(_ref) {
            var _func$propTypes;
            var prop = _ref.prop, cssProperty = _ref.cssProperty, alias = _ref.alias, key = _ref.key, _ref$transformValue = _ref.transformValue, transformValue = _ref$transformValue === void 0 ? getValue : _ref$transformValue, _ref$scale = _ref.scale, defaultScale = _ref$scale === void 0 ? {} : _ref$scale;
            var property = cssProperty || prop;
            var func = function func(props) {
                var value = index_esm_get(props, prop, alias, null);
                if (!is(value)) return null;
                var scale = index_esm_get(props.theme, key, defaultScale);
                var createStyle = function createStyle(n) {
                    var _ref2;
                    return is(n) ? (_ref2 = {}, _ref2[property] = transformValue(n, scale), _ref2) : null;
                };
                if (!isObject(value)) return createStyle(value);
                var breakpoints = index_esm_get(props.theme, "breakpoints", defaultBreakpoints);
                var styles = [];
                if (Array.isArray(value)) {
                    styles.push(createStyle(value[0]));
                    for (var i = 1; i < value.slice(0, breakpoints.length + 1).length; i++) {
                        var rule = createStyle(value[i]);
                        if (rule) {
                            var _styles$push;
                            var media = createMediaQuery(breakpoints[i - 1]);
                            styles.push((_styles$push = {}, _styles$push[media] = rule, _styles$push));
                        }
                    }
                } else {
                    for (var _key3 in value) {
                        var breakpoint = breakpoints[_key3];
                        var _media = createMediaQuery(breakpoint);
                        var _rule = createStyle(value[_key3]);
                        if (!breakpoint) {
                            styles.unshift(_rule);
                        } else {
                            var _styles$push2;
                            styles.push((_styles$push2 = {}, _styles$push2[_media] = _rule, _styles$push2));
                        }
                    }
                    styles.sort(compare);
                }
                return mergeAll.apply(void 0, styles);
            };
            func.propTypes = (_func$propTypes = {}, _func$propTypes[prop] = cloneFunction(propType), 
            _func$propTypes);
            func.propTypes[prop].meta = {
                prop,
                themeKey: key
            };
            if (alias) {
                func.propTypes[alias] = cloneFunction(propType);
                func.propTypes[alias].meta = {
                    prop: alias,
                    themeKey: key
                };
            }
            return func;
        };
        var index_esm_compose = function compose() {
            for (var _len2 = arguments.length, funcs = new Array(_len2), _key4 = 0; _key4 < _len2; _key4++) {
                funcs[_key4] = arguments[_key4];
            }
            var func = function func(props) {
                var n = funcs.map((function(fn) {
                    return fn(props);
                })).filter(Boolean);
                return mergeAll.apply(void 0, n);
            };
            func.propTypes = {};
            funcs.forEach((function(fn) {
                func.propTypes = extends_extends({}, func.propTypes, fn.propTypes);
            }));
            return func;
        };
        var mapProps = function mapProps(mapper) {
            return function(func) {
                var next = function next(props) {
                    return func(mapper(props));
                };
                for (var key in func) {
                    next[key] = func[key];
                }
                return next;
            };
        };
        var variant = function variant(_ref3) {
            var _fn$propTypes;
            var key = _ref3.key, _ref3$prop = _ref3.prop, prop = _ref3$prop === void 0 ? "variant" : _ref3$prop;
            var fn = function fn(props) {
                return index_esm_get(props.theme, [ key, props[prop] ].join("."), null);
            };
            fn.propTypes = (_fn$propTypes = {}, _fn$propTypes[prop] = prop_types_default().oneOfType([ prop_types_default().number, prop_types_default().string ]), 
            _fn$propTypes);
            return fn;
        };
        var spaceScale = [ 0, 4, 8, 16, 32, 64, 128, 256, 512 ];
        var getSpace = function getSpace(n, scale) {
            if (!num(n)) {
                return px(index_esm_get(scale, n, n));
            }
            var isNegative = n < 0;
            var absolute = Math.abs(n);
            var value = index_esm_get(scale, absolute);
            if (!num(value)) {
                return isNegative ? "-" + value : value;
            }
            return px(value * (isNegative ? -1 : 1));
        };
        var margin = style({
            prop: "margin",
            alias: "m",
            key: "space",
            transformValue: getSpace,
            scale: spaceScale
        });
        var marginTop = style({
            prop: "marginTop",
            alias: "mt",
            key: "space",
            transformValue: getSpace,
            scale: spaceScale
        });
        var marginBottom = style({
            prop: "marginBottom",
            alias: "mb",
            key: "space",
            transformValue: getSpace,
            scale: spaceScale
        });
        var marginLeft = style({
            prop: "marginLeft",
            alias: "ml",
            key: "space",
            transformValue: getSpace,
            scale: spaceScale
        });
        var marginRight = style({
            prop: "marginRight",
            alias: "mr",
            key: "space",
            transformValue: getSpace,
            scale: spaceScale
        });
        var padding = style({
            prop: "padding",
            alias: "p",
            key: "space",
            transformValue: getSpace,
            scale: spaceScale
        });
        var paddingTop = style({
            prop: "paddingTop",
            alias: "pt",
            key: "space",
            transformValue: getSpace,
            scale: spaceScale
        });
        var paddingBottom = style({
            prop: "paddingBottom",
            alias: "pb",
            key: "space",
            transformValue: getSpace,
            scale: spaceScale
        });
        var paddingLeft = style({
            prop: "paddingLeft",
            alias: "pl",
            key: "space",
            transformValue: getSpace,
            scale: spaceScale
        });
        var paddingRight = style({
            prop: "paddingRight",
            alias: "pr",
            key: "space",
            transformValue: getSpace,
            scale: spaceScale
        });
        var space = mapProps((function(props) {
            return extends_extends({}, props, {
                mt: is(props.my) ? props.my : props.mt,
                mb: is(props.my) ? props.my : props.mb,
                ml: is(props.mx) ? props.mx : props.ml,
                mr: is(props.mx) ? props.mx : props.mr,
                pt: is(props.py) ? props.py : props.pt,
                pb: is(props.py) ? props.py : props.pb,
                pl: is(props.px) ? props.px : props.pl,
                pr: is(props.px) ? props.px : props.pr
            });
        }))(index_esm_compose(margin, marginTop, marginBottom, marginLeft, marginRight, padding, paddingTop, paddingBottom, paddingLeft, paddingRight));
        var textColor = style({
            prop: "color",
            key: "colors"
        });
        var backgroundColor = style({
            prop: "backgroundColor",
            alias: "bg",
            key: "colors"
        });
        var color = index_esm_compose(textColor, backgroundColor);
        var getWidth = function getWidth(n, scale) {
            return !num(n) || n > 1 ? px(n) : n * 100 + "%";
        };
        var width = style({
            prop: "width",
            key: "widths",
            transformValue: getWidth
        });
        var getPx = function getPx(n, scale) {
            return px(index_esm_get(scale, n));
        };
        var fontSize = style({
            prop: "fontSize",
            key: "fontSizes",
            transformValue: getPx,
            scale: [ 12, 14, 16, 20, 24, 32, 48, 64, 72 ]
        });
        var fontFamily = style({
            prop: "fontFamily",
            key: "fonts"
        });
        var fontWeight = style({
            prop: "fontWeight",
            key: "fontWeights"
        });
        var lineHeight = style({
            prop: "lineHeight",
            key: "lineHeights"
        });
        var textAlign = style({
            prop: "textAlign"
        });
        var fontStyle = style({
            prop: "fontStyle"
        });
        var letterSpacing = style({
            prop: "letterSpacing",
            key: "letterSpacings",
            transformValue: getPx
        });
        var display = style({
            prop: "display"
        });
        var maxWidth = style({
            prop: "maxWidth",
            key: "maxWidths",
            transformValue: getPx
        });
        var minWidth = style({
            prop: "minWidth",
            key: "minWidths",
            transformValue: getPx
        });
        var height = style({
            prop: "height",
            key: "heights",
            transformValue: getPx
        });
        var maxHeight = style({
            prop: "maxHeight",
            key: "maxHeights",
            transformValue: getPx
        });
        var minHeight = style({
            prop: "minHeight",
            key: "minHeights",
            transformValue: getPx
        });
        var size = mapProps((function(props) {
            return extends_extends({}, props, {
                width: props.size,
                height: props.size
            });
        }))(index_esm_compose(width, height));
        var verticalAlign = style({
            prop: "verticalAlign"
        });
        var alignItems = style({
            prop: "alignItems"
        });
        var alignContent = style({
            prop: "alignContent"
        });
        var justifyItems = style({
            prop: "justifyItems"
        });
        var justifyContent = style({
            prop: "justifyContent"
        });
        var flexWrap = style({
            prop: "flexWrap"
        });
        var flexBasis = style({
            prop: "flexBasis",
            transformValue: getWidth
        });
        var flexDirection = style({
            prop: "flexDirection"
        });
        var flex = style({
            prop: "flex"
        });
        var justifySelf = style({
            prop: "justifySelf"
        });
        var alignSelf = style({
            prop: "alignSelf"
        });
        var order = style({
            prop: "order"
        });
        var gridGap = style({
            prop: "gridGap",
            key: "space",
            transformValue: getPx,
            scale: spaceScale
        });
        var gridColumnGap = style({
            prop: "gridColumnGap",
            key: "space",
            transformValue: getPx,
            scale: spaceScale
        });
        var gridRowGap = style({
            prop: "gridRowGap",
            key: "space",
            transformValue: getPx,
            scale: spaceScale
        });
        var gridColumn = style({
            prop: "gridColumn"
        });
        var gridRow = style({
            prop: "gridRow"
        });
        var gridAutoFlow = style({
            prop: "gridAutoFlow"
        });
        var gridAutoColumns = style({
            prop: "gridAutoColumns"
        });
        var gridAutoRows = style({
            prop: "gridAutoRows"
        });
        var gridTemplateColumns = style({
            prop: "gridTemplateColumns"
        });
        var gridTemplateRows = style({
            prop: "gridTemplateRows"
        });
        var gridTemplateAreas = style({
            prop: "gridTemplateAreas"
        });
        var gridArea = style({
            prop: "gridArea"
        });
        var border = style({
            prop: "border",
            key: "borders"
        });
        var borderWidth = style({
            prop: "borderWidth",
            key: "borderWidths",
            transformValue: getPx
        });
        var borderStyle = style({
            prop: "borderStyle",
            key: "borderStyles"
        });
        var borderColor = style({
            prop: "borderColor",
            key: "colors"
        });
        var borderTop = style({
            prop: "borderTop",
            key: "borders"
        });
        var borderRight = style({
            prop: "borderRight",
            key: "borders"
        });
        var borderBottom = style({
            prop: "borderBottom",
            key: "borders"
        });
        var borderLeft = style({
            prop: "borderLeft",
            key: "borders"
        });
        var borderRadius = style({
            prop: "borderRadius",
            key: "radii",
            transformValue: getPx
        });
        var borders = index_esm_compose(border, borderTop, borderRight, borderBottom, borderLeft, borderWidth, borderStyle, borderColor, borderRadius);
        var boxShadow = style({
            prop: "boxShadow",
            key: "shadows"
        });
        var opacity = style({
            prop: "opacity"
        });
        var overflow = style({
            prop: "overflow"
        });
        var background = style({
            prop: "background"
        });
        var backgroundImage = style({
            prop: "backgroundImage"
        });
        var backgroundSize = style({
            prop: "backgroundSize"
        });
        var backgroundPosition = style({
            prop: "backgroundPosition"
        });
        var backgroundRepeat = style({
            prop: "backgroundRepeat"
        });
        var position = style({
            prop: "position"
        });
        var zIndex = style({
            prop: "zIndex",
            key: "zIndices"
        });
        var index_esm_top = style({
            prop: "top",
            transformValue: getPx
        });
        var right = style({
            prop: "right",
            transformValue: getPx
        });
        var bottom = style({
            prop: "bottom",
            transformValue: getPx
        });
        var left = style({
            prop: "left",
            transformValue: getPx
        });
        var buttonStyle = variant({
            key: "buttons"
        });
        var textStyle = variant({
            key: "textStyles",
            prop: "textStyle"
        });
        var colorStyle = variant({
            key: "colorStyles",
            prop: "colors"
        });
        var difference = __webpack_require__(567);
        var difference_default = __webpack_require__.n(difference);
        var omit = __webpack_require__(576);
        var omit_default = __webpack_require__.n(omit);
        var lib_shallowEqual = __webpack_require__(584);
        var hoist_non_react_statics_cjs = __webpack_require__(585);
        var lib = __webpack_require__(586);
        var setStatic = function setStatic(key, value) {
            return function(BaseComponent) {
                BaseComponent[key] = value;
                return BaseComponent;
            };
        };
        var setDisplayName = function setDisplayName(displayName) {
            return setStatic("displayName", displayName);
        };
        var getDisplayName = function getDisplayName(Component$$1) {
            if (typeof Component$$1 === "string") {
                return Component$$1;
            }
            if (!Component$$1) {
                return undefined;
            }
            return Component$$1.displayName || Component$$1.name || "Component";
        };
        var wrapDisplayName = function wrapDisplayName(BaseComponent, hocName) {
            return hocName + "(" + getDisplayName(BaseComponent) + ")";
        };
        var Recompose_mapProps = function mapProps(propsMapper) {
            return function(BaseComponent) {
                var factory = (0, react.createFactory)(BaseComponent);
                var MapProps = function MapProps(props) {
                    return factory(propsMapper(props));
                };
                if (false) {}
                return MapProps;
            };
        };
        var classCallCheck = function(instance, Constructor) {
            if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
            }
        };
        var Recompose_extends = Object.assign || function(target) {
            for (var i = 1; i < arguments.length; i++) {
                var source = arguments[i];
                for (var key in source) {
                    if (Object.prototype.hasOwnProperty.call(source, key)) {
                        target[key] = source[key];
                    }
                }
            }
            return target;
        };
        var inherits = function(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, {
                constructor: {
                    value: subClass,
                    enumerable: false,
                    writable: true,
                    configurable: true
                }
            });
            if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
        };
        var objectWithoutProperties = function(obj, keys) {
            var target = {};
            for (var i in obj) {
                if (keys.indexOf(i) >= 0) continue;
                if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
                target[i] = obj[i];
            }
            return target;
        };
        var possibleConstructorReturn = function(self, call) {
            if (!self) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self;
        };
        var withProps = function withProps(input) {
            var hoc = Recompose_mapProps((function(props) {
                return Recompose_extends({}, props, typeof input === "function" ? input(props) : input);
            }));
            if (false) {}
            return hoc;
        };
        var pick = function pick(obj, keys) {
            var result = {};
            for (var i = 0; i < keys.length; i++) {
                var key = keys[i];
                if (obj.hasOwnProperty(key)) {
                    result[key] = obj[key];
                }
            }
            return result;
        };
        var withPropsOnChange = function withPropsOnChange(shouldMapOrKeys, propsMapper) {
            return function(BaseComponent) {
                var factory = createFactory(BaseComponent);
                var shouldMap = typeof shouldMapOrKeys === "function" ? shouldMapOrKeys : function(props, nextProps) {
                    return !shallowEqual(pick(props, shouldMapOrKeys), pick(nextProps, shouldMapOrKeys));
                };
                var WithPropsOnChange = function(_Component) {
                    inherits(WithPropsOnChange, _Component);
                    function WithPropsOnChange() {
                        var _temp, _this, _ret;
                        classCallCheck(this, WithPropsOnChange);
                        for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
                            args[_key] = arguments[_key];
                        }
                        return _ret = (_temp = (_this = possibleConstructorReturn(this, _Component.call.apply(_Component, [ this ].concat(args))), 
                        _this), _this.computedProps = propsMapper(_this.props), _temp), possibleConstructorReturn(_this, _ret);
                    }
                    WithPropsOnChange.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
                        if (shouldMap(this.props, nextProps)) {
                            this.computedProps = propsMapper(nextProps);
                        }
                    };
                    WithPropsOnChange.prototype.render = function render() {
                        return factory(Recompose_extends({}, this.props, this.computedProps));
                    };
                    return WithPropsOnChange;
                }(Component);
                if (false) {}
                return WithPropsOnChange;
            };
        };
        var mapValues = function mapValues(obj, func) {
            var result = {};
            for (var key in obj) {
                if (obj.hasOwnProperty(key)) {
                    result[key] = func(obj[key], key);
                }
            }
            return result;
        };
        var withHandlers = function withHandlers(handlers) {
            return function(BaseComponent) {
                var factory = createFactory(BaseComponent);
                var WithHandlers = function(_Component) {
                    inherits(WithHandlers, _Component);
                    function WithHandlers() {
                        var _temp, _this, _ret;
                        classCallCheck(this, WithHandlers);
                        for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
                            args[_key] = arguments[_key];
                        }
                        return _ret = (_temp = (_this = possibleConstructorReturn(this, _Component.call.apply(_Component, [ this ].concat(args))), 
                        _this), _initialiseProps.call(_this), _temp), possibleConstructorReturn(_this, _ret);
                    }
                    WithHandlers.prototype.componentWillReceiveProps = function componentWillReceiveProps() {
                        this.cachedHandlers = {};
                    };
                    WithHandlers.prototype.render = function render() {
                        return factory(Recompose_extends({}, this.props, this.handlers));
                    };
                    return WithHandlers;
                }(Component);
                var _initialiseProps = function _initialiseProps() {
                    var _this2 = this;
                    this.cachedHandlers = {};
                    this.handlers = mapValues(typeof handlers === "function" ? handlers(this.props) : handlers, (function(createHandler, handlerName) {
                        return function() {
                            var cachedHandler = _this2.cachedHandlers[handlerName];
                            if (cachedHandler) {
                                return cachedHandler.apply(undefined, arguments);
                            }
                            var handler = createHandler(_this2.props);
                            _this2.cachedHandlers[handlerName] = handler;
                            if (false) {}
                            return handler.apply(undefined, arguments);
                        };
                    }));
                };
                if (false) {}
                return WithHandlers;
            };
        };
        var defaultProps = function defaultProps(props) {
            return function(BaseComponent) {
                var factory = createFactory(BaseComponent);
                var DefaultProps = function DefaultProps(ownerProps) {
                    return factory(ownerProps);
                };
                DefaultProps.defaultProps = props;
                if (false) {}
                return DefaultProps;
            };
        };
        var Recompose_omit = function omit(obj, keys) {
            var rest = objectWithoutProperties(obj, []);
            for (var i = 0; i < keys.length; i++) {
                var key = keys[i];
                if (rest.hasOwnProperty(key)) {
                    delete rest[key];
                }
            }
            return rest;
        };
        var renameProp = function renameProp(oldName, newName) {
            var hoc = Recompose_mapProps((function(props) {
                var _babelHelpers$extends;
                return Recompose_extends({}, Recompose_omit(props, [ oldName ]), (_babelHelpers$extends = {}, 
                _babelHelpers$extends[newName] = props[oldName], _babelHelpers$extends));
            }));
            if (false) {}
            return hoc;
        };
        var keys = Object.keys;
        var mapKeys = function mapKeys(obj, func) {
            return keys(obj).reduce((function(result, key) {
                var val = obj[key];
                result[func(val, key)] = val;
                return result;
            }), {});
        };
        var renameProps = function renameProps(nameMap) {
            var hoc = Recompose_mapProps((function(props) {
                return Recompose_extends({}, Recompose_omit(props, keys(nameMap)), mapKeys(pick(props, keys(nameMap)), (function(_, oldName) {
                    return nameMap[oldName];
                })));
            }));
            if (false) {}
            return hoc;
        };
        var flattenProp = function flattenProp(propName) {
            return function(BaseComponent) {
                var factory = createFactory(BaseComponent);
                var FlattenProp = function FlattenProp(props) {
                    return factory(Recompose_extends({}, props, props[propName]));
                };
                if (false) {}
                return FlattenProp;
            };
        };
        var withState = function withState(stateName, stateUpdaterName, initialState) {
            return function(BaseComponent) {
                var factory = createFactory(BaseComponent);
                var WithState = function(_Component) {
                    inherits(WithState, _Component);
                    function WithState() {
                        var _temp, _this, _ret;
                        classCallCheck(this, WithState);
                        for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
                            args[_key] = arguments[_key];
                        }
                        return _ret = (_temp = (_this = possibleConstructorReturn(this, _Component.call.apply(_Component, [ this ].concat(args))), 
                        _this), _this.state = {
                            stateValue: typeof initialState === "function" ? initialState(_this.props) : initialState
                        }, _this.updateStateValue = function(updateFn, callback) {
                            return _this.setState((function(_ref) {
                                var stateValue = _ref.stateValue;
                                return {
                                    stateValue: typeof updateFn === "function" ? updateFn(stateValue) : updateFn
                                };
                            }), callback);
                        }, _temp), possibleConstructorReturn(_this, _ret);
                    }
                    WithState.prototype.render = function render() {
                        var _babelHelpers$extends;
                        return factory(Recompose_extends({}, this.props, (_babelHelpers$extends = {}, _babelHelpers$extends[stateName] = this.state.stateValue, 
                        _babelHelpers$extends[stateUpdaterName] = this.updateStateValue, _babelHelpers$extends)));
                    };
                    return WithState;
                }(Component);
                if (false) {}
                return WithState;
            };
        };
        var withStateHandlers = function withStateHandlers(initialState, stateUpdaters) {
            return function(BaseComponent) {
                var factory = createFactory(BaseComponent);
                var WithStateHandlers = function(_Component) {
                    inherits(WithStateHandlers, _Component);
                    function WithStateHandlers() {
                        var _temp, _this, _ret;
                        classCallCheck(this, WithStateHandlers);
                        for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
                            args[_key] = arguments[_key];
                        }
                        return _ret = (_temp = (_this = possibleConstructorReturn(this, _Component.call.apply(_Component, [ this ].concat(args))), 
                        _this), _initialiseProps.call(_this), _temp), possibleConstructorReturn(_this, _ret);
                    }
                    WithStateHandlers.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) {
                        var propsChanged = nextProps !== this.props;
                        var stateChanged = !shallowEqual(nextState, this.state);
                        return propsChanged || stateChanged;
                    };
                    WithStateHandlers.prototype.render = function render() {
                        return factory(Recompose_extends({}, this.props, this.state, this.stateUpdaters));
                    };
                    return WithStateHandlers;
                }(Component);
                var _initialiseProps = function _initialiseProps() {
                    var _this2 = this;
                    this.state = typeof initialState === "function" ? initialState(this.props) : initialState;
                    this.stateUpdaters = mapValues(stateUpdaters, (function(handler) {
                        return function(mayBeEvent) {
                            for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
                                args[_key2 - 1] = arguments[_key2];
                            }
                            if (mayBeEvent && typeof mayBeEvent.persist === "function") {
                                mayBeEvent.persist();
                            }
                            _this2.setState((function(state, props) {
                                return handler(state, props).apply(undefined, [ mayBeEvent ].concat(args));
                            }));
                        };
                    }));
                };
                if (false) {}
                return WithStateHandlers;
            };
        };
        var withReducer = function withReducer(stateName, dispatchName, reducer, initialState) {
            return function(BaseComponent) {
                var factory = createFactory(BaseComponent);
                var WithReducer = function(_Component) {
                    inherits(WithReducer, _Component);
                    function WithReducer() {
                        var _temp, _this, _ret;
                        classCallCheck(this, WithReducer);
                        for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
                            args[_key] = arguments[_key];
                        }
                        return _ret = (_temp = (_this = possibleConstructorReturn(this, _Component.call.apply(_Component, [ this ].concat(args))), 
                        _this), _this.state = {
                            stateValue: _this.initializeStateValue()
                        }, _this.dispatch = function(action) {
                            return _this.setState((function(_ref) {
                                var stateValue = _ref.stateValue;
                                return {
                                    stateValue: reducer(stateValue, action)
                                };
                            }));
                        }, _temp), possibleConstructorReturn(_this, _ret);
                    }
                    WithReducer.prototype.initializeStateValue = function initializeStateValue() {
                        if (initialState !== undefined) {
                            return typeof initialState === "function" ? initialState(this.props) : initialState;
                        }
                        return reducer(undefined, {
                            type: "@@recompose/INIT"
                        });
                    };
                    WithReducer.prototype.render = function render() {
                        var _babelHelpers$extends;
                        return factory(Recompose_extends({}, this.props, (_babelHelpers$extends = {}, _babelHelpers$extends[stateName] = this.state.stateValue, 
                        _babelHelpers$extends[dispatchName] = this.dispatch, _babelHelpers$extends)));
                    };
                    return WithReducer;
                }(Component);
                if (false) {}
                return WithReducer;
            };
        };
        var identity = function identity(Component$$1) {
            return Component$$1;
        };
        var branch = function branch(test, left) {
            var right = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : identity;
            return function(BaseComponent) {
                var leftFactory = void 0;
                var rightFactory = void 0;
                var Branch = function Branch(props) {
                    if (test(props)) {
                        leftFactory = leftFactory || createFactory(left(BaseComponent));
                        return leftFactory(props);
                    }
                    rightFactory = rightFactory || createFactory(right(BaseComponent));
                    return rightFactory(props);
                };
                if (false) {}
                return Branch;
            };
        };
        var renderComponent = function renderComponent(Component$$1) {
            return function(_) {
                var factory = createFactory(Component$$1);
                var RenderComponent = function RenderComponent(props) {
                    return factory(props);
                };
                if (false) {}
                return RenderComponent;
            };
        };
        var Nothing = function(_Component) {
            inherits(Nothing, _Component);
            function Nothing() {
                classCallCheck(this, Nothing);
                return possibleConstructorReturn(this, _Component.apply(this, arguments));
            }
            Nothing.prototype.render = function render() {
                return null;
            };
            return Nothing;
        }(react.Component);
        var renderNothing = function renderNothing(_) {
            return Nothing;
        };
        var shouldUpdate = function shouldUpdate(test) {
            return function(BaseComponent) {
                var factory = createFactory(BaseComponent);
                var ShouldUpdate = function(_Component) {
                    inherits(ShouldUpdate, _Component);
                    function ShouldUpdate() {
                        classCallCheck(this, ShouldUpdate);
                        return possibleConstructorReturn(this, _Component.apply(this, arguments));
                    }
                    ShouldUpdate.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
                        return test(this.props, nextProps);
                    };
                    ShouldUpdate.prototype.render = function render() {
                        return factory(this.props);
                    };
                    return ShouldUpdate;
                }(Component);
                if (false) {}
                return ShouldUpdate;
            };
        };
        var pure = function pure(BaseComponent) {
            var hoc = shouldUpdate((function(props, nextProps) {
                return !shallowEqual(props, nextProps);
            }));
            if (false) {}
            return hoc(BaseComponent);
        };
        var onlyUpdateForKeys = function onlyUpdateForKeys(propKeys) {
            var hoc = shouldUpdate((function(props, nextProps) {
                return !shallowEqual(pick(nextProps, propKeys), pick(props, propKeys));
            }));
            if (false) {}
            return hoc;
        };
        var onlyUpdateForPropTypes = function onlyUpdateForPropTypes(BaseComponent) {
            var propTypes = BaseComponent.propTypes;
            if (false) {}
            var propKeys = Object.keys(propTypes || {});
            var OnlyUpdateForPropTypes = onlyUpdateForKeys(propKeys)(BaseComponent);
            if (false) {}
            return OnlyUpdateForPropTypes;
        };
        var withContext = function withContext(childContextTypes, getChildContext) {
            return function(BaseComponent) {
                var factory = createFactory(BaseComponent);
                var WithContext = function(_Component) {
                    inherits(WithContext, _Component);
                    function WithContext() {
                        var _temp, _this, _ret;
                        classCallCheck(this, WithContext);
                        for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
                            args[_key] = arguments[_key];
                        }
                        return _ret = (_temp = (_this = possibleConstructorReturn(this, _Component.call.apply(_Component, [ this ].concat(args))), 
                        _this), _this.getChildContext = function() {
                            return getChildContext(_this.props);
                        }, _temp), possibleConstructorReturn(_this, _ret);
                    }
                    WithContext.prototype.render = function render() {
                        return factory(this.props);
                    };
                    return WithContext;
                }(Component);
                WithContext.childContextTypes = childContextTypes;
                if (false) {}
                return WithContext;
            };
        };
        var getContext = function getContext(contextTypes) {
            return function(BaseComponent) {
                var factory = createFactory(BaseComponent);
                var GetContext = function GetContext(ownerProps, context) {
                    return factory(Recompose_extends({}, ownerProps, context));
                };
                GetContext.contextTypes = contextTypes;
                if (false) {}
                return GetContext;
            };
        };
        var lifecycle = function lifecycle(spec) {
            return function(BaseComponent) {
                var factory = createFactory(BaseComponent);
                if (false) {}
                var Lifecycle = function(_Component) {
                    inherits(Lifecycle, _Component);
                    function Lifecycle() {
                        classCallCheck(this, Lifecycle);
                        return possibleConstructorReturn(this, _Component.apply(this, arguments));
                    }
                    Lifecycle.prototype.render = function render() {
                        return factory(Recompose_extends({}, this.props, this.state));
                    };
                    return Lifecycle;
                }(Component);
                Object.keys(spec).forEach((function(hook) {
                    return Lifecycle.prototype[hook] = spec[hook];
                }));
                if (false) {}
                return Lifecycle;
            };
        };
        var isClassComponent = function isClassComponent(Component$$1) {
            return Boolean(Component$$1 && Component$$1.prototype && typeof Component$$1.prototype.render === "function");
        };
        var toClass = function toClass(baseComponent) {
            if (isClassComponent(baseComponent)) {
                return baseComponent;
            }
            var ToClass = function(_Component) {
                inherits(ToClass, _Component);
                function ToClass() {
                    classCallCheck(this, ToClass);
                    return possibleConstructorReturn(this, _Component.apply(this, arguments));
                }
                ToClass.prototype.render = function render() {
                    if (typeof baseComponent === "string") {
                        return React.createElement(baseComponent, this.props);
                    }
                    return baseComponent(this.props, this.context);
                };
                return ToClass;
            }(Component);
            ToClass.displayName = getDisplayName(baseComponent);
            ToClass.propTypes = baseComponent.propTypes;
            ToClass.contextTypes = baseComponent.contextTypes;
            ToClass.defaultProps = baseComponent.defaultProps;
            return ToClass;
        };
        var setPropTypes = function setPropTypes(propTypes) {
            return setStatic("propTypes", propTypes);
        };
        function Recompose_compose() {
            for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {
                funcs[_key] = arguments[_key];
            }
            if (funcs.length === 0) {
                return function(arg) {
                    return arg;
                };
            }
            if (funcs.length === 1) {
                return funcs[0];
            }
            return funcs.reduce((function(a, b) {
                return function() {
                    return a(b.apply(undefined, arguments));
                };
            }));
        }
        var createSink = function createSink(callback) {
            return function(_Component) {
                inherits(Sink, _Component);
                function Sink() {
                    classCallCheck(this, Sink);
                    return possibleConstructorReturn(this, _Component.apply(this, arguments));
                }
                Sink.prototype.componentWillMount = function componentWillMount() {
                    callback(this.props);
                };
                Sink.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
                    callback(nextProps);
                };
                Sink.prototype.render = function render() {
                    return null;
                };
                return Sink;
            }(Component);
        };
        var componentFromProp = function componentFromProp(propName) {
            var Component$$1 = function Component$$1(props) {
                return createElement(props[propName], Recompose_omit(props, [ propName ]));
            };
            Component$$1.displayName = "componentFromProp(" + propName + ")";
            return Component$$1;
        };
        var nest = function nest() {
            for (var _len = arguments.length, Components = Array(_len), _key = 0; _key < _len; _key++) {
                Components[_key] = arguments[_key];
            }
            var factories = Components.map(createFactory);
            var Nest = function Nest(_ref) {
                var props = objectWithoutProperties(_ref, []), children = _ref.children;
                return factories.reduceRight((function(child, factory) {
                    return factory(props, child);
                }), children);
            };
            if (false) {
                var displayNames;
            }
            return Nest;
        };
        var hoistStatics = function hoistStatics(higherOrderComponent) {
            return function(BaseComponent) {
                var NewComponent = higherOrderComponent(BaseComponent);
                hoistNonReactStatics(NewComponent, BaseComponent);
                return NewComponent;
            };
        };
        var _config = {
            fromESObservable: null,
            toESObservable: null
        };
        var configureObservable = function configureObservable(c) {
            _config = c;
        };
        var config = {
            fromESObservable: function fromESObservable(observable) {
                return typeof _config.fromESObservable === "function" ? _config.fromESObservable(observable) : observable;
            },
            toESObservable: function toESObservable(stream) {
                return typeof _config.toESObservable === "function" ? _config.toESObservable(stream) : stream;
            }
        };
        var componentFromStreamWithConfig = function componentFromStreamWithConfig(config$$1) {
            return function(propsToVdom) {
                return function(_Component) {
                    inherits(ComponentFromStream, _Component);
                    function ComponentFromStream() {
                        var _config$fromESObserva;
                        var _temp, _this, _ret;
                        classCallCheck(this, ComponentFromStream);
                        for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
                            args[_key] = arguments[_key];
                        }
                        return _ret = (_temp = (_this = possibleConstructorReturn(this, _Component.call.apply(_Component, [ this ].concat(args))), 
                        _this), _this.state = {
                            vdom: null
                        }, _this.propsEmitter = createChangeEmitter(), _this.props$ = config$$1.fromESObservable((_config$fromESObserva = {
                            subscribe: function subscribe(observer) {
                                var unsubscribe = _this.propsEmitter.listen((function(props) {
                                    if (props) {
                                        observer.next(props);
                                    } else {
                                        observer.complete();
                                    }
                                }));
                                return {
                                    unsubscribe
                                };
                            }
                        }, _config$fromESObserva[$$observable] = function() {
                            return this;
                        }, _config$fromESObserva)), _this.vdom$ = config$$1.toESObservable(propsToVdom(_this.props$)), 
                        _temp), possibleConstructorReturn(_this, _ret);
                    }
                    ComponentFromStream.prototype.componentWillMount = function componentWillMount() {
                        var _this2 = this;
                        this.subscription = this.vdom$.subscribe({
                            next: function next(vdom) {
                                _this2.setState({
                                    vdom
                                });
                            }
                        });
                        this.propsEmitter.emit(this.props);
                    };
                    ComponentFromStream.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
                        this.propsEmitter.emit(nextProps);
                    };
                    ComponentFromStream.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) {
                        return nextState.vdom !== this.state.vdom;
                    };
                    ComponentFromStream.prototype.componentWillUnmount = function componentWillUnmount() {
                        this.propsEmitter.emit();
                        this.subscription.unsubscribe();
                    };
                    ComponentFromStream.prototype.render = function render() {
                        return this.state.vdom;
                    };
                    return ComponentFromStream;
                }(Component);
            };
        };
        var componentFromStream = function componentFromStream(propsToVdom) {
            return componentFromStreamWithConfig(config)(propsToVdom);
        };
        var identity$1 = function identity(t) {
            return t;
        };
        var mapPropsStreamWithConfig = function mapPropsStreamWithConfig(config$$1) {
            var componentFromStream = componentFromStreamWithConfig({
                fromESObservable: identity$1,
                toESObservable: identity$1
            });
            return function(transform) {
                return function(BaseComponent) {
                    var factory = createFactory(BaseComponent);
                    var fromESObservable = config$$1.fromESObservable, toESObservable = config$$1.toESObservable;
                    return componentFromStream((function(props$) {
                        var _ref;
                        return _ref = {
                            subscribe: function subscribe(observer) {
                                var subscription = toESObservable(transform(fromESObservable(props$))).subscribe({
                                    next: function next(childProps) {
                                        return observer.next(factory(childProps));
                                    }
                                });
                                return {
                                    unsubscribe: function unsubscribe() {
                                        return subscription.unsubscribe();
                                    }
                                };
                            }
                        }, _ref[$$observable] = function() {
                            return this;
                        }, _ref;
                    }));
                };
            };
        };
        var mapPropsStream = function mapPropsStream(transform) {
            var hoc = mapPropsStreamWithConfig(config)(transform);
            if (false) {}
            return hoc;
        };
        var createEventHandlerWithConfig = function createEventHandlerWithConfig(config$$1) {
            return function() {
                var _config$fromESObserva;
                var emitter = (0, lib.E)();
                var stream = config$$1.fromESObservable((_config$fromESObserva = {
                    subscribe: function subscribe(observer) {
                        var unsubscribe = emitter.listen((function(value) {
                            return observer.next(value);
                        }));
                        return {
                            unsubscribe
                        };
                    }
                }, _config$fromESObserva[es.Z] = function() {
                    return this;
                }, _config$fromESObserva));
                return {
                    handler: emitter.emit,
                    stream
                };
            };
        };
        var createEventHandler = createEventHandlerWithConfig(config);
        var lodash_merge = __webpack_require__(464);
        var merge_default = __webpack_require__.n(lodash_merge);
        var noop = __webpack_require__(587);
        var noop_default = __webpack_require__.n(noop);
        var lodash_pick = __webpack_require__(588);
        var pick_default = __webpack_require__.n(lodash_pick);
        var TARGET_OFFSET = 3;
        var CLICK_TIMEOUT = 1e3;
        var createOnRemoveObserver = function(element, onDetachCallback) {
            var observer = new MutationObserver((function() {
                if (!document.contains(element)) {
                    observer.disconnect();
                    onDetachCallback();
                }
            }));
            observer.observe(document, {
                childList: true,
                subtree: true
            });
            return observer;
        };
        var arrowStyle = "\n\tposition: absolute;\n\twidth: 0;\n\theight: 0;\n\tborder-color: transparent;\n\tborder-style: solid;\n";
        var TooltipTopArrow = styled_components_browser_esm.default.div(templateObject_1 || (templateObject_1 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\t", " bottom: 0;\n\tleft: 50%;\n\tmargin-left: -5px;\n\tborder-width: 5px 5px 0;\n\tborder-top-color: #000;\n" ], [ "\n\t", " bottom: 0;\n\tleft: 50%;\n\tmargin-left: -5px;\n\tborder-width: 5px 5px 0;\n\tborder-top-color: #000;\n" ])), arrowStyle);
        var TooltipRightArrow = styled_components_browser_esm.default.div(templateObject_2 || (templateObject_2 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\t", " top: 50%;\n\tleft: 0;\n\tmargin-top: -5px;\n\tborder-width: 5px 5px 5px 0;\n\tborder-right-color: #000;\n" ], [ "\n\t", " top: 50%;\n\tleft: 0;\n\tmargin-top: -5px;\n\tborder-width: 5px 5px 5px 0;\n\tborder-right-color: #000;\n" ])), arrowStyle);
        var TooltipLeftArrow = styled_components_browser_esm.default.div(templateObject_3 || (templateObject_3 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\t", " top: 50%;\n\tright: 0;\n\tmargin-top: -5px;\n\tborder-width: 5px 0 5px 5px;\n\tborder-left-color: #000;\n" ], [ "\n\t", " top: 50%;\n\tright: 0;\n\tmargin-top: -5px;\n\tborder-width: 5px 0 5px 5px;\n\tborder-left-color: #000;\n" ])), arrowStyle);
        var TooltipBottomArrow = styled_components_browser_esm.default.div(templateObject_4 || (templateObject_4 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\t", " top: 0;\n\tleft: 50%;\n\tmargin-left: -5px;\n\tborder-width: 0 5px 5px;\n\tborder-bottom-color: #000;\n" ], [ "\n\t", " top: 0;\n\tleft: 50%;\n\tmargin-left: -5px;\n\tborder-width: 0 5px 5px;\n\tborder-bottom-color: #000;\n" ])), arrowStyle);
        var getArrowElement = function(placement) {
            switch (placement) {
              case "right":
                return TooltipRightArrow;

              case "bottom":
                return TooltipBottomArrow;

              case "left":
                return TooltipLeftArrow;

              default:
                return TooltipTopArrow;
            }
        };
        var TooltipElement = styled_components_browser_esm.default.div(templateObject_5 || (templateObject_5 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\tdisplay: block;\n\tfont-size: 12px;\n\tfont-style: normal;\n\tfont-weight: 400;\n\tletter-spacing: normal;\n\tline-break: auto;\n\tline-height: 1.42857143;\n\tpadding: 5px;\n\tposition: absolute;\n\tmax-width: 300px;\n\ttext-align: left;\n\ttext-align: start;\n\ttext-decoration: none;\n\ttext-shadow: none;\n\ttext-transform: none;\n\tvisibility: hidden;\n\twhite-space: normal;\n\tword-break: normal;\n\tword-spacing: normal;\n\tword-wrap: normal;\n\tz-index: 10000;\n\tcolor: white;\n" ], [ "\n\tdisplay: block;\n\tfont-size: 12px;\n\tfont-style: normal;\n\tfont-weight: 400;\n\tletter-spacing: normal;\n\tline-break: auto;\n\tline-height: 1.42857143;\n\tpadding: 5px;\n\tposition: absolute;\n\tmax-width: 300px;\n\ttext-align: left;\n\ttext-align: start;\n\ttext-decoration: none;\n\ttext-shadow: none;\n\ttext-transform: none;\n\tvisibility: hidden;\n\twhite-space: normal;\n\tword-break: normal;\n\tword-spacing: normal;\n\tword-wrap: normal;\n\tz-index: 10000;\n\tcolor: white;\n" ])));
        var TooltipElementInner = styled_components_browser_esm.default.div(templateObject_6 || (templateObject_6 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\tbackground: black;\n\tborder-radius: 4px;\n\tpadding: 3px 8px;\n\ttext-align: center;\n" ], [ "\n\tbackground: black;\n\tborder-radius: 4px;\n\tpadding: 3px 8px;\n\ttext-align: center;\n" ])));
        var TooltipComponent = function(_super) {
            (0, tslib_es6.__extends)(TooltipComponent, _super);
            function TooltipComponent(props) {
                var _this = _super.call(this, props) || this;
                _this.state = {
                    show: false,
                    placement: "top",
                    coordinates: {
                        top: 0,
                        left: 0
                    }
                };
                return _this;
            }
            TooltipComponent.prototype.observe = function(target) {
                var _this = this;
                if (this.observer) {
                    this.observer.disconnect();
                }
                this.observer = createOnRemoveObserver(target, (function() {
                    _this.hide();
                }));
            };
            TooltipComponent.prototype.show = function(e, tooltipText, options) {
                if (options === void 0) {
                    options = {};
                }
                var top = 0;
                var left = 0;
                var target = e.target;
                this.observe(target);
                var boundingClientRect = target.getBoundingClientRect();
                var boundingRect = pick_default()(boundingClientRect, [ "top", "left", "width", "height" ]);
                boundingRect.top += window.scrollY;
                boundingRect.left += window.scrollX;
                var placement = options.placement, containerStyle = options.containerStyle, innerStyle = options.innerStyle, arrowStyle = options.arrowStyle;
                if (this.tooltipElementInner) {
                    this.tooltipElementInner.innerText = tooltipText;
                }
                if (!placement || placement === "top") {
                    top = boundingRect.top - this.tooltipElement.clientHeight - TARGET_OFFSET;
                    left = boundingRect.left + boundingRect.width / 2 - this.tooltipElement.clientWidth / 2;
                }
                if (placement === "right") {
                    top = boundingRect.top + boundingRect.height / 2 - this.tooltipElement.clientHeight / 2;
                    left = boundingRect.left + boundingRect.width + TARGET_OFFSET;
                }
                if (placement === "bottom") {
                    top = boundingRect.top + boundingRect.height + TARGET_OFFSET;
                    left = boundingRect.left + boundingRect.width / 2 - this.tooltipElement.clientWidth / 2;
                }
                if (placement === "left") {
                    top = boundingRect.top + boundingRect.height / 2 - this.tooltipElement.clientHeight / 2;
                    left = boundingRect.left - this.tooltipElement.clientWidth - TARGET_OFFSET;
                }
                this.setState({
                    coordinates: {
                        top,
                        left
                    },
                    show: true,
                    placement,
                    containerStyle,
                    innerStyle,
                    arrowStyle
                });
            };
            TooltipComponent.prototype.hide = function() {
                if (this.observer) {
                    this.observer.disconnect();
                    this.observer = undefined;
                }
                this.setState({
                    show: false,
                    coordinates: {
                        top: 0,
                        left: 0
                    }
                });
            };
            TooltipComponent.prototype.render = function() {
                var _this = this;
                var _a = this.state, placement = _a.placement, containerStyle = _a.containerStyle, innerStyle = _a.innerStyle, arrowStyle = _a.arrowStyle;
                var Arrow = getArrowElement(placement);
                var tooltipStyle = merge_default()({
                    top: this.state.coordinates.top,
                    left: this.state.coordinates.left,
                    visibility: this.state.show ? "visible" : "hidden"
                }, containerStyle);
                return react.createElement(TooltipElement, {
                    style: tooltipStyle,
                    ref: function(el) {
                        return _this.tooltipElement = el;
                    }
                }, react.createElement(TooltipElementInner, {
                    ref: function(el) {
                        return _this.tooltipElementInner = el;
                    },
                    style: innerStyle
                }), react.createElement(Arrow, {
                    style: arrowStyle
                }));
            };
            return TooltipComponent;
        }(react.Component);
        var Tooltips = function() {
            function Tooltips() {
                this.initialised = false;
                this.hideOnMouseOut = null;
            }
            Tooltips.prototype.initialiseElements = function() {
                var _this = this;
                if (this.initialised || !document || !document.body) {
                    return;
                }
                var tooltipRoot = document.createElement("div");
                tooltipRoot.id = "rendition-tooltip-root";
                document.body.appendChild(tooltipRoot);
                document.addEventListener("mouseover", (function(e) {
                    var target = e.target;
                    if (!_this.hideOnMouseOut || _this.hideOnMouseOut === target) {
                        return;
                    }
                    if (_this.hideOnMouseOut.firstElementChild && _this.hideOnMouseOut.contains && _this.hideOnMouseOut.contains(target)) {
                        return;
                    }
                    _this.hide();
                    _this.hideOnMouseOut = null;
                }));
                this.component = react_dom.render(react.createElement(TooltipComponent, null), tooltipRoot);
                this.initialised = true;
            };
            Tooltips.prototype.bindProps = function(props) {
                var _this = this;
                if (props.tooltip) {
                    var options_1 = {};
                    var trigger = "hover";
                    var tooltipText_1;
                    if (typeof props.tooltip === "string") {
                        tooltipText_1 = props.tooltip;
                    } else {
                        tooltipText_1 = props.tooltip.text;
                        options_1.placement = props.tooltip.placement;
                        options_1.containerStyle = props.tooltip.containerStyle;
                        options_1.innerStyle = props.tooltip.innerStyle;
                        options_1.arrowStyle = props.tooltip.arrowStyle;
                        if (props.tooltip.trigger) {
                            trigger = props.tooltip.trigger;
                        }
                    }
                    if (tooltipText_1) {
                        var showFn_1 = function(e) {
                            return _this.show(e, tooltipText_1, options_1);
                        };
                        if (trigger === "click") {
                            var oldFn_1 = props.onClick || noop_default();
                            var hideFn_1 = function() {
                                clearTimeout(_this.hideTimeout);
                                _this.hideTimeout = window.setTimeout((function() {
                                    return _this.hide();
                                }), CLICK_TIMEOUT);
                            };
                            props.onClick = function(e) {
                                showFn_1(e);
                                hideFn_1();
                                oldFn_1(e);
                            };
                        } else {
                            var oldMEFn_1 = props.onMouseEnter || noop_default();
                            props.onMouseEnter = function(e) {
                                showFn_1(e);
                                oldMEFn_1(e);
                                if (e.target.disabled) {
                                    _this.hideOnMouseOut = e.target;
                                }
                            };
                            var oldMLFn_1 = props.onMouseLeave || noop_default();
                            props.onMouseLeave = function(e) {
                                _this.hide();
                                oldMLFn_1(e);
                            };
                        }
                    }
                }
                return props;
            };
            Tooltips.prototype.show = function(e, tooltipText, options) {
                this.initialiseElements();
                this.component.show(e, tooltipText, options);
            };
            Tooltips.prototype.hide = function() {
                this.initialiseElements();
                this.component.hide();
            };
            return Tooltips;
        }();
        var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
        var tooltip = new Tooltips;
        var prop = (0, prop_types.oneOfType)([ prop_types.number, prop_types.string, (0, 
        prop_types.arrayOf)((0, prop_types.oneOfType)([ prop_types.number, prop_types.string ])) ]);
        var propTypes = {
            width: prop,
            minWidth: prop,
            maxWidth: prop,
            height: prop,
            minHeight: prop,
            maxHeight: prop,
            display: prop,
            fontSize: prop,
            color: prop,
            bg: prop,
            backgroundColor: prop,
            m: prop,
            mt: prop,
            mr: prop,
            mb: prop,
            ml: prop,
            mx: prop,
            my: prop,
            p: prop,
            pt: prop,
            pr: prop,
            pb: prop,
            pl: prop,
            px: prop,
            py: prop
        };
        var styledSystemProps = Object.keys(propTypes);
        var filterStyledSystemProps = function(passthroughProps) {
            return function(Base) {
                return react.forwardRef((function(props, ref) {
                    var nextProps = omit_default()(props, difference_default()(styledSystemProps, passthroughProps));
                    return react.createElement(Base, (0, tslib_es6.__assign)({}, nextProps, {
                        ref
                    }));
                }));
            };
        };
        var withStyledSystem = function(child) {
            var Base = (0, styled_components_browser_esm.default)(child)(asRendition_templateObject_1 || (asRendition_templateObject_1 = (0, 
            tslib_es6.__makeTemplateObject)([ "\n\t\t", "\n\t\t", "\n    ", "\n    ", "\n    ", "\n    ", "\n    ", "\n    ", "\n\t\t", "\n\t\t", "\n\t" ], [ "\n\t\t", "\n\t\t", "\n    ", "\n    ", "\n    ", "\n    ", "\n    ", "\n    ", "\n\t\t", "\n\t\t", "\n\t" ])), space, width, minWidth, maxWidth, height, minHeight, maxHeight, display, fontSize, color);
            Base.displayName = getDisplayName(child);
            Base.propTypes = propTypes;
            return react.forwardRef((function(props, ref) {
                return react.createElement(Base, (0, tslib_es6.__assign)({}, props, {
                    ref
                }));
            }));
        };
        var withTooltip = function(Base) {
            return react.forwardRef((function(_a, ref) {
                var props = (0, tslib_es6.__rest)(_a, []);
                if (!props.tooltip) {
                    return react.createElement(Base, (0, tslib_es6.__assign)({}, props, {
                        ref
                    }));
                }
                var tooltipProps = tooltip.bindProps(props);
                delete props.tooltip;
                return props.disabled ? react.createElement("span", {
                    onClick: tooltipProps.onClick,
                    onMouseEnter: tooltipProps.onMouseEnter,
                    onMouseLeave: tooltipProps.onMouseLeave
                }, react.createElement(Base, (0, tslib_es6.__assign)({}, props, {
                    ref
                }))) : react.createElement(Base, (0, tslib_es6.__assign)({}, tooltipProps, {
                    ref
                }));
            }));
        };
        function asRendition(component, additionalEnhancers, passthroughProps) {
            if (additionalEnhancers === void 0) {
                additionalEnhancers = [];
            }
            if (passthroughProps === void 0) {
                passthroughProps = [];
            }
            return Recompose_compose.apply(void 0, (0, tslib_es6.__spreadArrays)([ styled_components_browser_esm.withTheme ], additionalEnhancers || [], [ withTooltip, withStyledSystem, filterStyledSystemProps(passthroughProps) ]))(component);
        }
        var asRendition_templateObject_1;
        var Box = asRendition(styled_components_browser_esm.default.div(Box_templateObject_1 || (Box_templateObject_1 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\t\tbox-sizing: border-box;\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t" ], [ "\n\t\tbox-sizing: border-box;\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t" ])), flex, order, alignSelf));
        Box.displayName = "Box";
        var Box_templateObject_1;
        var Flex = (0, styled_components_browser_esm.default)(Box)(Flex_templateObject_1 || (Flex_templateObject_1 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\tdisplay: flex;\n\t", ";\n\t", ";\n\t", ";\n\t", ";\n" ], [ "\n\tdisplay: flex;\n\t", ";\n\t", ";\n\t", ";\n\t", ";\n" ])), flexWrap, flexDirection, alignItems, justifyContent);
        Flex.displayName = "Flex";
        var Flex_templateObject_1;
        function object_extends() {
            object_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return object_extends.apply(this, arguments);
        }
        var object_isObject = function isObject(item) {
            return item && typeof item === "object" && !Array.isArray(item);
        };
        var deepFreeze = function deepFreeze(obj) {
            Object.keys(obj).forEach((function(key) {
                return key && object_isObject(obj[key]) && Object.freeze(obj[key]);
            }));
            return Object.freeze(obj);
        };
        var object_deepMerge = function deepMerge(target) {
            for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
                sources[_key - 1] = arguments[_key];
            }
            if (!sources.length) {
                return target;
            }
            var output = object_extends({}, target);
            sources.forEach((function(source) {
                if (object_isObject(source)) {
                    Object.keys(source).forEach((function(key) {
                        if (object_isObject(source[key])) {
                            if (!output[key]) {
                                output[key] = object_extends({}, source[key]);
                            } else {
                                output[key] = deepMerge(output[key], source[key]);
                            }
                        } else {
                            output[key] = source[key];
                        }
                    }));
                }
            }));
            return output;
        };
        var removeUndefined = function removeUndefined(obj) {
            var result = {};
            Object.keys(obj).forEach((function(key) {
                if (obj[key] !== undefined) {
                    result[key] = obj[key];
                }
            }));
            return result;
        };
        styled_components_browser_esm.ThemeContext.Extend = function(_ref) {
            var children = _ref.children, value = _ref.value;
            return react.createElement(styled_components_browser_esm.ThemeContext.Consumer, null, (function(theme) {
                return react.createElement(styled_components_browser_esm.ThemeContext.Provider, {
                    value: object_deepMerge(theme, value)
                }, children);
            }));
        };
        styled_components_browser_esm.ThemeContext.Extend.propTypes = {
            children: prop_types_default().node.isRequired,
            value: prop_types_default().shape({}).isRequired
        };
        var ResponsiveContext = react.createContext(undefined);
        var ContainerTargetContext = react.createContext(typeof document === "object" ? document.body : undefined);
        var getBreakpoint = function getBreakpoint(windowWidth, theme) {
            var result;
            var sortedBreakpoints = Object.keys(theme.global.breakpoints).sort((function(a, b) {
                var first = theme.global.breakpoints[a];
                var second = theme.global.breakpoints[b];
                if (!first) return 1;
                if (!second) return -1;
                if (!first.value) return 1;
                if (!second.value) return -1;
                return first.value - second.value;
            }));
            var lastBreakpoint = sortedBreakpoints[sortedBreakpoints.length - 1];
            sortedBreakpoints.some((function(name) {
                var breakpoint = theme.global.breakpoints[name];
                if (breakpoint) {
                    if (!breakpoint.value || breakpoint.value >= windowWidth) {
                        result = name;
                        return true;
                    }
                }
                return false;
            }));
            return result || lastBreakpoint;
        };
        var getDeviceBreakpoint = function getDeviceBreakpoint(type, theme) {
            return theme.global.deviceBreakpoints[type];
        };
        var getBreakpointStyle = function getBreakpointStyle(theme, breakpointSize) {
            var breakpoint = breakpointSize && theme.global.breakpoints[breakpointSize] || {};
            if (!breakpoint.edgeSize) breakpoint.edgeSize = theme.global.edgeSize;
            if (!breakpoint.borderSize) breakpoint.borderSize = theme.global.borderSize;
            if (!breakpoint.size) breakpoint.size = theme.global.size;
            return breakpoint;
        };
        var colors_normalizeColor = function normalizeColor(color, theme, dark) {
            var colorSpec = theme.global && theme.global.colors[color] !== undefined ? theme.global.colors[color] : color;
            var result = colorSpec;
            if (colorSpec) {
                if ((dark === true || dark === undefined && theme.dark) && colorSpec.dark !== undefined) {
                    result = colorSpec.dark;
                } else if ((dark === false || !theme.dark) && colorSpec.light !== undefined) {
                    result = colorSpec.light;
                }
            }
            if (result && theme.global && theme.global.colors[result] !== undefined) {
                result = normalizeColor(result, theme, dark);
            }
            return result;
        };
        var parseHexToRGB = function parseHexToRGB(color) {
            return color.length < 7 ? color.match(/[A-Za-z0-9]{1}/g).map((function(v) {
                return parseInt("" + v + v, 16);
            })) : color.match(/[A-Za-z0-9]{2}/g).map((function(v) {
                return parseInt(v, 16);
            }));
        };
        var hslToRGB = function hslToRGB(h, s, l) {
            var r;
            var g;
            var b;
            if (s === 0 || s === "0") {
                r = l;
                g = l;
                b = l;
            } else {
                var hue2rgb = function hue2rgb(p, q, inT) {
                    var t = inT;
                    if (t < 0) t += 1;
                    if (t > 1) t -= 1;
                    if (t < .16666667) return p + (q - p) * 6 * t;
                    if (t < 1 / 2) return q;
                    if (t < .66666667) return p + (q - p) * (.66666667 - t) * 6;
                    return p;
                };
                var q = l < .5 ? l * (1 + s) : l + s - l * s;
                var p = 2 * l - q;
                r = hue2rgb(p, q, h + .33333333);
                g = hue2rgb(p, q, h);
                b = hue2rgb(p, q, h - .33333333);
            }
            return [ Math.round(r * 255), Math.round(g * 255), Math.round(b * 255) ];
        };
        var hexExp = /^#[A-Za-z0-9]{3,4}$|^#[A-Za-z0-9]{6,8}$/;
        var rgbExp = /^rgba?\(\s?([0-9]*)\s?,\s?([0-9]*)\s?,\s?([0-9]*)\s?\)/;
        var rgbaExp = /^rgba?\(\s?([0-9]*)\s?,\s?([0-9]*)\s?,\s?([0-9]*)\s?,\s?([.0-9]*)\s?\)/;
        var hslExp = /^hsla?\(\s?([0-9]*)\s?,\s?([0-9]*)%?\s?,\s?([0-9]*)%?\s?.*?\)/;
        var canExtractRGBArray = function canExtractRGBArray(color) {
            return hexExp.test(color) || rgbExp.test(color) || rgbaExp.test(color) || hslExp.test(color);
        };
        var getRGBArray = function getRGBArray(color) {
            if (hexExp.test(color)) {
                var _parseHexToRGB = parseHexToRGB(color), red = _parseHexToRGB[0], green = _parseHexToRGB[1], blue = _parseHexToRGB[2], alpha = _parseHexToRGB[3];
                return [ red, green, blue, alpha !== undefined ? alpha / 255 : undefined ];
            }
            var match = color.match(rgbExp);
            if (match) {
                return match.splice(1).map((function(v) {
                    return parseInt(v, 10);
                }));
            }
            match = color.match(rgbaExp);
            if (match) {
                return match.splice(1).map((function(v) {
                    return parseFloat(v, 10);
                }));
            }
            match = color.match(hslExp);
            if (match) {
                var _match$splice$map = match.splice(1).map((function(v) {
                    return parseInt(v, 10);
                })), h = _match$splice$map[0], s = _match$splice$map[1], l = _match$splice$map[2];
                return hslToRGB(h / 360, s / 100, l / 100);
            }
            return color;
        };
        var colorIsDark = function colorIsDark(color) {
            if (color && canExtractRGBArray(color)) {
                var _getRGBArray = getRGBArray(color), red = _getRGBArray[0], green = _getRGBArray[1], blue = _getRGBArray[2], alpha = _getRGBArray[3];
                if (alpha < .5) return undefined;
                var brightness = (299 * red + 587 * green + 114 * blue) / 1e3;
                return brightness < 125;
            }
            return undefined;
        };
        var getRGBA = function getRGBA(color, opacity) {
            if (color && canExtractRGBArray(color)) {
                var _getRGBArray2 = getRGBArray(color), red = _getRGBArray2[0], green = _getRGBArray2[1], blue = _getRGBArray2[2], alpha = _getRGBArray2[3];
                var normalizedAlpha;
                if (opacity !== undefined) {
                    normalizedAlpha = opacity;
                } else if (alpha !== undefined) {
                    normalizedAlpha = alpha;
                } else {
                    normalizedAlpha = 1;
                }
                return "rgba(" + red + ", " + green + ", " + blue + ", " + normalizedAlpha + ")";
            }
            return undefined;
        };
        var evalStyle = function evalStyle(arg, theme) {
            if (arg && Array.isArray(arg) && typeof arg[0] === "function") {
                return arg[0]({
                    theme
                });
            }
            return arg;
        };
        var normalizeBackground = function normalizeBackground(background, theme) {
            var result = background;
            if (background) {
                if (theme.dark && background.dark && typeof background.dark !== "boolean") {
                    result = background.dark;
                } else if (!theme.dark && background.light && typeof background.light !== "boolean") {
                    result = background.light;
                }
                result = evalStyle(result, theme);
            }
            return result;
        };
        var backgroundIsDark = function backgroundIsDark(backgroundArg, theme) {
            var background = normalizeBackground(backgroundArg, theme);
            var result;
            if (background) {
                if (typeof background === "object") {
                    var color = background.color, dark = background.dark, opacity = background.opacity;
                    if (typeof dark === "boolean") {
                        result = dark;
                    } else if (color && (!opacity || opacity !== "weak")) {
                        var backgroundColor = colors_normalizeColor(background.color, theme);
                        if (backgroundColor) {
                            result = colorIsDark(backgroundColor);
                        }
                    }
                } else {
                    var _color = colors_normalizeColor(background, theme);
                    if (_color) {
                        result = colorIsDark(_color);
                    }
                }
            }
            return result;
        };
        var darkContext = function darkContext(backgroundColor) {
            var isDark = colorIsDark(backgroundColor);
            if (isDark === undefined) return undefined;
            return isDark ? "dark" : "light";
        };
        var backgroundAndTextColors = function backgroundAndTextColors(backgroundArg, textArg, theme) {
            if (!backgroundArg) return [ undefined, textArg ];
            var global = theme.global;
            var background = normalizeBackground(backgroundArg, theme);
            var text = textArg || global.colors.text;
            var backgroundColor;
            var textColor;
            if (typeof background === "object") {
                if (background.dark === false) {
                    textColor = text.light || text;
                } else if (background.dark) {
                    textColor = text.dark || text;
                }
                if (background.color) {
                    var color = colors_normalizeColor(background.color, theme, background.dark);
                    var opacity = background.opacity === true ? global.opacity.medium : global.opacity[background.opacity] || background.opacity;
                    backgroundColor = getRGBA(color, opacity) || color;
                    if (!textColor && (opacity === undefined || opacity > .3)) {
                        var shade = darkContext(backgroundColor, theme);
                        textColor = colors_normalizeColor(shade && text[shade] || text, theme);
                    }
                }
            } else {
                backgroundColor = colors_normalizeColor(background, theme);
                var _shade = darkContext(backgroundColor, theme);
                if (_shade) {
                    textColor = colors_normalizeColor(text[_shade] || text, theme, _shade === "dark");
                } else {
                    if (backgroundColor !== "transparent") backgroundColor = undefined;
                    if (text) textColor = colors_normalizeColor(text, theme);
                }
            }
            if (textArg === false) textColor = undefined;
            return [ backgroundColor, textColor ];
        };
        var backgroundStyle = function backgroundStyle(backgroundArg, theme, textColorArg) {
            if (backgroundArg === undefined) return undefined;
            var background = normalizeBackground(backgroundArg, theme);
            if (typeof background === "string" && background.lastIndexOf("url", 0) === 0) {
                return (0, styled_components_browser_esm.css)([ "background:", " no-repeat center center;background-size:cover;" ], background);
            }
            var _backgroundAndTextCol = backgroundAndTextColors(background, textColorArg, theme), backgroundColor = _backgroundAndTextCol[0], textColor = _backgroundAndTextCol[1];
            if (background.image) {
                var backgroundStyles = "\n      " + (backgroundColor ? "background-color: " + backgroundColor + ";" : "") + "\n      background-image: " + background.image + ";\n      background-repeat: " + (background.repeat || "no-repeat") + ";\n      background-position: " + (background.position || "center center") + ";\n      background-size: " + (background.size || "cover") + ";\n    ";
                return (0, styled_components_browser_esm.css)([ "", " ", "" ], textColor ? "color: " + textColor + ";" : "", !background.opacity ? backgroundStyles : "position: relative;\n        z-index: 0;\n        &:before {\n          content: '';\n          position: absolute;\n          top: 0;\n          right: 0;\n          left: 0;\n          bottom: 0;\n          z-index: -1;\n          " + backgroundStyles + "\n          opacity: " + (background.opacity === true ? theme.global.opacity.medium : theme.global.opacity[background.opacity] || background.opacity) + ";\n        }");
            }
            if (backgroundColor) {
                return (0, styled_components_browser_esm.css)([ "background-color:", ";", "" ], backgroundColor, textColor ? "color: " + textColor + ";" : "");
            }
            if (typeof background === "string") return (0, styled_components_browser_esm.css)([ "background:", ";" ], colors_normalizeColor(background, theme));
            return undefined;
        };
        var activeStyle = (0, styled_components_browser_esm.css)([ "", "" ], (function(props) {
            return backgroundStyle(colors_normalizeColor(props.theme.global.active.background, props.theme), props.theme, props.theme.global.active.color);
        }));
        var selectedStyle = (0, styled_components_browser_esm.css)([ "", "" ], (function(props) {
            return backgroundStyle(colors_normalizeColor(props.theme.global.selected.background, props.theme), props.theme, props.theme.global.selected.color);
        }));
        var getHoverIndicatorStyle = function getHoverIndicatorStyle(hoverIndicator, theme) {
            var background;
            if (hoverIndicator === true || hoverIndicator === "background") {
                background = theme.global.hover.background;
            } else {
                background = hoverIndicator;
            }
            return (0, styled_components_browser_esm.css)([ "", "" ], backgroundStyle(background, theme, theme.global.hover.color));
        };
        function _assertThisInitialized(self) {
            if (self === void 0) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return self;
        }
        function _setPrototypeOf(o, p) {
            _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
                o.__proto__ = p;
                return o;
            };
            return _setPrototypeOf(o, p);
        }
        function _inheritsLoose(subClass, superClass) {
            subClass.prototype = Object.create(superClass.prototype);
            subClass.prototype.constructor = subClass;
            _setPrototypeOf(subClass, superClass);
        }
        function _getPrototypeOf(o) {
            _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
                return o.__proto__ || Object.getPrototypeOf(o);
            };
            return _getPrototypeOf(o);
        }
        function _isNativeFunction(fn) {
            return Function.toString.call(fn).indexOf("[native code]") !== -1;
        }
        function _isNativeReflectConstruct() {
            if (typeof Reflect === "undefined" || !Reflect.construct) return false;
            if (Reflect.construct.sham) return false;
            if (typeof Proxy === "function") return true;
            try {
                Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
                return true;
            } catch (e) {
                return false;
            }
        }
        function _construct(Parent, args, Class) {
            if (_isNativeReflectConstruct()) {
                _construct = Reflect.construct;
            } else {
                _construct = function _construct(Parent, args, Class) {
                    var a = [ null ];
                    a.push.apply(a, args);
                    var Constructor = Function.bind.apply(Parent, a);
                    var instance = new Constructor;
                    if (Class) _setPrototypeOf(instance, Class.prototype);
                    return instance;
                };
            }
            return _construct.apply(null, arguments);
        }
        function _wrapNativeSuper(Class) {
            var _cache = typeof Map === "function" ? new Map : undefined;
            _wrapNativeSuper = function _wrapNativeSuper(Class) {
                if (Class === null || !_isNativeFunction(Class)) return Class;
                if (typeof Class !== "function") {
                    throw new TypeError("Super expression must either be null or a function");
                }
                if (typeof _cache !== "undefined") {
                    if (_cache.has(Class)) return _cache.get(Class);
                    _cache.set(Class, Wrapper);
                }
                function Wrapper() {
                    return _construct(Class, arguments, _getPrototypeOf(this).constructor);
                }
                Wrapper.prototype = Object.create(Class.prototype, {
                    constructor: {
                        value: Wrapper,
                        enumerable: false,
                        writable: true,
                        configurable: true
                    }
                });
                return _setPrototypeOf(Wrapper, Class);
            };
            return _wrapNativeSuper(Class);
        }
        function last() {
            var _ref;
            return _ref = arguments.length - 1, _ref < 0 || arguments.length <= _ref ? undefined : arguments[_ref];
        }
        function negation(a) {
            return -a;
        }
        function addition(a, b) {
            return a + b;
        }
        function subtraction(a, b) {
            return a - b;
        }
        function multiplication(a, b) {
            return a * b;
        }
        function division(a, b) {
            return a / b;
        }
        function factorial(a) {
            if (a % 1 || !(+a >= 0)) return NaN;
            if (a > 170) return Infinity; else if (a === 0) return 1; else {
                return a * factorial(a - 1);
            }
        }
        function power(a, b) {
            return Math.pow(a, b);
        }
        function sqrt(a) {
            return Math.sqrt(a);
        }
        function max() {
            return Math.max.apply(Math, arguments);
        }
        function min() {
            return Math.min.apply(Math, arguments);
        }
        function comma() {
            return Array.of.apply(Array, arguments);
        }
        var defaultMathSymbols = {
            symbols: {
                "!": {
                    postfix: {
                        symbol: "!",
                        f: factorial,
                        notation: "postfix",
                        precedence: 6,
                        rightToLeft: 0,
                        argCount: 1
                    },
                    symbol: "!",
                    regSymbol: "!"
                },
                "^": {
                    infix: {
                        symbol: "^",
                        f: power,
                        notation: "infix",
                        precedence: 5,
                        rightToLeft: 1,
                        argCount: 2
                    },
                    symbol: "^",
                    regSymbol: "\\^"
                },
                "*": {
                    infix: {
                        symbol: "*",
                        f: multiplication,
                        notation: "infix",
                        precedence: 4,
                        rightToLeft: 0,
                        argCount: 2
                    },
                    symbol: "*",
                    regSymbol: "\\*"
                },
                "/": {
                    infix: {
                        symbol: "/",
                        f: division,
                        notation: "infix",
                        precedence: 4,
                        rightToLeft: 0,
                        argCount: 2
                    },
                    symbol: "/",
                    regSymbol: "/"
                },
                "+": {
                    infix: {
                        symbol: "+",
                        f: addition,
                        notation: "infix",
                        precedence: 2,
                        rightToLeft: 0,
                        argCount: 2
                    },
                    prefix: {
                        symbol: "+",
                        f: last,
                        notation: "prefix",
                        precedence: 3,
                        rightToLeft: 0,
                        argCount: 1
                    },
                    symbol: "+",
                    regSymbol: "\\+"
                },
                "-": {
                    infix: {
                        symbol: "-",
                        f: subtraction,
                        notation: "infix",
                        precedence: 2,
                        rightToLeft: 0,
                        argCount: 2
                    },
                    prefix: {
                        symbol: "-",
                        f: negation,
                        notation: "prefix",
                        precedence: 3,
                        rightToLeft: 0,
                        argCount: 1
                    },
                    symbol: "-",
                    regSymbol: "-"
                },
                ",": {
                    infix: {
                        symbol: ",",
                        f: comma,
                        notation: "infix",
                        precedence: 1,
                        rightToLeft: 0,
                        argCount: 2
                    },
                    symbol: ",",
                    regSymbol: ","
                },
                "(": {
                    prefix: {
                        symbol: "(",
                        f: last,
                        notation: "prefix",
                        precedence: 0,
                        rightToLeft: 0,
                        argCount: 1
                    },
                    symbol: "(",
                    regSymbol: "\\("
                },
                ")": {
                    postfix: {
                        symbol: ")",
                        f: undefined,
                        notation: "postfix",
                        precedence: 0,
                        rightToLeft: 0,
                        argCount: 1
                    },
                    symbol: ")",
                    regSymbol: "\\)"
                },
                min: {
                    func: {
                        symbol: "min",
                        f: min,
                        notation: "func",
                        precedence: 0,
                        rightToLeft: 0,
                        argCount: 1
                    },
                    symbol: "min",
                    regSymbol: "min\\b"
                },
                max: {
                    func: {
                        symbol: "max",
                        f: max,
                        notation: "func",
                        precedence: 0,
                        rightToLeft: 0,
                        argCount: 1
                    },
                    symbol: "max",
                    regSymbol: "max\\b"
                },
                sqrt: {
                    func: {
                        symbol: "sqrt",
                        f: sqrt,
                        notation: "func",
                        precedence: 0,
                        rightToLeft: 0,
                        argCount: 1
                    },
                    symbol: "sqrt",
                    regSymbol: "sqrt\\b"
                }
            }
        };
        var ERRORS = {
            1: "Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",
            2: "Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",
            3: "Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",
            4: "Couldn't generate valid rgb string from %s, it returned %s.\n\n",
            5: "Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",
            6: "Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",
            7: "Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",
            8: "Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",
            9: "Please provide a number of steps to the modularScale helper.\n\n",
            10: "Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",
            11: 'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',
            12: 'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',
            13: 'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',
            14: 'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',
            15: 'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',
            16: "You must provide a template to this method.\n\n",
            17: "You passed an unsupported selector state to this method.\n\n",
            18: "minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",
            19: "fromSize and toSize must be provided as stringified numbers with the same units.\n\n",
            20: "expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",
            21: "expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",
            22: "expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",
            23: "fontFace expects a name of a font-family.\n\n",
            24: "fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",
            25: "fontFace expects localFonts to be an array.\n\n",
            26: "fontFace expects fileFormats to be an array.\n\n",
            27: "radialGradient requries at least 2 color-stops to properly render.\n\n",
            28: "Please supply a filename to retinaImage() as the first argument.\n\n",
            29: "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",
            30: "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",
            31: "The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",
            32: "To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",
            33: "The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",
            34: "borderRadius expects a radius value as a string or number as the second argument.\n\n",
            35: 'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',
            36: "Property must be a string value.\n\n",
            37: "Syntax Error at %s.\n\n",
            38: "Formula contains a function that needs parentheses at %s.\n\n",
            39: "Formula is missing closing parenthesis at %s.\n\n",
            40: "Formula has too many closing parentheses at %s.\n\n",
            41: "All values in a formula must have the same unit or be unitless.\n\n",
            42: "Please provide a number of steps to the modularScale helper.\n\n",
            43: "Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",
            44: "Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",
            45: "Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",
            46: "Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",
            47: "minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",
            48: "fromSize and toSize must be provided as stringified numbers with the same units.\n\n",
            49: "Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",
            50: "Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",
            51: "Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",
            52: "fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",
            53: "fontFace expects localFonts to be an array.\n\n",
            54: "fontFace expects fileFormats to be an array.\n\n",
            55: "fontFace expects a name of a font-family.\n\n",
            56: "linearGradient requries at least 2 color-stops to properly render.\n\n",
            57: "radialGradient requries at least 2 color-stops to properly render.\n\n",
            58: "Please supply a filename to retinaImage() as the first argument.\n\n",
            59: "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",
            60: "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",
            61: "Property must be a string value.\n\n",
            62: "borderRadius expects a radius value as a string or number as the second argument.\n\n",
            63: 'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',
            64: "The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",
            65: "To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",
            66: "The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",
            67: "You must provide a template to this method.\n\n",
            68: "You passed an unsupported selector state to this method.\n\n",
            69: 'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',
            70: 'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',
            71: 'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',
            72: 'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',
            73: "Please provide a valid CSS variable.\n\n",
            74: "CSS variable not found.\n\n",
            75: "fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n"
        };
        function format() {
            for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
                args[_key] = arguments[_key];
            }
            var a = args[0];
            var b = [];
            var c;
            for (c = 1; c < args.length; c += 1) {
                b.push(args[c]);
            }
            b.forEach((function(d) {
                a = a.replace(/%[a-z]/, d);
            }));
            return a;
        }
        var PolishedError = function(_Error) {
            _inheritsLoose(PolishedError, _Error);
            function PolishedError(code) {
                var _this;
                if (true) {
                    _this = _Error.call(this, "An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#" + code + " for more information.") || this;
                } else {
                    var _len2, args, _key2;
                }
                return _assertThisInitialized(_this);
            }
            return PolishedError;
        }(_wrapNativeSuper(Error));
        var unitRegExp = /((?!\w)a|na|hc|mc|dg|me[r]?|xe|ni(?![a-zA-Z])|mm|cp|tp|xp|q(?!s)|hv|xamv|nimv|wv|sm|s(?!\D|$)|ged|darg?|nrut)/g;
        function mergeSymbolMaps(additionalSymbols) {
            var symbolMap = {};
            symbolMap.symbols = additionalSymbols ? _extends({}, defaultMathSymbols.symbols, additionalSymbols.symbols) : _extends({}, defaultMathSymbols.symbols);
            return symbolMap;
        }
        function exec(operators, values) {
            var _ref;
            var op = operators.pop();
            values.push(op.f.apply(op, (_ref = []).concat.apply(_ref, values.splice(-op.argCount))));
            return op.precedence;
        }
        function calculate(expression, additionalSymbols) {
            var symbolMap = mergeSymbolMaps(additionalSymbols);
            var match;
            var operators = [ symbolMap.symbols["("].prefix ];
            var values = [];
            var pattern = new RegExp("\\d+(?:\\.\\d+)?|" + Object.keys(symbolMap.symbols).map((function(key) {
                return symbolMap.symbols[key];
            })).sort((function(a, b) {
                return b.symbol.length - a.symbol.length;
            })).map((function(val) {
                return val.regSymbol;
            })).join("|") + "|(\\S)", "g");
            pattern.lastIndex = 0;
            var afterValue = false;
            do {
                match = pattern.exec(expression);
                var _ref2 = match || [ ")", undefined ], token = _ref2[0], bad = _ref2[1];
                var notNumber = symbolMap.symbols[token];
                var notNewValue = notNumber && !notNumber.prefix && !notNumber.func;
                var notAfterValue = !notNumber || !notNumber.postfix && !notNumber.infix;
                if (bad || (afterValue ? notAfterValue : notNewValue)) {
                    throw new PolishedError(37, match ? match.index : expression.length, expression);
                }
                if (afterValue) {
                    var curr = notNumber.postfix || notNumber.infix;
                    do {
                        var prev = operators[operators.length - 1];
                        if ((curr.precedence - prev.precedence || prev.rightToLeft) > 0) break;
                    } while (exec(operators, values));
                    afterValue = curr.notation === "postfix";
                    if (curr.symbol !== ")") {
                        operators.push(curr);
                        if (afterValue) exec(operators, values);
                    }
                } else if (notNumber) {
                    operators.push(notNumber.prefix || notNumber.func);
                    if (notNumber.func) {
                        match = pattern.exec(expression);
                        if (!match || match[0] !== "(") {
                            throw new PolishedError(38, match ? match.index : expression.length, expression);
                        }
                    }
                } else {
                    values.push(+token);
                    afterValue = true;
                }
            } while (match && operators.length);
            if (operators.length) {
                throw new PolishedError(39, match ? match.index : expression.length, expression);
            } else if (match) {
                throw new PolishedError(40, match ? match.index : expression.length, expression);
            } else {
                return values.pop();
            }
        }
        function reverseString(str) {
            return str.split("").reverse().join("");
        }
        function math(formula, additionalSymbols) {
            var reversedFormula = reverseString(formula);
            var formulaMatch = reversedFormula.match(unitRegExp);
            if (formulaMatch && !formulaMatch.every((function(unit) {
                return unit === formulaMatch[0];
            }))) {
                throw new PolishedError(41);
            }
            var cleanFormula = reverseString(reversedFormula.replace(unitRegExp, ""));
            return "" + calculate(cleanFormula, additionalSymbols) + (formulaMatch ? reverseString(formulaMatch[0]) : "");
        }
        var cssVariableRegex = /--[\S]*/g;
        function cssVar(cssVariable, passThrough) {
            if (!cssVariable || !cssVariable.match(cssVariableRegex)) {
                if (passThrough) return cssVariable;
                throw new PolishedError(73);
            }
            var variableValue;
            if (typeof document !== "undefined" && document.documentElement !== null) {
                variableValue = getComputedStyle(document.documentElement).getPropertyValue(cssVariable);
            }
            if (variableValue) {
                return variableValue.trim();
            } else {
                throw new PolishedError(74);
            }
        }
        function capitalizeString(string) {
            return string.charAt(0).toUpperCase() + string.slice(1);
        }
        var positionMap = null && [ "Top", "Right", "Bottom", "Left" ];
        function generateProperty(property, position) {
            if (!property) return position.toLowerCase();
            var splitProperty = property.split("-");
            if (splitProperty.length > 1) {
                splitProperty.splice(1, 0, position);
                return splitProperty.reduce((function(acc, val) {
                    return "" + acc + capitalizeString(val);
                }));
            }
            var joinedProperty = property.replace(/([a-z])([A-Z])/g, "$1" + position + "$2");
            return property === joinedProperty ? "" + property + position : joinedProperty;
        }
        function generateStyles(property, valuesWithDefaults) {
            var styles = {};
            for (var i = 0; i < valuesWithDefaults.length; i += 1) {
                if (valuesWithDefaults[i] || valuesWithDefaults[i] === 0) {
                    styles[generateProperty(property, positionMap[i])] = valuesWithDefaults[i];
                }
            }
            return styles;
        }
        function directionalProperty(property) {
            for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
                values[_key - 1] = arguments[_key];
            }
            var firstValue = values[0], _values$ = values[1], secondValue = _values$ === void 0 ? firstValue : _values$, _values$2 = values[2], thirdValue = _values$2 === void 0 ? firstValue : _values$2, _values$3 = values[3], fourthValue = _values$3 === void 0 ? secondValue : _values$3;
            var valuesWithDefaults = [ firstValue, secondValue, thirdValue, fourthValue ];
            return generateStyles(property, valuesWithDefaults);
        }
        function endsWith(string, suffix) {
            return string.substr(-suffix.length) === suffix;
        }
        var cssRegex = /^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/;
        function stripUnit(value, unitReturn) {
            if (typeof value !== "string") return unitReturn ? [ value, undefined ] : value;
            var matchedValue = value.match(cssRegex);
            if (unitReturn) {
                console.warn("stripUnit's unitReturn functionality has been marked for deprecation in polished 4.0. It's functionality has been been moved to getValueAndUnit.");
                if (matchedValue) return [ parseFloat(value), matchedValue[2] ];
                return [ value, undefined ];
            }
            if (matchedValue) return parseFloat(value);
            return value;
        }
        var pxtoFactory = function pxtoFactory(to) {
            return function(pxval, base) {
                if (base === void 0) {
                    base = "16px";
                }
                var newPxval = pxval;
                var newBase = base;
                if (typeof pxval === "string") {
                    if (!endsWith(pxval, "px")) {
                        throw new PolishedError(69, to, pxval);
                    }
                    newPxval = stripUnit(pxval);
                }
                if (typeof base === "string") {
                    if (!endsWith(base, "px")) {
                        throw new PolishedError(70, to, base);
                    }
                    newBase = stripUnit(base);
                }
                if (typeof newPxval === "string") {
                    throw new PolishedError(71, pxval, to);
                }
                if (typeof newBase === "string") {
                    throw new PolishedError(72, base, to);
                }
                return "" + newPxval / newBase + to;
            };
        };
        var em = null && pxtoFactory("em");
        var cssRegex$1 = /^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/;
        function getValueAndUnit(value) {
            if (typeof value !== "string") return [ value, "" ];
            var matchedValue = value.match(cssRegex$1);
            if (matchedValue) return [ parseFloat(value), matchedValue[2] ];
            return [ value, undefined ];
        }
        var ratioNames = {
            minorSecond: 1.067,
            majorSecond: 1.125,
            minorThird: 1.2,
            majorThird: 1.25,
            perfectFourth: 1.333,
            augFourth: 1.414,
            perfectFifth: 1.5,
            minorSixth: 1.6,
            goldenSection: 1.618,
            majorSixth: 1.667,
            minorSeventh: 1.778,
            majorSeventh: 1.875,
            octave: 2,
            majorTenth: 2.5,
            majorEleventh: 2.667,
            majorTwelfth: 3,
            doubleOctave: 4
        };
        function getRatio(ratioName) {
            return ratioNames[ratioName];
        }
        function modularScale(steps, base, ratio) {
            if (base === void 0) {
                base = "1em";
            }
            if (ratio === void 0) {
                ratio = 1.333;
            }
            if (typeof steps !== "number") {
                throw new PolishedError(42);
            }
            if (typeof ratio === "string" && !ratioNames[ratio]) {
                throw new PolishedError(43);
            }
            var _ref = typeof base === "string" ? getValueAndUnit(base) : [ base, "" ], realBase = _ref[0], unit = _ref[1];
            var realRatio = typeof ratio === "string" ? getRatio(ratio) : ratio;
            if (typeof realBase === "string") {
                throw new PolishedError(44, base);
            }
            return "" + realBase * Math.pow(realRatio, steps) + (unit || "");
        }
        var rem = null && pxtoFactory("rem");
        function between(fromSize, toSize, minScreen, maxScreen) {
            if (minScreen === void 0) {
                minScreen = "320px";
            }
            if (maxScreen === void 0) {
                maxScreen = "1200px";
            }
            var _getValueAndUnit = getValueAndUnit(fromSize), unitlessFromSize = _getValueAndUnit[0], fromSizeUnit = _getValueAndUnit[1];
            var _getValueAndUnit2 = getValueAndUnit(toSize), unitlessToSize = _getValueAndUnit2[0], toSizeUnit = _getValueAndUnit2[1];
            var _getValueAndUnit3 = getValueAndUnit(minScreen), unitlessMinScreen = _getValueAndUnit3[0], minScreenUnit = _getValueAndUnit3[1];
            var _getValueAndUnit4 = getValueAndUnit(maxScreen), unitlessMaxScreen = _getValueAndUnit4[0], maxScreenUnit = _getValueAndUnit4[1];
            if (typeof unitlessMinScreen !== "number" || typeof unitlessMaxScreen !== "number" || !minScreenUnit || !maxScreenUnit || minScreenUnit !== maxScreenUnit) {
                throw new PolishedError(47);
            }
            if (typeof unitlessFromSize !== "number" || typeof unitlessToSize !== "number" || fromSizeUnit !== toSizeUnit) {
                throw new PolishedError(48);
            }
            if (fromSizeUnit !== minScreenUnit || toSizeUnit !== maxScreenUnit) {
                throw new PolishedError(75);
            }
            var slope = (unitlessFromSize - unitlessToSize) / (unitlessMinScreen - unitlessMaxScreen);
            var base = unitlessToSize - slope * unitlessMaxScreen;
            return "calc(" + base.toFixed(2) + (fromSizeUnit || "") + " + " + (100 * slope).toFixed(2) + "vw)";
        }
        function clearFix(parent) {
            var _ref;
            if (parent === void 0) {
                parent = "&";
            }
            var pseudoSelector = parent + "::after";
            return _ref = {}, _ref[pseudoSelector] = {
                clear: "both",
                content: '""',
                display: "table"
            }, _ref;
        }
        function cover(offset) {
            if (offset === void 0) {
                offset = 0;
            }
            return {
                position: "absolute",
                top: offset,
                right: offset,
                bottom: offset,
                left: offset
            };
        }
        function ellipsis(width) {
            if (width === void 0) {
                width = "100%";
            }
            return {
                display: "inline-block",
                maxWidth: width,
                overflow: "hidden",
                textOverflow: "ellipsis",
                whiteSpace: "nowrap",
                wordWrap: "normal"
            };
        }
        function _createForOfIteratorHelperLoose(o, allowArrayLike) {
            var it;
            if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
                if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
                    if (it) o = it;
                    var i = 0;
                    return function() {
                        if (i >= o.length) return {
                            done: true
                        };
                        return {
                            done: false,
                            value: o[i++]
                        };
                    };
                }
                throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
            }
            it = o[Symbol.iterator]();
            return it.next.bind(it);
        }
        function _unsupportedIterableToArray(o, minLen) {
            if (!o) return;
            if (typeof o === "string") return _arrayLikeToArray(o, minLen);
            var n = Object.prototype.toString.call(o).slice(8, -1);
            if (n === "Object" && o.constructor) n = o.constructor.name;
            if (n === "Map" || n === "Set") return Array.from(o);
            if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
        }
        function _arrayLikeToArray(arr, len) {
            if (len == null || len > arr.length) len = arr.length;
            for (var i = 0, arr2 = new Array(len); i < len; i++) {
                arr2[i] = arr[i];
            }
            return arr2;
        }
        function fluidRange(cssProp, minScreen, maxScreen) {
            if (minScreen === void 0) {
                minScreen = "320px";
            }
            if (maxScreen === void 0) {
                maxScreen = "1200px";
            }
            if (!Array.isArray(cssProp) && typeof cssProp !== "object" || cssProp === null) {
                throw new PolishedError(49);
            }
            if (Array.isArray(cssProp)) {
                var mediaQueries = {};
                var fallbacks = {};
                for (var _iterator = _createForOfIteratorHelperLoose(cssProp), _step; !(_step = _iterator()).done; ) {
                    var _extends2, _extends3;
                    var obj = _step.value;
                    if (!obj.prop || !obj.fromSize || !obj.toSize) {
                        throw new PolishedError(50);
                    }
                    fallbacks[obj.prop] = obj.fromSize;
                    mediaQueries["@media (min-width: " + minScreen + ")"] = _extends({}, mediaQueries["@media (min-width: " + minScreen + ")"], (_extends2 = {}, 
                    _extends2[obj.prop] = between(obj.fromSize, obj.toSize, minScreen, maxScreen), _extends2));
                    mediaQueries["@media (min-width: " + maxScreen + ")"] = _extends({}, mediaQueries["@media (min-width: " + maxScreen + ")"], (_extends3 = {}, 
                    _extends3[obj.prop] = obj.toSize, _extends3));
                }
                return _extends({}, fallbacks, mediaQueries);
            } else {
                var _ref, _ref2, _ref3;
                if (!cssProp.prop || !cssProp.fromSize || !cssProp.toSize) {
                    throw new PolishedError(51);
                }
                return _ref3 = {}, _ref3[cssProp.prop] = cssProp.fromSize, _ref3["@media (min-width: " + minScreen + ")"] = (_ref = {}, 
                _ref[cssProp.prop] = between(cssProp.fromSize, cssProp.toSize, minScreen, maxScreen), 
                _ref), _ref3["@media (min-width: " + maxScreen + ")"] = (_ref2 = {}, _ref2[cssProp.prop] = cssProp.toSize, 
                _ref2), _ref3;
            }
        }
        var dataURIRegex = /^\s*data:([a-z]+\/[a-z-]+(;[a-z-]+=[a-z-]+)?)?(;charset=[a-z0-9-]+)?(;base64)?,[a-z0-9!$&',()*+,;=\-._~:@/?%\s]*\s*$/i;
        var formatHintMap = {
            woff: "woff",
            woff2: "woff2",
            ttf: "truetype",
            otf: "opentype",
            eot: "embedded-opentype",
            svg: "svg",
            svgz: "svg"
        };
        function generateFormatHint(format, formatHint) {
            if (!formatHint) return "";
            return ' format("' + formatHintMap[format] + '")';
        }
        function isDataURI(fontFilePath) {
            return !!fontFilePath.match(dataURIRegex);
        }
        function generateFileReferences(fontFilePath, fileFormats, formatHint) {
            if (isDataURI(fontFilePath)) {
                return 'url("' + fontFilePath + '")' + generateFormatHint(fileFormats[0], formatHint);
            }
            var fileFontReferences = fileFormats.map((function(format) {
                return 'url("' + fontFilePath + "." + format + '")' + generateFormatHint(format, formatHint);
            }));
            return fileFontReferences.join(", ");
        }
        function generateLocalReferences(localFonts) {
            var localFontReferences = localFonts.map((function(font) {
                return 'local("' + font + '")';
            }));
            return localFontReferences.join(", ");
        }
        function generateSources(fontFilePath, localFonts, fileFormats, formatHint) {
            var fontReferences = [];
            if (localFonts) fontReferences.push(generateLocalReferences(localFonts));
            if (fontFilePath) {
                fontReferences.push(generateFileReferences(fontFilePath, fileFormats, formatHint));
            }
            return fontReferences.join(", ");
        }
        function fontFace(_ref) {
            var fontFamily = _ref.fontFamily, fontFilePath = _ref.fontFilePath, fontStretch = _ref.fontStretch, fontStyle = _ref.fontStyle, fontVariant = _ref.fontVariant, fontWeight = _ref.fontWeight, _ref$fileFormats = _ref.fileFormats, fileFormats = _ref$fileFormats === void 0 ? [ "eot", "woff2", "woff", "ttf", "svg" ] : _ref$fileFormats, _ref$formatHint = _ref.formatHint, formatHint = _ref$formatHint === void 0 ? false : _ref$formatHint, localFonts = _ref.localFonts, unicodeRange = _ref.unicodeRange, fontDisplay = _ref.fontDisplay, fontVariationSettings = _ref.fontVariationSettings, fontFeatureSettings = _ref.fontFeatureSettings;
            if (!fontFamily) throw new PolishedError(55);
            if (!fontFilePath && !localFonts) {
                throw new PolishedError(52);
            }
            if (localFonts && !Array.isArray(localFonts)) {
                throw new PolishedError(53);
            }
            if (!Array.isArray(fileFormats)) {
                throw new PolishedError(54);
            }
            var fontFaceDeclaration = {
                "@font-face": {
                    fontFamily,
                    src: generateSources(fontFilePath, localFonts, fileFormats, formatHint),
                    unicodeRange,
                    fontStretch,
                    fontStyle,
                    fontVariant,
                    fontWeight,
                    fontDisplay,
                    fontVariationSettings,
                    fontFeatureSettings
                }
            };
            return JSON.parse(JSON.stringify(fontFaceDeclaration));
        }
        function hideText() {
            return {
                textIndent: "101%",
                overflow: "hidden",
                whiteSpace: "nowrap"
            };
        }
        function hideVisually() {
            return {
                border: "0",
                clip: "rect(0 0 0 0)",
                height: "1px",
                margin: "-1px",
                overflow: "hidden",
                padding: "0",
                position: "absolute",
                whiteSpace: "nowrap",
                width: "1px"
            };
        }
        function hiDPI(ratio) {
            if (ratio === void 0) {
                ratio = 1.3;
            }
            return "\n    @media only screen and (-webkit-min-device-pixel-ratio: " + ratio + "),\n    only screen and (min--moz-device-pixel-ratio: " + ratio + "),\n    only screen and (-o-min-device-pixel-ratio: " + ratio + "/1),\n    only screen and (min-resolution: " + Math.round(ratio * 96) + "dpi),\n    only screen and (min-resolution: " + ratio + "dppx)\n  ";
        }
        function constructGradientValue(literals) {
            var template = "";
            for (var _len = arguments.length, substitutions = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
                substitutions[_key - 1] = arguments[_key];
            }
            for (var i = 0; i < literals.length; i += 1) {
                template += literals[i];
                if (i === substitutions.length - 1 && substitutions[i]) {
                    var definedValues = substitutions.filter((function(substitute) {
                        return !!substitute;
                    }));
                    if (definedValues.length > 1) {
                        template = template.slice(0, -1);
                        template += ", " + substitutions[i];
                    } else if (definedValues.length === 1) {
                        template += "" + substitutions[i];
                    }
                } else if (substitutions[i]) {
                    template += substitutions[i] + " ";
                }
            }
            return template.trim();
        }
        function _templateObject() {
            var data = _taggedTemplateLiteralLoose([ "linear-gradient(", "", ")" ]);
            _templateObject = function _templateObject() {
                return data;
            };
            return data;
        }
        function linearGradient(_ref) {
            var colorStops = _ref.colorStops, fallback = _ref.fallback, _ref$toDirection = _ref.toDirection, toDirection = _ref$toDirection === void 0 ? "" : _ref$toDirection;
            if (!colorStops || colorStops.length < 2) {
                throw new PolishedError(56);
            }
            return {
                backgroundColor: fallback || colorStops[0].replace(/,\s+/g, ",").split(" ")[0].replace(/,(?=\S)/g, ", "),
                backgroundImage: constructGradientValue(_templateObject(), toDirection, colorStops.join(", ").replace(/,(?=\S)/g, ", "))
            };
        }
        function normalize() {
            var _ref;
            return [ (_ref = {
                html: {
                    lineHeight: "1.15",
                    textSizeAdjust: "100%"
                },
                body: {
                    margin: "0"
                },
                main: {
                    display: "block"
                },
                h1: {
                    fontSize: "2em",
                    margin: "0.67em 0"
                },
                hr: {
                    boxSizing: "content-box",
                    height: "0",
                    overflow: "visible"
                },
                pre: {
                    fontFamily: "monospace, monospace",
                    fontSize: "1em"
                },
                a: {
                    backgroundColor: "transparent"
                },
                "abbr[title]": {
                    borderBottom: "none",
                    textDecoration: "underline"
                }
            }, _ref["b,\n    strong"] = {
                fontWeight: "bolder"
            }, _ref["code,\n    kbd,\n    samp"] = {
                fontFamily: "monospace, monospace",
                fontSize: "1em"
            }, _ref.small = {
                fontSize: "80%"
            }, _ref["sub,\n    sup"] = {
                fontSize: "75%",
                lineHeight: "0",
                position: "relative",
                verticalAlign: "baseline"
            }, _ref.sub = {
                bottom: "-0.25em"
            }, _ref.sup = {
                top: "-0.5em"
            }, _ref.img = {
                borderStyle: "none"
            }, _ref["button,\n    input,\n    optgroup,\n    select,\n    textarea"] = {
                fontFamily: "inherit",
                fontSize: "100%",
                lineHeight: "1.15",
                margin: "0"
            }, _ref["button,\n    input"] = {
                overflow: "visible"
            }, _ref["button,\n    select"] = {
                textTransform: "none"
            }, _ref['button,\n    html [type="button"],\n    [type="reset"],\n    [type="submit"]'] = {
                WebkitAppearance: "button"
            }, _ref['button::-moz-focus-inner,\n    [type="button"]::-moz-focus-inner,\n    [type="reset"]::-moz-focus-inner,\n    [type="submit"]::-moz-focus-inner'] = {
                borderStyle: "none",
                padding: "0"
            }, _ref['button:-moz-focusring,\n    [type="button"]:-moz-focusring,\n    [type="reset"]:-moz-focusring,\n    [type="submit"]:-moz-focusring'] = {
                outline: "1px dotted ButtonText"
            }, _ref.fieldset = {
                padding: "0.35em 0.625em 0.75em"
            }, _ref.legend = {
                boxSizing: "border-box",
                color: "inherit",
                display: "table",
                maxWidth: "100%",
                padding: "0",
                whiteSpace: "normal"
            }, _ref.progress = {
                verticalAlign: "baseline"
            }, _ref.textarea = {
                overflow: "auto"
            }, _ref['[type="checkbox"],\n    [type="radio"]'] = {
                boxSizing: "border-box",
                padding: "0"
            }, _ref['[type="number"]::-webkit-inner-spin-button,\n    [type="number"]::-webkit-outer-spin-button'] = {
                height: "auto"
            }, _ref['[type="search"]'] = {
                WebkitAppearance: "textfield",
                outlineOffset: "-2px"
            }, _ref['[type="search"]::-webkit-search-decoration'] = {
                WebkitAppearance: "none"
            }, _ref["::-webkit-file-upload-button"] = {
                WebkitAppearance: "button",
                font: "inherit"
            }, _ref.details = {
                display: "block"
            }, _ref.summary = {
                display: "list-item"
            }, _ref.template = {
                display: "none"
            }, _ref["[hidden]"] = {
                display: "none"
            }, _ref), {
                "abbr[title]": {
                    textDecoration: "underline dotted"
                }
            } ];
        }
        function _templateObject$1() {
            var data = _taggedTemplateLiteralLoose([ "radial-gradient(", "", "", "", ")" ]);
            _templateObject$1 = function _templateObject() {
                return data;
            };
            return data;
        }
        function radialGradient(_ref) {
            var colorStops = _ref.colorStops, _ref$extent = _ref.extent, extent = _ref$extent === void 0 ? "" : _ref$extent, fallback = _ref.fallback, _ref$position = _ref.position, position = _ref$position === void 0 ? "" : _ref$position, _ref$shape = _ref.shape, shape = _ref$shape === void 0 ? "" : _ref$shape;
            if (!colorStops || colorStops.length < 2) {
                throw new PolishedError(57);
            }
            return {
                backgroundColor: fallback || colorStops[0].split(" ")[0],
                backgroundImage: constructGradientValue(_templateObject$1(), position, shape, extent, colorStops.join(", "))
            };
        }
        function retinaImage(filename, backgroundSize, extension, retinaFilename, retinaSuffix) {
            var _ref;
            if (extension === void 0) {
                extension = "png";
            }
            if (retinaSuffix === void 0) {
                retinaSuffix = "_2x";
            }
            if (!filename) {
                throw new PolishedError(58);
            }
            var ext = extension.replace(/^\./, "");
            var rFilename = retinaFilename ? retinaFilename + "." + ext : "" + filename + retinaSuffix + "." + ext;
            return _ref = {
                backgroundImage: "url(" + filename + "." + ext + ")"
            }, _ref[hiDPI()] = _extends({
                backgroundImage: "url(" + rFilename + ")"
            }, backgroundSize ? {
                backgroundSize
            } : {}), _ref;
        }
        var functionsMap = {
            easeInBack: "cubic-bezier(0.600, -0.280, 0.735, 0.045)",
            easeInCirc: "cubic-bezier(0.600,  0.040, 0.980, 0.335)",
            easeInCubic: "cubic-bezier(0.550,  0.055, 0.675, 0.190)",
            easeInExpo: "cubic-bezier(0.950,  0.050, 0.795, 0.035)",
            easeInQuad: "cubic-bezier(0.550,  0.085, 0.680, 0.530)",
            easeInQuart: "cubic-bezier(0.895,  0.030, 0.685, 0.220)",
            easeInQuint: "cubic-bezier(0.755,  0.050, 0.855, 0.060)",
            easeInSine: "cubic-bezier(0.470,  0.000, 0.745, 0.715)",
            easeOutBack: "cubic-bezier(0.175,  0.885, 0.320, 1.275)",
            easeOutCubic: "cubic-bezier(0.215,  0.610, 0.355, 1.000)",
            easeOutCirc: "cubic-bezier(0.075,  0.820, 0.165, 1.000)",
            easeOutExpo: "cubic-bezier(0.190,  1.000, 0.220, 1.000)",
            easeOutQuad: "cubic-bezier(0.250,  0.460, 0.450, 0.940)",
            easeOutQuart: "cubic-bezier(0.165,  0.840, 0.440, 1.000)",
            easeOutQuint: "cubic-bezier(0.230,  1.000, 0.320, 1.000)",
            easeOutSine: "cubic-bezier(0.390,  0.575, 0.565, 1.000)",
            easeInOutBack: "cubic-bezier(0.680, -0.550, 0.265, 1.550)",
            easeInOutCirc: "cubic-bezier(0.785,  0.135, 0.150, 0.860)",
            easeInOutCubic: "cubic-bezier(0.645,  0.045, 0.355, 1.000)",
            easeInOutExpo: "cubic-bezier(1.000,  0.000, 0.000, 1.000)",
            easeInOutQuad: "cubic-bezier(0.455,  0.030, 0.515, 0.955)",
            easeInOutQuart: "cubic-bezier(0.770,  0.000, 0.175, 1.000)",
            easeInOutQuint: "cubic-bezier(0.860,  0.000, 0.070, 1.000)",
            easeInOutSine: "cubic-bezier(0.445,  0.050, 0.550, 0.950)"
        };
        function getTimingFunction(functionName) {
            return functionsMap[functionName];
        }
        function timingFunctions(timingFunction) {
            return getTimingFunction(timingFunction);
        }
        var getBorderWidth = function getBorderWidth(pointingDirection, height, width) {
            var fullWidth = "" + width[0] + (width[1] || "");
            var halfWidth = "" + width[0] / 2 + (width[1] || "");
            var fullHeight = "" + height[0] + (height[1] || "");
            var halfHeight = "" + height[0] / 2 + (height[1] || "");
            switch (pointingDirection) {
              case "top":
                return "0 " + halfWidth + " " + fullHeight + " " + halfWidth;

              case "topLeft":
                return fullWidth + " " + fullHeight + " 0 0";

              case "left":
                return halfHeight + " " + fullWidth + " " + halfHeight + " 0";

              case "bottomLeft":
                return fullWidth + " 0 0 " + fullHeight;

              case "bottom":
                return fullHeight + " " + halfWidth + " 0 " + halfWidth;

              case "bottomRight":
                return "0 0 " + fullWidth + " " + fullHeight;

              case "right":
                return halfHeight + " 0 " + halfHeight + " " + fullWidth;

              case "topRight":
              default:
                return "0 " + fullWidth + " " + fullHeight + " 0";
            }
        };
        var getBorderColor = function getBorderColor(pointingDirection, foregroundColor) {
            switch (pointingDirection) {
              case "top":
              case "bottomRight":
                return {
                    borderBottomColor: foregroundColor
                };

              case "right":
              case "bottomLeft":
                return {
                    borderLeftColor: foregroundColor
                };

              case "bottom":
              case "topLeft":
                return {
                    borderTopColor: foregroundColor
                };

              case "left":
              case "topRight":
                return {
                    borderRightColor: foregroundColor
                };

              default:
                throw new PolishedError(59);
            }
        };
        function triangle(_ref) {
            var pointingDirection = _ref.pointingDirection, height = _ref.height, width = _ref.width, foregroundColor = _ref.foregroundColor, _ref$backgroundColor = _ref.backgroundColor, backgroundColor = _ref$backgroundColor === void 0 ? "transparent" : _ref$backgroundColor;
            var widthAndUnit = getValueAndUnit(width);
            var heightAndUnit = getValueAndUnit(height);
            if (isNaN(heightAndUnit[0]) || isNaN(widthAndUnit[0])) {
                throw new PolishedError(60);
            }
            return _extends({
                width: "0",
                height: "0",
                borderColor: backgroundColor
            }, getBorderColor(pointingDirection, foregroundColor), {
                borderStyle: "solid",
                borderWidth: getBorderWidth(pointingDirection, heightAndUnit, widthAndUnit)
            });
        }
        function wordWrap(wrap) {
            if (wrap === void 0) {
                wrap = "break-word";
            }
            var wordBreak = wrap === "break-word" ? "break-all" : wrap;
            return {
                overflowWrap: wrap,
                wordWrap: wrap,
                wordBreak
            };
        }
        function colorToInt(color) {
            return Math.round(color * 255);
        }
        function convertToInt(red, green, blue) {
            return colorToInt(red) + "," + colorToInt(green) + "," + colorToInt(blue);
        }
        function hslToRgb(hue, saturation, lightness, convert) {
            if (convert === void 0) {
                convert = convertToInt;
            }
            if (saturation === 0) {
                return convert(lightness, lightness, lightness);
            }
            var huePrime = (hue % 360 + 360) % 360 / 60;
            var chroma = (1 - Math.abs(2 * lightness - 1)) * saturation;
            var secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
            var red = 0;
            var green = 0;
            var blue = 0;
            if (huePrime >= 0 && huePrime < 1) {
                red = chroma;
                green = secondComponent;
            } else if (huePrime >= 1 && huePrime < 2) {
                red = secondComponent;
                green = chroma;
            } else if (huePrime >= 2 && huePrime < 3) {
                green = chroma;
                blue = secondComponent;
            } else if (huePrime >= 3 && huePrime < 4) {
                green = secondComponent;
                blue = chroma;
            } else if (huePrime >= 4 && huePrime < 5) {
                red = secondComponent;
                blue = chroma;
            } else if (huePrime >= 5 && huePrime < 6) {
                red = chroma;
                blue = secondComponent;
            }
            var lightnessModification = lightness - chroma / 2;
            var finalRed = red + lightnessModification;
            var finalGreen = green + lightnessModification;
            var finalBlue = blue + lightnessModification;
            return convert(finalRed, finalGreen, finalBlue);
        }
        var namedColorMap = {
            aliceblue: "f0f8ff",
            antiquewhite: "faebd7",
            aqua: "00ffff",
            aquamarine: "7fffd4",
            azure: "f0ffff",
            beige: "f5f5dc",
            bisque: "ffe4c4",
            black: "000",
            blanchedalmond: "ffebcd",
            blue: "0000ff",
            blueviolet: "8a2be2",
            brown: "a52a2a",
            burlywood: "deb887",
            cadetblue: "5f9ea0",
            chartreuse: "7fff00",
            chocolate: "d2691e",
            coral: "ff7f50",
            cornflowerblue: "6495ed",
            cornsilk: "fff8dc",
            crimson: "dc143c",
            cyan: "00ffff",
            darkblue: "00008b",
            darkcyan: "008b8b",
            darkgoldenrod: "b8860b",
            darkgray: "a9a9a9",
            darkgreen: "006400",
            darkgrey: "a9a9a9",
            darkkhaki: "bdb76b",
            darkmagenta: "8b008b",
            darkolivegreen: "556b2f",
            darkorange: "ff8c00",
            darkorchid: "9932cc",
            darkred: "8b0000",
            darksalmon: "e9967a",
            darkseagreen: "8fbc8f",
            darkslateblue: "483d8b",
            darkslategray: "2f4f4f",
            darkslategrey: "2f4f4f",
            darkturquoise: "00ced1",
            darkviolet: "9400d3",
            deeppink: "ff1493",
            deepskyblue: "00bfff",
            dimgray: "696969",
            dimgrey: "696969",
            dodgerblue: "1e90ff",
            firebrick: "b22222",
            floralwhite: "fffaf0",
            forestgreen: "228b22",
            fuchsia: "ff00ff",
            gainsboro: "dcdcdc",
            ghostwhite: "f8f8ff",
            gold: "ffd700",
            goldenrod: "daa520",
            gray: "808080",
            green: "008000",
            greenyellow: "adff2f",
            grey: "808080",
            honeydew: "f0fff0",
            hotpink: "ff69b4",
            indianred: "cd5c5c",
            indigo: "4b0082",
            ivory: "fffff0",
            khaki: "f0e68c",
            lavender: "e6e6fa",
            lavenderblush: "fff0f5",
            lawngreen: "7cfc00",
            lemonchiffon: "fffacd",
            lightblue: "add8e6",
            lightcoral: "f08080",
            lightcyan: "e0ffff",
            lightgoldenrodyellow: "fafad2",
            lightgray: "d3d3d3",
            lightgreen: "90ee90",
            lightgrey: "d3d3d3",
            lightpink: "ffb6c1",
            lightsalmon: "ffa07a",
            lightseagreen: "20b2aa",
            lightskyblue: "87cefa",
            lightslategray: "789",
            lightslategrey: "789",
            lightsteelblue: "b0c4de",
            lightyellow: "ffffe0",
            lime: "0f0",
            limegreen: "32cd32",
            linen: "faf0e6",
            magenta: "f0f",
            maroon: "800000",
            mediumaquamarine: "66cdaa",
            mediumblue: "0000cd",
            mediumorchid: "ba55d3",
            mediumpurple: "9370db",
            mediumseagreen: "3cb371",
            mediumslateblue: "7b68ee",
            mediumspringgreen: "00fa9a",
            mediumturquoise: "48d1cc",
            mediumvioletred: "c71585",
            midnightblue: "191970",
            mintcream: "f5fffa",
            mistyrose: "ffe4e1",
            moccasin: "ffe4b5",
            navajowhite: "ffdead",
            navy: "000080",
            oldlace: "fdf5e6",
            olive: "808000",
            olivedrab: "6b8e23",
            orange: "ffa500",
            orangered: "ff4500",
            orchid: "da70d6",
            palegoldenrod: "eee8aa",
            palegreen: "98fb98",
            paleturquoise: "afeeee",
            palevioletred: "db7093",
            papayawhip: "ffefd5",
            peachpuff: "ffdab9",
            peru: "cd853f",
            pink: "ffc0cb",
            plum: "dda0dd",
            powderblue: "b0e0e6",
            purple: "800080",
            rebeccapurple: "639",
            red: "f00",
            rosybrown: "bc8f8f",
            royalblue: "4169e1",
            saddlebrown: "8b4513",
            salmon: "fa8072",
            sandybrown: "f4a460",
            seagreen: "2e8b57",
            seashell: "fff5ee",
            sienna: "a0522d",
            silver: "c0c0c0",
            skyblue: "87ceeb",
            slateblue: "6a5acd",
            slategray: "708090",
            slategrey: "708090",
            snow: "fffafa",
            springgreen: "00ff7f",
            steelblue: "4682b4",
            tan: "d2b48c",
            teal: "008080",
            thistle: "d8bfd8",
            tomato: "ff6347",
            turquoise: "40e0d0",
            violet: "ee82ee",
            wheat: "f5deb3",
            white: "fff",
            whitesmoke: "f5f5f5",
            yellow: "ff0",
            yellowgreen: "9acd32"
        };
        function nameToHex(color) {
            if (typeof color !== "string") return color;
            var normalizedColorName = color.toLowerCase();
            return namedColorMap[normalizedColorName] ? "#" + namedColorMap[normalizedColorName] : color;
        }
        var hexRegex = /^#[a-fA-F0-9]{6}$/;
        var hexRgbaRegex = /^#[a-fA-F0-9]{8}$/;
        var reducedHexRegex = /^#[a-fA-F0-9]{3}$/;
        var reducedRgbaHexRegex = /^#[a-fA-F0-9]{4}$/;
        var rgbRegex = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i;
        var rgbaRegex = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i;
        var hslRegex = /^hsl\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i;
        var hslaRegex = /^hsla\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i;
        function parseToRgb(color) {
            if (typeof color !== "string") {
                throw new PolishedError(3);
            }
            var normalizedColor = nameToHex(color);
            if (normalizedColor.match(hexRegex)) {
                return {
                    red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
                    green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16),
                    blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16)
                };
            }
            if (normalizedColor.match(hexRgbaRegex)) {
                var alpha = parseFloat((parseInt("" + normalizedColor[7] + normalizedColor[8], 16) / 255).toFixed(2));
                return {
                    red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
                    green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16),
                    blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16),
                    alpha
                };
            }
            if (normalizedColor.match(reducedHexRegex)) {
                return {
                    red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
                    green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
                    blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16)
                };
            }
            if (normalizedColor.match(reducedRgbaHexRegex)) {
                var _alpha = parseFloat((parseInt("" + normalizedColor[4] + normalizedColor[4], 16) / 255).toFixed(2));
                return {
                    red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
                    green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
                    blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16),
                    alpha: _alpha
                };
            }
            var rgbMatched = rgbRegex.exec(normalizedColor);
            if (rgbMatched) {
                return {
                    red: parseInt("" + rgbMatched[1], 10),
                    green: parseInt("" + rgbMatched[2], 10),
                    blue: parseInt("" + rgbMatched[3], 10)
                };
            }
            var rgbaMatched = rgbaRegex.exec(normalizedColor);
            if (rgbaMatched) {
                return {
                    red: parseInt("" + rgbaMatched[1], 10),
                    green: parseInt("" + rgbaMatched[2], 10),
                    blue: parseInt("" + rgbaMatched[3], 10),
                    alpha: parseFloat("" + rgbaMatched[4])
                };
            }
            var hslMatched = hslRegex.exec(normalizedColor);
            if (hslMatched) {
                var hue = parseInt("" + hslMatched[1], 10);
                var saturation = parseInt("" + hslMatched[2], 10) / 100;
                var lightness = parseInt("" + hslMatched[3], 10) / 100;
                var rgbColorString = "rgb(" + hslToRgb(hue, saturation, lightness) + ")";
                var hslRgbMatched = rgbRegex.exec(rgbColorString);
                if (!hslRgbMatched) {
                    throw new PolishedError(4, normalizedColor, rgbColorString);
                }
                return {
                    red: parseInt("" + hslRgbMatched[1], 10),
                    green: parseInt("" + hslRgbMatched[2], 10),
                    blue: parseInt("" + hslRgbMatched[3], 10)
                };
            }
            var hslaMatched = hslaRegex.exec(normalizedColor);
            if (hslaMatched) {
                var _hue = parseInt("" + hslaMatched[1], 10);
                var _saturation = parseInt("" + hslaMatched[2], 10) / 100;
                var _lightness = parseInt("" + hslaMatched[3], 10) / 100;
                var _rgbColorString = "rgb(" + hslToRgb(_hue, _saturation, _lightness) + ")";
                var _hslRgbMatched = rgbRegex.exec(_rgbColorString);
                if (!_hslRgbMatched) {
                    throw new PolishedError(4, normalizedColor, _rgbColorString);
                }
                return {
                    red: parseInt("" + _hslRgbMatched[1], 10),
                    green: parseInt("" + _hslRgbMatched[2], 10),
                    blue: parseInt("" + _hslRgbMatched[3], 10),
                    alpha: parseFloat("" + hslaMatched[4])
                };
            }
            throw new PolishedError(5);
        }
        function rgbToHsl(color) {
            var red = color.red / 255;
            var green = color.green / 255;
            var blue = color.blue / 255;
            var max = Math.max(red, green, blue);
            var min = Math.min(red, green, blue);
            var lightness = (max + min) / 2;
            if (max === min) {
                if (color.alpha !== undefined) {
                    return {
                        hue: 0,
                        saturation: 0,
                        lightness,
                        alpha: color.alpha
                    };
                } else {
                    return {
                        hue: 0,
                        saturation: 0,
                        lightness
                    };
                }
            }
            var hue;
            var delta = max - min;
            var saturation = lightness > .5 ? delta / (2 - max - min) : delta / (max + min);
            switch (max) {
              case red:
                hue = (green - blue) / delta + (green < blue ? 6 : 0);
                break;

              case green:
                hue = (blue - red) / delta + 2;
                break;

              default:
                hue = (red - green) / delta + 4;
                break;
            }
            hue *= 60;
            if (color.alpha !== undefined) {
                return {
                    hue,
                    saturation,
                    lightness,
                    alpha: color.alpha
                };
            }
            return {
                hue,
                saturation,
                lightness
            };
        }
        function parseToHsl(color) {
            return rgbToHsl(parseToRgb(color));
        }
        var reduceHexValue = function reduceHexValue(value) {
            if (value.length === 7 && value[1] === value[2] && value[3] === value[4] && value[5] === value[6]) {
                return "#" + value[1] + value[3] + value[5];
            }
            return value;
        };
        function numberToHex(value) {
            var hex = value.toString(16);
            return hex.length === 1 ? "0" + hex : hex;
        }
        function colorToHex(color) {
            return numberToHex(Math.round(color * 255));
        }
        function convertToHex(red, green, blue) {
            return reduceHexValue("#" + colorToHex(red) + colorToHex(green) + colorToHex(blue));
        }
        function hslToHex(hue, saturation, lightness) {
            return hslToRgb(hue, saturation, lightness, convertToHex);
        }
        function hsl(value, saturation, lightness) {
            if (typeof value === "number" && typeof saturation === "number" && typeof lightness === "number") {
                return hslToHex(value, saturation, lightness);
            } else if (typeof value === "object" && saturation === undefined && lightness === undefined) {
                return hslToHex(value.hue, value.saturation, value.lightness);
            }
            throw new PolishedError(1);
        }
        function hsla(value, saturation, lightness, alpha) {
            if (typeof value === "number" && typeof saturation === "number" && typeof lightness === "number" && typeof alpha === "number") {
                return alpha >= 1 ? hslToHex(value, saturation, lightness) : "rgba(" + hslToRgb(value, saturation, lightness) + "," + alpha + ")";
            } else if (typeof value === "object" && saturation === undefined && lightness === undefined && alpha === undefined) {
                return value.alpha >= 1 ? hslToHex(value.hue, value.saturation, value.lightness) : "rgba(" + hslToRgb(value.hue, value.saturation, value.lightness) + "," + value.alpha + ")";
            }
            throw new PolishedError(2);
        }
        function rgb(value, green, blue) {
            if (typeof value === "number" && typeof green === "number" && typeof blue === "number") {
                return reduceHexValue("#" + numberToHex(value) + numberToHex(green) + numberToHex(blue));
            } else if (typeof value === "object" && green === undefined && blue === undefined) {
                return reduceHexValue("#" + numberToHex(value.red) + numberToHex(value.green) + numberToHex(value.blue));
            }
            throw new PolishedError(6);
        }
        function rgba(firstValue, secondValue, thirdValue, fourthValue) {
            if (typeof firstValue === "string" && typeof secondValue === "number") {
                var rgbValue = parseToRgb(firstValue);
                return "rgba(" + rgbValue.red + "," + rgbValue.green + "," + rgbValue.blue + "," + secondValue + ")";
            } else if (typeof firstValue === "number" && typeof secondValue === "number" && typeof thirdValue === "number" && typeof fourthValue === "number") {
                return fourthValue >= 1 ? rgb(firstValue, secondValue, thirdValue) : "rgba(" + firstValue + "," + secondValue + "," + thirdValue + "," + fourthValue + ")";
            } else if (typeof firstValue === "object" && secondValue === undefined && thirdValue === undefined && fourthValue === undefined) {
                return firstValue.alpha >= 1 ? rgb(firstValue.red, firstValue.green, firstValue.blue) : "rgba(" + firstValue.red + "," + firstValue.green + "," + firstValue.blue + "," + firstValue.alpha + ")";
            }
            throw new PolishedError(7);
        }
        var isRgb = function isRgb(color) {
            return typeof color.red === "number" && typeof color.green === "number" && typeof color.blue === "number" && (typeof color.alpha !== "number" || typeof color.alpha === "undefined");
        };
        var isRgba = function isRgba(color) {
            return typeof color.red === "number" && typeof color.green === "number" && typeof color.blue === "number" && typeof color.alpha === "number";
        };
        var isHsl = function isHsl(color) {
            return typeof color.hue === "number" && typeof color.saturation === "number" && typeof color.lightness === "number" && (typeof color.alpha !== "number" || typeof color.alpha === "undefined");
        };
        var isHsla = function isHsla(color) {
            return typeof color.hue === "number" && typeof color.saturation === "number" && typeof color.lightness === "number" && typeof color.alpha === "number";
        };
        function toColorString(color) {
            if (typeof color !== "object") throw new PolishedError(8);
            if (isRgba(color)) return rgba(color);
            if (isRgb(color)) return rgb(color);
            if (isHsla(color)) return hsla(color);
            if (isHsl(color)) return hsl(color);
            throw new PolishedError(8);
        }
        function curried(f, length, acc) {
            return function fn() {
                var combined = acc.concat(Array.prototype.slice.call(arguments));
                return combined.length >= length ? f.apply(this, combined) : curried(f, length, combined);
            };
        }
        function curry(f) {
            return curried(f, f.length, []);
        }
        function adjustHue(degree, color) {
            if (color === "transparent") return color;
            var hslColor = parseToHsl(color);
            return toColorString(_extends({}, hslColor, {
                hue: hslColor.hue + parseFloat(degree)
            }));
        }
        var curriedAdjustHue = null && curry(adjustHue);
        function complement(color) {
            if (color === "transparent") return color;
            var hslColor = parseToHsl(color);
            return toColorString(_extends({}, hslColor, {
                hue: (hslColor.hue + 180) % 360
            }));
        }
        function guard(lowerBoundary, upperBoundary, value) {
            return Math.max(lowerBoundary, Math.min(upperBoundary, value));
        }
        function darken(amount, color) {
            if (color === "transparent") return color;
            var hslColor = parseToHsl(color);
            return toColorString(_extends({}, hslColor, {
                lightness: guard(0, 1, hslColor.lightness - parseFloat(amount))
            }));
        }
        var curriedDarken = null && curry(darken);
        function desaturate(amount, color) {
            if (color === "transparent") return color;
            var hslColor = parseToHsl(color);
            return toColorString(_extends({}, hslColor, {
                saturation: guard(0, 1, hslColor.saturation - parseFloat(amount))
            }));
        }
        var curriedDesaturate = null && curry(desaturate);
        function getLuminance(color) {
            if (color === "transparent") return 0;
            var rgbColor = parseToRgb(color);
            var _Object$keys$map = Object.keys(rgbColor).map((function(key) {
                var channel = rgbColor[key] / 255;
                return channel <= .03928 ? channel / 12.92 : Math.pow((channel + .055) / 1.055, 2.4);
            })), r = _Object$keys$map[0], g = _Object$keys$map[1], b = _Object$keys$map[2];
            return parseFloat((.2126 * r + .7152 * g + .0722 * b).toFixed(3));
        }
        function getContrast(color1, color2) {
            var luminance1 = getLuminance(color1);
            var luminance2 = getLuminance(color2);
            return parseFloat((luminance1 > luminance2 ? (luminance1 + .05) / (luminance2 + .05) : (luminance2 + .05) / (luminance1 + .05)).toFixed(2));
        }
        function grayscale(color) {
            if (color === "transparent") return color;
            return toColorString(_extends({}, parseToHsl(color), {
                saturation: 0
            }));
        }
        function hslToColorString(color) {
            if (typeof color === "object" && typeof color.hue === "number" && typeof color.saturation === "number" && typeof color.lightness === "number") {
                if (color.alpha && typeof color.alpha === "number") {
                    return hsla({
                        hue: color.hue,
                        saturation: color.saturation,
                        lightness: color.lightness,
                        alpha: color.alpha
                    });
                }
                return hsl({
                    hue: color.hue,
                    saturation: color.saturation,
                    lightness: color.lightness
                });
            }
            throw new PolishedError(45);
        }
        function invert(color) {
            if (color === "transparent") return color;
            var value = parseToRgb(color);
            return toColorString(_extends({}, value, {
                red: 255 - value.red,
                green: 255 - value.green,
                blue: 255 - value.blue
            }));
        }
        function lighten(amount, color) {
            if (color === "transparent") return color;
            var hslColor = parseToHsl(color);
            return toColorString(_extends({}, hslColor, {
                lightness: guard(0, 1, hslColor.lightness + parseFloat(amount))
            }));
        }
        var curriedLighten = null && curry(lighten);
        function meetsContrastGuidelines(color1, color2) {
            var contrastRatio = getContrast(color1, color2);
            return {
                AA: contrastRatio >= 4.5,
                AALarge: contrastRatio >= 3,
                AAA: contrastRatio >= 7,
                AAALarge: contrastRatio >= 4.5
            };
        }
        function mix(weight, color, otherColor) {
            if (color === "transparent") return otherColor;
            if (otherColor === "transparent") return color;
            if (weight === 0) return otherColor;
            var parsedColor1 = parseToRgb(color);
            var color1 = _extends({}, parsedColor1, {
                alpha: typeof parsedColor1.alpha === "number" ? parsedColor1.alpha : 1
            });
            var parsedColor2 = parseToRgb(otherColor);
            var color2 = _extends({}, parsedColor2, {
                alpha: typeof parsedColor2.alpha === "number" ? parsedColor2.alpha : 1
            });
            var alphaDelta = color1.alpha - color2.alpha;
            var x = parseFloat(weight) * 2 - 1;
            var y = x * alphaDelta === -1 ? x : x + alphaDelta;
            var z = 1 + x * alphaDelta;
            var weight1 = (y / z + 1) / 2;
            var weight2 = 1 - weight1;
            var mixedColor = {
                red: Math.floor(color1.red * weight1 + color2.red * weight2),
                green: Math.floor(color1.green * weight1 + color2.green * weight2),
                blue: Math.floor(color1.blue * weight1 + color2.blue * weight2),
                alpha: color1.alpha * (parseFloat(weight) / 1) + color2.alpha * (1 - parseFloat(weight) / 1)
            };
            return rgba(mixedColor);
        }
        var curriedMix = null && curry(mix);
        function opacify(amount, color) {
            if (color === "transparent") return color;
            var parsedColor = parseToRgb(color);
            var alpha = typeof parsedColor.alpha === "number" ? parsedColor.alpha : 1;
            var colorWithAlpha = _extends({}, parsedColor, {
                alpha: guard(0, 1, (alpha * 100 + parseFloat(amount) * 100) / 100)
            });
            return rgba(colorWithAlpha);
        }
        var curriedOpacify = null && curry(opacify);
        var defaultReturnIfLightColor = "#000";
        var defaultReturnIfDarkColor = "#fff";
        function readableColor(color, returnIfLightColor, returnIfDarkColor, strict) {
            if (returnIfLightColor === void 0) {
                returnIfLightColor = defaultReturnIfLightColor;
            }
            if (returnIfDarkColor === void 0) {
                returnIfDarkColor = defaultReturnIfDarkColor;
            }
            if (strict === void 0) {
                strict = true;
            }
            var isColorLight = getLuminance(color) > .179;
            var preferredReturnColor = isColorLight ? returnIfLightColor : returnIfDarkColor;
            if (!strict || getContrast(color, preferredReturnColor) >= 4.5) {
                return preferredReturnColor;
            }
            return isColorLight ? defaultReturnIfLightColor : defaultReturnIfDarkColor;
        }
        function rgbToColorString(color) {
            if (typeof color === "object" && typeof color.red === "number" && typeof color.green === "number" && typeof color.blue === "number") {
                if (typeof color.alpha === "number") {
                    return rgba({
                        red: color.red,
                        green: color.green,
                        blue: color.blue,
                        alpha: color.alpha
                    });
                }
                return rgb({
                    red: color.red,
                    green: color.green,
                    blue: color.blue
                });
            }
            throw new PolishedError(46);
        }
        function saturate(amount, color) {
            if (color === "transparent") return color;
            var hslColor = parseToHsl(color);
            return toColorString(_extends({}, hslColor, {
                saturation: guard(0, 1, hslColor.saturation + parseFloat(amount))
            }));
        }
        var curriedSaturate = null && curry(saturate);
        function setHue(hue, color) {
            if (color === "transparent") return color;
            return toColorString(_extends({}, parseToHsl(color), {
                hue: parseFloat(hue)
            }));
        }
        var curriedSetHue = null && curry(setHue);
        function setLightness(lightness, color) {
            if (color === "transparent") return color;
            return toColorString(_extends({}, parseToHsl(color), {
                lightness: parseFloat(lightness)
            }));
        }
        var curriedSetLightness = null && curry(setLightness);
        function setSaturation(saturation, color) {
            if (color === "transparent") return color;
            return toColorString(_extends({}, parseToHsl(color), {
                saturation: parseFloat(saturation)
            }));
        }
        var curriedSetSaturation = null && curry(setSaturation);
        function shade(percentage, color) {
            if (color === "transparent") return color;
            return curriedMix(parseFloat(percentage), "rgb(0, 0, 0)", color);
        }
        var curriedShade = null && curry(shade);
        function tint(percentage, color) {
            if (color === "transparent") return color;
            return curriedMix(parseFloat(percentage), "rgb(255, 255, 255)", color);
        }
        var curriedTint = null && curry(tint);
        function transparentize(amount, color) {
            if (color === "transparent") return color;
            var parsedColor = parseToRgb(color);
            var alpha = typeof parsedColor.alpha === "number" ? parsedColor.alpha : 1;
            var colorWithAlpha = _extends({}, parsedColor, {
                alpha: guard(0, 1, +(alpha * 100 - parseFloat(amount) * 100).toFixed(2) / 100)
            });
            return rgba(colorWithAlpha);
        }
        var curriedTransparentize = null && curry(transparentize);
        function animation() {
            for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
                args[_key] = arguments[_key];
            }
            var multiMode = Array.isArray(args[0]);
            if (!multiMode && args.length > 8) {
                throw new PolishedError(64);
            }
            var code = args.map((function(arg) {
                if (multiMode && !Array.isArray(arg) || !multiMode && Array.isArray(arg)) {
                    throw new PolishedError(65);
                }
                if (Array.isArray(arg) && arg.length > 8) {
                    throw new PolishedError(66);
                }
                return Array.isArray(arg) ? arg.join(" ") : arg;
            })).join(", ");
            return {
                animation: code
            };
        }
        function backgroundImages() {
            for (var _len = arguments.length, properties = new Array(_len), _key = 0; _key < _len; _key++) {
                properties[_key] = arguments[_key];
            }
            return {
                backgroundImage: properties.join(", ")
            };
        }
        function backgrounds() {
            for (var _len = arguments.length, properties = new Array(_len), _key = 0; _key < _len; _key++) {
                properties[_key] = arguments[_key];
            }
            return {
                background: properties.join(", ")
            };
        }
        var sideMap = null && [ "top", "right", "bottom", "left" ];
        function polished_esm_border(sideKeyword) {
            for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
                values[_key - 1] = arguments[_key];
            }
            if (typeof sideKeyword === "string" && sideMap.indexOf(sideKeyword) >= 0) {
                var _ref;
                return _ref = {}, _ref["border" + capitalizeString(sideKeyword) + "Width"] = values[0], 
                _ref["border" + capitalizeString(sideKeyword) + "Style"] = values[1], _ref["border" + capitalizeString(sideKeyword) + "Color"] = values[2], 
                _ref;
            } else {
                values.unshift(sideKeyword);
                return {
                    borderWidth: values[0],
                    borderStyle: values[1],
                    borderColor: values[2]
                };
            }
        }
        function polished_esm_borderColor() {
            for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
                values[_key] = arguments[_key];
            }
            return directionalProperty.apply(void 0, [ "borderColor" ].concat(values));
        }
        function polished_esm_borderRadius(side, radius) {
            var uppercaseSide = capitalizeString(side);
            if (!radius && radius !== 0) {
                throw new PolishedError(62);
            }
            if (uppercaseSide === "Top" || uppercaseSide === "Bottom") {
                var _ref;
                return _ref = {}, _ref["border" + uppercaseSide + "RightRadius"] = radius, _ref["border" + uppercaseSide + "LeftRadius"] = radius, 
                _ref;
            }
            if (uppercaseSide === "Left" || uppercaseSide === "Right") {
                var _ref2;
                return _ref2 = {}, _ref2["borderTop" + uppercaseSide + "Radius"] = radius, _ref2["borderBottom" + uppercaseSide + "Radius"] = radius, 
                _ref2;
            }
            throw new PolishedError(63);
        }
        function polished_esm_borderStyle() {
            for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
                values[_key] = arguments[_key];
            }
            return directionalProperty.apply(void 0, [ "borderStyle" ].concat(values));
        }
        function polished_esm_borderWidth() {
            for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
                values[_key] = arguments[_key];
            }
            return directionalProperty.apply(void 0, [ "borderWidth" ].concat(values));
        }
        function generateSelectors(template, state) {
            var stateSuffix = state ? ":" + state : "";
            return template(stateSuffix);
        }
        function statefulSelectors(states, template, stateMap) {
            if (!template) throw new PolishedError(67);
            if (states.length === 0) return generateSelectors(template, null);
            var selectors = [];
            for (var i = 0; i < states.length; i += 1) {
                if (stateMap && stateMap.indexOf(states[i]) < 0) {
                    throw new PolishedError(68);
                }
                selectors.push(generateSelectors(template, states[i]));
            }
            selectors = selectors.join(",");
            return selectors;
        }
        var stateMap = [ undefined, null, "active", "focus", "hover" ];
        function template(state) {
            return "button" + state + ',\n  input[type="button"]' + state + ',\n  input[type="reset"]' + state + ',\n  input[type="submit"]' + state;
        }
        function buttons() {
            for (var _len = arguments.length, states = new Array(_len), _key = 0; _key < _len; _key++) {
                states[_key] = arguments[_key];
            }
            return statefulSelectors(states, template, stateMap);
        }
        function polished_esm_margin() {
            for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
                values[_key] = arguments[_key];
            }
            return directionalProperty.apply(void 0, [ "margin" ].concat(values));
        }
        function polished_esm_padding() {
            for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
                values[_key] = arguments[_key];
            }
            return directionalProperty.apply(void 0, [ "padding" ].concat(values));
        }
        var positionMap$1 = null && [ "absolute", "fixed", "relative", "static", "sticky" ];
        function polished_esm_position(firstValue) {
            for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
                values[_key - 1] = arguments[_key];
            }
            if (positionMap$1.indexOf(firstValue) >= 0 && firstValue) {
                return _extends({}, directionalProperty.apply(void 0, [ "" ].concat(values)), {
                    position: firstValue
                });
            } else {
                return directionalProperty.apply(void 0, [ "", firstValue ].concat(values));
            }
        }
        function polished_esm_size(height, width) {
            if (width === void 0) {
                width = height;
            }
            return {
                height,
                width
            };
        }
        var stateMap$1 = [ undefined, null, "active", "focus", "hover" ];
        function template$1(state) {
            return 'input[type="color"]' + state + ',\n    input[type="date"]' + state + ',\n    input[type="datetime"]' + state + ',\n    input[type="datetime-local"]' + state + ',\n    input[type="email"]' + state + ',\n    input[type="month"]' + state + ',\n    input[type="number"]' + state + ',\n    input[type="password"]' + state + ',\n    input[type="search"]' + state + ',\n    input[type="tel"]' + state + ',\n    input[type="text"]' + state + ',\n    input[type="time"]' + state + ',\n    input[type="url"]' + state + ',\n    input[type="week"]' + state + ",\n    input:not([type])" + state + ",\n    textarea" + state;
        }
        function textInputs() {
            for (var _len = arguments.length, states = new Array(_len), _key = 0; _key < _len; _key++) {
                states[_key] = arguments[_key];
            }
            return statefulSelectors(states, template$1, stateMap$1);
        }
        function transitions() {
            for (var _len = arguments.length, properties = new Array(_len), _key = 0; _key < _len; _key++) {
                properties[_key] = arguments[_key];
            }
            if (Array.isArray(properties[0]) && properties.length === 2) {
                var value = properties[1];
                if (typeof value !== "string") {
                    throw new PolishedError(61);
                }
                var transitionsString = properties[0].map((function(property) {
                    return property + " " + value;
                })).join(", ");
                return {
                    transition: transitionsString
                };
            } else {
                return {
                    transition: properties.join(", ")
                };
            }
        }
        var icons_Actions = __webpack_require__(505);
        var ClosedCaption = __webpack_require__(504);
        var Expand = __webpack_require__(506);
        var FormDown = __webpack_require__(498);
        var FormNext = __webpack_require__(502);
        var FormPrevious = __webpack_require__(501);
        var FormUp = __webpack_require__(492);
        var Next = __webpack_require__(500);
        var Pause = __webpack_require__(507);
        var Play = __webpack_require__(508);
        var Previous = __webpack_require__(499);
        var Subtract = __webpack_require__(503);
        var Volume = __webpack_require__(510);
        var VolumeLow = __webpack_require__(509);
        var themes_base = __webpack_require__(491);
        var parseMetricToNum = function parseMetricToNum(metric) {
            if (typeof metric === "number") return metric;
            if (metric.match(/\s/) && "production" !== "production") {
                console.warn('Invalid single measurement value: "' + metric + '"');
            }
            return parseFloat(metric.match(/\d+(\.\d+)?/), 10);
        };
        var mixins_fontSize = function fontSize(size, lineHeight) {
            return css([ "font-size:", ";line-height:", ";" ], (function(props) {
                return parseMetricToNum(size) / parseMetricToNum(props.theme.global.font.size) * 1 + "rem";
            }), (function(props) {
                return lineHeight || Math.ceil(parseMetricToNum(size) / parseMetricToNum(props.theme.global.lineHeight)) * (parseMetricToNum(props.theme.global.lineHeight) / parseMetricToNum(size)) + "px";
            }));
        };
        var breakpointStyle = function breakpointStyle(breakpoint, content) {
            return (0, styled_components_browser_esm.css)([ "@media only screen ", "{", ";}" ], breakpoint.value && "and (max-width: " + breakpoint.value + "px)", content);
        };
        var findAllByType = function findAllByType(component, type) {
            var matches = [];
            if (component.type === type) {
                matches.push(component);
            }
            if (component.children) {
                component.children.forEach((function(child) {
                    matches = matches.concat(findAllByType(child, type));
                }));
            }
            return matches;
        };
        var getAvailableAtBadge = function getAvailableAtBadge(availableAt, componentType) {
            return [ {
                url: "https://storybook.grommet.io/?selectedKind=" + componentType + "-" + availableAt + "&full=0&stories=1&panelRight=0",
                badge: "https://cdn-images-1.medium.com/fit/c/120/120/1*TD1P0HtIH9zF0UEH28zYtw.png",
                label: "Storybook"
            }, {
                url: "https://codesandbox.io/s/github/grommet/grommet-sandbox?initialpath=/" + availableAt.toLowerCase() + "&module=%2Fsrc%2F" + availableAt + ".js",
                badge: "https://codesandbox.io/static/img/play-codesandbox.svg",
                label: "CodeSandbox"
            } ];
        };
        function base_extends() {
            base_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return base_extends.apply(this, arguments);
        }
        var brandColor = "#7D4CDB";
        var accentColors = [ "#6FFFB0", "#FD6FFF", "#81FCED", "#FFCA58" ];
        var neutralColors = [ "#00873D", "#3D138D", "#00739D", "#A2423D" ];
        var statusColors = {
            critical: "#FF4040",
            error: "#FF4040",
            warning: "#FFAA15",
            ok: "#00C781",
            unknown: "#CCCCCC",
            disabled: "#CCCCCC"
        };
        var darkColors = [ "#333333", "#555555", "#777777", "#999999", "#999999", "#999999" ];
        var lightColors = [ "#F8F8F8", "#F2F2F2", "#EDEDED", "#DADADA", "#DADADA", "#DADADA" ];
        var focusColor = accentColors[0];
        var colors = {
            active: rgba(221, 221, 221, .5),
            "background-back": {
                dark: "#33333308",
                light: "#EDEDED"
            },
            "background-front": {
                dark: "#444444",
                light: "#FFFFFF"
            },
            "background-contrast": {
                light: "#33333310",
                dark: "#FFFFFF18"
            },
            "active-background": "background-contrast",
            "active-text": "text-strong",
            black: "#000000",
            border: {
                dark: rgba(255, 255, 255, .33),
                light: rgba(0, 0, 0, .33)
            },
            brand: brandColor,
            control: {
                dark: "accent-1",
                light: "brand"
            },
            focus: focusColor,
            "graph-0": "accent-1",
            "graph-1": "neutral-1",
            "graph-2": "neutral-2",
            "graph-3": "neutral-3",
            "graph-4": "neutral-4",
            placeholder: "#AAAAAA",
            selected: "brand",
            text: {
                dark: "#f8f8f8",
                light: "#444444"
            },
            "text-strong": {
                dark: "#FFFFFF",
                light: "#000000"
            },
            "text-weak": {
                dark: "#CCCCCC",
                light: "#555555"
            },
            "text-xweak": {
                dark: "#BBBBBB",
                light: "#666666"
            },
            icon: {
                dark: "#f8f8f8",
                light: "#666666"
            },
            "selected-background": "brand",
            "selected-text": "text-strong",
            white: "#FFFFFF"
        };
        var colorArray = function colorArray(array, prefix) {
            return array.forEach((function(color, index) {
                colors[prefix + "-" + (index + 1)] = color;
            }));
        };
        colorArray(accentColors, "accent");
        colorArray(darkColors, "dark");
        colorArray(lightColors, "light");
        colorArray(neutralColors, "neutral");
        Object.keys(statusColors).forEach((function(color) {
            colors["status-" + color] = statusColors[color];
        }));
        var generate = function generate(baseSpacing, scale) {
            if (baseSpacing === void 0) {
                baseSpacing = 24;
            }
            if (scale === void 0) {
                scale = 6;
            }
            var baseFontSize = baseSpacing * .75;
            var fontScale = baseSpacing / scale;
            var fontSizing = function fontSizing(factor) {
                return {
                    size: baseFontSize + factor * fontScale + "px",
                    height: baseSpacing + factor * fontScale + "px",
                    maxWidth: baseSpacing * (baseFontSize + factor * fontScale) + "px"
                };
            };
            var borderWidth = 2;
            var controlBorderWidth = 1;
            var result = object_deepMerge(themes_base.base, {
                global: {
                    active: {
                        background: {
                            color: "active",
                            opacity: "medium"
                        },
                        color: {
                            dark: "white",
                            light: "black"
                        }
                    },
                    animation: {
                        duration: "1s",
                        jiggle: {
                            duration: "0.1s"
                        }
                    },
                    borderSize: {
                        xsmall: "1px",
                        small: "2px",
                        medium: baseSpacing / 6 + "px",
                        large: baseSpacing / 2 + "px",
                        xlarge: baseSpacing + "px"
                    },
                    breakpoints: {
                        small: {
                            value: baseSpacing * 32,
                            borderSize: {
                                xsmall: "1px",
                                small: "2px",
                                medium: baseSpacing / 6 + "px",
                                large: baseSpacing / 4 + "px",
                                xlarge: baseSpacing / 2 + "px"
                            },
                            edgeSize: {
                                none: "0px",
                                hair: "1px",
                                xxsmall: "2px",
                                xsmall: baseSpacing / 8 + "px",
                                small: baseSpacing / 4 + "px",
                                medium: baseSpacing / 2 + "px",
                                large: baseSpacing + "px",
                                xlarge: baseSpacing * 2 + "px"
                            },
                            size: {
                                xxsmall: baseSpacing + "px",
                                xsmall: baseSpacing * 2 + "px",
                                small: baseSpacing * 4 + "px",
                                medium: baseSpacing * 8 + "px",
                                large: baseSpacing * 16 + "px",
                                xlarge: baseSpacing * 32 + "px",
                                full: "100%"
                            }
                        },
                        medium: {
                            value: baseSpacing * 64
                        },
                        large: {}
                    },
                    deviceBreakpoints: {
                        phone: "small",
                        tablet: "medium",
                        computer: "large"
                    },
                    colors,
                    control: {
                        border: {
                            width: controlBorderWidth + "px",
                            radius: "4px",
                            color: "border"
                        },
                        disabled: {
                            opacity: .3
                        }
                    },
                    debounceDelay: 300,
                    drop: {
                        background: {
                            dark: "black",
                            light: "white"
                        },
                        border: {
                            radius: "0px"
                        },
                        shadowSize: "small",
                        zIndex: "20"
                    },
                    edgeSize: {
                        none: "0px",
                        hair: "1px",
                        xxsmall: baseSpacing / 8 + "px",
                        xsmall: baseSpacing / 4 + "px",
                        small: baseSpacing / 2 + "px",
                        medium: baseSpacing + "px",
                        large: baseSpacing * 2 + "px",
                        xlarge: baseSpacing * 4 + "px",
                        responsiveBreakpoint: "small"
                    },
                    elevation: {
                        light: {
                            none: "none",
                            xsmall: "0px 1px 2px rgba(0, 0, 0, 0.20)",
                            small: "0px 2px 4px rgba(0, 0, 0, 0.20)",
                            medium: "0px 4px 8px rgba(0, 0, 0, 0.20)",
                            large: "0px 8px 16px rgba(0, 0, 0, 0.20)",
                            xlarge: "0px 12px 24px rgba(0, 0, 0, 0.20)"
                        },
                        dark: {
                            none: "none",
                            xsmall: "0px 2px 2px rgba(255, 255, 255, 0.40)",
                            small: "0px 4px 4px rgba(255, 255, 255, 0.40)",
                            medium: "0px 6px 8px rgba(255, 255, 255, 0.40)",
                            large: "0px 8px 16px rgba(255, 255, 255, 0.40)",
                            xlarge: "0px 12px 24px rgba(255, 255, 255, 0.40)"
                        }
                    },
                    focus: {
                        border: {
                            color: "focus"
                        },
                        shadow: {
                            color: "focus",
                            size: "2px"
                        }
                    },
                    font: base_extends({}, fontSizing(0)),
                    hover: {
                        background: {
                            color: "active",
                            opacity: "medium"
                        },
                        color: {
                            dark: "white",
                            light: "black"
                        }
                    },
                    input: {
                        padding: {
                            horizontal: parseMetricToNum(baseSpacing / 2 + "px") - parseMetricToNum(controlBorderWidth + "px") + "px",
                            vertical: parseMetricToNum(baseSpacing / 2 + "px") - parseMetricToNum(controlBorderWidth + "px") + "px"
                        },
                        font: {
                            weight: 600
                        }
                    },
                    opacity: {
                        strong: .8,
                        medium: .4,
                        weak: .1
                    },
                    selected: {
                        background: "selected",
                        color: "white"
                    },
                    spacing: baseSpacing + "px",
                    size: {
                        xxsmall: baseSpacing * 2 + "px",
                        xsmall: baseSpacing * 4 + "px",
                        small: baseSpacing * 8 + "px",
                        medium: baseSpacing * 16 + "px",
                        large: baseSpacing * 32 + "px",
                        xlarge: baseSpacing * 48 + "px",
                        xxlarge: baseSpacing * 64 + "px",
                        full: "100%"
                    }
                },
                accordion: {
                    panel: {},
                    border: {
                        side: "bottom",
                        color: "border"
                    },
                    heading: {
                        level: "4"
                    },
                    hover: {
                        color: {
                            dark: "light-4",
                            light: "dark-3"
                        },
                        heading: {
                            color: {
                                dark: "light-4",
                                light: "dark-3"
                            }
                        }
                    },
                    icons: {
                        collapse: FormUp.R,
                        expand: FormDown.I
                    }
                },
                anchor: {
                    textDecoration: "none",
                    fontWeight: 600,
                    color: {
                        dark: "accent-1",
                        light: "brand"
                    },
                    hover: {
                        textDecoration: "underline"
                    }
                },
                avatar: {
                    size: {
                        xsmall: baseSpacing * .75 + "px",
                        small: baseSpacing + "px",
                        medium: baseSpacing * 2 + "px",
                        large: baseSpacing * 3 + "px",
                        xlarge: baseSpacing * 4 + "px"
                    },
                    text: {
                        size: {
                            xsmall: "small",
                            small: "medium",
                            medium: "large",
                            large: "xlarge",
                            xlarge: "xxlarge"
                        }
                    }
                },
                box: {
                    responsiveBreakpoint: "small"
                },
                button: {
                    size: {
                        small: {
                            border: {
                                radius: baseSpacing * .75 + "px"
                            },
                            pad: {
                                vertical: baseSpacing / 4 - borderWidth + "px",
                                horizontal: baseSpacing - borderWidth * 2 + "px"
                            }
                        },
                        medium: {
                            border: {
                                radius: baseSpacing * .75 + "px"
                            },
                            pad: {
                                vertical: baseSpacing / 4 - borderWidth + "px",
                                horizontal: baseSpacing - borderWidth + "px"
                            }
                        },
                        large: {
                            border: {
                                radius: baseSpacing + "px"
                            },
                            pad: {
                                vertical: baseSpacing / 4 + borderWidth + "px",
                                horizontal: baseSpacing + borderWidth * 4 + "px"
                            }
                        }
                    },
                    border: {
                        width: borderWidth + "px",
                        radius: baseSpacing * .75 + "px"
                    },
                    active: {
                        background: "active-background",
                        color: "active-text"
                    },
                    disabled: {
                        opacity: .3
                    },
                    padding: {
                        vertical: baseSpacing / 4 - borderWidth + "px",
                        horizontal: baseSpacing - borderWidth + "px"
                    },
                    transition: {
                        timing: "ease-in-out",
                        duration: .1,
                        properties: [ "color", "background-color", "border-color", "box-shadow" ]
                    }
                },
                calendar: {
                    small: {
                        fontSize: baseFontSize - fontScale + "px",
                        lineHeight: 1.375,
                        daySize: baseSpacing * 8 / 7 + "px",
                        slideDuration: "0.2s"
                    },
                    medium: {
                        fontSize: baseFontSize + "px",
                        lineHeight: 1.45,
                        daySize: baseSpacing * 16 / 7 + "px",
                        slideDuration: "0.5s"
                    },
                    large: {
                        fontSize: baseFontSize + 3 * fontScale + "px",
                        lineHeight: 1.11,
                        daySize: baseSpacing * 32 / 7 + "px",
                        slideDuration: "0.8s"
                    },
                    icons: {
                        previous: Previous.L,
                        next: Next.o,
                        small: {
                            previous: FormPrevious.x,
                            next: FormNext.M
                        }
                    },
                    heading: {
                        level: "4"
                    }
                },
                card: {
                    container: {
                        round: "small",
                        elevation: "small"
                    },
                    header: {},
                    body: {},
                    footer: {}
                },
                carousel: {
                    icons: {
                        current: Subtract.L,
                        next: Next.o,
                        previous: Previous.L
                    },
                    animation: {
                        duration: 1e3
                    },
                    disabled: {
                        icons: {}
                    }
                },
                chart: {
                    color: "graph-0"
                },
                checkBox: {
                    border: {
                        color: {
                            dark: "rgba(255, 255, 255, 0.5)",
                            light: "rgba(0, 0, 0, 0.15)"
                        },
                        width: "2px"
                    },
                    check: {
                        radius: "4px",
                        thickness: "4px"
                    },
                    hover: {
                        border: {
                            color: {
                                dark: "white",
                                light: "black"
                            }
                        }
                    },
                    icon: {},
                    icons: {},
                    size: baseSpacing + "px",
                    toggle: {
                        color: {
                            dark: "#d9d9d9",
                            light: "#d9d9d9"
                        },
                        knob: {},
                        radius: baseSpacing + "px",
                        size: baseSpacing * 2 + "px"
                    }
                },
                checkBoxGroup: {},
                clock: {
                    analog: {
                        hour: {
                            color: {
                                dark: "light-2",
                                light: "dark-3"
                            },
                            width: baseSpacing / 3 + "px",
                            size: baseSpacing + "px",
                            shape: "round"
                        },
                        minute: {
                            color: {
                                dark: "light-4",
                                light: "dark-3"
                            },
                            width: baseSpacing / 6 + "px",
                            size: Math.round(baseSpacing / 2) + "px",
                            shape: "round"
                        },
                        second: {
                            color: {
                                dark: "accent-1",
                                light: "accent-1"
                            },
                            width: baseSpacing / 8 + "px",
                            size: Math.round(baseSpacing / 2.666) + "px",
                            shape: "round"
                        },
                        size: {
                            xsmall: baseSpacing * 2 + "px",
                            small: baseSpacing * 3 + "px",
                            medium: baseSpacing * 4 + "px",
                            large: baseSpacing * 6 + "px",
                            xlarge: baseSpacing * 9 + "px",
                            xxlarge: baseSpacing * 12 + "px",
                            huge: baseSpacing * 12 + "px"
                        }
                    },
                    digital: {
                        text: {
                            xsmall: {
                                size: baseFontSize - 2 * fontScale + "px",
                                height: 1.5
                            },
                            small: {
                                size: baseFontSize - fontScale + "px",
                                height: 1.43
                            },
                            medium: {
                                size: baseFontSize + "px",
                                height: 1.375
                            },
                            large: {
                                size: baseFontSize + fontScale + "px",
                                height: 1.167
                            },
                            xlarge: {
                                size: baseFontSize + 2 * fontScale + "px",
                                height: 1.1875
                            },
                            xxlarge: {
                                size: baseFontSize + 4 * fontScale + "px",
                                height: 1.125
                            }
                        }
                    }
                },
                collapsible: {
                    minSpeed: 200,
                    baseline: 500
                },
                dateInput: {},
                dataTable: {
                    groupHeader: {
                        background: {
                            dark: "dark-2",
                            light: "light-2"
                        },
                        border: {
                            side: "bottom",
                            size: "xsmall"
                        },
                        pad: {
                            horizontal: "small",
                            vertical: "xsmall"
                        }
                    },
                    groupEnd: {
                        border: {
                            side: "bottom",
                            size: "xsmall"
                        }
                    },
                    header: {
                        gap: "small",
                        units: {
                            color: "text-xweak",
                            margin: {
                                left: "xsmall"
                            }
                        }
                    },
                    icons: {
                        ascending: FormDown.I,
                        contract: FormUp.R,
                        descending: FormUp.R,
                        expand: FormDown.I
                    },
                    primary: {
                        weight: "bold"
                    },
                    resize: {
                        border: {
                            color: "border",
                            side: "end"
                        }
                    }
                },
                diagram: {
                    line: {
                        color: "graph-0"
                    }
                },
                formField: {
                    border: {
                        color: "border",
                        error: {
                            color: {
                                dark: "white",
                                light: "status-critical"
                            }
                        },
                        position: "inner",
                        side: "bottom"
                    },
                    content: {
                        pad: "small"
                    },
                    disabled: {
                        background: {
                            color: "status-disabled",
                            opacity: "medium"
                        }
                    },
                    error: {
                        color: "status-critical",
                        margin: {
                            vertical: "xsmall",
                            horizontal: "small"
                        }
                    },
                    help: {
                        color: "dark-3",
                        margin: {
                            start: "small"
                        }
                    },
                    info: {
                        color: "text-xweak",
                        margin: {
                            vertical: "xsmall",
                            horizontal: "small"
                        }
                    },
                    label: {
                        margin: {
                            vertical: "xsmall",
                            horizontal: "small"
                        }
                    },
                    margin: {
                        bottom: "small"
                    }
                },
                grommet: {},
                heading: {
                    font: {},
                    level: {
                        1: {
                            font: {},
                            small: base_extends({}, fontSizing(4)),
                            medium: base_extends({}, fontSizing(8)),
                            large: base_extends({}, fontSizing(16)),
                            xlarge: base_extends({}, fontSizing(24))
                        },
                        2: {
                            font: {},
                            small: base_extends({}, fontSizing(2)),
                            medium: base_extends({}, fontSizing(4)),
                            large: base_extends({}, fontSizing(8)),
                            xlarge: base_extends({}, fontSizing(12))
                        },
                        3: {
                            font: {},
                            small: base_extends({}, fontSizing(1)),
                            medium: base_extends({}, fontSizing(2)),
                            large: base_extends({}, fontSizing(4)),
                            xlarge: base_extends({}, fontSizing(6))
                        },
                        4: {
                            font: {},
                            small: base_extends({}, fontSizing(0)),
                            medium: base_extends({}, fontSizing(0)),
                            large: base_extends({}, fontSizing(0)),
                            xlarge: base_extends({}, fontSizing(0))
                        },
                        5: {
                            font: {},
                            small: base_extends({}, fontSizing(-.5)),
                            medium: base_extends({}, fontSizing(-.5)),
                            large: base_extends({}, fontSizing(-.5)),
                            xlarge: base_extends({}, fontSizing(-.5))
                        },
                        6: {
                            font: {},
                            small: base_extends({}, fontSizing(-1)),
                            medium: base_extends({}, fontSizing(-1)),
                            large: base_extends({}, fontSizing(-1)),
                            xlarge: base_extends({}, fontSizing(-1))
                        }
                    },
                    responsiveBreakpoint: "small",
                    weight: 600
                },
                layer: {
                    background: {
                        dark: "black",
                        light: "white"
                    },
                    border: {
                        radius: "4px"
                    },
                    container: {
                        zIndex: "20"
                    },
                    overlay: {
                        background: "rgba(0, 0, 0, 0.5)"
                    },
                    responsiveBreakpoint: "small",
                    zIndex: "20"
                },
                list: {
                    item: {
                        border: "horizontal",
                        pad: {
                            horizontal: "medium",
                            vertical: "small"
                        }
                    }
                },
                maskedInput: {},
                menu: {
                    icons: {
                        down: FormDown.I
                    }
                },
                meter: {
                    color: "graph-0"
                },
                paragraph: {
                    font: {},
                    small: base_extends({}, fontSizing(-1)),
                    medium: base_extends({}, fontSizing(0)),
                    large: base_extends({}, fontSizing(1)),
                    xlarge: base_extends({}, fontSizing(2)),
                    xxlarge: base_extends({}, fontSizing(4))
                },
                radioButton: {
                    border: {
                        color: {
                            dark: "rgba(255, 255, 255, 0.5)",
                            light: "rgba(0, 0, 0, 0.15)"
                        },
                        width: "2px"
                    },
                    check: {
                        radius: "100%"
                    },
                    hover: {
                        border: {
                            color: {
                                dark: "white",
                                light: "black"
                            }
                        }
                    },
                    icon: {},
                    icons: {},
                    gap: "small",
                    size: baseSpacing + "px",
                    font: {},
                    container: {}
                },
                radioButtonGroup: {},
                rangeInput: {
                    track: {
                        height: "4px",
                        color: "border"
                    },
                    thumb: {}
                },
                rangeSelector: {
                    background: {
                        invert: {
                            color: "light-4"
                        }
                    }
                },
                select: {
                    clear: {
                        container: {
                            pad: "small",
                            background: "background-contrast"
                        },
                        text: {
                            color: "text-weak"
                        }
                    },
                    container: {},
                    control: {},
                    icons: {
                        margin: {
                            horizontal: "small"
                        },
                        down: FormDown.I
                    },
                    options: {
                        container: {
                            align: "start",
                            pad: "small"
                        },
                        text: {
                            margin: "none"
                        }
                    },
                    step: 20
                },
                skipLinks: {
                    position: "top",
                    container: {
                        elevation: "large",
                        round: "small",
                        pad: "medium"
                    },
                    label: {
                        margin: {
                            bottom: "medium"
                        },
                        size: "medium"
                    }
                },
                tab: {
                    active: {
                        color: "text"
                    },
                    border: {
                        side: "bottom",
                        size: "small",
                        color: {
                            dark: "accent-1",
                            light: "brand"
                        },
                        active: {
                            color: {
                                dark: "white",
                                light: "black"
                            }
                        },
                        disabled: {},
                        hover: {
                            color: {
                                dark: "white",
                                light: "black"
                            }
                        }
                    },
                    color: "control",
                    hover: {
                        color: {
                            dark: "white",
                            light: "black"
                        }
                    },
                    margin: {
                        vertical: "xxsmall",
                        horizontal: "small"
                    },
                    pad: {
                        bottom: "xsmall"
                    }
                },
                tabs: {
                    header: {},
                    panel: {}
                },
                table: {
                    header: {
                        align: "start",
                        pad: {
                            horizontal: "small",
                            vertical: "xsmall"
                        },
                        border: "bottom"
                    },
                    body: {
                        align: "start",
                        pad: {
                            horizontal: "small",
                            vertical: "xsmall"
                        }
                    },
                    footer: {
                        align: "start",
                        pad: {
                            horizontal: "small",
                            vertical: "xsmall"
                        },
                        border: "top"
                    }
                },
                text: {
                    font: {},
                    xsmall: base_extends({}, fontSizing(-1.5)),
                    small: base_extends({}, fontSizing(-1)),
                    medium: base_extends({}, fontSizing(0)),
                    large: base_extends({}, fontSizing(1)),
                    xlarge: base_extends({}, fontSizing(2)),
                    xxlarge: base_extends({}, fontSizing(4)),
                    "2xl": base_extends({}, fontSizing(4)),
                    "3xl": base_extends({}, fontSizing(6)),
                    "4xl": base_extends({}, fontSizing(9)),
                    "5xl": base_extends({}, fontSizing(13)),
                    "6xl": base_extends({}, fontSizing(18))
                },
                textArea: {},
                textInput: {},
                tip: {
                    content: {
                        background: "background-contrast",
                        elevation: "small",
                        margin: "xsmall",
                        pad: {
                            vertical: "xsmall",
                            horizontal: "small"
                        },
                        round: "small"
                    },
                    drop: {
                        align: {
                            top: "bottom"
                        }
                    }
                },
                video: {
                    captions: {
                        background: "rgba(0, 0, 0, 0.7)"
                    },
                    icons: {
                        closedCaption: ClosedCaption.V,
                        configure: icons_Actions.e,
                        fullScreen: Expand.M,
                        pause: Pause.d,
                        play: Play.s,
                        reduceVolume: VolumeLow.t,
                        volume: Volume.f
                    },
                    scrubber: {
                        color: "light-4"
                    }
                },
                worldMap: {
                    color: "light-3",
                    continent: {
                        active: "8px",
                        base: "6px"
                    },
                    hover: {
                        color: "light-4"
                    },
                    place: {
                        active: "20px",
                        base: "8px"
                    }
                }
            });
            return deepFreeze(result);
        };
        var base_base = generate(24);
        var baseStyle = (0, styled_components_browser_esm.css)([ "font-family:", ";font-size:", ";line-height:", ";font-weight:", ";", " box-sizing:border-box;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;" ], (function(props) {
            return props.theme.global.font.family;
        }), (function(props) {
            return props.theme.global.font.size;
        }), (function(props) {
            return props.theme.global.font.height;
        }), (function(props) {
            return props.theme.global.font.weight;
        }), (function(props) {
            return !props.plain && backgroundStyle(props.theme.baseBackground, props.theme);
        }));
        var controlBorderStyle = (0, styled_components_browser_esm.css)([ "border:", " solid ", ";border-radius:", ";" ], (function(props) {
            return props.theme.global.control.border.width;
        }), (function(props) {
            return colors_normalizeColor(props.theme.global.control.border.color || "border", props.theme);
        }), (function(props) {
            return props.theme.global.control.border.radius;
        }));
        var edgeStyle = function edgeStyle(kind, data, responsive, responsiveBreakpoint, theme) {
            var breakpoint = responsiveBreakpoint && theme.global.breakpoints[responsiveBreakpoint];
            if (typeof data === "string") {
                return (0, styled_components_browser_esm.css)([ "", ":", ";", ";" ], kind, theme.global.edgeSize[data] || data, responsive && breakpoint ? breakpointStyle(breakpoint, "\n        " + kind + ": " + (breakpoint.edgeSize[data] || data) + ";\n      ") : "");
            }
            var result = [];
            var horizontal = data.horizontal, vertical = data.vertical, top = data.top, bottom = data.bottom, left = data.left, right = data.right;
            var horizontalVerticalEqual = horizontal && vertical && horizontal === vertical;
            var allSidesEqual = top && bottom && left && right && top === bottom === left === right;
            if (horizontalVerticalEqual || allSidesEqual) {
                var value = horizontalVerticalEqual ? horizontal : top;
                return (0, styled_components_browser_esm.css)([ "", ":", ";", ";" ], kind, theme.global.edgeSize[value] || value, responsive && breakpoint ? breakpointStyle(breakpoint, "\n        " + kind + ": " + (breakpoint.edgeSize[value] || value) + ";\n      ") : "");
            }
            if (horizontal) {
                result.push((0, styled_components_browser_esm.css)([ "", "-left:", ";", "-right:", ";", ";" ], kind, theme.global.edgeSize[horizontal] || horizontal, kind, theme.global.edgeSize[horizontal] || horizontal, responsive && breakpoint ? breakpointStyle(breakpoint, "\n          " + kind + "-left: " + (breakpoint.edgeSize[horizontal] || horizontal) + ";\n          " + kind + "-right: " + (breakpoint.edgeSize[horizontal] || horizontal) + ";\n        ") : ""));
            }
            if (vertical) {
                result.push((0, styled_components_browser_esm.css)([ "", "-top:", ";", "-bottom:", ";", ";" ], kind, theme.global.edgeSize[vertical] || vertical, kind, theme.global.edgeSize[vertical] || vertical, responsive && breakpoint ? breakpointStyle(breakpoint, "\n          " + kind + "-top: " + (breakpoint.edgeSize[vertical] || vertical) + ";\n          " + kind + "-bottom: " + (breakpoint.edgeSize[vertical] || vertical) + ";\n        ") : ""));
            }
            if (top) {
                result.push((0, styled_components_browser_esm.css)([ "", "-top:", ";", ";" ], kind, theme.global.edgeSize[top] || top, responsive && breakpoint ? breakpointStyle(breakpoint, "\n          " + kind + "-top: " + (breakpoint.edgeSize[top] || top) + ";\n        ") : ""));
            }
            if (bottom) {
                result.push((0, styled_components_browser_esm.css)([ "", "-bottom:", ";", ";" ], kind, theme.global.edgeSize[bottom] || bottom, responsive && breakpoint ? breakpointStyle(breakpoint, "\n          " + kind + "-bottom: " + (breakpoint.edgeSize[bottom] || bottom) + ";\n        ") : ""));
            }
            if (left) {
                result.push((0, styled_components_browser_esm.css)([ "", "-left:", ";", ";" ], kind, theme.global.edgeSize[left] || left, responsive && breakpoint ? breakpointStyle(breakpoint, "\n          " + kind + "-left: " + (breakpoint.edgeSize[left] || left) + ";\n        ") : ""));
            }
            if (right) {
                result.push((0, styled_components_browser_esm.css)([ "", "-right:", ";", ";" ], kind, theme.global.edgeSize[right] || right, responsive && breakpoint ? breakpointStyle(breakpoint, "\n          " + kind + "-right: " + (breakpoint.edgeSize[right] || right) + ";\n        ") : ""));
            }
            if (data.start) {
                result.push((0, styled_components_browser_esm.css)([ "", "-inline-start:", ";", ";" ], kind, theme.global.edgeSize[data.start] || data.start, responsive && breakpoint ? breakpointStyle(breakpoint, "\n          " + kind + "-inline-start: " + (breakpoint.edgeSize[data.start] || data.start) + ";\n        ") : ""));
            }
            if (data.end) {
                result.push((0, styled_components_browser_esm.css)([ "", "-inline-end:", ";", ";" ], kind, theme.global.edgeSize[data.end] || data.end, responsive && breakpoint ? breakpointStyle(breakpoint, "\n          " + kind + "-inline-end: " + (breakpoint.edgeSize[data.end] || data.end) + ";\n        ") : ""));
            }
            return result;
        };
        var fillStyle = function fillStyle(fillProp) {
            if (fillProp === "horizontal") {
                return "width: 100%;";
            }
            if (fillProp === "vertical") {
                return "height: 100%;";
            }
            if (fillProp) {
                return "\n      width: 100%;\n      height: 100%;\n    ";
            }
            return undefined;
        };
        var focusStyles = function focusStyles(props, _temp) {
            var _ref = _temp === void 0 ? {} : _temp, forceOutline = _ref.forceOutline, justBorder = _ref.justBorder;
            var focus = props.theme.global.focus;
            if (!focus || forceOutline && !focus.outline) {
                var color = colors_normalizeColor("focus", props.theme);
                if (color) return "outline: 2px solid " + color + ";";
                return "";
            }
            if (focus.outline && (!focus.border || !justBorder)) {
                if (typeof focus.outline === "object") {
                    var _color = colors_normalizeColor(focus.outline.color || "focus", props.theme);
                    var size = focus.outline.size || "2px";
                    return "\n        outline-offset: 0px;\n        outline: " + size + " solid " + _color + ";\n      ";
                }
                return "outline: " + focus.outline + ";";
            }
            if (focus.shadow && (!focus.border || !justBorder)) {
                if (typeof focus.shadow === "object") {
                    var _color2 = colors_normalizeColor(focus.border && focus.border.color || focus.shadow.color || "focus", props.theme);
                    var _size = focus.shadow.size || "2px";
                    return "\n        outline: none;\n        box-shadow: 0 0 " + _size + " " + _size + " " + _color2 + ";\n      ";
                }
                return "\n      outline: none;\n      box-shadow: " + focus.shadow + ";\n    ";
            }
            if (focus.border) {
                var _color3 = colors_normalizeColor(focus.border.color || "focus", props.theme);
                return "\n      outline: none;\n      border-color: " + _color3 + ";\n    ";
            }
            return "";
        };
        var unfocusStyles = function unfocusStyles(props, _temp2) {
            var _ref2 = _temp2 === void 0 ? {} : _temp2, forceOutline = _ref2.forceOutline, justBorder = _ref2.justBorder;
            var focus = props.theme.global.focus;
            if (!focus || forceOutline && !focus.outline) {
                var color = normalizeColor("focus", props.theme);
                if (color) return "outline: none;";
                return "";
            }
            if (focus.outline && (!focus.border || !justBorder)) {
                if (typeof focus.outline === "object") {
                    return "\n        outline-offset: 0px;\n        outline: none;\n      ";
                }
                return "outline: none;";
            }
            if (focus.shadow && (!focus.border || !justBorder)) {
                if (typeof focus.shadow === "object") {
                    return "\n        outline: none;\n        box-shadow: none;\n      ";
                }
                return "\n      outline: none;\n      box-shadow: none;\n    ";
            }
            if (focus.border) {
                return "\n      outline: none;\n      border-color: none;\n    ";
            }
            return "";
        };
        var focusStyle = function focusStyle(_temp3) {
            var _ref3 = _temp3 === void 0 ? {} : _temp3, forceOutline = _ref3.forceOutline, justBorder = _ref3.justBorder, skipSvgChildren = _ref3.skipSvgChildren;
            return (0, styled_components_browser_esm.css)([ "", " ", " ", "" ], (function(props) {
                return !skipSvgChildren && "\n  > circle,\n  > ellipse,\n  > line,\n  > path,\n  > polygon,\n  > polyline,\n  > rect {\n    " + focusStyles(props) + "\n  }";
            }), (function(props) {
                return focusStyles(props, {
                    forceOutline,
                    justBorder
                });
            }), !forceOutline && "\n  ::-moz-focus-inner {\n    border: 0;\n  }\n  ");
        };
        var unfocusStyle = function unfocusStyle(_temp4) {
            var _ref4 = _temp4 === void 0 ? {} : _temp4, forceOutline = _ref4.forceOutline, justBorder = _ref4.justBorder, skipSvgChildren = _ref4.skipSvgChildren;
            return css([ "", " ", " ", "" ], (function(props) {
                return !skipSvgChildren && "\n  > circle,\n  > ellipse,\n  > line,\n  > path,\n  > polygon,\n  > polyline,\n  > rect {\n    " + unfocusStyles(props) + "\n  }";
            }), (function(props) {
                return unfocusStyles(props, {
                    forceOutline,
                    justBorder
                });
            }), !forceOutline && "\n  ::-moz-focus-inner {\n    border: 0;\n  }\n  ");
        };
        var adjustPad = function adjustPad(props, value) {
            return parseMetricToNum((props.theme.global.edgeSize[value] || value) + "px") + parseMetricToNum(props.theme.global.control.border.width + "px") + "px";
        };
        var getInputPadBySide = function getInputPadBySide(props, side) {
            if (typeof props.theme.global.input.padding !== "object") {
                var _adjustedPad = adjustPad(props, props.theme.global.input.padding);
                return _adjustedPad;
            }
            var orientation;
            if (side === "left" || side === "right") orientation = "horizontal"; else if (side === "top" || side === "bottom") orientation = "vertical"; else orientation = undefined;
            var pad = props.theme.global.input.padding[side] || props.theme.global.input.padding[orientation];
            var adjustedPad = adjustPad(props, pad);
            return adjustedPad;
        };
        var placeholderColor = (0, styled_components_browser_esm.css)([ "color:", ";" ], (function(props) {
            return colors_normalizeColor(props.theme.global.colors.placeholder, props.theme);
        }));
        var placeholderStyle = (0, styled_components_browser_esm.css)([ "&::-webkit-input-placeholder{", ";}&::-moz-placeholder{", ";}&:-ms-input-placeholder{", ";}" ], placeholderColor, placeholderColor, placeholderColor);
        var inputSizeStyle = function inputSizeStyle(props) {
            var data = props.theme.text[props.size];
            return (0, styled_components_browser_esm.css)([ "font-size:", ";line-height:", ";" ], data.size, data.height);
        };
        var inputStyle = (0, styled_components_browser_esm.css)([ "box-sizing:border-box;", " font-family:inherit;border:none;-webkit-appearance:none;background:transparent;color:inherit;width:100%;", " ", " ", " margin:0;", " ", ";", " ", "::-webkit-search-decoration{-webkit-appearance:none;}&::-moz-focus-inner{border:none;outline:none;}&:-moz-placeholder,&::-moz-placeholder{opacity:1;}", "" ], (function(props) {
            return "font-size: " + (props.theme.global.input.font.size ? props.theme.text[props.theme.global.input.font.size].size || props.theme.global.input.font.size : "inherit") + ";";
        }), (function(props) {
            return props.theme.global.input.font.height && "line-height: " + props.theme.global.input.font.height + ";";
        }), (function(props) {
            return props.theme.global.input.padding && typeof props.theme.global.input.padding !== "object" ? "padding: " + (parseMetricToNum(props.theme.global.edgeSize[props.theme.global.input.padding] || props.theme.global.input.padding) - parseMetricToNum(props.theme.global.control.border.width)) + "px;" : edgeStyle("padding", props.theme.global.input.padding, props.responsive, props.theme.box.responsiveBreakpoint, props.theme);
        }), (function(props) {
            return (props.theme.global.input.weight || props.theme.global.input.font.weight) && (0, 
            styled_components_browser_esm.css)([ "font-weight:", ";" ], props.theme.global.input.weight || props.theme.global.input.font.weight);
        }), (function(props) {
            return props.size && inputSizeStyle(props);
        }), (function(props) {
            return props.focus && !props.plain && focusStyle();
        }), controlBorderStyle, placeholderStyle, (function(props) {
            return props.theme.global.input.extend;
        }));
        var overflowStyle = function overflowStyle(overflowProp) {
            if (typeof overflowProp === "string") {
                return (0, styled_components_browser_esm.css)([ "overflow:", ";" ], overflowProp);
            }
            return (0, styled_components_browser_esm.css)([ "", " ", ";" ], overflowProp.horizontal && "overflow-x: " + overflowProp.horizontal + ";", overflowProp.vertical && "overflow-y: " + overflowProp.vertical + ";");
        };
        var ALIGN_SELF_MAP = {
            center: "center",
            end: "flex-end",
            start: "flex-start",
            stretch: "stretch"
        };
        var genericStyles = (0, styled_components_browser_esm.css)([ "", " ", " ", "" ], (function(props) {
            return props.alignSelf && "align-self: " + ALIGN_SELF_MAP[props.alignSelf] + ";";
        }), (function(props) {
            return props.gridArea && "grid-area: " + props.gridArea + ";";
        }), (function(props) {
            return props.margin && props.theme.global && edgeStyle("margin", props.margin, props.responsive, props.theme.global.edgeSize.responsiveBreakpoint, props.theme);
        }));
        var disabledStyle = function disabledStyle(componentStyle) {
            return (0, styled_components_browser_esm.css)([ "opacity:", ";cursor:default;" ], (function(props) {
                return componentStyle || props.theme.global.control.disabled.opacity;
            }));
        };
        var sizeStyle = function sizeStyle(name, value, theme) {
            return (0, styled_components_browser_esm.css)([ "", ":", ";" ], name, theme.global.size[value] || value);
        };
        var plainInputStyle = (0, styled_components_browser_esm.css)([ "outline:none;border:none;" ]);
        var kindPartStyles = function kindPartStyles(obj, theme, colorValue) {
            var styles = [];
            if (obj.padding || obj.pad) {
                var pad = obj.padding || obj.pad;
                if (pad.vertical || pad.horizontal) styles.push("padding: " + (theme.global.edgeSize[pad.vertical] || pad.vertical || 0) + " " + (theme.global.edgeSize[pad.horizontal] || pad.horizontal || 0) + ";"); else styles.push("padding: " + (theme.global.edgeSize[pad] || pad || 0) + ";");
            }
            if (obj.background) styles.push(backgroundStyle(colorValue || obj.background, theme, obj.color || (Object.prototype.hasOwnProperty.call(obj, "color") && obj.color === undefined ? false : undefined))); else if (obj.color) styles.push("color: " + colors_normalizeColor(obj.color, theme) + ";");
            if (obj.border) {
                if (obj.border.width) styles.push((0, styled_components_browser_esm.css)([ "border-style:solid;border-width:", ";" ], obj.border.width));
                if (obj.border.color) styles.push((0, styled_components_browser_esm.css)([ "border-color:", ";" ], colors_normalizeColor(!obj.background && colorValue || obj.border.color || "border", theme)));
                if (obj.border.radius) styles.push((0, styled_components_browser_esm.css)([ "border-radius:", ";" ], obj.border.radius));
            } else if (obj.border === false) styles.push("border: none;");
            if (colorValue && !obj.border && !obj.background) styles.push("color: " + colors_normalizeColor(colorValue, theme) + ";");
            if (obj.font) {
                if (obj.font.size) {
                    styles.push("font-size: " + (theme.text[obj.font.size].size || obj.font.size) + ";");
                }
                if (obj.font.height) {
                    styles.push("line-height: " + obj.font.height + ";");
                }
                if (obj.font.weight) {
                    styles.push("font-weight: " + obj.font.weight + ";");
                }
            }
            if (obj.opacity) {
                var opacity = obj.opacity === true ? theme.global.opacity.medium : theme.global.opacity[obj.opacity] || obj.opacity;
                styles.push("opacity: " + opacity + ";");
            }
            if (obj.extend) styles.push(obj.extend);
            return styles;
        };
        var TEXT_ALIGN_MAP = {
            center: "center",
            end: "right",
            start: "left"
        };
        var textAlignStyle = (0, styled_components_browser_esm.css)([ "text-align:", ";" ], (function(props) {
            return TEXT_ALIGN_MAP[props.textAlign];
        }));
        var default_props_defaultProps = {
            theme: base_base
        };
        var extendDefaultTheme = function extendDefaultTheme(theme) {
            default_props_defaultProps.theme = deepMerge(base, theme);
        };
        var fullStyle = (0, styled_components_browser_esm.css)([ "width:100vw;height:100vh;overflow:auto;" ]);
        var StyledGrommet = styled_components_browser_esm.default.div.withConfig({
            displayName: "StyledGrommet",
            componentId: "sc-19lkkz7-0"
        })([ "", " ", " ", " ", " ", "" ], (function(props) {
            return !props.plain && baseStyle;
        }), (function(props) {
            return props.full && fullStyle;
        }), (function(props) {
            return props.theme.global.font.face;
        }), (function(props) {
            return props.theme.grommet.extend;
        }), (function(props) {
            return props.cssVars && Object.keys(props.theme.global.colors).filter((function(k) {
                return typeof props.theme.global.colors[k] === "string";
            })).map((function(k) {
                return "--" + k + ": " + props.theme.global.colors[k] + ";";
            })).join("\n");
        }));
        StyledGrommet.defaultProps = {};
        Object.setPrototypeOf(StyledGrommet.defaultProps, default_props_defaultProps);
        function Grommet_extends() {
            Grommet_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return Grommet_extends.apply(this, arguments);
        }
        function _objectWithoutPropertiesLoose(source, excluded) {
            if (source == null) return {};
            var target = {};
            var sourceKeys = Object.keys(source);
            var key, i;
            for (i = 0; i < sourceKeys.length; i++) {
                key = sourceKeys[i];
                if (excluded.indexOf(key) >= 0) continue;
                target[key] = source[key];
            }
            return target;
        }
        function Grommet_assertThisInitialized(self) {
            if (self === void 0) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return self;
        }
        function Grommet_inheritsLoose(subClass, superClass) {
            subClass.prototype = Object.create(superClass.prototype);
            subClass.prototype.constructor = subClass;
            subClass.__proto__ = superClass;
        }
        function Grommet_defineProperty(obj, key, value) {
            if (key in obj) {
                Object.defineProperty(obj, key, {
                    value,
                    enumerable: true,
                    configurable: true,
                    writable: true
                });
            } else {
                obj[key] = value;
            }
            return obj;
        }
        function Grommet_templateObject() {
            var data = Grommet_taggedTemplateLiteralLoose([ "\n  body { margin: 0; }\n" ]);
            Grommet_templateObject = function _templateObject() {
                return data;
            };
            return data;
        }
        function Grommet_taggedTemplateLiteralLoose(strings, raw) {
            if (!raw) {
                raw = strings.slice(0);
            }
            strings.raw = raw;
            return strings;
        }
        var FullGlobalStyle = (0, styled_components_browser_esm.createGlobalStyle)(Grommet_templateObject());
        var Grommet = function(_Component) {
            Grommet_inheritsLoose(Grommet, _Component);
            function Grommet() {
                var _this;
                for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
                    args[_key] = arguments[_key];
                }
                _this = _Component.call.apply(_Component, [ this ].concat(args)) || this;
                Grommet_defineProperty(Grommet_assertThisInitialized(_this), "state", {});
                Grommet_defineProperty(Grommet_assertThisInitialized(_this), "onResize", (function() {
                    var _this$state = _this.state, theme = _this$state.theme, responsive = _this$state.responsive;
                    var breakpoint;
                    if (!responsive) {
                        breakpoint = _this.deviceResponsive();
                    }
                    if (!breakpoint) breakpoint = getBreakpoint(window.innerWidth, theme);
                    if (breakpoint !== responsive) {
                        _this.setState({
                            responsive: breakpoint
                        });
                    }
                }));
                return _this;
            }
            Grommet.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
                var backgroundProp = nextProps.background, dir = nextProps.dir, _nextProps$theme = nextProps.theme, theme = _nextProps$theme === void 0 ? {} : _nextProps$theme, themeMode = nextProps.themeMode;
                var stateTheme = prevState.theme, themeProp = prevState.themeProp, themeModeProp = prevState.themeModeProp;
                var nextTheme = object_deepMerge(base_base, theme);
                if (!stateTheme || theme !== themeProp || themeMode !== themeModeProp) {
                    var themeBackground = nextTheme.global.colors.background;
                    nextTheme.dark = (themeMode || theme.defaultMode) === "dark";
                    var color = colors_normalizeColor(backgroundProp || themeBackground, nextTheme);
                    nextTheme.dark = backgroundIsDark(color, nextTheme);
                    nextTheme.baseBackground = backgroundProp || themeBackground;
                    if (dir) {
                        nextTheme.dir = dir;
                    }
                    return {
                        theme: nextTheme,
                        themeProp: theme,
                        themeModeProp: themeMode
                    };
                }
                return null;
            };
            var _proto = Grommet.prototype;
            _proto.componentDidMount = function componentDidMount() {
                window.addEventListener("resize", this.onResize);
                this.onResize();
            };
            _proto.componentWillUnmount = function componentWillUnmount() {
                window.removeEventListener("resize", this.onResize);
            };
            _proto.deviceResponsive = function deviceResponsive() {
                var userAgent = this.props.userAgent;
                var theme = this.state.theme;
                if (userAgent) {
                    if (/(tablet|ipad|playbook|silk)|(android(?!.*mobile))/i.test(userAgent)) {
                        return getDeviceBreakpoint("tablet", theme);
                    }
                    if (/Mobile|iPhone|Android/.test(userAgent)) {
                        return getDeviceBreakpoint("phone", theme);
                    }
                    return getDeviceBreakpoint("computer", theme);
                }
                return undefined;
            };
            _proto.render = function render() {
                var _this$props = this.props, children = _this$props.children, full = _this$props.full, _this$props$container = _this$props.containerTarget, containerTarget = _this$props$container === void 0 ? typeof document === "object" ? document.body : undefined : _this$props$container, rest = _objectWithoutPropertiesLoose(_this$props, [ "children", "full", "containerTarget" ]);
                delete rest.theme;
                var _this$state2 = this.state, theme = _this$state2.theme, stateResponsive = _this$state2.responsive;
                var responsive = stateResponsive || this.deviceResponsive() || theme.global.deviceBreakpoints.tablet;
                return react.createElement(styled_components_browser_esm.ThemeContext.Provider, {
                    value: theme
                }, react.createElement(ResponsiveContext.Provider, {
                    value: responsive
                }, react.createElement(ContainerTargetContext.Provider, {
                    value: containerTarget
                }, react.createElement(StyledGrommet, Grommet_extends({
                    full
                }, rest), children), full && react.createElement(FullGlobalStyle, null))));
            };
            return Grommet;
        }(react.Component);
        Grommet_defineProperty(Grommet, "displayName", "Grommet");
        var GrommetDoc;
        if (false) {}
        var GrommetWrapper = GrommetDoc || Grommet;
        var cloneDeep = __webpack_require__(356);
        var cloneDeep_default = __webpack_require__.n(cloneDeep);
        var primary = "#00AEEF";
        var secondary = "#2A506F";
        var tertiary = "#527699";
        var quartenary = "#DDE1f0";
        var danger = "#FF423D";
        var theme_warning = "#FCA321";
        var success = "#1AC135";
        var theme_info = "#1496E1";
        var theme_colors = {
            primary: {
                main: primary,
                semilight: "#aedff9",
                light: "#08bcff",
                dark: "#009dd7"
            },
            secondary: {
                main: secondary,
                semilight: "#abb9c5",
                light: "#2e587a",
                dark: "#23445e"
            },
            tertiary: {
                main: tertiary,
                light: "#5b82a7",
                semilight: "#bbc8d6",
                dark: "#456482"
            },
            quartenary: {
                main: quartenary,
                light: "#f8f9fd",
                dark: "#b7bed3"
            },
            danger: {
                main: danger,
                semilight: "#ffa1a1",
                light: "#feebeb",
                dark: "#eb0800"
            },
            warning: {
                main: theme_warning,
                semilight: "#fdd190",
                light: "#fef3e5",
                dark: "#ad6800"
            },
            success: {
                main: success,
                semilight: "#8ce09a",
                light: "#e8f8ea",
                dark: "#138b27"
            },
            info: {
                main: theme_info,
                semilight: "#90cbee",
                light: "#e8f5fc",
                dark: "#107dbc"
            },
            text: {
                main: "#2A506F",
                light: "#527699",
                dark: "#23445e"
            },
            statusIdle: {
                main: "#89c683"
            },
            statusConfiguring: {
                main: "#ffb25e"
            },
            statusUpdating: {
                main: "#75C5F5"
            },
            statusPostProvisioning: {
                main: "#aa96d5"
            },
            statusOffline: {
                main: "#fd7c7c"
            },
            statusInactive: {
                main: "#d3d6db"
            },
            gray: {
                main: "#c6c8c9",
                light: "#f4f4f4",
                dark: "#9f9f9f"
            }
        };
        var defaultControlHeight = 38;
        var emphasizedControlHeight = 48;
        var breakpoints = [ 576, 768, 992, 1200 ];
        var theme_space = [ 0, 4, 8, 16, defaultControlHeight, emphasizedControlHeight, 128 ];
        var fontSizes = [ 10, 12, 14, 16, 18, 24, 34, 58, 72 ];
        var weights = [ 400, 600 ];
        var radius = 3;
        var font = "'Source Sans Pro', Helvetica, sans-serif";
        var monospace = "'Ubuntu Mono', 'Courier New', monospace";
        var theme_lineHeight = 1.5;
        var header = {
            height: "0"
        };
        var theme = {
            breakpoints,
            space: theme_space,
            fontSizes,
            weights,
            font,
            monospace,
            lineHeight: theme_lineHeight,
            colors: theme_colors,
            radius,
            header,
            global: {
                font: {
                    family: font,
                    size: px(fontSizes[2]),
                    height: theme_lineHeight
                },
                control: {
                    disabled: {
                        opacity: .4
                    },
                    border: {
                        radius: "4px",
                        color: theme_colors.quartenary.main
                    }
                },
                colors: {
                    focus: theme_colors.primary.main,
                    placeholder: theme_colors.secondary.semilight
                },
                selected: {
                    background: theme_colors.primary.main
                },
                hover: {
                    background: {
                        color: theme_colors.quartenary.main,
                        opacity: 1
                    },
                    color: {
                        dark: "inherit",
                        light: "inherit"
                    }
                },
                active: {
                    background: {
                        color: theme_colors.quartenary.main,
                        opacity: 1
                    },
                    color: {
                        dark: "inherit",
                        light: "inherit"
                    }
                },
                drop: {
                    border: {
                        radius: "4px"
                    },
                    zIndex: 45,
                    extend: "\n\t\t\t\tcolor: " + theme_colors.secondary.main + "; border: 1px solid " + theme_colors.quartenary.main + ";\n\t\t\t\tanimation-duration: 0s;\n\t\t\t"
                },
                input: {
                    weight: 400
                }
            },
            button: {
                height: "38px",
                font: {
                    weight: 600,
                    size: px(fontSizes[2])
                },
                border: {
                    width: "1px",
                    radius: "20px",
                    color: theme_colors.text.main
                },
                padding: {
                    horizontal: "30px"
                }
            },
            navBar: {
                font: {
                    size: px(fontSizes[2])
                }
            },
            radioButton: {
                border: {
                    width: "1px",
                    color: {
                        dark: theme_colors.quartenary.main,
                        light: theme_colors.quartenary.main
                    }
                },
                hover: {
                    border: {
                        color: {
                            dark: theme_colors.tertiary.main,
                            light: theme_colors.tertiary.main
                        }
                    }
                },
                check: {
                    color: {
                        dark: "white",
                        light: "white"
                    }
                },
                icon: {
                    size: "12px"
                },
                gap: "10px",
                size: "20px"
            },
            select: {
                icons: {
                    color: theme_colors.secondary.main
                },
                control: {
                    extend: "color: " + theme_colors.secondary.main
                }
            },
            layer: {
                container: {
                    zIndex: 40
                },
                zIndex: 30
            },
            text: {
                medium: {
                    size: px(fontSizes[2]),
                    height: theme_lineHeight
                }
            },
            tab: {
                extend: "padding: " + px(theme_space[1]) + " " + px(theme_space[3]),
                color: theme_colors.secondary.main,
                margin: "none",
                border: {
                    size: "xsmall",
                    color: theme_colors.quartenary.main,
                    active: {
                        color: theme_colors.primary.main
                    },
                    hover: {
                        color: theme_colors.quartenary.main
                    }
                },
                hover: {
                    color: theme_colors.primary.dark
                },
                active: {
                    color: theme_colors.primary.main
                }
            },
            checkBox: {
                size: "20px",
                color: theme_colors.primary.main,
                border: {
                    color: {
                        dark: theme_colors.quartenary.main,
                        light: theme_colors.quartenary.main
                    },
                    width: "1px"
                },
                check: {
                    radius: "4px",
                    thickness: "2px"
                },
                hover: {
                    border: {
                        color: {
                            dark: theme_colors.quartenary.main,
                            light: theme_colors.quartenary.main
                        }
                    }
                },
                toggle: {
                    color: {
                        dark: theme_colors.primary.main,
                        light: theme_colors.quartenary.main
                    },
                    radius: "20px",
                    size: "40px",
                    knob: {}
                }
            },
            accordion: {
                border: {
                    side: "bottom"
                }
            },
            rating: {
                star: {
                    color: {
                        full: theme_colors.warning.main,
                        empty: theme_colors.quartenary.main
                    }
                }
            }
        };
        const dist_esm5_theme = theme;
        var normal = function(props) {
            var _a, _b;
            return (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.weights) === null || _b === void 0 ? void 0 : _b[0];
        };
        var bold = function(props) {
            var _a, _b;
            return (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.weights) === null || _b === void 0 ? void 0 : _b[1];
        };
        var styledUtils_px = function(n) {
            return typeof n === "number" ? n + "px" : n;
        };
        var styledUtils_monospace = function(props) {
            return props.monospace ? (0, styled_components_browser_esm.css)(styledUtils_templateObject_1 || (styledUtils_templateObject_1 = (0, 
            tslib_es6.__makeTemplateObject)([ "\n\t\t\t\tfont-family: ", ";\n\t\t  " ], [ "\n\t\t\t\tfont-family: ", ";\n\t\t  " ])), props.theme.monospace) : null;
        };
        var emphasized = function(props) {
            return (0, styled_components_browser_esm.css)(styledUtils_templateObject_2 || (styledUtils_templateObject_2 = (0, 
            tslib_es6.__makeTemplateObject)([ "\n\t\theight: ", ";\n\t" ], [ "\n\t\theight: ", ";\n\t" ])), styledUtils_px(props.emphasized ? props.theme.space[5] : props.theme.space[4]));
        };
        var styledUtils_templateObject_1, styledUtils_templateObject_2;
        var debounce = __webpack_require__(511);
        var debounce_default = __webpack_require__.n(debounce);
        var BreakpointContext = react.createContext({
            currentBreakpoint: 0
        });
        var BreakpointProvider = function(_a) {
            var breakpoints = _a.breakpoints, children = _a.children;
            var _b = react.useState(0), currentBreakpoint = _b[0], setCurrentBreakpoint = _b[1];
            react.useEffect((function() {
                if (!breakpoints || !breakpoints.length) {
                    return;
                }
                var handleResize = function() {
                    var clientWidth = window.innerWidth;
                    var breakpointIndex = breakpoints.findIndex((function(breakpoint) {
                        return clientWidth < breakpoint;
                    }));
                    var currentBreakpoint = breakpointIndex >= 0 ? breakpointIndex : breakpoints.length - 1;
                    setCurrentBreakpoint(currentBreakpoint);
                };
                var debouncedResize = debounce_default()(handleResize, 80);
                handleResize();
                window.addEventListener("resize", debouncedResize, {
                    passive: false
                });
                return function() {
                    window.removeEventListener("resize", debouncedResize);
                };
            }), [ breakpoints ]);
            return react.createElement(BreakpointContext.Provider, {
                value: {
                    currentBreakpoint
                }
            }, children);
        };
        BreakpointProvider.displayName = "BreakpointProvider";
        var react_side_effect_lib = __webpack_require__(484);
        var lib_default = __webpack_require__.n(react_side_effect_lib);
        var react_fast_compare = __webpack_require__(485);
        var react_fast_compare_default = __webpack_require__.n(react_fast_compare);
        var object_assign = __webpack_require__(287);
        var object_assign_default = __webpack_require__.n(object_assign);
        var ATTRIBUTE_NAMES = {
            BODY: "bodyAttributes",
            HTML: "htmlAttributes",
            TITLE: "titleAttributes"
        };
        var TAG_NAMES = {
            BASE: "base",
            BODY: "body",
            HEAD: "head",
            HTML: "html",
            LINK: "link",
            META: "meta",
            NOSCRIPT: "noscript",
            SCRIPT: "script",
            STYLE: "style",
            TITLE: "title"
        };
        var VALID_TAG_NAMES = Object.keys(TAG_NAMES).map((function(name) {
            return TAG_NAMES[name];
        }));
        var TAG_PROPERTIES = {
            CHARSET: "charset",
            CSS_TEXT: "cssText",
            HREF: "href",
            HTTPEQUIV: "http-equiv",
            INNER_HTML: "innerHTML",
            ITEM_PROP: "itemprop",
            NAME: "name",
            PROPERTY: "property",
            REL: "rel",
            SRC: "src",
            TARGET: "target"
        };
        var REACT_TAG_MAP = {
            accesskey: "accessKey",
            charset: "charSet",
            class: "className",
            contenteditable: "contentEditable",
            contextmenu: "contextMenu",
            "http-equiv": "httpEquiv",
            itemprop: "itemProp",
            tabindex: "tabIndex"
        };
        var HELMET_PROPS = {
            DEFAULT_TITLE: "defaultTitle",
            DEFER: "defer",
            ENCODE_SPECIAL_CHARACTERS: "encodeSpecialCharacters",
            ON_CHANGE_CLIENT_STATE: "onChangeClientState",
            TITLE_TEMPLATE: "titleTemplate"
        };
        var HTML_TAG_MAP = Object.keys(REACT_TAG_MAP).reduce((function(obj, key) {
            obj[REACT_TAG_MAP[key]] = key;
            return obj;
        }), {});
        var SELF_CLOSING_TAGS = [ TAG_NAMES.NOSCRIPT, TAG_NAMES.SCRIPT, TAG_NAMES.STYLE ];
        var HELMET_ATTRIBUTE = "data-react-helmet";
        var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
            return typeof obj;
        } : function(obj) {
            return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
        };
        var Helmet_classCallCheck = function(instance, Constructor) {
            if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
            }
        };
        var createClass = function() {
            function defineProperties(target, props) {
                for (var i = 0; i < props.length; i++) {
                    var descriptor = props[i];
                    descriptor.enumerable = descriptor.enumerable || false;
                    descriptor.configurable = true;
                    if ("value" in descriptor) descriptor.writable = true;
                    Object.defineProperty(target, descriptor.key, descriptor);
                }
            }
            return function(Constructor, protoProps, staticProps) {
                if (protoProps) defineProperties(Constructor.prototype, protoProps);
                if (staticProps) defineProperties(Constructor, staticProps);
                return Constructor;
            };
        }();
        var Helmet_extends = Object.assign || function(target) {
            for (var i = 1; i < arguments.length; i++) {
                var source = arguments[i];
                for (var key in source) {
                    if (Object.prototype.hasOwnProperty.call(source, key)) {
                        target[key] = source[key];
                    }
                }
            }
            return target;
        };
        var Helmet_inherits = function(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, {
                constructor: {
                    value: subClass,
                    enumerable: false,
                    writable: true,
                    configurable: true
                }
            });
            if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
        };
        var Helmet_objectWithoutProperties = function(obj, keys) {
            var target = {};
            for (var i in obj) {
                if (keys.indexOf(i) >= 0) continue;
                if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
                target[i] = obj[i];
            }
            return target;
        };
        var Helmet_possibleConstructorReturn = function(self, call) {
            if (!self) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self;
        };
        var encodeSpecialCharacters = function encodeSpecialCharacters(str) {
            var encode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
            if (encode === false) {
                return String(str);
            }
            return String(str).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;");
        };
        var getTitleFromPropsList = function getTitleFromPropsList(propsList) {
            var innermostTitle = getInnermostProperty(propsList, TAG_NAMES.TITLE);
            var innermostTemplate = getInnermostProperty(propsList, HELMET_PROPS.TITLE_TEMPLATE);
            if (innermostTemplate && innermostTitle) {
                return innermostTemplate.replace(/%s/g, (function() {
                    return Array.isArray(innermostTitle) ? innermostTitle.join("") : innermostTitle;
                }));
            }
            var innermostDefaultTitle = getInnermostProperty(propsList, HELMET_PROPS.DEFAULT_TITLE);
            return innermostTitle || innermostDefaultTitle || undefined;
        };
        var getOnChangeClientState = function getOnChangeClientState(propsList) {
            return getInnermostProperty(propsList, HELMET_PROPS.ON_CHANGE_CLIENT_STATE) || function() {};
        };
        var getAttributesFromPropsList = function getAttributesFromPropsList(tagType, propsList) {
            return propsList.filter((function(props) {
                return typeof props[tagType] !== "undefined";
            })).map((function(props) {
                return props[tagType];
            })).reduce((function(tagAttrs, current) {
                return Helmet_extends({}, tagAttrs, current);
            }), {});
        };
        var getBaseTagFromPropsList = function getBaseTagFromPropsList(primaryAttributes, propsList) {
            return propsList.filter((function(props) {
                return typeof props[TAG_NAMES.BASE] !== "undefined";
            })).map((function(props) {
                return props[TAG_NAMES.BASE];
            })).reverse().reduce((function(innermostBaseTag, tag) {
                if (!innermostBaseTag.length) {
                    var keys = Object.keys(tag);
                    for (var i = 0; i < keys.length; i++) {
                        var attributeKey = keys[i];
                        var lowerCaseAttributeKey = attributeKey.toLowerCase();
                        if (primaryAttributes.indexOf(lowerCaseAttributeKey) !== -1 && tag[lowerCaseAttributeKey]) {
                            return innermostBaseTag.concat(tag);
                        }
                    }
                }
                return innermostBaseTag;
            }), []);
        };
        var getTagsFromPropsList = function getTagsFromPropsList(tagName, primaryAttributes, propsList) {
            var approvedSeenTags = {};
            return propsList.filter((function(props) {
                if (Array.isArray(props[tagName])) {
                    return true;
                }
                if (typeof props[tagName] !== "undefined") {
                    warn("Helmet: " + tagName + ' should be of type "Array". Instead found type "' + _typeof(props[tagName]) + '"');
                }
                return false;
            })).map((function(props) {
                return props[tagName];
            })).reverse().reduce((function(approvedTags, instanceTags) {
                var instanceSeenTags = {};
                instanceTags.filter((function(tag) {
                    var primaryAttributeKey = void 0;
                    var keys = Object.keys(tag);
                    for (var i = 0; i < keys.length; i++) {
                        var attributeKey = keys[i];
                        var lowerCaseAttributeKey = attributeKey.toLowerCase();
                        if (primaryAttributes.indexOf(lowerCaseAttributeKey) !== -1 && !(primaryAttributeKey === TAG_PROPERTIES.REL && tag[primaryAttributeKey].toLowerCase() === "canonical") && !(lowerCaseAttributeKey === TAG_PROPERTIES.REL && tag[lowerCaseAttributeKey].toLowerCase() === "stylesheet")) {
                            primaryAttributeKey = lowerCaseAttributeKey;
                        }
                        if (primaryAttributes.indexOf(attributeKey) !== -1 && (attributeKey === TAG_PROPERTIES.INNER_HTML || attributeKey === TAG_PROPERTIES.CSS_TEXT || attributeKey === TAG_PROPERTIES.ITEM_PROP)) {
                            primaryAttributeKey = attributeKey;
                        }
                    }
                    if (!primaryAttributeKey || !tag[primaryAttributeKey]) {
                        return false;
                    }
                    var value = tag[primaryAttributeKey].toLowerCase();
                    if (!approvedSeenTags[primaryAttributeKey]) {
                        approvedSeenTags[primaryAttributeKey] = {};
                    }
                    if (!instanceSeenTags[primaryAttributeKey]) {
                        instanceSeenTags[primaryAttributeKey] = {};
                    }
                    if (!approvedSeenTags[primaryAttributeKey][value]) {
                        instanceSeenTags[primaryAttributeKey][value] = true;
                        return true;
                    }
                    return false;
                })).reverse().forEach((function(tag) {
                    return approvedTags.push(tag);
                }));
                var keys = Object.keys(instanceSeenTags);
                for (var i = 0; i < keys.length; i++) {
                    var attributeKey = keys[i];
                    var tagUnion = object_assign_default()({}, approvedSeenTags[attributeKey], instanceSeenTags[attributeKey]);
                    approvedSeenTags[attributeKey] = tagUnion;
                }
                return approvedTags;
            }), []).reverse();
        };
        var getInnermostProperty = function getInnermostProperty(propsList, property) {
            for (var i = propsList.length - 1; i >= 0; i--) {
                var props = propsList[i];
                if (props.hasOwnProperty(property)) {
                    return props[property];
                }
            }
            return null;
        };
        var reducePropsToState = function reducePropsToState(propsList) {
            return {
                baseTag: getBaseTagFromPropsList([ TAG_PROPERTIES.HREF, TAG_PROPERTIES.TARGET ], propsList),
                bodyAttributes: getAttributesFromPropsList(ATTRIBUTE_NAMES.BODY, propsList),
                defer: getInnermostProperty(propsList, HELMET_PROPS.DEFER),
                encode: getInnermostProperty(propsList, HELMET_PROPS.ENCODE_SPECIAL_CHARACTERS),
                htmlAttributes: getAttributesFromPropsList(ATTRIBUTE_NAMES.HTML, propsList),
                linkTags: getTagsFromPropsList(TAG_NAMES.LINK, [ TAG_PROPERTIES.REL, TAG_PROPERTIES.HREF ], propsList),
                metaTags: getTagsFromPropsList(TAG_NAMES.META, [ TAG_PROPERTIES.NAME, TAG_PROPERTIES.CHARSET, TAG_PROPERTIES.HTTPEQUIV, TAG_PROPERTIES.PROPERTY, TAG_PROPERTIES.ITEM_PROP ], propsList),
                noscriptTags: getTagsFromPropsList(TAG_NAMES.NOSCRIPT, [ TAG_PROPERTIES.INNER_HTML ], propsList),
                onChangeClientState: getOnChangeClientState(propsList),
                scriptTags: getTagsFromPropsList(TAG_NAMES.SCRIPT, [ TAG_PROPERTIES.SRC, TAG_PROPERTIES.INNER_HTML ], propsList),
                styleTags: getTagsFromPropsList(TAG_NAMES.STYLE, [ TAG_PROPERTIES.CSS_TEXT ], propsList),
                title: getTitleFromPropsList(propsList),
                titleAttributes: getAttributesFromPropsList(ATTRIBUTE_NAMES.TITLE, propsList)
            };
        };
        var rafPolyfill = function() {
            var clock = Date.now();
            return function(callback) {
                var currentTime = Date.now();
                if (currentTime - clock > 16) {
                    clock = currentTime;
                    callback(currentTime);
                } else {
                    setTimeout((function() {
                        rafPolyfill(callback);
                    }), 0);
                }
            };
        }();
        var cafPolyfill = function cafPolyfill(id) {
            return clearTimeout(id);
        };
        var requestAnimationFrame = typeof window !== "undefined" ? window.requestAnimationFrame && window.requestAnimationFrame.bind(window) || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || rafPolyfill : global.requestAnimationFrame || rafPolyfill;
        var cancelAnimationFrame = typeof window !== "undefined" ? window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || cafPolyfill : global.cancelAnimationFrame || cafPolyfill;
        var warn = function warn(msg) {
            return console && typeof console.warn === "function" && console.warn(msg);
        };
        var _helmetCallback = null;
        var handleClientStateChange = function handleClientStateChange(newState) {
            if (_helmetCallback) {
                cancelAnimationFrame(_helmetCallback);
            }
            if (newState.defer) {
                _helmetCallback = requestAnimationFrame((function() {
                    commitTagChanges(newState, (function() {
                        _helmetCallback = null;
                    }));
                }));
            } else {
                commitTagChanges(newState);
                _helmetCallback = null;
            }
        };
        var commitTagChanges = function commitTagChanges(newState, cb) {
            var baseTag = newState.baseTag, bodyAttributes = newState.bodyAttributes, htmlAttributes = newState.htmlAttributes, linkTags = newState.linkTags, metaTags = newState.metaTags, noscriptTags = newState.noscriptTags, onChangeClientState = newState.onChangeClientState, scriptTags = newState.scriptTags, styleTags = newState.styleTags, title = newState.title, titleAttributes = newState.titleAttributes;
            updateAttributes(TAG_NAMES.BODY, bodyAttributes);
            updateAttributes(TAG_NAMES.HTML, htmlAttributes);
            updateTitle(title, titleAttributes);
            var tagUpdates = {
                baseTag: updateTags(TAG_NAMES.BASE, baseTag),
                linkTags: updateTags(TAG_NAMES.LINK, linkTags),
                metaTags: updateTags(TAG_NAMES.META, metaTags),
                noscriptTags: updateTags(TAG_NAMES.NOSCRIPT, noscriptTags),
                scriptTags: updateTags(TAG_NAMES.SCRIPT, scriptTags),
                styleTags: updateTags(TAG_NAMES.STYLE, styleTags)
            };
            var addedTags = {};
            var removedTags = {};
            Object.keys(tagUpdates).forEach((function(tagType) {
                var _tagUpdates$tagType = tagUpdates[tagType], newTags = _tagUpdates$tagType.newTags, oldTags = _tagUpdates$tagType.oldTags;
                if (newTags.length) {
                    addedTags[tagType] = newTags;
                }
                if (oldTags.length) {
                    removedTags[tagType] = tagUpdates[tagType].oldTags;
                }
            }));
            cb && cb();
            onChangeClientState(newState, addedTags, removedTags);
        };
        var flattenArray = function flattenArray(possibleArray) {
            return Array.isArray(possibleArray) ? possibleArray.join("") : possibleArray;
        };
        var updateTitle = function updateTitle(title, attributes) {
            if (typeof title !== "undefined" && document.title !== title) {
                document.title = flattenArray(title);
            }
            updateAttributes(TAG_NAMES.TITLE, attributes);
        };
        var updateAttributes = function updateAttributes(tagName, attributes) {
            var elementTag = document.getElementsByTagName(tagName)[0];
            if (!elementTag) {
                return;
            }
            var helmetAttributeString = elementTag.getAttribute(HELMET_ATTRIBUTE);
            var helmetAttributes = helmetAttributeString ? helmetAttributeString.split(",") : [];
            var attributesToRemove = [].concat(helmetAttributes);
            var attributeKeys = Object.keys(attributes);
            for (var i = 0; i < attributeKeys.length; i++) {
                var attribute = attributeKeys[i];
                var value = attributes[attribute] || "";
                if (elementTag.getAttribute(attribute) !== value) {
                    elementTag.setAttribute(attribute, value);
                }
                if (helmetAttributes.indexOf(attribute) === -1) {
                    helmetAttributes.push(attribute);
                }
                var indexToSave = attributesToRemove.indexOf(attribute);
                if (indexToSave !== -1) {
                    attributesToRemove.splice(indexToSave, 1);
                }
            }
            for (var _i = attributesToRemove.length - 1; _i >= 0; _i--) {
                elementTag.removeAttribute(attributesToRemove[_i]);
            }
            if (helmetAttributes.length === attributesToRemove.length) {
                elementTag.removeAttribute(HELMET_ATTRIBUTE);
            } else if (elementTag.getAttribute(HELMET_ATTRIBUTE) !== attributeKeys.join(",")) {
                elementTag.setAttribute(HELMET_ATTRIBUTE, attributeKeys.join(","));
            }
        };
        var updateTags = function updateTags(type, tags) {
            var headElement = document.head || document.querySelector(TAG_NAMES.HEAD);
            var tagNodes = headElement.querySelectorAll(type + "[" + HELMET_ATTRIBUTE + "]");
            var oldTags = Array.prototype.slice.call(tagNodes);
            var newTags = [];
            var indexToDelete = void 0;
            if (tags && tags.length) {
                tags.forEach((function(tag) {
                    var newElement = document.createElement(type);
                    for (var attribute in tag) {
                        if (tag.hasOwnProperty(attribute)) {
                            if (attribute === TAG_PROPERTIES.INNER_HTML) {
                                newElement.innerHTML = tag.innerHTML;
                            } else if (attribute === TAG_PROPERTIES.CSS_TEXT) {
                                if (newElement.styleSheet) {
                                    newElement.styleSheet.cssText = tag.cssText;
                                } else {
                                    newElement.appendChild(document.createTextNode(tag.cssText));
                                }
                            } else {
                                var value = typeof tag[attribute] === "undefined" ? "" : tag[attribute];
                                newElement.setAttribute(attribute, value);
                            }
                        }
                    }
                    newElement.setAttribute(HELMET_ATTRIBUTE, "true");
                    if (oldTags.some((function(existingTag, index) {
                        indexToDelete = index;
                        return newElement.isEqualNode(existingTag);
                    }))) {
                        oldTags.splice(indexToDelete, 1);
                    } else {
                        newTags.push(newElement);
                    }
                }));
            }
            oldTags.forEach((function(tag) {
                return tag.parentNode.removeChild(tag);
            }));
            newTags.forEach((function(tag) {
                return headElement.appendChild(tag);
            }));
            return {
                oldTags,
                newTags
            };
        };
        var generateElementAttributesAsString = function generateElementAttributesAsString(attributes) {
            return Object.keys(attributes).reduce((function(str, key) {
                var attr = typeof attributes[key] !== "undefined" ? key + '="' + attributes[key] + '"' : "" + key;
                return str ? str + " " + attr : attr;
            }), "");
        };
        var generateTitleAsString = function generateTitleAsString(type, title, attributes, encode) {
            var attributeString = generateElementAttributesAsString(attributes);
            var flattenedTitle = flattenArray(title);
            return attributeString ? "<" + type + " " + HELMET_ATTRIBUTE + '="true" ' + attributeString + ">" + encodeSpecialCharacters(flattenedTitle, encode) + "</" + type + ">" : "<" + type + " " + HELMET_ATTRIBUTE + '="true">' + encodeSpecialCharacters(flattenedTitle, encode) + "</" + type + ">";
        };
        var generateTagsAsString = function generateTagsAsString(type, tags, encode) {
            return tags.reduce((function(str, tag) {
                var attributeHtml = Object.keys(tag).filter((function(attribute) {
                    return !(attribute === TAG_PROPERTIES.INNER_HTML || attribute === TAG_PROPERTIES.CSS_TEXT);
                })).reduce((function(string, attribute) {
                    var attr = typeof tag[attribute] === "undefined" ? attribute : attribute + '="' + encodeSpecialCharacters(tag[attribute], encode) + '"';
                    return string ? string + " " + attr : attr;
                }), "");
                var tagContent = tag.innerHTML || tag.cssText || "";
                var isSelfClosing = SELF_CLOSING_TAGS.indexOf(type) === -1;
                return str + "<" + type + " " + HELMET_ATTRIBUTE + '="true" ' + attributeHtml + (isSelfClosing ? "/>" : ">" + tagContent + "</" + type + ">");
            }), "");
        };
        var convertElementAttributestoReactProps = function convertElementAttributestoReactProps(attributes) {
            var initProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
            return Object.keys(attributes).reduce((function(obj, key) {
                obj[REACT_TAG_MAP[key] || key] = attributes[key];
                return obj;
            }), initProps);
        };
        var convertReactPropstoHtmlAttributes = function convertReactPropstoHtmlAttributes(props) {
            var initAttributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
            return Object.keys(props).reduce((function(obj, key) {
                obj[HTML_TAG_MAP[key] || key] = props[key];
                return obj;
            }), initAttributes);
        };
        var generateTitleAsReactComponent = function generateTitleAsReactComponent(type, title, attributes) {
            var _initProps;
            var initProps = (_initProps = {
                key: title
            }, _initProps[HELMET_ATTRIBUTE] = true, _initProps);
            var props = convertElementAttributestoReactProps(attributes, initProps);
            return [ react.createElement(TAG_NAMES.TITLE, props, title) ];
        };
        var generateTagsAsReactComponent = function generateTagsAsReactComponent(type, tags) {
            return tags.map((function(tag, i) {
                var _mappedTag;
                var mappedTag = (_mappedTag = {
                    key: i
                }, _mappedTag[HELMET_ATTRIBUTE] = true, _mappedTag);
                Object.keys(tag).forEach((function(attribute) {
                    var mappedAttribute = REACT_TAG_MAP[attribute] || attribute;
                    if (mappedAttribute === TAG_PROPERTIES.INNER_HTML || mappedAttribute === TAG_PROPERTIES.CSS_TEXT) {
                        var content = tag.innerHTML || tag.cssText;
                        mappedTag.dangerouslySetInnerHTML = {
                            __html: content
                        };
                    } else {
                        mappedTag[mappedAttribute] = tag[attribute];
                    }
                }));
                return react.createElement(type, mappedTag);
            }));
        };
        var getMethodsForTag = function getMethodsForTag(type, tags, encode) {
            switch (type) {
              case TAG_NAMES.TITLE:
                return {
                    toComponent: function toComponent() {
                        return generateTitleAsReactComponent(type, tags.title, tags.titleAttributes, encode);
                    },
                    toString: function toString() {
                        return generateTitleAsString(type, tags.title, tags.titleAttributes, encode);
                    }
                };

              case ATTRIBUTE_NAMES.BODY:
              case ATTRIBUTE_NAMES.HTML:
                return {
                    toComponent: function toComponent() {
                        return convertElementAttributestoReactProps(tags);
                    },
                    toString: function toString() {
                        return generateElementAttributesAsString(tags);
                    }
                };

              default:
                return {
                    toComponent: function toComponent() {
                        return generateTagsAsReactComponent(type, tags);
                    },
                    toString: function toString() {
                        return generateTagsAsString(type, tags, encode);
                    }
                };
            }
        };
        var mapStateOnServer = function mapStateOnServer(_ref) {
            var baseTag = _ref.baseTag, bodyAttributes = _ref.bodyAttributes, encode = _ref.encode, htmlAttributes = _ref.htmlAttributes, linkTags = _ref.linkTags, metaTags = _ref.metaTags, noscriptTags = _ref.noscriptTags, scriptTags = _ref.scriptTags, styleTags = _ref.styleTags, _ref$title = _ref.title, title = _ref$title === undefined ? "" : _ref$title, titleAttributes = _ref.titleAttributes;
            return {
                base: getMethodsForTag(TAG_NAMES.BASE, baseTag, encode),
                bodyAttributes: getMethodsForTag(ATTRIBUTE_NAMES.BODY, bodyAttributes, encode),
                htmlAttributes: getMethodsForTag(ATTRIBUTE_NAMES.HTML, htmlAttributes, encode),
                link: getMethodsForTag(TAG_NAMES.LINK, linkTags, encode),
                meta: getMethodsForTag(TAG_NAMES.META, metaTags, encode),
                noscript: getMethodsForTag(TAG_NAMES.NOSCRIPT, noscriptTags, encode),
                script: getMethodsForTag(TAG_NAMES.SCRIPT, scriptTags, encode),
                style: getMethodsForTag(TAG_NAMES.STYLE, styleTags, encode),
                title: getMethodsForTag(TAG_NAMES.TITLE, {
                    title,
                    titleAttributes
                }, encode)
            };
        };
        var Helmet = function Helmet(Component) {
            var _class, _temp;
            return _temp = _class = function(_React$Component) {
                Helmet_inherits(HelmetWrapper, _React$Component);
                function HelmetWrapper() {
                    Helmet_classCallCheck(this, HelmetWrapper);
                    return Helmet_possibleConstructorReturn(this, _React$Component.apply(this, arguments));
                }
                HelmetWrapper.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
                    return !react_fast_compare_default()(this.props, nextProps);
                };
                HelmetWrapper.prototype.mapNestedChildrenToProps = function mapNestedChildrenToProps(child, nestedChildren) {
                    if (!nestedChildren) {
                        return null;
                    }
                    switch (child.type) {
                      case TAG_NAMES.SCRIPT:
                      case TAG_NAMES.NOSCRIPT:
                        return {
                            innerHTML: nestedChildren
                        };

                      case TAG_NAMES.STYLE:
                        return {
                            cssText: nestedChildren
                        };
                    }
                    throw new Error("<" + child.type + " /> elements are self-closing and can not contain children. Refer to our API for more information.");
                };
                HelmetWrapper.prototype.flattenArrayTypeChildren = function flattenArrayTypeChildren(_ref) {
                    var _babelHelpers$extends;
                    var child = _ref.child, arrayTypeChildren = _ref.arrayTypeChildren, newChildProps = _ref.newChildProps, nestedChildren = _ref.nestedChildren;
                    return Helmet_extends({}, arrayTypeChildren, (_babelHelpers$extends = {}, _babelHelpers$extends[child.type] = [].concat(arrayTypeChildren[child.type] || [], [ Helmet_extends({}, newChildProps, this.mapNestedChildrenToProps(child, nestedChildren)) ]), 
                    _babelHelpers$extends));
                };
                HelmetWrapper.prototype.mapObjectTypeChildren = function mapObjectTypeChildren(_ref2) {
                    var _babelHelpers$extends2, _babelHelpers$extends3;
                    var child = _ref2.child, newProps = _ref2.newProps, newChildProps = _ref2.newChildProps, nestedChildren = _ref2.nestedChildren;
                    switch (child.type) {
                      case TAG_NAMES.TITLE:
                        return Helmet_extends({}, newProps, (_babelHelpers$extends2 = {}, _babelHelpers$extends2[child.type] = nestedChildren, 
                        _babelHelpers$extends2.titleAttributes = Helmet_extends({}, newChildProps), _babelHelpers$extends2));

                      case TAG_NAMES.BODY:
                        return Helmet_extends({}, newProps, {
                            bodyAttributes: Helmet_extends({}, newChildProps)
                        });

                      case TAG_NAMES.HTML:
                        return Helmet_extends({}, newProps, {
                            htmlAttributes: Helmet_extends({}, newChildProps)
                        });
                    }
                    return Helmet_extends({}, newProps, (_babelHelpers$extends3 = {}, _babelHelpers$extends3[child.type] = Helmet_extends({}, newChildProps), 
                    _babelHelpers$extends3));
                };
                HelmetWrapper.prototype.mapArrayTypeChildrenToProps = function mapArrayTypeChildrenToProps(arrayTypeChildren, newProps) {
                    var newFlattenedProps = Helmet_extends({}, newProps);
                    Object.keys(arrayTypeChildren).forEach((function(arrayChildName) {
                        var _babelHelpers$extends4;
                        newFlattenedProps = Helmet_extends({}, newFlattenedProps, (_babelHelpers$extends4 = {}, 
                        _babelHelpers$extends4[arrayChildName] = arrayTypeChildren[arrayChildName], _babelHelpers$extends4));
                    }));
                    return newFlattenedProps;
                };
                HelmetWrapper.prototype.warnOnInvalidChildren = function warnOnInvalidChildren(child, nestedChildren) {
                    if (false) {}
                    return true;
                };
                HelmetWrapper.prototype.mapChildrenToProps = function mapChildrenToProps(children, newProps) {
                    var _this2 = this;
                    var arrayTypeChildren = {};
                    react.Children.forEach(children, (function(child) {
                        if (!child || !child.props) {
                            return;
                        }
                        var _child$props = child.props, nestedChildren = _child$props.children, childProps = Helmet_objectWithoutProperties(_child$props, [ "children" ]);
                        var newChildProps = convertReactPropstoHtmlAttributes(childProps);
                        _this2.warnOnInvalidChildren(child, nestedChildren);
                        switch (child.type) {
                          case TAG_NAMES.LINK:
                          case TAG_NAMES.META:
                          case TAG_NAMES.NOSCRIPT:
                          case TAG_NAMES.SCRIPT:
                          case TAG_NAMES.STYLE:
                            arrayTypeChildren = _this2.flattenArrayTypeChildren({
                                child,
                                arrayTypeChildren,
                                newChildProps,
                                nestedChildren
                            });
                            break;

                          default:
                            newProps = _this2.mapObjectTypeChildren({
                                child,
                                newProps,
                                newChildProps,
                                nestedChildren
                            });
                            break;
                        }
                    }));
                    newProps = this.mapArrayTypeChildrenToProps(arrayTypeChildren, newProps);
                    return newProps;
                };
                HelmetWrapper.prototype.render = function render() {
                    var _props = this.props, children = _props.children, props = Helmet_objectWithoutProperties(_props, [ "children" ]);
                    var newProps = Helmet_extends({}, props);
                    if (children) {
                        newProps = this.mapChildrenToProps(children, newProps);
                    }
                    return react.createElement(Component, newProps);
                };
                createClass(HelmetWrapper, null, [ {
                    key: "canUseDOM",
                    set: function set$$1(canUseDOM) {
                        Component.canUseDOM = canUseDOM;
                    }
                } ]);
                return HelmetWrapper;
            }(react.Component), _class.propTypes = {
                base: prop_types_default().object,
                bodyAttributes: prop_types_default().object,
                children: prop_types_default().oneOfType([ prop_types_default().arrayOf(prop_types_default().node), prop_types_default().node ]),
                defaultTitle: prop_types_default().string,
                defer: prop_types_default().bool,
                encodeSpecialCharacters: prop_types_default().bool,
                htmlAttributes: prop_types_default().object,
                link: prop_types_default().arrayOf(prop_types_default().object),
                meta: prop_types_default().arrayOf(prop_types_default().object),
                noscript: prop_types_default().arrayOf(prop_types_default().object),
                onChangeClientState: prop_types_default().func,
                script: prop_types_default().arrayOf(prop_types_default().object),
                style: prop_types_default().arrayOf(prop_types_default().object),
                title: prop_types_default().string,
                titleAttributes: prop_types_default().object,
                titleTemplate: prop_types_default().string
            }, _class.defaultProps = {
                defer: true,
                encodeSpecialCharacters: true
            }, _class.peek = Component.peek, _class.rewind = function() {
                var mappedState = Component.rewind();
                if (!mappedState) {
                    mappedState = mapStateOnServer({
                        baseTag: [],
                        bodyAttributes: {},
                        encodeSpecialCharacters: true,
                        htmlAttributes: {},
                        linkTags: [],
                        metaTags: [],
                        noscriptTags: [],
                        scriptTags: [],
                        styleTags: [],
                        title: "",
                        titleAttributes: {}
                    });
                }
                return mappedState;
            }, _temp;
        };
        var NullComponent = function NullComponent() {
            return null;
        };
        var HelmetSideEffects = lib_default()(reducePropsToState, handleClientStateChange, mapStateOnServer)(NullComponent);
        var HelmetExport = Helmet(HelmetSideEffects);
        HelmetExport.renderStatic = HelmetExport.rewind;
        const es_Helmet = null && HelmetExport;
        var Base = (0, styled_components_browser_esm.default)(GrommetWrapper)(Provider_templateObject_1 || (Provider_templateObject_1 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\tfont-family: ", ";\n\tfont-size: ", ";\n\tcolor: ", ";\n" ], [ "\n\tfont-family: ", ";\n\tfont-size: ", ";\n\tcolor: ", ";\n" ])), (function(props) {
            return props.theme.font;
        }), (function(props) {
            return styledUtils_px(props.theme.fontSizes[2]);
        }), (function(props) {
            return styledUtils_px(props.theme.colors.text.main);
        }));
        var BaseProvider = function(_a) {
            var theme = _a.theme, props = (0, tslib_es6.__rest)(_a, [ "theme" ]);
            var isDefaultFont = !(theme === null || theme === void 0 ? void 0 : theme.font);
            var providerTheme = merge_default()(cloneDeep_default()(dist_esm5_theme), theme);
            return react.createElement(BreakpointProvider, {
                breakpoints: providerTheme.breakpoints
            }, isDefaultFont && react.createElement(HelmetExport, null, react.createElement("link", {
                href: "https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,400;0,600;1,400&family=Ubuntu+Mono:wght@400;700&display=fallback",
                rel: "stylesheet"
            })), react.createElement(Base, (0, tslib_es6.__assign)({
                theme: providerTheme
            }, props)));
        };
        var Provider = BaseProvider;
        var Provider_templateObject_1;
        function Keyboard_objectWithoutPropertiesLoose(source, excluded) {
            if (source == null) return {};
            var target = {};
            var sourceKeys = Object.keys(source);
            var key, i;
            for (i = 0; i < sourceKeys.length; i++) {
                key = sourceKeys[i];
                if (excluded.indexOf(key) >= 0) continue;
                target[key] = source[key];
            }
            return target;
        }
        var KEYS = {
            8: "onBackspace",
            9: "onTab",
            13: "onEnter",
            27: "onEsc",
            32: "onSpace",
            37: "onLeft",
            38: "onUp",
            39: "onRight",
            40: "onDown",
            188: "onComma",
            16: "onShift"
        };
        var Keyboard = function Keyboard(_ref) {
            var capture = _ref.capture, target = _ref.target, children = _ref.children, onKeyDown = _ref.onKeyDown, restProps = Keyboard_objectWithoutPropertiesLoose(_ref, [ "capture", "target", "children", "onKeyDown" ]);
            var onKeyDownHandler = (0, react.useCallback)((function(event) {
                var key = event.keyCode ? event.keyCode : event.which;
                var callbackName = KEYS[key];
                for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
                    rest[_key - 1] = arguments[_key];
                }
                if (callbackName && restProps[callbackName]) {
                    restProps[callbackName].apply(restProps, [ event ].concat(rest));
                }
                if (onKeyDown) {
                    onKeyDown.apply(void 0, [ event ].concat(rest));
                }
            }), [ onKeyDown, restProps ]);
            (0, react.useEffect)((function() {
                if (target === "document") {
                    document.addEventListener("keydown", onKeyDownHandler, capture);
                }
                return function() {
                    if (target === "document") {
                        document.removeEventListener("keydown", onKeyDownHandler, capture);
                    }
                };
            }), [ capture, onKeyDownHandler, target ]);
            return target === "document" ? children : (0, react.cloneElement)(react.Children.only(children), {
                onKeyDown: onKeyDownHandler
            });
        };
        var KeyboardDoc;
        if (false) {}
        var KeyboardWrapper = KeyboardDoc || Keyboard;
        var responsiveBorderStyle = function responsiveBorderStyle(data, theme) {
            var color = colors_normalizeColor(data.color || "border", theme);
            var borderSize = data.size || "xsmall";
            var style = data.style || "solid";
            var side = typeof data === "string" ? data : data.side || "all";
            var breakpoint = theme.box.responsiveBreakpoint && theme.global.breakpoints[theme.box.responsiveBreakpoint];
            if (!breakpoint.borderSize) breakpoint.borderSize = theme.global.borderSize;
            var value = breakpoint && (breakpoint.borderSize[borderSize] || borderSize) && style + " " + (breakpoint.borderSize[borderSize] || borderSize) + " " + color;
            if (!value) return undefined;
            if (side === "top" || side === "bottom" || side === "left" || side === "right") return "border-" + side + ": " + value + ";";
            if (side === "end" || side === "start") return "border-inline-" + side + ": " + value + ";";
            if (side === "vertical") return "\n      border-left: " + value + ";\n      border-right: " + value + ";\n    ";
            if (side === "horizontal") return "\n      border-top: " + value + ";\n      border-bottom: " + value + ";\n    ";
            if (side === "between") return undefined;
            return "border: " + value + ";";
        };
        var border_borderStyle = function borderStyle(data, responsive, theme) {
            var styles = [];
            var color = colors_normalizeColor(data.color || "border", theme);
            var borderSize = data.size || "xsmall";
            var style = data.style || "solid";
            var side = typeof data === "string" ? data : data.side || "all";
            var value = style + " " + (theme.global.borderSize[borderSize] || borderSize) + " " + color;
            var responsiveStyle = responsive && responsiveBorderStyle(data, theme);
            var breakpoint = responsiveStyle && theme.box.responsiveBreakpoint && theme.global.breakpoints[theme.box.responsiveBreakpoint];
            if (side === "top" || side === "bottom" || side === "left" || side === "right") {
                styles.push("border-" + side + ": " + value + ";");
                if (responsiveStyle) {
                    styles.push(breakpointStyle(breakpoint, responsiveStyle));
                }
            } else if (side === "end" || side === "start") {
                styles.push((0, styled_components_browser_esm.css)([ "border-inline-", ":", ";" ], side, value));
                if (responsiveStyle) {
                    styles.push(breakpointStyle(breakpoint, responsiveStyle));
                }
            } else if (side === "vertical") {
                styles.push((0, styled_components_browser_esm.css)([ "border-left:", ";border-right:", ";" ], value, value));
                if (responsiveStyle) {
                    styles.push(breakpointStyle(breakpoint, responsiveStyle));
                }
            } else if (side === "horizontal") {
                styles.push((0, styled_components_browser_esm.css)([ "border-top:", ";border-bottom:", ";" ], value, value));
                if (responsiveStyle) {
                    styles.push(breakpointStyle(breakpoint, responsiveStyle));
                }
            } else if (side === "between") {} else {
                styles.push((0, styled_components_browser_esm.css)([ "border:", ";" ], value));
                if (responsiveStyle) {
                    styles.push(breakpointStyle(breakpoint, responsiveStyle));
                }
            }
            return styles;
        };
        var _FLEX_MAP;
        function StyledBox_extends() {
            StyledBox_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return StyledBox_extends.apply(this, arguments);
        }
        var ALIGN_MAP = {
            baseline: "baseline",
            center: "center",
            end: "flex-end",
            start: "flex-start",
            stretch: "stretch"
        };
        var alignStyle = (0, styled_components_browser_esm.css)([ "align-items:", ";" ], (function(props) {
            return ALIGN_MAP[props.align];
        }));
        var ALIGN_CONTENT_MAP = {
            around: "around",
            between: "between",
            center: "center",
            end: "flex-end",
            start: "flex-start",
            stretch: "stretch"
        };
        var alignContentStyle = (0, styled_components_browser_esm.css)([ "align-content:", ";" ], (function(props) {
            return ALIGN_CONTENT_MAP[props.alignContent];
        }));
        var BASIS_MAP = {
            auto: "auto",
            full: "100%",
            "1/2": "50%",
            "1/4": "25%",
            "2/4": "50%",
            "3/4": "75%",
            "1/3": "33.33%",
            "2/3": "66.66%"
        };
        var basisStyle = (0, styled_components_browser_esm.css)([ "flex-basis:", ";" ], (function(props) {
            return BASIS_MAP[props.basis] || props.theme.global.size[props.basis] || props.basis;
        }));
        var directionStyle = function directionStyle(direction, theme) {
            var styles = [ (0, styled_components_browser_esm.css)([ "min-width:0;min-height:0;flex-direction:", ";" ], direction === "row-responsive" ? "row" : direction) ];
            if (direction === "row-responsive" && theme.box.responsiveBreakpoint) {
                var breakpoint = getBreakpointStyle(theme, theme.box.responsiveBreakpoint);
                if (breakpoint) {
                    styles.push(breakpointStyle(breakpoint, "\n        flex-direction: column;\n        flex-basis: auto;\n        justify-content: flex-start;\n        align-items: stretch;\n      "));
                }
            }
            return styles;
        };
        var elevationStyle = (0, styled_components_browser_esm.css)([ "box-shadow:", ";" ], (function(props) {
            return props.theme.global.elevation[props.theme.dark ? "dark" : "light"][props.elevationProp];
        }));
        var FLEX_MAP = (_FLEX_MAP = {}, _FLEX_MAP[true] = "1 1", _FLEX_MAP[false] = "0 0", 
        _FLEX_MAP.grow = "1 0", _FLEX_MAP.shrink = "0 1", _FLEX_MAP);
        var flexGrowShrinkProp = function flexGrowShrinkProp(flex) {
            if (typeof flex === "boolean" || typeof flex === "string") {
                return FLEX_MAP[flex];
            }
            return (flex.grow ? flex.grow : 0) + " " + (flex.shrink ? flex.shrink : 0);
        };
        var flexStyle = (0, styled_components_browser_esm.css)([ "flex:", ";" ], (function(props) {
            return "" + flexGrowShrinkProp(props.flex) + (props.flex !== true && !props.basis ? " auto" : "");
        }));
        var JUSTIFY_MAP = {
            around: "space-around",
            between: "space-between",
            center: "center",
            end: "flex-end",
            evenly: "space-evenly",
            start: "flex-start"
        };
        var justifyStyle = (0, styled_components_browser_esm.css)([ "justify-content:", ";" ], (function(props) {
            return JUSTIFY_MAP[props.justify];
        }));
        var WRAP_MAP = {
            true: "wrap",
            reverse: "wrap-reverse"
        };
        var wrapStyle = (0, styled_components_browser_esm.css)([ "flex-wrap:", ";" ], (function(props) {
            return WRAP_MAP[props.wrapProp];
        }));
        var ROUND_MAP = {
            full: "100%"
        };
        var roundStyle = function roundStyle(data, responsive, theme) {
            var breakpoint = getBreakpointStyle(theme, theme.box.responsiveBreakpoint);
            var styles = [];
            if (typeof data === "object") {
                var size = ROUND_MAP[data.size] || theme.global.edgeSize[data.size || "medium"] || data.size;
                var responsiveSize = responsive && breakpoint && breakpoint.edgeSize[data.size] && (breakpoint.edgeSize[data.size] || data.size);
                if (data.corner === "top") {
                    styles.push((0, styled_components_browser_esm.css)([ "border-top-left-radius:", ";border-top-right-radius:", ";" ], size, size));
                    if (responsiveSize) {
                        styles.push(breakpointStyle(breakpoint, "\n          border-top-left-radius: " + responsiveSize + ";\n          border-top-right-radius: " + responsiveSize + ";\n        "));
                    }
                } else if (data.corner === "bottom") {
                    styles.push((0, styled_components_browser_esm.css)([ "border-bottom-left-radius:", ";border-bottom-right-radius:", ";" ], size, size));
                    if (responsiveSize) {
                        styles.push(breakpointStyle(breakpoint, "\n          border-bottom-left-radius: " + responsiveSize + ";\n          border-bottom-right-radius: " + responsiveSize + ";\n        "));
                    }
                } else if (data.corner === "left") {
                    styles.push((0, styled_components_browser_esm.css)([ "border-top-left-radius:", ";border-bottom-left-radius:", ";" ], size, size));
                    if (responsiveSize) {
                        styles.push(breakpointStyle(breakpoint, "\n          border-top-left-radius: " + responsiveSize + ";\n          border-bottom-left-radius: " + responsiveSize + ";\n        "));
                    }
                } else if (data.corner === "right") {
                    styles.push((0, styled_components_browser_esm.css)([ "border-top-right-radius:", ";border-bottom-right-radius:", ";" ], size, size));
                    if (responsiveSize) {
                        styles.push(breakpointStyle(breakpoint, "\n          border-top-right-radius: " + responsiveSize + ";\n          border-bottom-right-radius: " + responsiveSize + ";\n        "));
                    }
                } else if (data.corner) {
                    styles.push((0, styled_components_browser_esm.css)([ "border-", "-radius:", ";" ], data.corner, size));
                    if (responsiveSize) {
                        styles.push(breakpointStyle(breakpoint, "\n          border-" + data.corner + "-radius: " + responsiveSize + ";\n        "));
                    }
                } else {
                    styles.push((0, styled_components_browser_esm.css)([ "border-radius:", ";" ], size));
                    if (responsiveSize) {
                        styles.push(breakpointStyle(breakpoint, "\n          border-radius: " + responsiveSize + ";\n        "));
                    }
                }
            } else {
                var _size = data === true ? "medium" : data;
                styles.push((0, styled_components_browser_esm.css)([ "border-radius:", ";" ], ROUND_MAP[_size] || theme.global.edgeSize[_size] || _size));
                var _responsiveSize = breakpoint && breakpoint.edgeSize[_size];
                if (_responsiveSize) {
                    styles.push(breakpointStyle(breakpoint, "\n        border-radius: " + _responsiveSize + ";\n      "));
                }
            }
            return styles;
        };
        var SLIDE_SIZES = {
            xsmall: 1,
            small: 5,
            medium: 10,
            large: 50,
            xlarge: 200
        };
        var PULSE_SIZES = {
            xsmall: 1.001,
            small: 1.01,
            medium: 1.1,
            large: 1.5,
            xlarge: 2
        };
        var JIGGLE_SIZES = {
            xsmall: .1,
            small: 1,
            medium: 5,
            large: 400,
            xlarge: 1e3
        };
        var ZOOM_SIZES = {
            xsmall: .001,
            small: .01,
            medium: .05,
            large: .1,
            xlarge: .5
        };
        var animationBounds = function animationBounds(type, size) {
            if (size === void 0) {
                size = "medium";
            }
            if (type === "fadeIn") {
                return [ "opacity: 0;", "opacity: 1;" ];
            }
            if (type === "fadeOut") {
                return [ "opacity: 1;", "opacity: 0;" ];
            }
            if (type === "jiggle") {
                var deg = JIGGLE_SIZES[size];
                return [ "transform: rotate(-" + deg + "deg);", "transform: rotate(" + deg + "deg);" ];
            }
            if (type === "pulse") {
                return [ "transform: scale(1);", "transform: scale(" + PULSE_SIZES[size] + ")" ];
            }
            if (type === "rotateRight") {
                return [ "transform: rotate(0deg);", "transform: rotate(359deg);" ];
            }
            if (type === "rotateLeft") {
                return [ "transform: rotate(0deg);", "transform: rotate(-359deg);" ];
            }
            if (type === "flipIn") {
                return [ "transform: rotateY(90deg);", "transform: rotateY(0);" ];
            }
            if (type === "flipOut") {
                return [ "transform: rotateY(0);", "transform: rotateY(90deg);" ];
            }
            if (type === "slideDown") {
                return [ "transform: translateY(-" + SLIDE_SIZES[size] + "%);", "transform: none;" ];
            }
            if (type === "slideLeft") {
                return [ "transform: translateX(" + SLIDE_SIZES[size] + "%);", "transform: none;" ];
            }
            if (type === "slideRight") {
                return [ "transform: translateX(-" + SLIDE_SIZES[size] + "%);", "transform: none;" ];
            }
            if (type === "slideUp") {
                return [ "transform: translateY(" + SLIDE_SIZES[size] + "%);", "transform: none;" ];
            }
            if (type === "zoomIn") {
                return [ "transform: scale(" + (1 - ZOOM_SIZES[size]) + ");", "transform: none;" ];
            }
            if (type === "zoomOut") {
                return [ "transform: scale(" + (1 + ZOOM_SIZES[size]) + ");", "transform: none;" ];
            }
            return [];
        };
        var normalizeTiming = function normalizeTiming(time, defaultTiming) {
            return time ? time / 1e3 + "s" : defaultTiming;
        };
        var animationEnding = function animationEnding(type) {
            if (type === "jiggle") {
                return "alternate infinite";
            }
            if (type === "pulse") {
                return "alternate infinite";
            }
            if (type === "rotateRight" || type === "rotateLeft") {
                return "infinite linear";
            }
            return "forwards";
        };
        var animationObjectStyle = function animationObjectStyle(animation, theme) {
            var bounds = animationBounds(animation.type, animation.size);
            if (bounds) {
                var animationTransition = (0, styled_components_browser_esm.css)([ "from{", ";}to{", ";}" ], bounds[0], bounds[1]);
                return (0, styled_components_browser_esm.css)([ "", " ", " ", " ", "" ], (0, styled_components_browser_esm.keyframes)([ "", "" ], animationTransition), normalizeTiming(animation.duration, (theme.global.animation[animation.type] ? theme.global.animation[animation.type].duration : undefined) || theme.global.animation.duration), normalizeTiming(animation.delay, "0s"), animationEnding(animation.type));
            }
            return "";
        };
        var animationItemStyle = function animationItemStyle(item, theme) {
            if (typeof item === "string") {
                return animationObjectStyle({
                    type: item
                }, theme);
            }
            if (Array.isArray(item)) {
                return item.reduce((function(style, a, index) {
                    return (0, styled_components_browser_esm.css)([ "", "", " ", "" ], style, index > 0 ? "," : "", animationItemStyle(a, theme));
                }), "");
            }
            if (typeof item === "object") {
                return animationObjectStyle(item, theme);
            }
            return "";
        };
        var animationAncilaries = function animationAncilaries(animation) {
            if (animation.type === "flipIn" || animation.type === "flipOut") {
                return "perspective: 1000px; transform-style: preserve-3d;";
            }
            return "";
        };
        var animationObjectInitialStyle = function animationObjectInitialStyle(animation) {
            var bounds = animationBounds(animation.type, animation.size);
            if (bounds) {
                return bounds[0] + " " + animationAncilaries(animation);
            }
            return "";
        };
        var animationInitialStyle = function animationInitialStyle(item) {
            if (typeof item === "string") {
                return animationObjectInitialStyle({
                    type: item
                });
            }
            if (Array.isArray(item)) {
                return item.map((function(a) {
                    return typeof a === "string" ? animationObjectInitialStyle({
                        type: a
                    }) : animationObjectInitialStyle(a);
                })).join("");
            }
            if (typeof item === "object") {
                return animationObjectInitialStyle(item);
            }
            return "";
        };
        var animationStyle = (0, styled_components_browser_esm.css)([ "", ";" ], (function(props) {
            return (0, styled_components_browser_esm.css)([ "", " animation:", ";" ], animationInitialStyle(props.animation), animationItemStyle(props.animation, props.theme));
        }));
        var interactiveStyle = (0, styled_components_browser_esm.css)([ "cursor:pointer;&:hover{", "}" ], (function(props) {
            return props.hoverIndicator && getHoverIndicatorStyle(props.hoverIndicator, props.theme);
        }));
        var getSize = function getSize(props, size) {
            return props.theme.global.size[size] || size;
        };
        var heightObjectStyle = (0, styled_components_browser_esm.css)([ "", ";", ";" ], (function(props) {
            return props.heightProp.max && (0, styled_components_browser_esm.css)([ "max-height:", ";" ], getSize(props, props.heightProp.max));
        }), (function(props) {
            return props.heightProp.min && (0, styled_components_browser_esm.css)([ "min-height:", ";" ], getSize(props, props.heightProp.min));
        }));
        var heightStyle = (0, styled_components_browser_esm.css)([ "height:", ";" ], (function(props) {
            return getSize(props, props.heightProp);
        }));
        var widthObjectStyle = (0, styled_components_browser_esm.css)([ "", ";", ";", ";" ], (function(props) {
            return props.widthProp.max && (0, styled_components_browser_esm.css)([ "max-width:", ";" ], getSize(props, props.widthProp.max));
        }), (function(props) {
            return props.widthProp.min && (0, styled_components_browser_esm.css)([ "min-width:", ";" ], getSize(props, props.widthProp.min));
        }), (function(props) {
            return props.widthProp.width && (0, styled_components_browser_esm.css)([ "width:", ";" ], getSize(props, props.widthProp.width));
        }));
        var widthStyle = (0, styled_components_browser_esm.css)([ "width:", ";" ], (function(props) {
            return getSize(props, props.widthProp);
        }));
        var StyledBox = styled_components_browser_esm.default.div.withConfig({
            displayName: "StyledBox",
            componentId: "sc-13pk1d4-0"
        })([ "display:flex;box-sizing:border-box;", ";", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", "" ], (function(props) {
            return !props.basis && "max-width: 100%;";
        }), genericStyles, (function(props) {
            return props.align && alignStyle;
        }), (function(props) {
            return props.alignContent && alignContentStyle;
        }), (function(props) {
            return props.background && backgroundStyle(props.background, props.theme);
        }), (function(props) {
            return props.border && (Array.isArray(props.border) ? props.border.map((function(border) {
                return border_borderStyle(border, props.responsive, props.theme);
            })) : border_borderStyle(props.border, props.responsive, props.theme));
        }), (function(props) {
            return props.directionProp && directionStyle(props.directionProp, props.theme);
        }), (function(props) {
            return props.heightProp && (typeof props.heightProp === "object" ? heightObjectStyle : heightStyle);
        }), (function(props) {
            return props.widthProp && (typeof props.widthProp === "object" ? widthObjectStyle : widthStyle);
        }), (function(props) {
            return props.flex !== undefined && flexStyle;
        }), (function(props) {
            return props.basis && basisStyle;
        }), (function(props) {
            return props.fillProp && fillStyle(props.fillProp);
        }), (function(props) {
            return props.justify && justifyStyle;
        }), (function(props) {
            return props.pad && edgeStyle("padding", props.pad, props.responsive, props.theme.box.responsiveBreakpoint, props.theme);
        }), (function(props) {
            return props.round && roundStyle(props.round, props.responsive, props.theme);
        }), (function(props) {
            return props.wrapProp && wrapStyle;
        }), (function(props) {
            return props.overflowProp && overflowStyle(props.overflowProp);
        }), (function(props) {
            return props.elevationProp && elevationStyle;
        }), (function(props) {
            return props.animation && animationStyle;
        }), (function(props) {
            return props.onClick && interactiveStyle;
        }), (function(props) {
            return props.onClick && props.focus && props.focusIndicator !== false && focusStyle();
        }), (function(props) {
            return props.theme.box && props.theme.box.extend;
        }));
        var gapStyle = function gapStyle(directionProp, gap, responsive, border, theme) {
            var metric = theme.global.edgeSize[gap] || gap;
            var breakpoint = getBreakpointStyle(theme, theme.box.responsiveBreakpoint);
            var responsiveMetric = responsive && breakpoint && breakpoint.edgeSize[gap];
            var styles = [];
            if (directionProp === "column" || directionProp === "column-reverse") {
                styles.push("height: " + metric + ";");
                if (responsiveMetric) {
                    styles.push(breakpointStyle(breakpoint, "height: " + responsiveMetric + ";"));
                }
            } else {
                styles.push("width: " + metric + ";");
                if (responsiveMetric) {
                    if (directionProp === "row" || directionProp === "row-reverse") {
                        styles.push(breakpointStyle(breakpoint, "width: " + responsiveMetric + ";"));
                    } else if (directionProp === "row-responsive") {
                        styles.push(breakpointStyle(breakpoint, "\n          width: auto;\n          height: " + responsiveMetric + ";\n        "));
                    }
                }
            }
            if (border === "between" || border && border.side === "between") {
                var borderSize = border.size || "xsmall";
                var borderMetric = theme.global.borderSize[borderSize] || borderSize;
                var borderOffset = parseMetricToNum(metric) / 2 - parseMetricToNum(borderMetric) / 2 + "px";
                var responsiveBorderMetric = responsive && breakpoint && (breakpoint.borderSize[borderSize] || borderSize);
                var responsiveBorderOffset = responsiveBorderMetric && parseMetricToNum(responsiveMetric) / 2 - parseMetricToNum(responsiveBorderMetric) / 2 + "px";
                if (directionProp === "column" || directionProp === "column-reverse") {
                    var adjustedBorder = typeof border === "string" ? "top" : StyledBox_extends({}, border, {
                        side: "top"
                    });
                    styles.push((0, styled_components_browser_esm.css)([ "position:relative;&:after{content:'';position:absolute;width:100%;top:", ";", "}" ], borderOffset, border_borderStyle(adjustedBorder, responsive, theme)));
                    if (responsiveBorderOffset) {
                        styles.push(breakpointStyle(breakpoint, "\n            &:after {\n              content: '';\n              top: " + responsiveBorderOffset + ";\n            }"));
                    }
                } else {
                    var _adjustedBorder = typeof border === "string" ? "left" : StyledBox_extends({}, border, {
                        side: "left"
                    });
                    styles.push((0, styled_components_browser_esm.css)([ "position:relative;&:after{content:'';position:absolute;height:100%;left:", ";", "}" ], borderOffset, border_borderStyle(_adjustedBorder, directionProp !== "row-responsive" && responsive, theme)));
                    if (responsiveBorderOffset) {
                        if (directionProp === "row" || directionProp === "row-reverse") {
                            styles.push(breakpointStyle(breakpoint, "\n              &:after {\n                content: '';\n                left: " + responsiveBorderOffset + ";\n              }"));
                        } else if (directionProp === "row-responsive") {
                            var adjustedBorder2 = typeof border === "string" ? "top" : StyledBox_extends({}, border, {
                                side: "top"
                            });
                            styles.push(breakpointStyle(breakpoint, "\n              &:after {\n                content: '';\n                height: auto;\n                left: unset;\n                width: 100%;\n                top: " + responsiveBorderOffset + ";\n                border-left: none;\n                " + responsiveBorderStyle(adjustedBorder2, theme) + "\n              }"));
                        }
                    }
                }
            }
            return styles;
        };
        StyledBox.defaultProps = {};
        Object.setPrototypeOf(StyledBox.defaultProps, default_props_defaultProps);
        var StyledBoxGap = styled_components_browser_esm.default.div.withConfig({
            displayName: "StyledBox__StyledBoxGap",
            componentId: "sc-13pk1d4-1"
        })([ "flex:0 0 auto;align-self:stretch;", ";" ], (function(props) {
            return props.gap && gapStyle(props.directionProp, props.gap, props.responsive, props.border, props.theme);
        }));
        StyledBoxGap.defaultProps = {};
        Object.setPrototypeOf(StyledBoxGap.defaultProps, default_props_defaultProps);
        function Box_extends() {
            Box_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return Box_extends.apply(this, arguments);
        }
        function Box_objectWithoutPropertiesLoose(source, excluded) {
            if (source == null) return {};
            var target = {};
            var sourceKeys = Object.keys(source);
            var key, i;
            for (i = 0; i < sourceKeys.length; i++) {
                key = sourceKeys[i];
                if (excluded.indexOf(key) >= 0) continue;
                target[key] = source[key];
            }
            return target;
        }
        var Box_Box = (0, react.forwardRef)((function(_ref, ref) {
            var a11yTitle = _ref.a11yTitle, background = _ref.background, border = _ref.border, children = _ref.children, _ref$direction = _ref.direction, direction = _ref$direction === void 0 ? "column" : _ref$direction, elevation = _ref.elevation, fill = _ref.fill, gap = _ref.gap, _onBlur = _ref.onBlur, onClick = _ref.onClick, _onFocus = _ref.onFocus, overflow = _ref.overflow, _ref$responsive = _ref.responsive, responsive = _ref$responsive === void 0 ? true : _ref$responsive, tag = _ref.tag, as = _ref.as, wrap = _ref.wrap, width = _ref.width, height = _ref.height, tabIndex = _ref.tabIndex, rest = Box_objectWithoutPropertiesLoose(_ref, [ "a11yTitle", "background", "border", "children", "direction", "elevation", "fill", "gap", "onBlur", "onClick", "onFocus", "overflow", "responsive", "tag", "as", "wrap", "width", "height", "tabIndex" ]);
            var theme = (0, react.useContext)(styled_components_browser_esm.ThemeContext) || default_props_defaultProps.theme;
            var focusable = (0, react.useMemo)((function() {
                return onClick && !(tabIndex < 0);
            }), [ onClick, tabIndex ]);
            var _useState = (0, react.useState)(), focus = _useState[0], setFocus = _useState[1];
            var clickProps = (0, react.useMemo)((function() {
                if (focusable) {
                    return {
                        onClick,
                        onFocus: function onFocus(event) {
                            setFocus(true);
                            if (_onFocus) _onFocus(event);
                        },
                        onBlur: function onBlur(event) {
                            setFocus(false);
                            if (_onBlur) _onBlur(event);
                        }
                    };
                }
                var result = {};
                if (_onBlur) result.onBlur = _onBlur;
                if (onClick) result.onClick = onClick;
                if (_onFocus) result.onFocus = _onFocus;
                return result;
            }), [ focusable, onClick, _onFocus, _onBlur ]);
            var adjustedTabIndex = (0, react.useMemo)((function() {
                if (tabIndex !== undefined) return tabIndex;
                if (focusable) return 0;
                return undefined;
            }), [ focusable, tabIndex ]);
            if ((border === "between" || border && border.side === "between") && !gap) {
                console.warn("Box must have a gap to use border between");
            }
            var contents = children;
            if (gap && gap !== "none") {
                var boxAs = !as && tag ? tag : as;
                contents = [];
                var firstIndex;
                react.Children.forEach(children, (function(child, index) {
                    if (child) {
                        if (firstIndex === undefined) {
                            firstIndex = index;
                        } else {
                            contents.push(react.createElement(StyledBoxGap, {
                                key: "gap-" + index,
                                as: boxAs === "span" ? boxAs : "div",
                                gap,
                                directionProp: direction,
                                responsive,
                                border
                            }));
                        }
                    }
                    contents.push(child);
                }));
            }
            if (background || theme.darkChanged) {
                var dark = backgroundIsDark(background, theme);
                var darkChanged = dark !== undefined && dark !== theme.dark;
                if (darkChanged || theme.darkChanged) {
                    dark = dark === undefined ? theme.dark : dark;
                    contents = react.createElement(styled_components_browser_esm.ThemeContext.Provider, {
                        value: Box_extends({}, theme, {
                            dark
                        })
                    }, contents);
                }
            }
            var content = react.createElement(StyledBox, Box_extends({
                as: !as && tag ? tag : as,
                "aria-label": a11yTitle,
                background,
                border,
                ref,
                directionProp: direction,
                elevationProp: elevation,
                fillProp: fill,
                focus,
                overflowProp: overflow,
                wrapProp: wrap,
                widthProp: width,
                heightProp: height,
                responsive,
                tabIndex: adjustedTabIndex
            }, clickProps, rest), contents);
            if (onClick) {
                content = react.createElement(KeyboardWrapper, {
                    onEnter: onClick
                }, content);
            }
            return content;
        }));
        Box_Box.displayName = "Box";
        var BoxDoc;
        if (false) {}
        var BoxWrapper = BoxDoc || Box_Box;
        var findScrollParent = function findScrollParent(element, horizontal) {
            var result;
            if (element) {
                var parent = element.parentNode;
                while (!result && parent && parent.getBoundingClientRect) {
                    var rect = parent.getBoundingClientRect();
                    if (horizontal) {
                        if (rect.width && parent.scrollWidth > rect.width + 10) {
                            result = parent;
                        }
                    } else if (rect.height && parent.scrollHeight > rect.height + 10) {
                        result = parent;
                    }
                    parent = parent.parentNode;
                }
                if (!result) {
                    result = document;
                } else if (result.tagName.toLowerCase() === "body") {
                    result = document;
                }
            }
            return result;
        };
        var documentTags = [ "html", "body" ];
        var findScrollParents = function findScrollParents(element, horizontal) {
            var result = [];
            if (element) {
                var parent = element.parentNode;
                while (parent && parent.getBoundingClientRect) {
                    var rect = parent.getBoundingClientRect();
                    if (horizontal) {
                        if (rect.width && parent.scrollWidth > rect.width + 10) {
                            result.push(parent);
                        }
                    } else if (rect.height && parent.scrollHeight > rect.height + 10) {
                        result.push(parent);
                    }
                    parent = parent.parentNode;
                }
                if (result.length === 0) {
                    result.push(document);
                } else if (documentTags.includes(result[0].tagName.toLowerCase())) {
                    result.length = 0;
                    result.push(document);
                }
            }
            return result;
        };
        var containsFocus = function containsFocus(node) {
            var element = document.activeElement;
            while (element) {
                if (element === node) break;
                element = element.parentElement;
            }
            return !!element;
        };
        var getFirstFocusableDescendant = function getFirstFocusableDescendant(element) {
            var children = element.getElementsByTagName("*");
            for (var i = 0; i < children.length; i += 1) {
                var child = children[i];
                var tagName = child.tagName.toLowerCase();
                if (tagName === "input" || tagName === "select") {
                    return child;
                }
            }
            return undefined;
        };
        var getBodyChildElements = function getBodyChildElements() {
            var excludeMatch = /^(script|link)$/i;
            var children = [];
            [].forEach.call(document.body.children, (function(node) {
                if (!excludeMatch.test(node.tagName)) {
                    children.push(node);
                }
            }));
            return children;
        };
        var getNewContainer = function getNewContainer(target, targetChildPosition) {
            if (target === void 0) {
                target = document.body;
            }
            var container = document.createElement("div");
            if (targetChildPosition === "first") {
                target.prepend(container);
            } else {
                target.appendChild(container);
            }
            return container;
        };
        var setFocusWithoutScroll = function setFocusWithoutScroll(element) {
            var x = window.scrollX;
            var y = window.scrollY;
            element.focus();
            window.scrollTo(x, y);
        };
        var TABINDEX = "tabindex";
        var TABINDEX_STATE = "data-g-tabindex";
        var makeNodeFocusable = function makeNodeFocusable(node) {
            if (!node.hasAttribute("aria-live")) {
                node.setAttribute("aria-hidden", false);
                var elements = node.getElementsByTagName("*");
                Array.prototype.filter.call(elements || [], (function(element) {
                    return element.hasAttribute(TABINDEX_STATE);
                })).forEach((function(element) {
                    var prior = element.getAttribute(TABINDEX_STATE);
                    if (prior >= 0) {
                        element.setAttribute(TABINDEX, element.getAttribute(TABINDEX_STATE));
                    } else if (prior === "none") {
                        element.removeAttribute(TABINDEX);
                    }
                    element.removeAttribute(TABINDEX_STATE);
                }));
            }
        };
        var autoFocusingTags = /(a|area|input|select|textarea|button|iframe)$/;
        var makeNodeUnfocusable = function makeNodeUnfocusable(node) {
            if (!node.hasAttribute("aria-live")) {
                node.setAttribute("aria-hidden", true);
                var elements = node.getElementsByTagName("*");
                Array.prototype.filter.call(elements || [], (function(element) {
                    return element.getAttribute(TABINDEX) !== null;
                })).forEach((function(element) {
                    element.setAttribute(TABINDEX_STATE, element.getAttribute(TABINDEX));
                    element.setAttribute(TABINDEX, -1);
                }));
                Array.prototype.filter.call(elements || [], (function(element) {
                    var currentTag = element.tagName.toLowerCase();
                    return currentTag.match(autoFocusingTags) && element.focus && element.getAttribute(TABINDEX_STATE) === null;
                })).forEach((function(element) {
                    element.setAttribute(TABINDEX_STATE, "none");
                    element.setAttribute(TABINDEX, -1);
                }));
            }
        };
        var findVisibleParent = function findVisibleParent(element) {
            if (element) {
                return element.offsetParent ? element : findVisibleParent(element.parentElement) || element;
            }
            return undefined;
        };
        var isNodeAfterScroll = function isNodeAfterScroll(node, target) {
            var _node$getBoundingClie = node.getBoundingClientRect(), bottom = _node$getBoundingClie.bottom;
            var _ref = target.getBoundingClientRect ? target.getBoundingClientRect() : {
                height: 0,
                top: 0
            }, height = _ref.height, top = _ref.top;
            return bottom >= top + height;
        };
        var isNodeBeforeScroll = function isNodeBeforeScroll(node, target) {
            var _node$getBoundingClie2 = node.getBoundingClientRect(), top = _node$getBoundingClie2.top;
            var _ref2 = target.getBoundingClientRect ? target.getBoundingClientRect() : {
                top: 0
            }, targetTop = _ref2.top;
            return top <= targetTop;
        };
        function FocusedContainer_extends() {
            FocusedContainer_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return FocusedContainer_extends.apply(this, arguments);
        }
        function FocusedContainer_objectWithoutPropertiesLoose(source, excluded) {
            if (source == null) return {};
            var target = {};
            var sourceKeys = Object.keys(source);
            var key, i;
            for (i = 0; i < sourceKeys.length; i++) {
                key = sourceKeys[i];
                if (excluded.indexOf(key) >= 0) continue;
                target[key] = source[key];
            }
            return target;
        }
        var isNotAncestorOf = function isNotAncestorOf(child) {
            return function(parent) {
                return !parent.contains(child);
            };
        };
        var FocusedContainer = function FocusedContainer(_ref) {
            var _ref$hidden = _ref.hidden, hidden = _ref$hidden === void 0 ? false : _ref$hidden, _ref$restrictScroll = _ref.restrictScroll, restrictScroll = _ref$restrictScroll === void 0 ? false : _ref$restrictScroll, children = _ref.children, trapFocus = _ref.trapFocus, rest = FocusedContainer_objectWithoutPropertiesLoose(_ref, [ "hidden", "restrictScroll", "children", "trapFocus" ]);
            var _useState = (0, react.useState)(""), bodyOverflowStyle = _useState[0], setBodyOverflowStyle = _useState[1];
            var ref = (0, react.useRef)(null);
            (0, react.useEffect)((function() {
                var removeTrap = function removeTrap() {
                    var child = ref.current;
                    getBodyChildElements().filter(isNotAncestorOf(child)).forEach(makeNodeFocusable);
                    if (restrictScroll) {
                        document.body.style.overflow = bodyOverflowStyle;
                    }
                };
                var handleTrapFocus = function handleTrapFocus() {
                    var child = ref.current;
                    getBodyChildElements().filter(isNotAncestorOf(child)).forEach(makeNodeUnfocusable);
                    if (restrictScroll && bodyOverflowStyle !== "hidden") {
                        setBodyOverflowStyle(document.body.style.overflow);
                        document.body.style.overflow = "hidden";
                    }
                };
                var timer = setTimeout((function() {
                    if (!hidden && trapFocus) {
                        handleTrapFocus();
                    }
                }), 0);
                return function() {
                    removeTrap();
                    clearTimeout(timer);
                };
            }), [ hidden, bodyOverflowStyle, restrictScroll, trapFocus ]);
            return react.createElement("div", FocusedContainer_extends({
                ref,
                "aria-hidden": hidden
            }, rest), children);
        };
        var PortalContext = react.createContext(undefined);
        function getTransformOriginStyle(align) {
            var vertical = "top";
            if (align.bottom) {
                vertical = "bottom";
            }
            var horizontal = "left";
            if (align.right) {
                horizontal = "right";
            }
            return vertical + " " + horizontal;
        }
        var dropKeyFrames = (0, styled_components_browser_esm.keyframes)([ "0%{opacity:0.5;transform:scale(0.8);}100%{opacity:1;transform:scale(1);}" ]);
        var StyledDrop = styled_components_browser_esm.default.div.withConfig({
            displayName: "StyledDrop",
            componentId: "sc-16s5rx8-0"
        })([ "", " border-radius:", ";position:fixed;z-index:", ";outline:none;", " opacity:0;transform-origin:", ";animation:", " 0.1s forwards;animation-delay:0.01s;@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){display:flex;align-items:stretch;}", "" ], baseStyle, (function(props) {
            return props.theme.global.drop.border.radius;
        }), (function(props) {
            return props.theme.global.drop.zIndex;
        }), (function(props) {
            return !props.plain && backgroundStyle(props.theme.global.drop.background, props.theme);
        }), (function(props) {
            return getTransformOriginStyle(props.alignProp);
        }), dropKeyFrames, (function(props) {
            return props.theme.global.drop && props.theme.global.drop.extend;
        }));
        StyledDrop.defaultProps = {};
        Object.setPrototypeOf(StyledDrop.defaultProps, default_props_defaultProps);
        function DropContainer_extends() {
            DropContainer_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return DropContainer_extends.apply(this, arguments);
        }
        function DropContainer_objectWithoutPropertiesLoose(source, excluded) {
            if (source == null) return {};
            var target = {};
            var sourceKeys = Object.keys(source);
            var key, i;
            for (i = 0; i < sourceKeys.length; i++) {
                key = sourceKeys[i];
                if (excluded.indexOf(key) >= 0) continue;
                target[key] = source[key];
            }
            return target;
        }
        var preventLayerClose = function preventLayerClose(event) {
            var key = event.keyCode ? event.keyCode : event.which;
            if (key === 27) {
                event.stopPropagation();
            }
        };
        var defaultAlign = {
            top: "top",
            left: "left"
        };
        var defaultPortalContext = [];
        var DropContainer = (0, react.forwardRef)((function(_ref, ref) {
            var _ref$align = _ref.align, align = _ref$align === void 0 ? defaultAlign : _ref$align, onAlign = _ref.onAlign, children = _ref.children, dropTarget = _ref.dropTarget, elevation = _ref.elevation, onClickOutside = _ref.onClickOutside, onEsc = _ref.onEsc, onKeyDown = _ref.onKeyDown, _ref$overflow = _ref.overflow, overflow = _ref$overflow === void 0 ? "auto" : _ref$overflow, plain = _ref.plain, responsive = _ref.responsive, restrictFocus = _ref.restrictFocus, _ref$stretch = _ref.stretch, stretch = _ref$stretch === void 0 ? "width" : _ref$stretch, trapFocus = _ref.trapFocus, rest = DropContainer_objectWithoutPropertiesLoose(_ref, [ "align", "onAlign", "children", "dropTarget", "elevation", "onClickOutside", "onEsc", "onKeyDown", "overflow", "plain", "responsive", "restrictFocus", "stretch", "trapFocus" ]);
            var theme = (0, react.useContext)(styled_components_browser_esm.ThemeContext) || default_props_defaultProps.theme;
            var portalContext = (0, react.useContext)(PortalContext) || defaultPortalContext;
            var portalId = (0, react.useMemo)((function() {
                return portalContext.length;
            }), [ portalContext ]);
            var nextPortalContext = (0, react.useMemo)((function() {
                return [].concat(portalContext, [ portalId ]);
            }), [ portalContext, portalId ]);
            var dropRef = (0, react.useRef)();
            (0, react.useEffect)((function() {
                var notifyAlign = function notifyAlign() {
                    var styleCurrent = (ref || dropRef).current.style;
                    var alignControl = styleCurrent.top !== "" ? "top" : "bottom";
                    onAlign(alignControl);
                };
                var place = function place(preserveHeight) {
                    var windowWidth = window.innerWidth;
                    var windowHeight = window.innerHeight;
                    var target = dropTarget;
                    var container = (ref || dropRef).current;
                    if (container && target) {
                        container.style.left = "";
                        container.style.top = "";
                        container.style.bottom = "";
                        container.style.width = "";
                        if (!preserveHeight) {
                            container.style.maxHeight = "";
                        }
                        var targetRect = target.getBoundingClientRect();
                        var containerRect = container.getBoundingClientRect();
                        var width;
                        if (stretch) {
                            width = Math.min(stretch === "align" ? Math.min(targetRect.width, containerRect.width) : Math.max(targetRect.width, containerRect.width), windowWidth);
                        } else {
                            width = Math.min(containerRect.width, windowWidth);
                        }
                        var left;
                        if (align.left) {
                            if (align.left === "left") {
                                left = targetRect.left;
                            } else if (align.left === "right") {
                                left = targetRect.left + targetRect.width;
                            }
                        } else if (align.right) {
                            if (align.right === "left") {
                                left = targetRect.left - width;
                            } else if (align.right === "right") {
                                left = targetRect.left + targetRect.width - width;
                            }
                        } else {
                            left = targetRect.left + targetRect.width / 2 - width / 2;
                        }
                        if (left + width > windowWidth) {
                            left -= left + width - windowWidth;
                        } else if (left < 0) {
                            left = 0;
                        }
                        var top;
                        var bottom;
                        var maxHeight = containerRect.height;
                        if (align.top) {
                            if (align.top === "top") {
                                top = targetRect.top;
                            } else {
                                top = targetRect.bottom;
                            }
                            var percentVisibleAreaBelow = 100 - targetRect.bottom / windowHeight * 100;
                            if (windowHeight === top || percentVisibleAreaBelow <= 20) {
                                top = "";
                                if (align.top === "bottom") {
                                    bottom = targetRect.top;
                                } else {
                                    bottom = targetRect.bottom;
                                }
                                maxHeight = bottom;
                                container.style.maxHeight = maxHeight + "px";
                            } else if (top > 0) {
                                maxHeight = windowHeight - top;
                                container.style.maxHeight = maxHeight + "px";
                            } else {
                                maxHeight = windowHeight - top;
                            }
                        } else if (align.bottom) {
                            if (align.bottom === "bottom") {
                                bottom = targetRect.bottom;
                            } else {
                                bottom = targetRect.top;
                            }
                            maxHeight = bottom;
                            container.style.maxHeight = maxHeight + "px";
                        } else {
                            top = targetRect.top + targetRect.height / 2 - containerRect.height / 2;
                            maxHeight = windowHeight - top;
                        }
                        if (responsive && (containerRect.height > maxHeight || maxHeight < windowHeight / 10)) {
                            if (align.top && top > windowHeight / 2) {
                                top = "";
                                if (align.top === "bottom") {
                                    bottom = targetRect.top;
                                } else {
                                    bottom = targetRect.bottom;
                                }
                                maxHeight = bottom;
                            } else if (align.bottom && maxHeight < windowHeight / 2) {
                                bottom = "";
                                if (align.bottom === "bottom") {
                                    top = targetRect.top;
                                } else {
                                    top = targetRect.bottom;
                                }
                                maxHeight = windowHeight - top;
                            }
                        }
                        container.style.left = left + "px";
                        if (stretch) {
                            container.style.width = width + .1 + "px";
                        }
                        if (top !== "") {
                            container.style.top = top + "px";
                        }
                        if (bottom !== "") {
                            container.style.bottom = windowHeight - bottom + "px";
                        }
                        if (!preserveHeight) {
                            if (theme.drop && theme.drop.maxHeight) {
                                maxHeight = Math.min(maxHeight, parseMetricToNum(theme.drop.maxHeight));
                            }
                            container.style.maxHeight = maxHeight + "px";
                        }
                    }
                    if (onAlign) notifyAlign();
                };
                var scrollParents;
                var addScrollListeners = function addScrollListeners() {
                    scrollParents = findScrollParents(dropTarget);
                    scrollParents.forEach((function(scrollParent) {
                        return scrollParent.addEventListener("scroll", place);
                    }));
                };
                var removeScrollListeners = function removeScrollListeners() {
                    scrollParents.forEach((function(scrollParent) {
                        return scrollParent.removeEventListener("scroll", place);
                    }));
                    scrollParents = [];
                };
                var onClickDocument = function onClickDocument(event) {
                    var clickedPortalId = null;
                    var node = event.target;
                    while (clickedPortalId === null && node !== document) {
                        var attr = node.getAttribute("data-g-portal-id");
                        if (attr !== null) clickedPortalId = parseInt(attr, 10);
                        node = node.parentNode;
                    }
                    if (clickedPortalId === null || portalContext.indexOf(clickedPortalId) !== -1) {
                        onClickOutside(event);
                    }
                };
                var onResize = function onResize() {
                    removeScrollListeners();
                    addScrollListeners();
                    place(false);
                };
                addScrollListeners();
                window.addEventListener("resize", onResize);
                if (onClickOutside) {
                    document.addEventListener("mousedown", onClickDocument);
                }
                place(false);
                return function() {
                    removeScrollListeners();
                    window.removeEventListener("resize", onResize);
                    if (onClickOutside) {
                        document.removeEventListener("mousedown", onClickDocument);
                    }
                };
            }), [ align, onAlign, dropTarget, onClickOutside, portalContext, portalId, ref, responsive, restrictFocus, stretch, theme.drop ]);
            (0, react.useEffect)((function() {
                if (restrictFocus) {
                    (ref || dropRef).current.focus();
                }
            }), [ ref, restrictFocus ]);
            var content = react.createElement(StyledDrop, DropContainer_extends({
                ref: ref || dropRef,
                as: BoxWrapper,
                plain,
                elevation: !plain ? elevation || theme.global.drop.shadowSize || "small" : undefined,
                tabIndex: "-1",
                alignProp: align,
                overflow,
                "data-g-portal-id": portalId
            }, rest), children);
            if (theme.global.drop.background) {
                var dark = backgroundIsDark(theme.global.drop.background, theme);
                if (dark !== undefined && dark !== theme.dark) {
                    content = react.createElement(styled_components_browser_esm.ThemeContext.Provider, {
                        value: DropContainer_extends({}, theme, {
                            dark
                        })
                    }, content);
                }
            }
            return react.createElement(PortalContext.Provider, {
                value: nextPortalContext
            }, react.createElement(FocusedContainer, {
                onKeyDown: onEsc && preventLayerClose,
                trapFocus
            }, react.createElement(KeyboardWrapper, {
                capture: true,
                onEsc: onEsc ? function(event) {
                    event.stopPropagation();
                    onEsc(event);
                } : undefined,
                onKeyDown,
                target: "document"
            }, content)));
        }));
        function Drop_extends() {
            Drop_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return Drop_extends.apply(this, arguments);
        }
        function Drop_objectWithoutPropertiesLoose(source, excluded) {
            if (source == null) return {};
            var target = {};
            var sourceKeys = Object.keys(source);
            var key, i;
            for (i = 0; i < sourceKeys.length; i++) {
                key = sourceKeys[i];
                if (excluded.indexOf(key) >= 0) continue;
                target[key] = source[key];
            }
            return target;
        }
        var Drop = (0, react.forwardRef)((function(_ref, ref) {
            var restrictFocus = _ref.restrictFocus, dropTarget = _ref.target, _ref$trapFocus = _ref.trapFocus, trapFocus = _ref$trapFocus === void 0 ? true : _ref$trapFocus, rest = Drop_objectWithoutPropertiesLoose(_ref, [ "restrictFocus", "target", "trapFocus" ]);
            var theme = (0, react.useContext)(styled_components_browser_esm.ThemeContext) || default_props_defaultProps.theme;
            var _useState = (0, react.useState)(), originalFocusedElement = _useState[0], setOriginalFocusedElement = _useState[1];
            (0, react.useEffect)((function() {
                return setOriginalFocusedElement(document.activeElement);
            }), []);
            var _useState2 = (0, react.useState)(), dropContainer = _useState2[0], setDropContainer = _useState2[1];
            var containerTarget = (0, react.useContext)(ContainerTargetContext);
            (0, react.useEffect)((function() {
                return setDropContainer(getNewContainer(containerTarget));
            }), [ containerTarget ]);
            (0, react.useEffect)((function() {
                return function() {
                    if (restrictFocus && originalFocusedElement) {
                        if (originalFocusedElement.focus) {
                            setFocusWithoutScroll(originalFocusedElement);
                        } else if (originalFocusedElement.parentNode && originalFocusedElement.parentNode.focus) {
                            setFocusWithoutScroll(originalFocusedElement.parentNode);
                        }
                    }
                    if (dropContainer) {
                        containerTarget.removeChild(dropContainer);
                    }
                };
            }), [ containerTarget, dropContainer, originalFocusedElement, restrictFocus ]);
            return dropContainer ? (0, react_dom.createPortal)(react.createElement(DropContainer, Drop_extends({
                ref,
                dir: theme && theme.dir,
                dropTarget,
                restrictFocus,
                trapFocus
            }, rest)), dropContainer) : null;
        }));
        Drop.displayName = "Drop";
        var DropDoc;
        if (false) {}
        var DropWrapper = DropDoc || Drop;
        var useForwardedRef = function useForwardedRef(ref) {
            var innerRef = (0, react.useRef)(null);
            (0, react.useEffect)((function() {
                if (!ref) return;
                if (typeof ref === "function") {
                    ref(innerRef.current);
                } else {
                    ref.current = innerRef.current;
                }
            }));
            return innerRef;
        };
        function Tip_extends() {
            Tip_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return Tip_extends.apply(this, arguments);
        }
        var Tip = (0, react.forwardRef)((function(_ref, tipRef) {
            var children = _ref.children, content = _ref.content, dropProps = _ref.dropProps, plain = _ref.plain;
            var theme = (0, react.useContext)(styled_components_browser_esm.ThemeContext);
            var _useState = (0, react.useState)(false), over = _useState[0], setOver = _useState[1];
            var componentRef = useForwardedRef(tipRef);
            var wrapInvalidElement = function wrapInvalidElement() {
                return !react.isValidElement(children) ? react.createElement("span", null, children) : children;
            };
            var child = react.Children.count(children) === 1 ? wrapInvalidElement() : react.Children.only(children);
            var clonedChild = (0, react.cloneElement)(child, {
                onMouseOver: function onMouseOver() {
                    return setOver(true);
                },
                onMouseLeave: function onMouseLeave() {
                    return setOver(false);
                },
                onFocus: function onFocus() {
                    return setOver(true);
                },
                onBlur: function onBlur() {
                    return setOver(false);
                },
                key: "tip-child",
                ref: function ref(node) {
                    if (typeof componentRef === "function") {
                        componentRef(node);
                    } else if (componentRef) {
                        componentRef.current = node;
                    }
                    var callerRef = child.ref;
                    if (typeof callerRef === "function") {
                        callerRef(node);
                    } else if (callerRef) {
                        callerRef.current = node;
                    }
                }
            });
            return [ clonedChild, over && react.createElement(DropWrapper, Tip_extends({
                target: componentRef.current,
                trapFocus: false,
                key: "tip-drop",
                plain: true
            }, theme.tip.drop, dropProps), plain ? content : react.createElement(BoxWrapper, theme.tip.content, content)) ];
        }));
        Tip.displayName = "Tip";
        var TipDoc;
        if (false) {}
        var TipWrapper = TipDoc || Tip;
        var radiusStyle = function radiusStyle(props) {
            var isIconOnly = props.hasIcon && !props.hasLabel;
            var size = props.sizeProp;
            if (!isIconOnly && size && props.theme.button.size && props.theme.button.size[size]) {
                return props.theme.button.size[size].border.radius;
            }
            return props.theme.button.border.radius;
        };
        var StyledButton_fontStyle = function fontStyle(props) {
            var size = props.sizeProp || "medium";
            var data = props.theme.text[size];
            return (0, styled_components_browser_esm.css)([ "font-size:", ";line-height:", ";" ], data.size, data.height);
        };
        var padStyle = function padStyle(props) {
            var size = props.sizeProp;
            if (size && props.theme.button.size && props.theme.button.size[size]) {
                return (0, styled_components_browser_esm.css)([ "", " ", "" ], props.theme.button.size[size].pad.vertical, props.theme.button.size[size].pad.horizontal);
            }
            return (0, styled_components_browser_esm.css)([ "", " ", "" ], props.theme.button.padding.vertical, props.theme.button.padding.horizontal);
        };
        var basicStyle = function basicStyle(props) {
            return (0, styled_components_browser_esm.css)([ "border:", " solid ", ";border-radius:", ";color:", ";padding:", ";", "" ], props.theme.button.border.width, colors_normalizeColor(props.colorValue || props.theme.button.border.color || "control", props.theme), radiusStyle(props), colors_normalizeColor(props.theme.button.color || "text", props.theme), padStyle(props), StyledButton_fontStyle(props));
        };
        var primaryStyle = function primaryStyle(props) {
            return (0, styled_components_browser_esm.css)([ "", " border-radius:", ";", "" ], backgroundStyle(colors_normalizeColor(props.colorValue || props.theme.button.primary && props.theme.button.primary.color || "control", props.theme), props.theme, props.theme.button.color), radiusStyle(props), props.theme.button.primary && props.theme.button.primary.extend);
        };
        function getHoverColor(props) {
            if (props.colorValue) {
                return colors_normalizeColor(props.colorValue, props.theme);
            }
            if (props.active && props.primary && props.theme.button.primary && props.theme.button.primary.active && props.theme.button.primary.active.border && props.theme.button.primary.active.border.color) {
                return colors_normalizeColor(props.theme.button.primary.active.border.color, props.theme);
            }
            return colors_normalizeColor(props.theme.button.border.color || "control", props.theme);
        }
        var hoverStyle = (0, styled_components_browser_esm.css)([ "&:hover{", " ", ";}" ], (function(props) {
            return props.hoverIndicator && getHoverIndicatorStyle(props.hoverIndicator, props.theme);
        }), (function(props) {
            return !props.plain && (0, styled_components_browser_esm.css)([ "box-shadow:0px 0px 0px 2px ", ";" ], getHoverColor(props));
        }));
        var StyledButton_fillStyle = function fillStyle(fillContainer) {
            if (fillContainer === "horizontal") {
                return "width: 100%;";
            }
            if (fillContainer === "vertical") {
                return "height: 100%;";
            }
            if (fillContainer) {
                return "\n      width: 100%;\n      height: 100%;\n      max-width: none;\n      flex: 1 0 auto;\n    ";
            }
            return undefined;
        };
        var plainStyle = function plainStyle(props) {
            return (0, styled_components_browser_esm.css)([ "color:", ";outline:none;border:none;padding:0;text-align:inherit;" ], colors_normalizeColor(props.colorValue || "inherit", props.theme));
        };
        var activeButtonStyle = function activeButtonStyle(props) {
            return (0, styled_components_browser_esm.css)([ "", " ", " ", "" ], activeStyle, props.primary && props.theme.button.primary && props.theme.button.primary.active && props.theme.button.primary.active.border && props.theme.button.primary.active.border.color && "border: " + props.theme.button.border.width + " solid\n    " + colors_normalizeColor(props.theme.button.primary.active.border.color, props.theme) + ";\n    ", props.primary && props.theme.button.primary && props.theme.button.primary.active && props.theme.button.primary.active.extend);
        };
        var disabledButtonStyle = function disabledButtonStyle(props) {
            return (0, styled_components_browser_esm.css)([ "", " ", " ", " ", "" ], disabledStyle(props.theme.button.disabled.opacity), !props.plain && props.theme.button.disabled.border && props.theme.button.disabled.border.color && "border: " + props.theme.button.border.width + " solid\n    " + colors_normalizeColor(props.theme.button.disabled.border.color, props.theme) + ";", props.theme.button.disabled.color && (props.primary ? backgroundStyle(colors_normalizeColor(props.theme.button.disabled.color, props.theme), props.theme, props.theme.button.color) : "color: " + colors_normalizeColor(props.theme.button.disabled.color, props.theme) + ";"), props.theme.button.disabled && props.theme.button.disabled.extend);
        };
        var StyledButton = styled_components_browser_esm.default.button.withConfig({
            displayName: "StyledButton",
            componentId: "sc-323bzc-0"
        })([ "display:inline-block;box-sizing:border-box;cursor:pointer;font:inherit;text-decoration:none;margin:0;background:transparent;overflow:visible;text-transform:none;", " ", " ", " ", " ", " ", " ", " &:focus{", "}", " ", " ", " ", " ", "" ], genericStyles, (function(props) {
            return props.plain && plainStyle(props);
        }), (function(props) {
            return !props.plain && basicStyle(props);
        }), (function(props) {
            return props.primary && primaryStyle(props);
        }), (function(props) {
            return !props.disabled && !props.focus && hoverStyle;
        }), (function(props) {
            return !props.disabled && props.active && activeButtonStyle(props);
        }), (function(props) {
            return props.disabled && props.theme.button && props.theme.button.disabled && disabledButtonStyle(props);
        }), (function(props) {
            return (!props.plain || props.focusIndicator) && focusStyle();
        }), (function(props) {
            return !props.plain && props.theme.button.transition && "\n    transition-property: " + props.theme.button.transition.properties.join(",") + ";\n    transition-duration: " + props.theme.button.transition.duration + "s;\n    transition-timing-function: " + props.theme.button.transition.timing + ";\n  ";
        }), (function(props) {
            return props.fillContainer && StyledButton_fillStyle(props.fillContainer);
        }), (function(props) {
            return props.hasIcon && !props.hasLabel && "\n    line-height: 0;\n  ";
        }), (function(props) {
            return props.pad && props.hasIcon && !props.hasLabel && "\n    padding: " + props.theme.global.edgeSize.small + ";\n  ";
        }), (function(props) {
            return props.theme.button && props.theme.button.extend;
        }));
        StyledButton.defaultProps = {};
        Object.setPrototypeOf(StyledButton.defaultProps, default_props_defaultProps);
        var StyledButtonKind_radiusStyle = function radiusStyle(props) {
            var size = props.sizeProp;
            if (size && props.theme.button.size && props.theme.button.size[size]) return (0, 
            styled_components_browser_esm.css)([ "border-radius:", ";" ], props.theme.button.size[size].border.radius);
            if (props.theme.button.border && props.theme.button.border.radius) return (0, styled_components_browser_esm.css)([ "border-radius:", ";" ], props.theme.button.border.radius);
            return "";
        };
        var StyledButtonKind_fontStyle = function fontStyle(props) {
            var size = props.sizeProp || "medium";
            var data = props.theme.text[size];
            return (0, styled_components_browser_esm.css)([ "font-size:", ";line-height:", ";" ], data.size, data.height);
        };
        var padFromTheme = function padFromTheme(size, theme) {
            if (size && theme.button.size && theme.button.size[size] && theme.button.size[size].pad) {
                return {
                    vertical: theme.button.size[size].pad.vertical,
                    horizontal: theme.button.size[size].pad.horizontal
                };
            }
            if (theme.button.padding) {
                return {
                    vertical: theme.global.edgeSize[theme.button.padding.vertical] || theme.button.padding.vertical,
                    horizontal: theme.global.edgeSize[theme.button.padding.horizontal] || theme.button.padding.horizontal
                };
            }
            return undefined;
        };
        var StyledButtonKind_padStyle = function padStyle(_ref) {
            var size = _ref.sizeProp, theme = _ref.theme;
            var pad = padFromTheme(size, theme);
            return pad ? (0, styled_components_browser_esm.css)([ "padding:", " ", ";" ], pad.vertical, pad.horizontal) : "";
        };
        var StyledButtonKind_basicStyle = function basicStyle(props) {
            return (0, styled_components_browser_esm.css)([ "border:none;", ";", " ", " > svg{vertical-align:bottom;}" ], StyledButtonKind_radiusStyle(props), StyledButtonKind_padStyle(props), StyledButtonKind_fontStyle(props));
        };
        var getPath = function getPath(theme, path) {
            var obj;
            if (path) {
                obj = theme;
                var parts = path.split(".");
                while (obj && parts.length) {
                    obj = obj[parts.shift()];
                }
            }
            return obj;
        };
        var adjustPadStyle = function adjustPadStyle(pad, width) {
            var offset = parseMetricToNum(width);
            return (0, styled_components_browser_esm.css)([ "padding:", "px ", "px;" ], parseMetricToNum(pad.vertical) - offset, parseMetricToNum(pad.horizontal) - offset);
        };
        var kindStyle = function kindStyle(_ref2) {
            var colorValue = _ref2.colorValue, size = _ref2.sizeProp, themePaths = _ref2.themePaths, theme = _ref2.theme;
            var styles = [];
            var pad = padFromTheme(size, theme);
            themePaths.base.forEach((function(themePath) {
                var obj = getPath(theme, "button." + themePath);
                if (obj) {
                    styles.push(kindPartStyles(obj, theme, colorValue));
                    if (obj.border && obj.border.width && pad && !obj.padding) {
                        styles.push(adjustPadStyle(pad, obj.border.width));
                    }
                }
            }));
            themePaths.hover.forEach((function(themePath) {
                var obj = getPath(theme, "button." + themePath);
                if (obj) {
                    var partStyles = kindPartStyles(obj, theme);
                    var adjPadStyles = "";
                    if (obj.border && obj.border.width && pad && !obj.padding) {
                        adjPadStyles = adjustPadStyle(pad, obj.border.width);
                    }
                    if (partStyles.length > 0) {
                        styles.push((0, styled_components_browser_esm.css)([ "&:hover{", " ", "}" ], partStyles, adjPadStyles));
                    }
                }
            }));
            return styles;
        };
        var hoverIndicatorStyle = function hoverIndicatorStyle(_ref3) {
            var hoverIndicator = _ref3.hoverIndicator, theme = _ref3.theme;
            var themishObj = {};
            if (hoverIndicator === true || hoverIndicator === "background") themishObj.background = theme.global.hover.background; else themishObj.background = hoverIndicator;
            var styles = kindPartStyles(themishObj, theme);
            if (styles.length > 0) return (0, styled_components_browser_esm.css)([ "&:hover{", "}" ], styles);
            return "";
        };
        var StyledButtonKind_fillStyle = function fillStyle(fillContainer) {
            if (fillContainer === "horizontal") {
                return "width: 100%;";
            }
            if (fillContainer === "vertical") {
                return "height: 100%;";
            }
            if (fillContainer) {
                return "\n      width: 100%;\n      height: 100%;\n      max-width: none;\n      flex: 1 0 auto;\n    ";
            }
            return undefined;
        };
        var StyledButtonKind_plainStyle = function plainStyle() {
            return (0, styled_components_browser_esm.css)([ "outline:none;border:none;padding:0;text-align:inherit;color:inherit;> svg{vertical-align:bottom;}" ]);
        };
        var StyledButtonKind = styled_components_browser_esm.default.button.attrs((function() {
            return {
                kind: undefined
            };
        })).withConfig({
            displayName: "StyledButtonKind",
            componentId: "sc-1vhfpnt-0"
        })([ "display:inline-block;box-sizing:border-box;cursor:pointer;font:inherit;text-decoration:none;margin:0;background:transparent;overflow:visible;text-transform:none;", " ", " ", " ", " ", " ", " ", " ", " &:focus{", "}", " ", " ", "" ], genericStyles, (function(props) {
            return props.plain && StyledButtonKind_plainStyle(props);
        }), (function(props) {
            return !props.disabled && props.active && activeStyle;
        }), (function(props) {
            return !props.plain && StyledButtonKind_basicStyle(props);
        }), (function(props) {
            return !props.plain && kindStyle(props);
        }), (function(props) {
            return !props.plain && props.align && "\n    text-align: " + props.align + ";\n    ";
        }), (function(props) {
            return !props.disabled && props.hoverIndicator && hoverIndicatorStyle(props);
        }), (function(props) {
            return props.disabled && disabledStyle(props.theme.button.disabled.opacity);
        }), (function(props) {
            return (!props.plain || props.focusIndicator) && focusStyle();
        }), (function(props) {
            return !props.plain && props.theme.button.transition && "\n    transition-property: " + props.theme.button.transition.properties.join(",") + ";\n    transition-duration: " + props.theme.button.transition.duration + "s;\n    transition-timing-function: " + props.theme.button.transition.timing + ";\n  ";
        }), (function(props) {
            return props.fillContainer && StyledButtonKind_fillStyle(props.fillContainer);
        }), (function(props) {
            return props.theme.button && props.theme.button.extend;
        }));
        StyledButtonKind.defaultProps = {};
        Object.setPrototypeOf(StyledButtonKind.defaultProps, default_props_defaultProps);
        function Button_extends() {
            Button_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return Button_extends.apply(this, arguments);
        }
        function Button_objectWithoutPropertiesLoose(source, excluded) {
            if (source == null) return {};
            var target = {};
            var sourceKeys = Object.keys(source);
            var key, i;
            for (i = 0; i < sourceKeys.length; i++) {
                key = sourceKeys[i];
                if (excluded.indexOf(key) >= 0) continue;
                target[key] = source[key];
            }
            return target;
        }
        var getIconColor = function getIconColor(paths, theme, colorProp) {
            if (paths === void 0) {
                paths = [];
            }
            var result = [];
            var index = paths.length - 1;
            while (index >= 0 && !result[1]) {
                var obj = theme.button;
                if (paths[index]) {
                    var parts = paths[index].split(".");
                    while (obj && parts.length) {
                        obj = obj[parts.shift()];
                    }
                }
                if (obj) {
                    var background = colorProp && obj.background && obj.background.color ? colorProp : obj.background;
                    var objColor = obj.color || (Object.prototype.hasOwnProperty.call(obj, "color") && obj.color === undefined ? false : undefined);
                    var color = colorProp && (!obj.background || !obj.background.color) && (!obj.border || !obj.border.color) ? colorProp : objColor;
                    result = backgroundAndTextColors(background, color, theme);
                }
                index -= 1;
            }
            return result[1] || undefined;
        };
        var Button = (0, react.forwardRef)((function(_ref, ref) {
            var a11yTitle = _ref.a11yTitle, active = _ref.active, _ref$align = _ref.align, align = _ref$align === void 0 ? "center" : _ref$align, color = _ref.color, children = _ref.children, disabled = _ref.disabled, icon = _ref.icon, _ref$focusIndicator = _ref.focusIndicator, focusIndicator = _ref$focusIndicator === void 0 ? true : _ref$focusIndicator, _ref$gap = _ref.gap, gap = _ref$gap === void 0 ? "small" : _ref$gap, fill = _ref.fill, href = _ref.href, kindArg = _ref.kind, label = _ref.label, _onBlur = _ref.onBlur, onClick = _ref.onClick, _onFocus = _ref.onFocus, onMouseOut = _ref.onMouseOut, onMouseOver = _ref.onMouseOver, plain = _ref.plain, primary = _ref.primary, reverse = _ref.reverse, secondary = _ref.secondary, selected = _ref.selected, size = _ref.size, tip = _ref.tip, _ref$type = _ref.type, type = _ref$type === void 0 ? "button" : _ref$type, as = _ref.as, rest = Button_objectWithoutPropertiesLoose(_ref, [ "a11yTitle", "active", "align", "color", "children", "disabled", "icon", "focusIndicator", "gap", "fill", "href", "kind", "label", "onBlur", "onClick", "onFocus", "onMouseOut", "onMouseOver", "plain", "primary", "reverse", "secondary", "selected", "size", "tip", "type", "as" ]);
            var theme = (0, react.useContext)(styled_components_browser_esm.ThemeContext) || default_props_defaultProps.theme;
            var _useState = (0, react.useState)(), focus = _useState[0], setFocus = _useState[1];
            var _useState2 = (0, react.useState)(false), hover = _useState2[0], setHover = _useState2[1];
            if ((icon || label) && children) {
                console.warn("Button should not have children if icon or label is provided");
            }
            var kind = (0, react.useMemo)((function() {
                if (theme.button["default"]) {
                    if (kindArg) return kindArg;
                    if (primary) return "primary";
                    if (secondary) return "secondary";
                    return "default";
                }
                return undefined;
            }), [ kindArg, primary, secondary, theme.button["default"] ]);
            var themePaths = (0, react.useMemo)((function() {
                if (!kind || plain) return undefined;
                var result = {
                    base: [],
                    hover: []
                };
                result.base.push(kind);
                if (selected) {
                    result.base.push("selected", "selected." + kind);
                }
                if (disabled) {
                    result.base.push("disabled", "disabled." + kind);
                } else {
                    if (active) {
                        result.base.push("active", "active." + kind);
                    }
                    result.hover.push("hover", "hover." + kind);
                    if (active) {
                        result.hover.push("hover.active", "hover.active." + kind);
                    }
                }
                return result;
            }), [ active, disabled, kind, plain, selected ]);
            var isDarkBackground = function isDarkBackground() {
                var backgroundColor = normalizeBackground(colors_normalizeColor(color || theme.button.primary && theme.button.primary.color || theme.global.colors.control || "brand", theme), theme);
                return colorIsDark(backgroundColor, theme);
            };
            var onMouseOverButton = function onMouseOverButton(event) {
                setHover(true);
                if (onMouseOver) {
                    onMouseOver(event);
                }
            };
            var onMouseOutButton = function onMouseOutButton(event) {
                setHover(false);
                if (onMouseOut) {
                    onMouseOut(event);
                }
            };
            var buttonIcon = icon;
            if (icon && !icon.props.color) {
                if (kind) {
                    if (!plain) {
                        var iconColor = hover && getIconColor(themePaths.hover, theme) || getIconColor(themePaths.base, theme, color);
                        if (iconColor) buttonIcon = (0, react.cloneElement)(icon, {
                            color: iconColor
                        });
                    }
                } else if (primary) {
                    buttonIcon = (0, react.cloneElement)(icon, {
                        color: theme.global.colors.text[isDarkBackground() ? "dark" : "light"]
                    });
                }
            }
            var domTag = !as && href ? "a" : as;
            var first = reverse ? label : buttonIcon;
            var second = reverse ? buttonIcon : label;
            var contents;
            if (first && second) {
                contents = react.createElement(BoxWrapper, {
                    direction: "row",
                    align: "center",
                    justify: align === "center" ? "center" : "between",
                    gap,
                    responsive: false
                }, first, second);
            } else if (typeof children === "function") {
                contents = children({
                    disabled,
                    hover,
                    focus
                });
            } else {
                contents = first || second || children;
            }
            var styledButtonResult;
            if (kind) {
                styledButtonResult = react.createElement(StyledButtonKind, Button_extends({}, rest, {
                    as: domTag,
                    ref,
                    active,
                    align,
                    "aria-label": a11yTitle,
                    colorValue: color,
                    disabled,
                    gap,
                    fillContainer: fill,
                    focus,
                    focusIndicator,
                    href,
                    kind,
                    themePaths,
                    onClick,
                    onFocus: function onFocus(event) {
                        setFocus(true);
                        if (_onFocus) _onFocus(event);
                    },
                    onBlur: function onBlur(event) {
                        setFocus(false);
                        if (_onBlur) _onBlur(event);
                    },
                    onMouseOver: onMouseOverButton,
                    onMouseOut: onMouseOutButton,
                    plain: plain || react.Children.count(children) > 0,
                    primary,
                    sizeProp: size,
                    type: !href ? type : undefined
                }), contents);
            } else {
                styledButtonResult = react.createElement(StyledButton, Button_extends({}, rest, {
                    as: domTag,
                    ref,
                    "aria-label": a11yTitle,
                    colorValue: color,
                    active,
                    selected,
                    disabled,
                    hasIcon: !!icon,
                    gap,
                    hasLabel: !!label,
                    fillContainer: fill,
                    focus,
                    focusIndicator,
                    href,
                    kind,
                    themePaths,
                    onClick,
                    onFocus: function onFocus(event) {
                        setFocus(true);
                        if (_onFocus) _onFocus(event);
                    },
                    onBlur: function onBlur(event) {
                        setFocus(false);
                        if (_onBlur) _onBlur(event);
                    },
                    onMouseOver: onMouseOverButton,
                    onMouseOut: onMouseOutButton,
                    pad: !plain,
                    plain: typeof plain !== "undefined" ? plain : react.Children.count(children) > 0 || icon && !label,
                    primary,
                    sizeProp: size,
                    type: !href ? type : undefined
                }), contents);
            }
            if (tip) {
                if (typeof tip === "string") {
                    return react.createElement(TipWrapper, {
                        content: tip
                    }, styledButtonResult);
                }
                return react.createElement(TipWrapper, tip, styledButtonResult);
            }
            return styledButtonResult;
        }));
        Button.displayName = "Button";
        var ButtonDoc;
        if (false) {}
        var ButtonWrapper = ButtonDoc || Button;
        var useBreakpoint = function(value) {
            var normalizedValue = Array.isArray(value) ? value : [ value ];
            if (normalizedValue.length > breakpoints.length) {
                throw new Error("There should be no more than " + breakpoints.length + " value entries");
            }
            var currentBreakpoint = react.useContext(BreakpointContext).currentBreakpoint;
            var missingValues = Array(breakpoints.length - normalizedValue.length).fill(normalizedValue[normalizedValue.length - 1]);
            var newValues = (0, tslib_es6.__spreadArrays)(normalizedValue, missingValues);
            return newValues[currentBreakpoint];
        };
        var TooltipArrow_arrowStyle = "\n\tposition: absolute;\n\tborder: solid;\n\tborder-width: 0 1px 1px 0;\n\tdisplay: inline-block;\n\tpadding: 3px;\n\tbackground-color: white;\n";
        var TooltipArrow_TooltipTopArrow = styled_components_browser_esm.default.div(TooltipArrow_templateObject_1 || (TooltipArrow_templateObject_1 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\t", "\n\tborder-color: ", ";\n\tbottom: 2px;\n\tleft: 50%;\n\tmargin-left: -3px;\n\ttransform: rotate(45deg);\n" ], [ "\n\t", "\n\tborder-color: ", ";\n\tbottom: 2px;\n\tleft: 50%;\n\tmargin-left: -3px;\n\ttransform: rotate(45deg);\n" ])), TooltipArrow_arrowStyle, (function(props) {
            return props.theme.colors.gray.main;
        }));
        var TooltipArrow_TooltipRightArrow = styled_components_browser_esm.default.div(TooltipArrow_templateObject_2 || (TooltipArrow_templateObject_2 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\t", "\n\tborder-color: ", ";\n\ttop: 50%;\n\tleft: 2px;\n\tmargin-top: -3px;\n\ttransform: rotate(135deg);\n" ], [ "\n\t", "\n\tborder-color: ", ";\n\ttop: 50%;\n\tleft: 2px;\n\tmargin-top: -3px;\n\ttransform: rotate(135deg);\n" ])), TooltipArrow_arrowStyle, (function(props) {
            return props.theme.colors.gray.main;
        }));
        var TooltipArrow_TooltipLeftArrow = styled_components_browser_esm.default.div(TooltipArrow_templateObject_3 || (TooltipArrow_templateObject_3 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\t", "\n\tborder-color: ", ";\n\ttop: 50%;\n\tright: 2px;\n\tmargin-top: -3px;\n\ttransform: rotate(-45deg);\n" ], [ "\n\t", "\n\tborder-color: ", ";\n\ttop: 50%;\n\tright: 2px;\n\tmargin-top: -3px;\n\ttransform: rotate(-45deg);\n" ])), TooltipArrow_arrowStyle, (function(props) {
            return props.theme.colors.gray.main;
        }));
        var TooltipArrow_TooltipBottomArrow = styled_components_browser_esm.default.div(TooltipArrow_templateObject_4 || (TooltipArrow_templateObject_4 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\t", "\n\tborder-color: ", ";\n\ttop: 2px;\n\tleft: 50%;\n\tmargin-left: -3px;\n\ttransform: rotate(-135deg);\n" ], [ "\n\t", "\n\tborder-color: ", ";\n\ttop: 2px;\n\tleft: 50%;\n\tmargin-left: -3px;\n\ttransform: rotate(-135deg);\n" ])), TooltipArrow_arrowStyle, (function(props) {
            return props.theme.colors.gray.main;
        }));
        var TooltipArrow_getArrowElement = function(placement) {
            switch (placement) {
              case "right":
                return TooltipArrow_TooltipRightArrow;

              case "bottom":
                return TooltipArrow_TooltipBottomArrow;

              case "left":
                return TooltipArrow_TooltipLeftArrow;

              default:
                return TooltipArrow_TooltipTopArrow;
            }
        };
        var TooltipArrow = function(_a) {
            var placement = _a.placement;
            var ArrowElement = react.useMemo((function() {
                return TooltipArrow_getArrowElement(placement);
            }), [ placement ]);
            return react.createElement(ArrowElement, null);
        };
        const internal_TooltipArrow = TooltipArrow;
        var TooltipArrow_templateObject_1, TooltipArrow_templateObject_2, TooltipArrow_templateObject_3, TooltipArrow_templateObject_4;
        var Popover_StyledDrop = (0, styled_components_browser_esm.default)(DropWrapper)(Popover_templateObject_1 || (Popover_templateObject_1 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\tborder: 0;\n" ], [ "\n\tborder: 0;\n" ])));
        var StyledDropOuter = styled_components_browser_esm.default.div(Popover_templateObject_2 || (Popover_templateObject_2 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\tmax-width: 200px;\n\toverflow: auto;\n\tmargin: 5px;\n\tbackground: white;\n\tbox-shadow: ", ";\n\tborder-radius: ", ";\n\tborder: ", ";\n" ], [ "\n\tmax-width: 200px;\n\toverflow: auto;\n\tmargin: 5px;\n\tbackground: white;\n\tbox-shadow: ", ";\n\tborder-radius: ", ";\n\tborder: ", ";\n" ])), (function(props) {
            return "1px 1px 5px" + props.theme.colors.gray.light;
        }), (function(props) {
            return styledUtils_px(props.theme.radius);
        }), (function(props) {
            return "1px solid " + props.theme.colors.gray.main;
        }));
        var StyledDropInner = styled_components_browser_esm.default.div(Popover_templateObject_3 || (Popover_templateObject_3 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\tposition: relative;\n" ], [ "\n\tposition: relative;\n" ])));
        var getDropAlign = function(placement) {
            switch (placement) {
              case "bottom":
                return {
                    top: "bottom"
                };

              case "top":
                return {
                    bottom: "top"
                };

              case "left":
                return {
                    right: "left"
                };

              case "right":
                return {
                    left: "right"
                };
            }
        };
        var BasePopover = function(_a) {
            var placement = _a.placement, target = _a.target, onDismiss = _a.onDismiss, children = _a.children, rest = (0, 
            tslib_es6.__rest)(_a, [ "placement", "target", "onDismiss", "children" ]);
            var dropAlign = react.useMemo((function() {
                return getDropAlign(placement);
            }), [ placement ]);
            return react.createElement(Popover_StyledDrop, (0, tslib_es6.__assign)({}, rest, {
                target,
                onClickOutside: onDismiss,
                onEsc: onDismiss,
                align: dropAlign,
                plain: true
            }), react.createElement(internal_TooltipArrow, {
                placement
            }), react.createElement(StyledDropOuter, null, react.createElement(StyledDropInner, null, children)));
        };
        BasePopover.defaultProps = {
            placement: "top"
        };
        var Popover = BasePopover;
        var Popover_templateObject_1, Popover_templateObject_2, Popover_templateObject_3;
        var Confirm = function(_a) {
            var text = _a.text, onOK = _a.onOK, onCancel = _a.onCancel, rest = (0, tslib_es6.__rest)(_a, [ "text", "onOK", "onCancel" ]);
            return react.createElement(Popover, (0, tslib_es6.__assign)({}, rest, {
                onDismiss: onCancel
            }), react.createElement(Box, {
                mx: 2,
                mt: 2,
                fontSize: 3
            }, text), react.createElement(Box, null, react.createElement(Button_Button, {
                m: 2,
                size: "small",
                onClick: onCancel
            }, "Cancel"), react.createElement(Button_Button, {
                m: 2,
                size: "small",
                primary: true,
                onClick: onOK
            }, "OK")));
        };
        var Confirm_useForwardedRef = function(ref) {
            var innerRef = react.useRef(null);
            react.useEffect((function() {
                if (!ref) {
                    return;
                }
                if (typeof ref === "function") {
                    ref(innerRef.current);
                } else {
                    ref.current = innerRef.current;
                }
            }));
            return innerRef;
        };
        function withConfirm(Base) {
            return react.forwardRef((function(_a, ref) {
                var onClick = _a.onClick, confirmation = _a.confirmation, rest = (0, tslib_es6.__rest)(_a, [ "onClick", "confirmation" ]);
                var targetRef = Confirm_useForwardedRef(ref);
                var _b = react.useState(null), clickEvent = _b[0], setClickEvent = _b[1];
                var handleOk = react.useCallback((function() {
                    if (onClick) {
                        onClick(clickEvent);
                    }
                    setClickEvent(null);
                }), [ onClick, clickEvent ]);
                var handleCancel = react.useCallback((function() {
                    setClickEvent(null);
                }), []);
                var handleBaseClick = react.useCallback((function(e) {
                    setClickEvent(e);
                }), []);
                var confirmOptions = react.useMemo((function() {
                    return typeof confirmation === "string" ? {
                        text: confirmation
                    } : confirmation;
                }), [ confirmation ]);
                return react.createElement(react.Fragment, null, clickEvent && react.createElement(Confirm, (0, 
                tslib_es6.__assign)({}, confirmOptions, {
                    target: targetRef.current,
                    onOK: handleOk,
                    onCancel: handleCancel
                })), react.createElement(Base, (0, tslib_es6.__assign)({}, rest, {
                    ref: targetRef,
                    onClick: handleBaseClick
                })));
            }));
        }
        var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
        var hashCode = function(text, max) {
            var hash = 0;
            for (var index = 0; index < text.length; index++) {
                hash = text.charCodeAt(index) + ((hash << 5) - hash);
            }
            return hash >> text.length * 8 & max;
        };
        var utils_randomString = function(length) {
            if (length === void 0) {
                length = 16;
            }
            var text = "";
            var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
            for (var i = 0; i < length; i++) {
                text += possible.charAt(Math.floor(Math.random() * possible.length));
            }
            return text;
        };
        var regexEscape = function(str) {
            return str.replace(matchOperatorsRe, "\\$&");
        };
        var withConditional = function(hoc, fn) {
            return function(Base) {
                var Wrapped = hoc(Base);
                return react.forwardRef((function(props, ref) {
                    var Component = fn(props) ? Wrapped : Base;
                    return react.createElement(Component, (0, tslib_es6.__assign)((0, tslib_es6.__assign)({}, props), {
                        ref
                    }));
                }));
            };
        };
        var node_modules_color = __webpack_require__(515);
        var color_default = __webpack_require__.n(node_modules_color);
        var color_hash = __webpack_require__(523);
        var color_hash_default = __webpack_require__.n(color_hash);
        var find = __webpack_require__(525);
        var find_default = __webpack_require__.n(find);
        var lodash_get = __webpack_require__(546);
        var get_default = __webpack_require__.n(lodash_get);
        var memoize = __webpack_require__(552);
        var memoize_default = __webpack_require__.n(memoize);
        var colorHash = new (color_hash_default());
        var shadeCustomColor = function(color, shade) {
            if (shade === "main") {
                return color;
            }
            if (shade === "light") {
                return colorUtils_lighten(color);
            }
            return colorUtils_darken(color);
        };
        var getLegibleTextColor = memoize_default()((function(bg, contrast) {
            if (contrast === void 0) {
                contrast = 4.5;
            }
            var bgColor = new (color_default())(bg);
            var findWithContrast = function(darken) {
                if (darken >= 1) {
                    return bgColor.darken(1).hex();
                }
                var textColor = bgColor.darken(darken);
                if (textColor.contrast(bgColor) >= contrast) {
                    return textColor.hex();
                }
                return findWithContrast(darken + .05);
            };
            return findWithContrast(.1);
        }));
        var generateColorFromString = memoize_default()((function(text) {
            return colorHash.hex(text.replace(/\s/g, ""));
        }));
        var isLight = function(color) {
            return color_default()(color).luminosity() > .65;
        };
        var opaque = function(color, opacity) {
            return new (color_default())((0, tslib_es6.__spreadArrays)(color_default()(color).array(), [ opacity ])).string();
        };
        var colorUtils_lighten = function(color) {
            return color_default()(color).fade(.3).string();
        };
        var colorUtils_darken = function(color, amount) {
            return color_default()(color).darken(amount || .2).string();
        };
        var getColoringType = function(props) {
            var type = find_default()(Object.keys(props), (function(b) {
                return !!props[b] && !!find_default()(Object.keys(props.theme.colors), (function(k) {
                    return k === b;
                }));
            }));
            return type;
        };
        var getColor = function(props, key, shade) {
            if (get_default()(props, key)) {
                return shadeCustomColor(get_default()(props, key), shade);
            }
            var type = getColoringType(props);
            if (type) {
                var color = get_default()(props.theme, "colors." + type);
                if (color != null && typeof color === "object") {
                    return color[shade];
                } else {
                    return shadeCustomColor(color, shade);
                }
            }
        };
        var getHoverEffectOverride = function(bg, color, opacity) {
            return (0, styled_components_browser_esm.css)(Button_templateObject_1 || (Button_templateObject_1 = (0, 
            tslib_es6.__makeTemplateObject)([ "\n\t\t&:hover:enabled,\n\t\t&:focus:enabled,\n\t\t&:active:enabled {\n\t\t\tsvg {\n\t\t\t\tcolor: ", " !important;\n\t\t\t}\n\n\t\t\tbox-shadow: none;\n\t\t\tbackground: ", ";\n\t\t\tborder-color: ", ";\n\t\t\tcolor: ", ";\n\t\t\topacity: ", ";\n\t\t}\n\t" ], [ "\n\t\t&:hover:enabled,\n\t\t&:focus:enabled,\n\t\t&:active:enabled {\n\t\t\tsvg {\n\t\t\t\tcolor: ", " !important;\n\t\t\t}\n\n\t\t\tbox-shadow: none;\n\t\t\tbackground: ", ";\n\t\t\tborder-color: ", ";\n\t\t\tcolor: ", ";\n\t\t\topacity: ", ";\n\t\t}\n\t" ])), color, bg, bg, color, opacity !== null && opacity !== void 0 ? opacity : "initial");
        };
        var ButtonBase = (0, styled_components_browser_esm.default)(ButtonWrapper)(Button_templateObject_2 || (Button_templateObject_2 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\t& {\n\t\tfont-weight: ", ";\n\t\tfont-size: ", ";\n\t\theight: ", ";\n\t\twhite-space: nowrap;\n\t\tsvg {\n\t\t\tcolor: inherit !important;\n\t\t\tfont-size: 0.925em;\n\t\t}\n\t\t/* These rules cause consistent styling when the button is rendered as a link */\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\n\t\t&:disabled {\n\t\t\tcursor: not-allowed;\n\t\t}\n\t}\n" ], [ "\n\t& {\n\t\tfont-weight: ", ";\n\t\tfont-size: ", ";\n\t\theight: ", ";\n\t\twhite-space: nowrap;\n\t\tsvg {\n\t\t\tcolor: inherit !important;\n\t\t\tfont-size: 0.925em;\n\t\t}\n\t\t/* These rules cause consistent styling when the button is rendered as a link */\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\n\t\t&:disabled {\n\t\t\tcursor: not-allowed;\n\t\t}\n\t}\n" ])), (function(props) {
            return props.theme.button.font.weight;
        }), (function(props) {
            return props.theme.button.font.size;
        }), (function(props) {
            return props.theme.button.height;
        }));
        var ColouredButton = (0, styled_components_browser_esm.default)(ButtonBase)(Button_templateObject_3 || (Button_templateObject_3 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\t& {\n\t\tcolor: ", ";\n\t\t", ";\n\t}\n" ], [ "\n\t& {\n\t\tcolor: ", ";\n\t\t", ";\n\t}\n" ])), (function(props) {
            return isLight(getColor(props, "color", "main")) ? props.theme.colors.text.main : "white";
        }), (function(props) {
            var color = getColor(props, "color", "dark");
            return getHoverEffectOverride(color, isLight(color) ? props.theme.colors.text.main : "white");
        }));
        var Outline = (0, styled_components_browser_esm.default)(ButtonBase)(Button_templateObject_4 || (Button_templateObject_4 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\t& {\n\t\tcolor: ", ";\n\t\tborder-color: ", ";\n\t\tsvg {\n\t\t\tcolor: ", " !important;\n\t\t}\n\t\t", ";\n\t}\n" ], [ "\n\t& {\n\t\tcolor: ", ";\n\t\tborder-color: ", ";\n\t\tsvg {\n\t\t\tcolor: ", " !important;\n\t\t}\n\t\t", ";\n\t}\n" ])), (function(props) {
            return props.theme.colors.text.main;
        }), (function(props) {
            return getColor(props, "color", "main") || props.theme.colors.text.main;
        }), (function(props) {
            return props.theme.colors.tertiary.main;
        }), (function(props) {
            return getHoverEffectOverride(props.color || props.theme.colors.text.main, isLight(getColor(props, "color", "main")) ? props.theme.colors.text.main : "white");
        }));
        var Light = (0, styled_components_browser_esm.default)(ButtonBase)(Button_templateObject_5 || (Button_templateObject_5 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\t& {\n\t\tcolor: ", ";\n\t\tborder-color: ", ";\n\t\tbackground: white;\n\t\tborder: none;\n\t\t", ";\n\n\t\t&:disabled {\n\t\t\topacity: 1;\n\t\t\tcolor: #c6c8c9;\n\t\t}\n\t}\n" ], [ "\n\t& {\n\t\tcolor: ", ";\n\t\tborder-color: ", ";\n\t\tbackground: white;\n\t\tborder: none;\n\t\t", ";\n\n\t\t&:disabled {\n\t\t\topacity: 1;\n\t\t\tcolor: #c6c8c9;\n\t\t}\n\t}\n" ])), (function(props) {
            return props.theme.colors.text.main;
        }), (function(props) {
            return props.theme.colors.text.main;
        }), (function(props) {
            return getHoverEffectOverride("white", props.theme.colors.secondary.main, "0.9");
        }));
        var LightOutline = (0, styled_components_browser_esm.default)(Light)(Button_templateObject_6 || (Button_templateObject_6 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\t& {\n\t\tcolor: white;\n\t\tborder: 1px solid white;\n\t\tbackground: transparent;\n\t\t", ";\n\n\t\t&:disabled {\n\t\t\topacity: 1;\n\t\t\tcolor: #c6c8c9;\n\t\t}\n\t}\n" ], [ "\n\t& {\n\t\tcolor: white;\n\t\tborder: 1px solid white;\n\t\tbackground: transparent;\n\t\t", ";\n\n\t\t&:disabled {\n\t\t\topacity: 1;\n\t\t\tcolor: #c6c8c9;\n\t\t}\n\t}\n" ])), (function(props) {
            return getHoverEffectOverride("white", props.theme.colors.secondary.main, "0.9");
        }));
        var Plain = (0, styled_components_browser_esm.default)(ButtonBase)(templateObject_7 || (templateObject_7 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\t& {\n\t\tcolor: ", ";\n\t\theight: auto;\n\t\tfont-weight: ", ";\n\t\tborder-radius: 0;\n\t\t", ";\n\t}\n" ], [ "\n\t& {\n\t\tcolor: ", ";\n\t\theight: auto;\n\t\tfont-weight: ", ";\n\t\tborder-radius: 0;\n\t\t", ";\n\t}\n" ])), (function(props) {
            return getColor(props, "color", "main") || props.theme.colors.text.main;
        }), (function(props) {
            return props.theme.button.font.weight;
        }), (function(props) {
            return getHoverEffectOverride("none", getColor(props, "color", "dark") || props.theme.colors.text.light);
        }));
        var underlineButtonActiveStyles = function(props) {
            return (0, styled_components_browser_esm.css)(templateObject_8 || (templateObject_8 = (0, 
            tslib_es6.__makeTemplateObject)([ "\n\t& {\n\t\tcolor: ", ";\n\t\tbackground: none;\n\t\tbox-shadow: 0px -1px 0 0px inset;\n\t}\n" ], [ "\n\t& {\n\t\tcolor: ", ";\n\t\tbackground: none;\n\t\tbox-shadow: 0px -1px 0 0px inset;\n\t}\n" ])), getColor(props, "color", "main") || props.theme.colors.text.main);
        };
        var Underline = (0, styled_components_browser_esm.default)(Plain)(templateObject_9 || (templateObject_9 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\t& {\n\t\t", "\n\t\tborder-bottom: 1px solid;\n\t\tbackground: none;\n\t\t&:hover:enabled,\n\t\t&:focus:enabled,\n\t\t&:active:enabled {\n\t\t\t", ";\n\t\t}\n\t}\n" ], [ "\n\t& {\n\t\t", "\n\t\tborder-bottom: 1px solid;\n\t\tbackground: none;\n\t\t&:hover:enabled,\n\t\t&:focus:enabled,\n\t\t&:active:enabled {\n\t\t\t", ";\n\t\t}\n\t}\n" ])), (function(props) {
            return props.active ? underlineButtonActiveStyles(props) : "";
        }), underlineButtonActiveStyles);
        var getStyledButton = function(_a, isPrimary) {
            var outline = _a.outline, underline = _a.underline, plain = _a.plain, active = _a.active, light = _a.light;
            if (plain) {
                return Plain;
            }
            if (light) {
                if (outline) {
                    return LightOutline;
                }
                return Light;
            }
            if (underline) {
                return Underline;
            }
            if (outline && !active || !isPrimary) {
                return Outline;
            }
            return ColouredButton;
        };
        var BaseButton = react.forwardRef((function(props, ref) {
            var outline = props.outline, underline = props.underline, children = props.children, label = props.label, primary = props.primary, color = props.color, plain = props.plain, active = props.active, light = props.light, compact = props.compact, restProps = (0, 
            tslib_es6.__rest)(props, [ "outline", "underline", "children", "label", "primary", "color", "plain", "active", "light", "compact" ]);
            var shouldCompact = useBreakpoint(compact || [ false ]);
            var basePrimary = !!props.bg || !!getColoringType(props) && !outline && !underline && !props.plain;
            var baseColor = props.bg || getColor(props, "bg", "main");
            baseColor = baseColor || props.theme.colors.secondary.main;
            if (active) {
                basePrimary = !basePrimary;
            }
            var StyledButton = getStyledButton({
                underline,
                plain,
                active,
                light
            }, basePrimary);
            return react.createElement(StyledButton, (0, tslib_es6.__assign)({
                ref,
                primary: basePrimary,
                color: baseColor,
                active: active && (underline || plain),
                gap: styledUtils_px(props.theme.space[2])
            }, restProps, {
                plain: !!plain || !!underline,
                label: shouldCompact ? undefined : label || children
            }));
        }));
        var Button_Button = withConditional(withConfirm, (function(props) {
            return "confirmation" in props;
        }))(asRendition(BaseButton, [], [ "width", "color", "bg" ]));
        var Button_templateObject_1, Button_templateObject_2, Button_templateObject_3, Button_templateObject_4, Button_templateObject_5, Button_templateObject_6, templateObject_7, templateObject_8, templateObject_9;
        var whitespace = function(props) {
            return props.whitespace ? (0, styled_components_browser_esm.css)(Txt_templateObject_1 || (Txt_templateObject_1 = (0, 
            tslib_es6.__makeTemplateObject)([ "\n\t\t\t\twhite-space: ", ";\n\t\t  " ], [ "\n\t\t\t\twhite-space: ", ";\n\t\t  " ])), props.whitespace) : null;
        };
        var caps = function(props) {
            return props.caps ? (0, styled_components_browser_esm.css)(Txt_templateObject_2 || (Txt_templateObject_2 = (0, 
            tslib_es6.__makeTemplateObject)([ "\n\t\t\t\ttext-transform: uppercase;\n\t\t\t\tletter-spacing: 0.2em;\n\t\t  " ], [ "\n\t\t\t\ttext-transform: uppercase;\n\t\t\t\tletter-spacing: 0.2em;\n\t\t  " ]))) : null;
        };
        var italic = function(props) {
            return props.italic ? (0, styled_components_browser_esm.css)(Txt_templateObject_3 || (Txt_templateObject_3 = (0, 
            tslib_es6.__makeTemplateObject)([ "\n\t\t\t\tfont-style: italic;\n\t\t  " ], [ "\n\t\t\t\tfont-style: italic;\n\t\t  " ]))) : null;
        };
        var Txt_bold = function(props) {
            return props.bold ? (0, styled_components_browser_esm.css)(Txt_templateObject_4 || (Txt_templateObject_4 = (0, 
            tslib_es6.__makeTemplateObject)([ "\n\t\t\t\tfont-weight: ", ";\n\t\t  " ], [ "\n\t\t\t\tfont-weight: ", ";\n\t\t  " ])), props.theme.weights[props.theme.weights.length - 1]) : null;
        };
        var truncate = function(props) {
            return props.truncate && (0, styled_components_browser_esm.css)(Txt_templateObject_5 || (Txt_templateObject_5 = (0, 
            tslib_es6.__makeTemplateObject)([ "\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t" ], [ "\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t" ])));
        };
        var align = style({
            key: "text-align",
            prop: "align",
            cssProperty: "text-align"
        });
        var BaseTxt = styled_components_browser_esm.default.div(Txt_templateObject_6 || (Txt_templateObject_6 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\t", "\n\t", "\n\t", "\n\n\t", "\n\t", "\n\t", "\n\n\t", "\n" ], [ "\n\t", "\n\t", "\n\t", "\n\n\t", "\n\t", "\n\t", "\n\n\t", "\n" ])), align, styledUtils_monospace, whitespace, caps, Txt_bold, italic, truncate);
        var Factory = function(tag) {
            return asRendition((function(props) {
                return react.createElement(BaseTxt, (0, tslib_es6.__assign)({
                    as: tag
                }, props));
            }));
        };
        var Txt_Base = Factory();
        Txt_Base.displayName = "Txt";
        Txt_Base.span = Factory("span");
        Txt_Base.p = Factory("p");
        var Txt = Txt_Base;
        var Txt_templateObject_1, Txt_templateObject_2, Txt_templateObject_3, Txt_templateObject_4, Txt_templateObject_5, Txt_templateObject_6;
        var hiddenPositionStyle = (0, styled_components_browser_esm.css)([ "left:-100%;right:100%;z-index:-1;position:fixed;" ]);
        var desktopLayerStyle = "\n  position: fixed;\n  top: 0px;\n  left: 0px;\n  right: 0px;\n  bottom: 0px;\n";
        var responsiveLayerStyle = "\n  position: absolute;\n  width: 100%;\n  height: 100%;\n  min-height: 100vh;\n";
        var StyledLayer = styled_components_browser_esm.default.div.withConfig({
            displayName: "StyledLayer",
            componentId: "rmtehz-0"
        })([ "", " background:transparent;position:relative;z-index:", ";pointer-events:none;outline:none;", " ", ";" ], baseStyle, (function(props) {
            return props.theme.layer.zIndex;
        }), (function(props) {
            if (props.position === "hidden") {
                return hiddenPositionStyle;
            }
            var styles = [];
            if (props.targetBounds) {
                var _props$targetBounds = props.targetBounds, left = _props$targetBounds.left, right = _props$targetBounds.right, top = _props$targetBounds.top, bottom = _props$targetBounds.bottom;
                styles.push("\n        position: fixed;\n        top: " + top + "px;\n        left: " + left + "px;\n        right: " + right + "px;\n        bottom: " + bottom + "px;\n      ");
            } else {
                styles.push(desktopLayerStyle);
            }
            if (props.responsive && props.theme.layer.responsiveBreakpoint) {
                var breakpoint = props.theme.global.breakpoints[props.theme.layer.responsiveBreakpoint];
                styles.push(breakpointStyle(breakpoint, responsiveLayerStyle));
            }
            return styles;
        }), (function(props) {
            return props.theme.layer && props.theme.layer.extend;
        }));
        StyledLayer.defaultProps = {};
        Object.setPrototypeOf(StyledLayer.defaultProps, default_props_defaultProps);
        var StyledOverlay = styled_components_browser_esm.default.div.withConfig({
            displayName: "StyledLayer__StyledOverlay",
            componentId: "rmtehz-1"
        })([ "position:absolute;", " top:0px;left:0px;right:0px;bottom:0px;", " pointer-events:all;" ], (function(props) {
            if (props.responsive && props.theme.layer.responsiveBreakpoint) {
                var breakpoint = props.theme.global.breakpoints[props.theme.layer.responsiveBreakpoint];
                return breakpointStyle(breakpoint, "position: relative;");
            }
            return "";
        }), (function(props) {
            return !props.plain && props.theme.layer.overlay.background && backgroundStyle(props.theme.layer.overlay.background, props.theme);
        }));
        var getMargin = function getMargin(margin, theme, position) {
            var axis = position.indexOf("top") !== -1 || position.indexOf("bottom") !== -1 ? "vertical" : "horizontal";
            var marginValue = margin[position] || margin[axis] || margin;
            var marginApplied = theme.global.edgeSize[marginValue] || marginValue;
            var marginInTheme = !!theme.global.edgeSize[marginValue];
            return !marginInTheme && typeof marginValue !== "string" ? 0 : parseMetricToNum(marginApplied);
        };
        var getBounds = function getBounds(bounds, margin, theme, position) {
            if (position === void 0) {
                position = undefined;
            }
            if (position) {
                return bounds[position] + getMargin(margin, theme, position);
            }
            return {
                bottom: bounds.bottom + getMargin(margin, theme, "bottom"),
                end: bounds.right + getMargin(margin, theme, "end"),
                left: bounds.left + getMargin(margin, theme, "left"),
                right: bounds.right + getMargin(margin, theme, "right"),
                start: bounds.left + getMargin(margin, theme, "start"),
                top: bounds.top + getMargin(margin, theme, "top")
            };
        };
        var KEYFRAMES = {
            center: {
                vertical: (0, styled_components_browser_esm.keyframes)([ "0%{transform:translateX(-50%) scale(0.8);}100%{transform:translateX(-50%) scale(1);}" ]),
                horizontal: (0, styled_components_browser_esm.keyframes)([ "0%{transform:translateY(-50%) scale(0.8);}100%{transform:translateY(-50) scale(1);}" ]),
                true: (0, styled_components_browser_esm.keyframes)([ "0%{transform:scale(0.8);}100%{transform:scale(1);}" ]),
                false: (0, styled_components_browser_esm.keyframes)([ "0%{transform:translate(-50%,-50%) scale(0.8);}100%{transform:translate(-50%,-50%) scale(1);}" ])
            },
            top: {
                vertical: (0, styled_components_browser_esm.keyframes)([ "0%{transform:translate(-50%,-100%);}100%{transform:translate(-50%,0);}" ]),
                horizontal: (0, styled_components_browser_esm.keyframes)([ "0%{transform:translateY(-100%);}100%{transform:translateY(0);}" ]),
                true: (0, styled_components_browser_esm.keyframes)([ "0%{transform:translateY(-100%);}100%{transform:translateY(0);}" ]),
                false: (0, styled_components_browser_esm.keyframes)([ "0%{transform:translate(-50%,-100%);}100%{transform:translate(-50%,0);}" ])
            },
            bottom: {
                vertical: (0, styled_components_browser_esm.keyframes)([ "0%{transform:translate(-50%,100%);}100%{transform:translate(-50%,0);}" ]),
                horizontal: (0, styled_components_browser_esm.keyframes)([ "0%{transform:translateY(100%);}100%{transform:translateY(0);}" ]),
                true: (0, styled_components_browser_esm.keyframes)([ "0%{transform:translateY(100%);}100%{transform:translateY(0);}" ]),
                false: (0, styled_components_browser_esm.keyframes)([ "0%{transform:translate(-50%,100%);}100%{transform:translate(-50%,0);}" ])
            },
            left: {
                vertical: (0, styled_components_browser_esm.keyframes)([ "0%{transform:translateX(-100%);}100%{transform:translateX(0);}" ]),
                horizontal: (0, styled_components_browser_esm.keyframes)([ "0%{transform:translate(-100%,-50%);}100%{transform:translate(0,-50%);}" ]),
                true: (0, styled_components_browser_esm.keyframes)([ "0%{transform:translateX(-100%);}100%{transform:translateX(0);}" ]),
                false: (0, styled_components_browser_esm.keyframes)([ "0%{transform:translate(-100%,-50%);}100%{transform:translate(0,-50%);}" ])
            },
            right: {
                vertical: (0, styled_components_browser_esm.keyframes)([ "0%{transform:translateX(100%);}100%{transform:translateX(0);}" ]),
                horizontal: (0, styled_components_browser_esm.keyframes)([ "0%{transform:translate(100%,-50%);}100%{transform:translate(0,-50%);}" ]),
                true: (0, styled_components_browser_esm.keyframes)([ "0%{transform:translateX(100%);}100%{transform:translateX(0);}" ]),
                false: (0, styled_components_browser_esm.keyframes)([ "0%{transform:translate(100%,-50%);}100%{transform:translate(0,-50%);}" ])
            },
            start: {
                vertical: (0, styled_components_browser_esm.keyframes)([ "0%{transform:translateX(-100%);}100%{transform:translateX(0);}" ]),
                horizontal: (0, styled_components_browser_esm.keyframes)([ "0%{transform:translate(-100%,-50%);}100%{transform:translate(0,-50%);}" ]),
                true: (0, styled_components_browser_esm.keyframes)([ "0%{transform:translateX(-100%);}100%{transform:translateX(0);}" ]),
                false: (0, styled_components_browser_esm.keyframes)([ "0%{transform:translate(-100%,-50%);}100%{transform:translate(0,-50%);}" ])
            },
            end: {
                vertical: (0, styled_components_browser_esm.keyframes)([ "0%{transform:translateX(100%);}100%{transform:translateX(0);}" ]),
                horizontal: (0, styled_components_browser_esm.keyframes)([ "0%{transform:translate(100%,-50%);}100%{transform:translate(0,-50%);}" ]),
                true: (0, styled_components_browser_esm.keyframes)([ "0%{transform:translateX(100%);}100%{transform:translateX(0);}" ]),
                false: (0, styled_components_browser_esm.keyframes)([ "0%{transform:translate(100%,-50%);}100%{transform:translate(0,-50%);}" ])
            }
        };
        var animationDuration = 200;
        var getAnimationStyle = function getAnimationStyle(props, position, full) {
            var animation = props.animation !== undefined ? props.animation : props.animate;
            if (animation === undefined) animation = "slide";
            var keys;
            if (animation === "slide" || animation === true) {
                keys = KEYFRAMES[position][full];
            } else if (animation === "fadeIn") {
                keys = (0, styled_components_browser_esm.keyframes)([ "0%{opacity:0}100%{opacity:1}" ]);
            }
            return keys ? (0, styled_components_browser_esm.css)([ "animation:", " ", "s ease-in-out forwards;" ], keys, animationDuration / 1e3) : "";
        };
        var POSITIONS = {
            center: {
                vertical: function vertical(bounds) {
                    return (0, styled_components_browser_esm.css)([ "top:", "px;bottom:", "px;left:50%;transform:translateX(-50%);", "" ], bounds.top, bounds.bottom, (function(props) {
                        return getAnimationStyle(props, "center", "vertical");
                    }));
                },
                horizontal: function horizontal(bounds) {
                    return (0, styled_components_browser_esm.css)([ "left:", "px;right:", "px;top:50%;transform:translateY(-50%);", "" ], bounds.left, bounds.right, (function(props) {
                        return getAnimationStyle(props, "center", "horizontal");
                    }));
                },
                true: function _true(bounds) {
                    return (0, styled_components_browser_esm.css)([ "top:", "px;bottom:", "px;left:", "px;right:", "px;", "" ], bounds.top, bounds.bottom, bounds.left, bounds.right, (function(props) {
                        return getAnimationStyle(props, "center", "true");
                    }));
                },
                false: function _false() {
                    return (0, styled_components_browser_esm.css)([ "top:50%;left:50%;transform:translate(-50%,-50%);", "" ], (function(props) {
                        return getAnimationStyle(props, "center", "false");
                    }));
                }
            },
            top: {
                vertical: function vertical(bounds) {
                    return (0, styled_components_browser_esm.css)([ "top:", "px;bottom:", "px;left:50%;transform:translate(-50%,0%);", "" ], bounds.top, bounds.bottom, (function(props) {
                        return getAnimationStyle(props, "top", "vertical");
                    }));
                },
                horizontal: function horizontal(bounds) {
                    return (0, styled_components_browser_esm.css)([ "left:", "px;right:", "px;top:", "px;transform:translateY(0);", "" ], bounds.left, bounds.right, bounds.top, (function(props) {
                        return getAnimationStyle(props, "top", "horizontal");
                    }));
                },
                true: function _true(bounds) {
                    return (0, styled_components_browser_esm.css)([ "top:", "px;bottom:", "px;left:", "px;right:", "px;transform:translateY(0);", "" ], bounds.top, bounds.bottom, bounds.left, bounds.right, (function(props) {
                        return getAnimationStyle(props, "top", "true");
                    }));
                },
                false: function _false(bounds) {
                    return (0, styled_components_browser_esm.css)([ "top:", "px;left:50%;transform:translate(-50%,0);", "" ], bounds.top, (function(props) {
                        return getAnimationStyle(props, "top", "false");
                    }));
                }
            },
            bottom: {
                vertical: function vertical(bounds) {
                    return (0, styled_components_browser_esm.css)([ "top:", "px;bottom:", "px;left:50%;transform:translate(-50%,0);", "" ], bounds.top, bounds.bottom, (function(props) {
                        return getAnimationStyle(props, "bottom", "vertical");
                    }));
                },
                horizontal: function horizontal(bounds) {
                    return (0, styled_components_browser_esm.css)([ "left:", "px;right:", "px;bottom:", "px;transform:translateY(0);", "" ], bounds.left, bounds.top, bounds.bottom, (function(props) {
                        return getAnimationStyle(props, "bottom", "horizontal");
                    }));
                },
                true: function _true(bounds) {
                    return (0, styled_components_browser_esm.css)([ "top:", "px;bottom:", "px;left:", "px;right:", "px;transform:translateY(0);", "" ], bounds.top, bounds.bottom, bounds.left, bounds.right, (function(props) {
                        return getAnimationStyle(props, "bottom", "true");
                    }));
                },
                false: function _false(bounds) {
                    return (0, styled_components_browser_esm.css)([ "bottom:", "px;left:50%;transform:translate(-50%,0);", "" ], bounds.bottom, (function(props) {
                        return getAnimationStyle(props, "bottom", "false");
                    }));
                }
            },
            left: {
                vertical: function vertical(bounds) {
                    return (0, styled_components_browser_esm.css)([ "top:", "px;bottom:", "px;left:", "px;transform:translateX(0);", "" ], bounds.top, bounds.bottom, bounds.left, (function(props) {
                        return getAnimationStyle(props, "left", "vertical");
                    }));
                },
                horizontal: function horizontal(bounds) {
                    return (0, styled_components_browser_esm.css)([ "left:", "px;right:", "px;top:50%;transform:translate(0,-50%);", "" ], bounds.left, bounds.right, (function(props) {
                        return getAnimationStyle(props, "left", "horizontal");
                    }));
                },
                true: function _true(bounds) {
                    return (0, styled_components_browser_esm.css)([ "top:", "px;bottom:", "px;left:", "px;right:", "px;transform:translateX(0);", "" ], bounds.top, bounds.bottom, bounds.left, bounds.right, (function(props) {
                        return getAnimationStyle(props, "left", "true");
                    }));
                },
                false: function _false(bounds) {
                    return (0, styled_components_browser_esm.css)([ "left:", "px;top:50%;transform:translate(0,-50%);", "" ], bounds.left, (function(props) {
                        return getAnimationStyle(props, "left", "false");
                    }));
                }
            },
            right: {
                vertical: function vertical(bounds) {
                    return (0, styled_components_browser_esm.css)([ "top:", "px;bottom:", "px;right:", "px;transform:translateX(0);", "" ], bounds.top, bounds.bottom, bounds.right, (function(props) {
                        return getAnimationStyle(props, "right", "vertical");
                    }));
                },
                horizontal: function horizontal(bounds) {
                    return (0, styled_components_browser_esm.css)([ "left:", "px;right:", "px;top:50%;transform:translate(0,-50%);", "" ], bounds.left, bounds.right, (function(props) {
                        return getAnimationStyle(props, "right", "horizontal");
                    }));
                },
                true: function _true(bounds) {
                    return (0, styled_components_browser_esm.css)([ "top:", "px;bottom:", "px;left:", "px;right:", "px;transform:translateX(0);", "" ], bounds.top, bounds.bottom, bounds.left, bounds.right, (function(props) {
                        return getAnimationStyle(props, "right", "true");
                    }));
                },
                false: function _false(bounds) {
                    return (0, styled_components_browser_esm.css)([ "right:", "px;top:50%;transform:translate(0,-50%);", "" ], bounds.right, (function(props) {
                        return getAnimationStyle(props, "right", "false");
                    }));
                }
            },
            start: {
                vertical: function vertical(bounds) {
                    return (0, styled_components_browser_esm.css)([ "top:", "px;bottom:", "px;inset-inline-start:", "px;transform:translateX(0);", "" ], bounds.top, bounds.bottom, bounds.start, (function(props) {
                        return getAnimationStyle(props, "start", "vertical");
                    }));
                },
                horizontal: function horizontal(bounds) {
                    return (0, styled_components_browser_esm.css)([ "inset-inline-start:", "px;inset-inline-end:", "px;top:50%;transform:translate(0,-50%);", "" ], bounds.start, bounds.end, (function(props) {
                        return getAnimationStyle(props, "start", "horizontal");
                    }));
                },
                true: function _true(bounds) {
                    return (0, styled_components_browser_esm.css)([ "top:", "px;bottom:", "px;inset-inline-start:", "px;inset-inline-end:", "px;transform:translateX(0);", "" ], bounds.top, bounds.bottom, bounds.start, bounds.end, (function(props) {
                        return getAnimationStyle(props, "start", "true");
                    }));
                },
                false: function _false(bounds) {
                    return (0, styled_components_browser_esm.css)([ "inset-inline-start:", "px;top:50%;transform:translate(0,-50%);", "" ], bounds.start, (function(props) {
                        return getAnimationStyle(props, "start", "false");
                    }));
                }
            },
            end: {
                vertical: function vertical(bounds) {
                    return (0, styled_components_browser_esm.css)([ "top:", "px;bottom:", "px;inset-inline-end:", "px;transform:translateX(0);", "" ], bounds.top, bounds.bottom, bounds.end, (function(props) {
                        return getAnimationStyle(props, "end", "vertical");
                    }));
                },
                horizontal: function horizontal(bounds) {
                    return (0, styled_components_browser_esm.css)([ "inset-inline-start:", "px;inset-inline-end:", "px;top:50%;transform:translate(0,-50%);", "" ], bounds.start, bounds.end, (function(props) {
                        return getAnimationStyle(props, "end", "horizontal");
                    }));
                },
                true: function _true(bounds) {
                    return (0, styled_components_browser_esm.css)([ "top:", "px;bottom:", "px;inset-inline-start:", "px;inset-inline-end:", "px;transform:translateX(0);", "" ], bounds.top, bounds.bottom, bounds.start, bounds.end, (function(props) {
                        return getAnimationStyle(props, "end", "true");
                    }));
                },
                false: function _false(bounds) {
                    return (0, styled_components_browser_esm.css)([ "inset-inline-end:", "px;top:50%;transform:translate(0,-50%);", "" ], bounds.end, (function(props) {
                        return getAnimationStyle(props, "end", "false");
                    }));
                }
            },
            "top-right": {
                vertical: function vertical(bounds) {
                    return (0, styled_components_browser_esm.css)([ "top:", "px;bottom:", "px;right:", "px;transform:translateX(0);", ";" ], bounds.top, bounds.bottom, bounds.right, (function(props) {
                        return getAnimationStyle(props, "top", "true");
                    }));
                },
                horizontal: function horizontal(bounds) {
                    return (0, styled_components_browser_esm.css)([ "left:", "px;right:", "px;top:0;transform:translateX(0);", ";" ], bounds.left, bounds.right, (function(props) {
                        return getAnimationStyle(props, "top", "true");
                    }));
                },
                true: function _true(bounds) {
                    return (0, styled_components_browser_esm.css)([ "top:", "px;bottom:", "px;left:", "px;right:", "px;transform:translateX(0);", ";" ], bounds.top, bounds.bottom, bounds.left, bounds.right, (function(props) {
                        return getAnimationStyle(props, "top", "true");
                    }));
                },
                false: function _false(bounds) {
                    return (0, styled_components_browser_esm.css)([ "top:", "px;right:", "px;transform:translateY(0);", ";" ], bounds.top, bounds.right, (function(props) {
                        return getAnimationStyle(props, "top", "true");
                    }));
                }
            },
            "top-left": {
                vertical: function vertical(bounds) {
                    return (0, styled_components_browser_esm.css)([ "top:", "px;bottom:", "px;left:", "px;transform:translateX(0);", "" ], bounds.top, bounds.bottom, bounds.left, (function(props) {
                        return getAnimationStyle(props, "top", "true");
                    }));
                },
                horizontal: function horizontal(bounds) {
                    return (0, styled_components_browser_esm.css)([ "left:", "px;right:", "px;top:0;transform:translateX(0);", "" ], bounds.left, bounds.right, (function(props) {
                        return getAnimationStyle(props, "top", "true");
                    }));
                },
                true: function _true(bounds) {
                    return (0, styled_components_browser_esm.css)([ "top:", "px;bottom:", "px;left:", "px;right:", "px;transform:translateX(0);", "" ], bounds.top, bounds.bottom, bounds.left, bounds.right, (function(props) {
                        return getAnimationStyle(props, "top", "true");
                    }));
                },
                false: function _false(bounds) {
                    return (0, styled_components_browser_esm.css)([ "top:", "px;left:", "px;transform:translateY(0);", "" ], bounds.top, bounds.left, (function(props) {
                        return getAnimationStyle(props, "top", "true");
                    }));
                }
            },
            "bottom-right": {
                vertical: function vertical(bounds) {
                    return (0, styled_components_browser_esm.css)([ "top:", "px;bottom:", "px;right:", "px;transform:translateX(0);", "" ], bounds.top, bounds.bottom, bounds.right, (function(props) {
                        return getAnimationStyle(props, "bottom", "true");
                    }));
                },
                horizontal: function horizontal(bounds) {
                    return (0, styled_components_browser_esm.css)([ "left:", "px;right:", "px;bottom:", "px;transform:translateY(0);", "" ], bounds.left, bounds.right, bounds.bottom, (function(props) {
                        return getAnimationStyle(props, "bottom", "true");
                    }));
                },
                true: function _true(bounds) {
                    return (0, styled_components_browser_esm.css)([ "top:", "px;bottom:", "px;left:", "px;right:", "px;transform:translateX(0);", "" ], bounds.top, bounds.bottom, bounds.left, bounds.right, (function(props) {
                        return getAnimationStyle(props, "bottom", "true");
                    }));
                },
                false: function _false(bounds) {
                    return (0, styled_components_browser_esm.css)([ "bottom:", "px;right:", "px;transform:translateY(0);", "" ], bounds.bottom, bounds.right, (function(props) {
                        return getAnimationStyle(props, "bottom", "true");
                    }));
                }
            },
            "bottom-left": {
                vertical: function vertical(bounds) {
                    return (0, styled_components_browser_esm.css)([ "top:", "px;bottom:", "px;left:", "px;transform:translateX(0);", "" ], bounds.top, bounds.bottom, bounds.left, (function(props) {
                        return getAnimationStyle(props, "bottom", "true");
                    }));
                },
                horizontal: function horizontal(bounds) {
                    return (0, styled_components_browser_esm.css)([ "left:", "px;right:", "px;bottom:", "px;transform:translateY(0);", "" ], bounds.left, bounds.right, bounds.bottom, (function(props) {
                        return getAnimationStyle(props, "bottom", "true");
                    }));
                },
                true: function _true(bounds) {
                    return (0, styled_components_browser_esm.css)([ "top:", "px;bottom:", "px;left:", "px;right:", "px;transform:translateX(0);", "" ], bounds.top, bounds.bottom, bounds.left, bounds.right, (function(props) {
                        return getAnimationStyle(props, "bottom", "true");
                    }));
                },
                false: function _false(bounds) {
                    return (0, styled_components_browser_esm.css)([ "bottom:", "px;left:", "px;transform:translateY(0);", "" ], bounds.bottom, bounds.left, (function(props) {
                        return getAnimationStyle(props, "bottom", "true");
                    }));
                }
            }
        };
        var StyledLayer_roundStyle = function roundStyle(data, theme, position, margin) {
            var styles = [];
            var size = data === true ? "medium" : data;
            var round = theme.global.edgeSize[size] || size;
            var customCSS = round.split(" ").length > 1;
            if (margin === "none" && !customCSS && theme.layer.border.intelligentRounding === true) {
                if (position === "bottom") {
                    styles.push((0, styled_components_browser_esm.css)([ "border-radius:", " ", " 0 0;" ], round, round));
                } else if (position === "bottom-left") {
                    styles.push((0, styled_components_browser_esm.css)([ "border-radius:0 ", " 0 0;" ], round));
                } else if (position === "bottom-right") {
                    styles.push((0, styled_components_browser_esm.css)([ "border-radius:", " 0 0 0;" ], round));
                } else if (position === "end") {
                    styles.push((0, styled_components_browser_esm.css)([ "border-start-start-radius:", ";border-end-start-radius:", ";" ], round, round));
                } else if (position === "left") {
                    styles.push((0, styled_components_browser_esm.css)([ "border-radius:0 ", " ", " 0;" ], round, round));
                } else if (position === "right") {
                    styles.push((0, styled_components_browser_esm.css)([ "border-radius:", " 0 0 ", ";" ], round, round));
                } else if (position === "start") {
                    styles.push((0, styled_components_browser_esm.css)([ "border-end-end-radius:", ";border-start-end-radius:", ";" ], round, round));
                } else if (position === "top") {
                    styles.push((0, styled_components_browser_esm.css)([ "border-radius:0 0 ", " ", ";" ], round, round));
                } else if (position === "top-left") {
                    styles.push((0, styled_components_browser_esm.css)([ "border-radius:0 0 ", " 0;" ], round));
                } else if (position === "top-right") {
                    styles.push((0, styled_components_browser_esm.css)([ "border-radius:0 0 0 ", ";" ], round));
                } else {
                    styles.push((0, styled_components_browser_esm.css)([ "border-radius:", ";" ], round));
                }
            } else {
                styles.push((0, styled_components_browser_esm.css)([ "border-radius:", ";" ], round));
            }
            return styles;
        };
        var desktopContainerStyle = (0, styled_components_browser_esm.css)([ "", " max-height:", ";max-width:", ";", ";", ";" ], (function(props) {
            if (!props.modal && props.position === "hidden") {
                return hiddenPositionStyle;
            }
            return (0, styled_components_browser_esm.css)([ "position:", ";" ], props.modal ? "absolute" : "fixed");
        }), (function(props) {
            return "calc(100% - " + getBounds(props.targetBounds, props.margin, props.theme, "top") + "px - " + getBounds(props.targetBounds, props.margin, props.theme, "bottom") + "px)";
        }), (function(props) {
            return "calc(100% - " + getBounds(props.targetBounds, props.margin, props.theme, "left") + "px - " + getBounds(props.targetBounds, props.margin, props.theme, "right") + "px)";
        }), (function(props) {
            return props.plain || props.full && props.margin === "none" ? "border-radius: 0;" : StyledLayer_roundStyle(props.theme.layer.border.radius, props.theme, props.position, props.margin);
        }), (function(props) {
            return props.position !== "hidden" && POSITIONS[props.position][props.full](getBounds(props.targetBounds, props.margin, props.theme), props.targetBounds) || "";
        }));
        var responsiveContainerStyle = (0, styled_components_browser_esm.css)([ "position:relative;max-height:none;max-width:none;border-radius:0;top:0;bottom:0;left:0;right:0;transform:none;animation:none;height:100vh;width:100vw;" ]);
        var StyledLayer_elevationStyle = (0, styled_components_browser_esm.css)([ "box-shadow:", ";" ], (function(props) {
            return props.theme.global.elevation[props.theme.dark ? "dark" : "light"][props.theme.layer.container.elevation];
        }));
        var StyledContainer = styled_components_browser_esm.default.div.withConfig({
            displayName: "StyledLayer__StyledContainer",
            componentId: "rmtehz-2"
        })([ "", " display:flex;flex-direction:column;min-height:", ";", " outline:none;pointer-events:all;z-index:", ";", " ", " ", ";", ";" ], (function(props) {
            return !props.modal ? baseStyle : "";
        }), (function(props) {
            return props.theme.global.size.xxsmall;
        }), (function(props) {
            return !props.plain && (props.background || props.theme.layer.background) && backgroundStyle(props.background || props.theme.layer.background, props.theme);
        }), (function(props) {
            return props.theme.layer.container.zIndex;
        }), (function(props) {
            return props.theme.layer.container.elevation && StyledLayer_elevationStyle;
        }), desktopContainerStyle, (function(props) {
            if (props.responsive && props.theme.layer.responsiveBreakpoint) {
                var breakpoint = props.theme.global.breakpoints[props.theme.layer.responsiveBreakpoint];
                if (breakpoint) {
                    return breakpointStyle(breakpoint, responsiveContainerStyle);
                }
            }
            return "";
        }), (function(props) {
            return props.theme.layer.container && props.theme.layer.container.extend;
        }));
        StyledContainer.defaultProps = {};
        Object.setPrototypeOf(StyledContainer.defaultProps, default_props_defaultProps);
        function LayerContainer_extends() {
            LayerContainer_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return LayerContainer_extends.apply(this, arguments);
        }
        function LayerContainer_objectWithoutPropertiesLoose(source, excluded) {
            if (source == null) return {};
            var target = {};
            var sourceKeys = Object.keys(source);
            var key, i;
            for (i = 0; i < sourceKeys.length; i++) {
                key = sourceKeys[i];
                if (excluded.indexOf(key) >= 0) continue;
                target[key] = source[key];
            }
            return target;
        }
        var HiddenAnchor = styled_components_browser_esm.default.a.withConfig({
            displayName: "LayerContainer__HiddenAnchor",
            componentId: "sc-1srj14c-0"
        })([ "width:0;height:0;overflow:hidden;position:absolute;" ]);
        var LayerContainer_defaultPortalContext = [];
        var fullBounds = {
            left: 0,
            right: 0,
            top: 0,
            bottom: 0
        };
        var LayerContainer = (0, react.forwardRef)((function(_ref, ref) {
            var background = _ref.background, children = _ref.children, _ref$full = _ref.full, full = _ref$full === void 0 ? false : _ref$full, id = _ref.id, _ref$margin = _ref.margin, margin = _ref$margin === void 0 ? "none" : _ref$margin, _ref$modal = _ref.modal, modal = _ref$modal === void 0 ? true : _ref$modal, onClickOutside = _ref.onClickOutside, onEsc = _ref.onEsc, plain = _ref.plain, _ref$position = _ref.position, position = _ref$position === void 0 ? "center" : _ref$position, _ref$responsive = _ref.responsive, responsive = _ref$responsive === void 0 ? true : _ref$responsive, layerTarget = _ref.target, rest = LayerContainer_objectWithoutPropertiesLoose(_ref, [ "background", "children", "full", "id", "margin", "modal", "onClickOutside", "onEsc", "plain", "position", "responsive", "target" ]);
            var theme = (0, react.useContext)(styled_components_browser_esm.ThemeContext) || default_props_defaultProps.theme;
            var _useState = (0, react.useState)(fullBounds), targetBounds = _useState[0], setTargetBounds = _useState[1];
            var anchorRef = (0, react.useRef)();
            var containerRef = (0, react.useRef)();
            var layerRef = (0, react.useRef)();
            var portalContext = (0, react.useContext)(PortalContext) || LayerContainer_defaultPortalContext;
            var portalId = (0, react.useMemo)((function() {
                return portalContext.length;
            }), [ portalContext ]);
            var nextPortalContext = (0, react.useMemo)((function() {
                return [].concat(portalContext, [ portalId ]);
            }), [ portalContext, portalId ]);
            (0, react.useEffect)((function() {
                if (position !== "hidden") {
                    var node = layerRef.current || containerRef.current || ref.current;
                    if (node && node.scrollIntoView) node.scrollIntoView();
                    var element = document.activeElement;
                    while (element) {
                        if (element === containerRef.current) {
                            break;
                        }
                        element = element.parentElement;
                    }
                    if (modal && !element && anchorRef.current) {
                        anchorRef.current.focus();
                    }
                }
            }), [ modal, position, ref ]);
            (0, react.useEffect)((function() {
                if (position !== "hidden") {
                    var node = layerRef.current || containerRef.current || ref.current;
                    if (node && node.scrollIntoView) node.scrollIntoView();
                }
            }), [ position, ref ]);
            (0, react.useEffect)((function() {
                var onClickDocument = function onClickDocument(event) {
                    var clickedPortalId = null;
                    var node = event.target;
                    while (clickedPortalId === null && node !== document && node !== null) {
                        var attr = node.getAttribute("data-g-portal-id");
                        if (attr !== null && attr !== "") clickedPortalId = parseInt(attr, 10); else node = node.parentNode;
                    }
                    if ((clickedPortalId === null || portalContext.indexOf(clickedPortalId) !== -1) && node !== null) {
                        onClickOutside(event);
                    }
                };
                if (onClickOutside) {
                    document.addEventListener("mousedown", onClickDocument);
                }
                if (layerTarget) {
                    var updateBounds = function updateBounds() {
                        var rect = findVisibleParent(layerTarget).getBoundingClientRect();
                        setTargetBounds({
                            left: rect.left,
                            right: window.innerWidth - rect.right,
                            top: rect.top,
                            bottom: window.innerHeight - rect.bottom
                        });
                    };
                    updateBounds();
                    window.addEventListener("resize", updateBounds);
                    window.addEventListener("scroll", updateBounds, true);
                    return function() {
                        window.removeEventListener("resize", updateBounds);
                        window.removeEventListener("scroll", updateBounds, true);
                        if (onClickOutside) {
                            document.removeEventListener("mousedown", onClickDocument);
                        }
                    };
                }
                setTargetBounds(fullBounds);
                return function() {
                    if (onClickOutside) {
                        document.removeEventListener("mousedown", onClickDocument);
                    }
                };
            }), [ layerTarget, onClickOutside, portalContext, portalId ]);
            var content = react.createElement(StyledContainer, LayerContainer_extends({
                ref: ref || containerRef,
                background,
                elevation: theme.layer.container.elevation,
                id,
                full,
                margin,
                modal,
                targetBounds: !modal ? targetBounds : fullBounds
            }, rest, {
                position,
                plain,
                responsive,
                dir: theme.dir,
                "data-g-portal-id": portalId
            }), react.createElement(HiddenAnchor, {
                ref: anchorRef,
                tabIndex: "-1",
                "aria-hidden": "true"
            }), children);
            if (modal) {
                content = react.createElement(StyledLayer, {
                    ref: layerRef,
                    id,
                    targetBounds,
                    plain,
                    position,
                    responsive,
                    tabIndex: "-1",
                    dir: theme.dir
                }, react.createElement(StyledOverlay, {
                    plain,
                    responsive,
                    onMouseDown: onClickOutside
                }), content);
            }
            if (onEsc) {
                content = react.createElement(KeyboardWrapper, {
                    onEsc: onEsc ? function(event) {
                        event.stopPropagation();
                        onEsc(event);
                    } : undefined,
                    target: modal === false ? "document" : undefined
                }, content);
            }
            if (theme.layer.background) {
                var dark = backgroundIsDark(theme.layer.background, theme);
                if (dark !== undefined && dark !== theme.dark) {
                    content = react.createElement(styled_components_browser_esm.ThemeContext.Provider, {
                        value: LayerContainer_extends({}, theme, {
                            dark
                        })
                    }, content);
                }
            }
            content = react.createElement(PortalContext.Provider, {
                value: nextPortalContext
            }, content);
            if (modal) {
                content = react.createElement(FocusedContainer, {
                    hidden: position === "hidden",
                    restrictScroll: !layerTarget ? true : undefined,
                    trapFocus: true
                }, content);
            }
            return content;
        }));
        function Layer_extends() {
            Layer_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return Layer_extends.apply(this, arguments);
        }
        var Layer = (0, react.forwardRef)((function(props, ref) {
            var animate = props.animate, animation = props.animation, targetChildPosition = props.targetChildPosition;
            var _useState = (0, react.useState)(), originalFocusedElement = _useState[0], setOriginalFocusedElement = _useState[1];
            (0, react.useEffect)((function() {
                return setOriginalFocusedElement(document.activeElement);
            }), []);
            var _useState2 = (0, react.useState)(), layerContainer = _useState2[0], setLayerContainer = _useState2[1];
            var containerTarget = (0, react.useContext)(ContainerTargetContext);
            (0, react.useEffect)((function() {
                return setLayerContainer(getNewContainer(containerTarget, targetChildPosition));
            }), [ containerTarget, targetChildPosition ]);
            (0, react.useEffect)((function() {
                return function() {
                    if (originalFocusedElement) {
                        if (originalFocusedElement.focus) {
                            setTimeout((function() {
                                return originalFocusedElement.focus();
                            }), 0);
                        } else if (originalFocusedElement.parentNode && originalFocusedElement.parentNode.focus) {
                            originalFocusedElement.parentNode.focus();
                        }
                    }
                    if (layerContainer) {
                        var activeAnimation = animation !== undefined ? animation : animate;
                        if (activeAnimation !== false) {
                            var layerClone = layerContainer.cloneNode(true);
                            layerClone.id = "layerClone";
                            containerTarget.appendChild(layerClone);
                            var clonedContainer = layerClone.querySelector('[class*="StyledLayer__StyledContainer"]');
                            if (clonedContainer && clonedContainer.style) {
                                clonedContainer.style.animationDirection = "reverse";
                            }
                            setTimeout((function() {
                                var clone = document.getElementById("layerClone");
                                if (clone) {
                                    containerTarget.removeChild(clone);
                                    layerContainer.remove();
                                }
                            }), animationDuration);
                        } else {
                            containerTarget.removeChild(layerContainer);
                        }
                    }
                };
            }), [ animate, animation, containerTarget, layerContainer, originalFocusedElement ]);
            return layerContainer ? (0, react_dom.createPortal)(react.createElement(LayerContainer, Layer_extends({
                ref
            }, props)), layerContainer) : null;
        }));
        Layer.displayName = "Layer";
        var LayerDoc;
        if (false) {}
        var LayerWrapper = LayerDoc || Layer;
        var BaseHeading = styled_components_browser_esm.default.h3(Heading_templateObject_1 || (Heading_templateObject_1 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\tfont-weight: normal;\n\t", "\n\t", ";\n\t", "\n\t", "\n" ], [ "\n\tfont-weight: normal;\n\t", "\n\t", ";\n\t", "\n\t", "\n" ])), align, styledUtils_monospace, caps, Txt_bold);
        BaseHeading.displayName = "Heading";
        var setDefaultProps = withProps((function(props) {
            return Object.assign({
                fontSize: 4,
                m: 0,
                bold: false
            }, props);
        }));
        var Heading_Factory = function(tag) {
            return asRendition((function(props) {
                return react.createElement(BaseHeading, (0, tslib_es6.__assign)({
                    as: tag
                }, props));
            }), [ setDefaultProps ]);
        };
        var Heading_Base = Heading_Factory();
        Heading_Base.h1 = Heading_Factory("h1");
        Heading_Base.h1.defaultProps = {
            fontSize: 7,
            m: 0
        };
        Heading_Base.h2 = Heading_Factory("h2");
        Heading_Base.h2.defaultProps = {
            fontSize: 6,
            m: 0
        };
        Heading_Base.h3 = Heading_Factory("h3");
        Heading_Base.h3.defaultProps = {
            fontSize: 5,
            m: 0
        };
        Heading_Base.h4 = Heading_Factory("h4");
        Heading_Base.h4.defaultProps = {
            fontSize: 4,
            m: 0,
            bold: true
        };
        Heading_Base.h5 = Heading_Factory("h5");
        Heading_Base.h5.defaultProps = {
            fontSize: 3,
            m: 0,
            bold: true
        };
        Heading_Base.h6 = Heading_Factory("h6");
        Heading_Base.h6.defaultProps = {
            fontSize: 2,
            m: 0,
            bold: true
        };
        var Heading = Heading_Base;
        var Heading_templateObject_1;
        var bodyNoOverflowClass = "rendition-modal-open";
        var GlobalStyle = (0, styled_components_browser_esm.createGlobalStyle)(Modal_templateObject_1 || (Modal_templateObject_1 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\t.", " {\n\t\toverflow: hidden;\n\t}\n" ], [ "\n\t.", " {\n\t\toverflow: hidden;\n\t}\n" ])), bodyNoOverflowClass);
        var DEFAULT_MODAL_WIDTH = 700;
        var ModalSizer = (0, styled_components_browser_esm.default)(Box)(Modal_templateObject_2 || (Modal_templateObject_2 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\toverflow-y: auto;\n" ], [ "\n\toverflow-y: auto;\n" ])));
        var HeadingDescription = (0, styled_components_browser_esm.default)(Txt)(Modal_templateObject_3 || (Modal_templateObject_3 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\tfont-weight: normal;\n" ], [ "\n\tfont-weight: normal;\n" ])));
        var ModalButton = function(props) {
            return "href" in props && props.href ? react.createElement(Button_Button, (0, tslib_es6.__assign)({
                as: "a"
            }, props)) : react.createElement(Button_Button, (0, tslib_es6.__assign)({}, props));
        };
        var BaseModal = function(_super) {
            (0, tslib_es6.__extends)(BaseModal, _super);
            function BaseModal(props) {
                var _this = _super.call(this, props) || this;
                _this.ownIndex = 0;
                _this.handleKeyDown = function(e) {
                    var _a;
                    if (BaseModal.mountedCount !== _this.ownIndex) {
                        return;
                    }
                    if (!e.defaultPrevented && e.which === 13) {
                        e.preventDefault();
                        e.stopPropagation();
                        if ((_a = _this.props.primaryButtonProps) === null || _a === void 0 ? void 0 : _a.disabled) {
                            return;
                        }
                        if (e.which === 13) {
                            _this.props.done();
                        }
                    }
                };
                _this.stopPropagation = function(e) {
                    return e.stopPropagation();
                };
                _this.popModal = function() {
                    if (BaseModal.mountedCount !== _this.ownIndex) {
                        return;
                    }
                    (_this.props.cancel || _this.props.done)();
                };
                return _this;
            }
            BaseModal.prototype.componentDidMount = function() {
                if (!BaseModal.mountedCount) {
                    document.body.classList.add(bodyNoOverflowClass);
                }
                window.addEventListener("keydown", this.handleKeyDown);
                BaseModal.mountedCount++;
                this.ownIndex = BaseModal.mountedCount;
            };
            BaseModal.prototype.componentWillUnmount = function() {
                BaseModal.mountedCount--;
                if (!BaseModal.mountedCount) {
                    document.body.classList.remove(bodyNoOverflowClass);
                }
                window.removeEventListener("keydown", this.handleKeyDown);
            };
            BaseModal.prototype.render = function() {
                var _a, _b, _c;
                var _d = this.props, width = _d.width, theme = _d.theme, props = (0, tslib_es6.__rest)(_d, [ "width", "theme" ]);
                var cancelButtonProps = Object.assign({
                    ml: 3
                }, props.cancelButtonProps);
                var secondaryButtonProps = Object.assign({
                    primary: true,
                    outline: true,
                    ml: 3
                }, props.secondaryButtonProps);
                var shouldChangePrimaryButtonOrder = ((_b = (_a = props.primaryButtonProps) === null || _a === void 0 ? void 0 : _a.danger) !== null && _b !== void 0 ? _b : (_c = props.primaryButtonProps) === null || _c === void 0 ? void 0 : _c.warning) === true;
                var primaryButtonProps = merge_default()((0, tslib_es6.__assign)({
                    primary: true,
                    ml: 3
                }, shouldChangePrimaryButtonOrder && {
                    style: {
                        order: -1
                    }
                }), props.primaryButtonProps);
                return react.createElement(LayerWrapper, {
                    onEsc: this.popModal,
                    onClickOutside: this.popModal,
                    responsive: false,
                    position: props.position || "center",
                    margin: "small",
                    animate: false,
                    style: {
                        marginTop: props.position === "top" ? theme.header.height : undefined
                    }
                }, react.createElement(GlobalStyle, null), react.createElement(ModalSizer, {
                    width: width || DEFAULT_MODAL_WIDTH,
                    maxWidth: "100%",
                    onClick: this.stopPropagation,
                    style: props.style,
                    id: props.id,
                    className: props.className
                }, react.createElement(Box, {
                    p: [ styledUtils_px(theme.space[3]), "40px 50px 30px" ]
                }, props.titleElement ? react.createElement(Heading.h3, {
                    mb: 4
                }, props.titleElement) : !!props.title && react.createElement(Heading.h3, {
                    mb: 4
                }, props.title, !!props.titleDetails && react.createElement(HeadingDescription, {
                    color: "text.light",
                    fontSize: 2
                }, props.titleDetails)), props.children, react.createElement(Flex, {
                    mt: 5,
                    alignItems: "center",
                    justifyContent: "flex-end"
                }, props.cancel && react.createElement(ModalButton, (0, tslib_es6.__assign)({}, cancelButtonProps, {
                    onClick: props.cancel
                }), cancelButtonProps && cancelButtonProps.children || "Cancel"), props.secondaryButtonProps && react.createElement(ModalButton, (0, 
                tslib_es6.__assign)({}, secondaryButtonProps)), react.createElement(ModalButton, (0, 
                tslib_es6.__assign)({}, primaryButtonProps, {
                    onClick: props.done
                }), props.action || "OK")))));
            };
            BaseModal.mountedCount = 0;
            return BaseModal;
        }(react.Component);
        var Modal = (0, styled_components_browser_esm.withTheme)(BaseModal);
        var Modal_templateObject_1, Modal_templateObject_2, Modal_templateObject_3;
        var faBan = __webpack_require__(592);
        var faCheckCircle = __webpack_require__(594);
        var faExclamationTriangle = __webpack_require__(593);
        var faLightbulb = __webpack_require__(595);
        function index_es_typeof(obj) {
            if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
                index_es_typeof = function(obj) {
                    return typeof obj;
                };
            } else {
                index_es_typeof = function(obj) {
                    return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
                };
            }
            return index_es_typeof(obj);
        }
        function _classCallCheck(instance, Constructor) {
            if (!(instance instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
            }
        }
        function _defineProperties(target, props) {
            for (var i = 0; i < props.length; i++) {
                var descriptor = props[i];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor) descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
            }
        }
        function _createClass(Constructor, protoProps, staticProps) {
            if (protoProps) _defineProperties(Constructor.prototype, protoProps);
            if (staticProps) _defineProperties(Constructor, staticProps);
            return Constructor;
        }
        function index_es_defineProperty(obj, key, value) {
            if (key in obj) {
                Object.defineProperty(obj, key, {
                    value,
                    enumerable: true,
                    configurable: true,
                    writable: true
                });
            } else {
                obj[key] = value;
            }
            return obj;
        }
        function _objectSpread(target) {
            for (var i = 1; i < arguments.length; i++) {
                var source = arguments[i] != null ? arguments[i] : {};
                var ownKeys = Object.keys(source);
                if (typeof Object.getOwnPropertySymbols === "function") {
                    ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter((function(sym) {
                        return Object.getOwnPropertyDescriptor(source, sym).enumerable;
                    })));
                }
                ownKeys.forEach((function(key) {
                    index_es_defineProperty(target, key, source[key]);
                }));
            }
            return target;
        }
        function _slicedToArray(arr, i) {
            return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
        }
        function _toConsumableArray(arr) {
            return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
        }
        function _arrayWithoutHoles(arr) {
            if (Array.isArray(arr)) {
                for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
                return arr2;
            }
        }
        function _arrayWithHoles(arr) {
            if (Array.isArray(arr)) return arr;
        }
        function _iterableToArray(iter) {
            if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
        }
        function _iterableToArrayLimit(arr, i) {
            var _arr = [];
            var _n = true;
            var _d = false;
            var _e = undefined;
            try {
                for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
                    _arr.push(_s.value);
                    if (i && _arr.length === i) break;
                }
            } catch (err) {
                _d = true;
                _e = err;
            } finally {
                try {
                    if (!_n && _i["return"] != null) _i["return"]();
                } finally {
                    if (_d) throw _e;
                }
            }
            return _arr;
        }
        function _nonIterableSpread() {
            throw new TypeError("Invalid attempt to spread non-iterable instance");
        }
        function _nonIterableRest() {
            throw new TypeError("Invalid attempt to destructure non-iterable instance");
        }
        var index_es_noop = function noop() {};
        var _WINDOW = {};
        var _DOCUMENT = {};
        var _MUTATION_OBSERVER = null;
        var _PERFORMANCE = {
            mark: index_es_noop,
            measure: index_es_noop
        };
        try {
            if (typeof window !== "undefined") _WINDOW = window;
            if (typeof document !== "undefined") _DOCUMENT = document;
            if (typeof MutationObserver !== "undefined") _MUTATION_OBSERVER = MutationObserver;
            if (typeof performance !== "undefined") _PERFORMANCE = performance;
        } catch (e) {}
        var index_es_ref = _WINDOW.navigator || {}, _ref$userAgent = index_es_ref.userAgent, userAgent = _ref$userAgent === void 0 ? "" : _ref$userAgent;
        var WINDOW = _WINDOW;
        var DOCUMENT = _DOCUMENT;
        var MUTATION_OBSERVER = _MUTATION_OBSERVER;
        var PERFORMANCE = _PERFORMANCE;
        var IS_BROWSER = !!WINDOW.document;
        var IS_DOM = !!DOCUMENT.documentElement && !!DOCUMENT.head && typeof DOCUMENT.addEventListener === "function" && typeof DOCUMENT.createElement === "function";
        var IS_IE = ~userAgent.indexOf("MSIE") || ~userAgent.indexOf("Trident/");
        var NAMESPACE_IDENTIFIER = "___FONT_AWESOME___";
        var UNITS_IN_GRID = 16;
        var DEFAULT_FAMILY_PREFIX = "fa";
        var DEFAULT_REPLACEMENT_CLASS = "svg-inline--fa";
        var DATA_FA_I2SVG = "data-fa-i2svg";
        var DATA_FA_PSEUDO_ELEMENT = "data-fa-pseudo-element";
        var DATA_FA_PSEUDO_ELEMENT_PENDING = "data-fa-pseudo-element-pending";
        var DATA_PREFIX = "data-prefix";
        var DATA_ICON = "data-icon";
        var HTML_CLASS_I2SVG_BASE_CLASS = "fontawesome-i2svg";
        var MUTATION_APPROACH_ASYNC = "async";
        var TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS = [ "HTML", "HEAD", "STYLE", "SCRIPT" ];
        var PRODUCTION = function() {
            try {
                return "production" === "production";
            } catch (e) {
                return false;
            }
        }();
        var PREFIX_TO_STYLE = {
            fas: "solid",
            far: "regular",
            fal: "light",
            fad: "duotone",
            fab: "brands",
            fak: "kit",
            fa: "solid"
        };
        var STYLE_TO_PREFIX = {
            solid: "fas",
            regular: "far",
            light: "fal",
            duotone: "fad",
            brands: "fab",
            kit: "fak"
        };
        var LAYERS_TEXT_CLASSNAME = "fa-layers-text";
        var FONT_FAMILY_PATTERN = /Font Awesome ([5 ]*)(Solid|Regular|Light|Duotone|Brands|Free|Pro|Kit).*/;
        var FONT_WEIGHT_TO_PREFIX = {
            900: "fas",
            400: "far",
            normal: "far",
            300: "fal"
        };
        var oneToTen = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];
        var oneToTwenty = oneToTen.concat([ 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 ]);
        var ATTRIBUTES_WATCHED_FOR_MUTATION = [ "class", "data-prefix", "data-icon", "data-fa-transform", "data-fa-mask" ];
        var DUOTONE_CLASSES = {
            GROUP: "group",
            SWAP_OPACITY: "swap-opacity",
            PRIMARY: "primary",
            SECONDARY: "secondary"
        };
        var RESERVED_CLASSES = [ "xs", "sm", "lg", "fw", "ul", "li", "border", "pull-left", "pull-right", "spin", "pulse", "rotate-90", "rotate-180", "rotate-270", "flip-horizontal", "flip-vertical", "flip-both", "stack", "stack-1x", "stack-2x", "inverse", "layers", "layers-text", "layers-counter", DUOTONE_CLASSES.GROUP, DUOTONE_CLASSES.SWAP_OPACITY, DUOTONE_CLASSES.PRIMARY, DUOTONE_CLASSES.SECONDARY ].concat(oneToTen.map((function(n) {
            return "".concat(n, "x");
        }))).concat(oneToTwenty.map((function(n) {
            return "w-".concat(n);
        })));
        var initial = WINDOW.FontAwesomeConfig || {};
        function getAttrConfig(attr) {
            var element = DOCUMENT.querySelector("script[" + attr + "]");
            if (element) {
                return element.getAttribute(attr);
            }
        }
        function coerce(val) {
            if (val === "") return true;
            if (val === "false") return false;
            if (val === "true") return true;
            return val;
        }
        if (DOCUMENT && typeof DOCUMENT.querySelector === "function") {
            var attrs = [ [ "data-family-prefix", "familyPrefix" ], [ "data-replacement-class", "replacementClass" ], [ "data-auto-replace-svg", "autoReplaceSvg" ], [ "data-auto-add-css", "autoAddCss" ], [ "data-auto-a11y", "autoA11y" ], [ "data-search-pseudo-elements", "searchPseudoElements" ], [ "data-observe-mutations", "observeMutations" ], [ "data-mutate-approach", "mutateApproach" ], [ "data-keep-original-source", "keepOriginalSource" ], [ "data-measure-performance", "measurePerformance" ], [ "data-show-missing-icons", "showMissingIcons" ] ];
            attrs.forEach((function(_ref) {
                var _ref2 = _slicedToArray(_ref, 2), attr = _ref2[0], key = _ref2[1];
                var val = coerce(getAttrConfig(attr));
                if (val !== undefined && val !== null) {
                    initial[key] = val;
                }
            }));
        }
        var _default = {
            familyPrefix: DEFAULT_FAMILY_PREFIX,
            replacementClass: DEFAULT_REPLACEMENT_CLASS,
            autoReplaceSvg: true,
            autoAddCss: true,
            autoA11y: true,
            searchPseudoElements: false,
            observeMutations: true,
            mutateApproach: "async",
            keepOriginalSource: true,
            measurePerformance: false,
            showMissingIcons: true
        };
        var index_es_config = _objectSpread({}, _default, initial);
        if (!index_es_config.autoReplaceSvg) index_es_config.observeMutations = false;
        var fontawesome_svg_core_index_es_config = _objectSpread({}, index_es_config);
        WINDOW.FontAwesomeConfig = fontawesome_svg_core_index_es_config;
        var w = WINDOW || {};
        if (!w[NAMESPACE_IDENTIFIER]) w[NAMESPACE_IDENTIFIER] = {};
        if (!w[NAMESPACE_IDENTIFIER].styles) w[NAMESPACE_IDENTIFIER].styles = {};
        if (!w[NAMESPACE_IDENTIFIER].hooks) w[NAMESPACE_IDENTIFIER].hooks = {};
        if (!w[NAMESPACE_IDENTIFIER].shims) w[NAMESPACE_IDENTIFIER].shims = [];
        var namespace = w[NAMESPACE_IDENTIFIER];
        var functions = [];
        var listener = function listener() {
            DOCUMENT.removeEventListener("DOMContentLoaded", listener);
            index_es_loaded = 1;
            functions.map((function(fn) {
                return fn();
            }));
        };
        var index_es_loaded = false;
        if (IS_DOM) {
            index_es_loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(DOCUMENT.readyState);
            if (!index_es_loaded) DOCUMENT.addEventListener("DOMContentLoaded", listener);
        }
        function domready(fn) {
            if (!IS_DOM) return;
            index_es_loaded ? setTimeout(fn, 0) : functions.push(fn);
        }
        var PENDING = "pending";
        var SETTLED = "settled";
        var FULFILLED = "fulfilled";
        var REJECTED = "rejected";
        var NOOP = function NOOP() {};
        var isNode = typeof global !== "undefined" && typeof global.process !== "undefined" && typeof global.process.emit === "function";
        var asyncSetTimer = typeof setImmediate === "undefined" ? setTimeout : setImmediate;
        var asyncQueue = [];
        var asyncTimer;
        function asyncFlush() {
            for (var i = 0; i < asyncQueue.length; i++) {
                asyncQueue[i][0](asyncQueue[i][1]);
            }
            asyncQueue = [];
            asyncTimer = false;
        }
        function asyncCall(callback, arg) {
            asyncQueue.push([ callback, arg ]);
            if (!asyncTimer) {
                asyncTimer = true;
                asyncSetTimer(asyncFlush, 0);
            }
        }
        function invokeResolver(resolver, promise) {
            function resolvePromise(value) {
                resolve(promise, value);
            }
            function rejectPromise(reason) {
                reject(promise, reason);
            }
            try {
                resolver(resolvePromise, rejectPromise);
            } catch (e) {
                rejectPromise(e);
            }
        }
        function invokeCallback(subscriber) {
            var owner = subscriber.owner;
            var settled = owner._state;
            var value = owner._data;
            var callback = subscriber[settled];
            var promise = subscriber.then;
            if (typeof callback === "function") {
                settled = FULFILLED;
                try {
                    value = callback(value);
                } catch (e) {
                    reject(promise, e);
                }
            }
            if (!handleThenable(promise, value)) {
                if (settled === FULFILLED) {
                    resolve(promise, value);
                }
                if (settled === REJECTED) {
                    reject(promise, value);
                }
            }
        }
        function handleThenable(promise, value) {
            var resolved;
            try {
                if (promise === value) {
                    throw new TypeError("A promises callback cannot return that same promise.");
                }
                if (value && (typeof value === "function" || index_es_typeof(value) === "object")) {
                    var then = value.then;
                    if (typeof then === "function") {
                        then.call(value, (function(val) {
                            if (!resolved) {
                                resolved = true;
                                if (value === val) {
                                    fulfill(promise, val);
                                } else {
                                    resolve(promise, val);
                                }
                            }
                        }), (function(reason) {
                            if (!resolved) {
                                resolved = true;
                                reject(promise, reason);
                            }
                        }));
                        return true;
                    }
                }
            } catch (e) {
                if (!resolved) {
                    reject(promise, e);
                }
                return true;
            }
            return false;
        }
        function resolve(promise, value) {
            if (promise === value || !handleThenable(promise, value)) {
                fulfill(promise, value);
            }
        }
        function fulfill(promise, value) {
            if (promise._state === PENDING) {
                promise._state = SETTLED;
                promise._data = value;
                asyncCall(publishFulfillment, promise);
            }
        }
        function reject(promise, reason) {
            if (promise._state === PENDING) {
                promise._state = SETTLED;
                promise._data = reason;
                asyncCall(publishRejection, promise);
            }
        }
        function publish(promise) {
            promise._then = promise._then.forEach(invokeCallback);
        }
        function publishFulfillment(promise) {
            promise._state = FULFILLED;
            publish(promise);
        }
        function publishRejection(promise) {
            promise._state = REJECTED;
            publish(promise);
            if (!promise._handled && isNode) {
                global.process.emit("unhandledRejection", promise._data, promise);
            }
        }
        function notifyRejectionHandled(promise) {
            global.process.emit("rejectionHandled", promise);
        }
        function P(resolver) {
            if (typeof resolver !== "function") {
                throw new TypeError("Promise resolver " + resolver + " is not a function");
            }
            if (this instanceof P === false) {
                throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
            }
            this._then = [];
            invokeResolver(resolver, this);
        }
        P.prototype = {
            constructor: P,
            _state: PENDING,
            _then: null,
            _data: undefined,
            _handled: false,
            then: function then(onFulfillment, onRejection) {
                var subscriber = {
                    owner: this,
                    then: new this.constructor(NOOP),
                    fulfilled: onFulfillment,
                    rejected: onRejection
                };
                if ((onRejection || onFulfillment) && !this._handled) {
                    this._handled = true;
                    if (this._state === REJECTED && isNode) {
                        asyncCall(notifyRejectionHandled, this);
                    }
                }
                if (this._state === FULFILLED || this._state === REJECTED) {
                    asyncCall(invokeCallback, subscriber);
                } else {
                    this._then.push(subscriber);
                }
                return subscriber.then;
            },
            catch: function _catch(onRejection) {
                return this.then(null, onRejection);
            }
        };
        P.all = function(promises) {
            if (!Array.isArray(promises)) {
                throw new TypeError("You must pass an array to Promise.all().");
            }
            return new P((function(resolve, reject) {
                var results = [];
                var remaining = 0;
                function resolver(index) {
                    remaining++;
                    return function(value) {
                        results[index] = value;
                        if (!--remaining) {
                            resolve(results);
                        }
                    };
                }
                for (var i = 0, promise; i < promises.length; i++) {
                    promise = promises[i];
                    if (promise && typeof promise.then === "function") {
                        promise.then(resolver(i), reject);
                    } else {
                        results[i] = promise;
                    }
                }
                if (!remaining) {
                    resolve(results);
                }
            }));
        };
        P.race = function(promises) {
            if (!Array.isArray(promises)) {
                throw new TypeError("You must pass an array to Promise.race().");
            }
            return new P((function(resolve, reject) {
                for (var i = 0, promise; i < promises.length; i++) {
                    promise = promises[i];
                    if (promise && typeof promise.then === "function") {
                        promise.then(resolve, reject);
                    } else {
                        resolve(promise);
                    }
                }
            }));
        };
        P.resolve = function(value) {
            if (value && index_es_typeof(value) === "object" && value.constructor === P) {
                return value;
            }
            return new P((function(resolve) {
                resolve(value);
            }));
        };
        P.reject = function(reason) {
            return new P((function(resolve, reject) {
                reject(reason);
            }));
        };
        var picked = typeof Promise === "function" ? Promise : P;
        var d = UNITS_IN_GRID;
        var meaninglessTransform = {
            size: 16,
            x: 0,
            y: 0,
            rotate: 0,
            flipX: false,
            flipY: false
        };
        function isReserved(name) {
            return ~RESERVED_CLASSES.indexOf(name);
        }
        function insertCss(css) {
            if (!css || !IS_DOM) {
                return;
            }
            var style = DOCUMENT.createElement("style");
            style.setAttribute("type", "text/css");
            style.innerHTML = css;
            var headChildren = DOCUMENT.head.childNodes;
            var beforeChild = null;
            for (var i = headChildren.length - 1; i > -1; i--) {
                var child = headChildren[i];
                var tagName = (child.tagName || "").toUpperCase();
                if ([ "STYLE", "LINK" ].indexOf(tagName) > -1) {
                    beforeChild = child;
                }
            }
            DOCUMENT.head.insertBefore(style, beforeChild);
            return css;
        }
        var idPool = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
        function nextUniqueId() {
            var size = 12;
            var id = "";
            while (size-- > 0) {
                id += idPool[Math.random() * 62 | 0];
            }
            return id;
        }
        function toArray(obj) {
            var array = [];
            for (var i = (obj || []).length >>> 0; i--; ) {
                array[i] = obj[i];
            }
            return array;
        }
        function classArray(node) {
            if (node.classList) {
                return toArray(node.classList);
            } else {
                return (node.getAttribute("class") || "").split(" ").filter((function(i) {
                    return i;
                }));
            }
        }
        function getIconName(familyPrefix, cls) {
            var parts = cls.split("-");
            var prefix = parts[0];
            var iconName = parts.slice(1).join("-");
            if (prefix === familyPrefix && iconName !== "" && !isReserved(iconName)) {
                return iconName;
            } else {
                return null;
            }
        }
        function htmlEscape(str) {
            return "".concat(str).replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/'/g, "&#39;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
        }
        function joinAttributes(attributes) {
            return Object.keys(attributes || {}).reduce((function(acc, attributeName) {
                return acc + "".concat(attributeName, '="').concat(htmlEscape(attributes[attributeName]), '" ');
            }), "").trim();
        }
        function joinStyles(styles) {
            return Object.keys(styles || {}).reduce((function(acc, styleName) {
                return acc + "".concat(styleName, ": ").concat(styles[styleName], ";");
            }), "");
        }
        function transformIsMeaningful(transform) {
            return transform.size !== meaninglessTransform.size || transform.x !== meaninglessTransform.x || transform.y !== meaninglessTransform.y || transform.rotate !== meaninglessTransform.rotate || transform.flipX || transform.flipY;
        }
        function transformForSvg(_ref) {
            var transform = _ref.transform, containerWidth = _ref.containerWidth, iconWidth = _ref.iconWidth;
            var outer = {
                transform: "translate(".concat(containerWidth / 2, " 256)")
            };
            var innerTranslate = "translate(".concat(transform.x * 32, ", ").concat(transform.y * 32, ") ");
            var innerScale = "scale(".concat(transform.size / 16 * (transform.flipX ? -1 : 1), ", ").concat(transform.size / 16 * (transform.flipY ? -1 : 1), ") ");
            var innerRotate = "rotate(".concat(transform.rotate, " 0 0)");
            var inner = {
                transform: "".concat(innerTranslate, " ").concat(innerScale, " ").concat(innerRotate)
            };
            var path = {
                transform: "translate(".concat(iconWidth / 2 * -1, " -256)")
            };
            return {
                outer,
                inner,
                path
            };
        }
        function transformForCss(_ref2) {
            var transform = _ref2.transform, _ref2$width = _ref2.width, width = _ref2$width === void 0 ? UNITS_IN_GRID : _ref2$width, _ref2$height = _ref2.height, height = _ref2$height === void 0 ? UNITS_IN_GRID : _ref2$height, _ref2$startCentered = _ref2.startCentered, startCentered = _ref2$startCentered === void 0 ? false : _ref2$startCentered;
            var val = "";
            if (startCentered && IS_IE) {
                val += "translate(".concat(transform.x / d - width / 2, "em, ").concat(transform.y / d - height / 2, "em) ");
            } else if (startCentered) {
                val += "translate(calc(-50% + ".concat(transform.x / d, "em), calc(-50% + ").concat(transform.y / d, "em)) ");
            } else {
                val += "translate(".concat(transform.x / d, "em, ").concat(transform.y / d, "em) ");
            }
            val += "scale(".concat(transform.size / d * (transform.flipX ? -1 : 1), ", ").concat(transform.size / d * (transform.flipY ? -1 : 1), ") ");
            val += "rotate(".concat(transform.rotate, "deg) ");
            return val;
        }
        var ALL_SPACE = {
            x: 0,
            y: 0,
            width: "100%",
            height: "100%"
        };
        function fillBlack(abstract) {
            var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
            if (abstract.attributes && (abstract.attributes.fill || force)) {
                abstract.attributes.fill = "black";
            }
            return abstract;
        }
        function deGroup(abstract) {
            if (abstract.tag === "g") {
                return abstract.children;
            } else {
                return [ abstract ];
            }
        }
        function makeIconMasking(_ref) {
            var children = _ref.children, attributes = _ref.attributes, main = _ref.main, mask = _ref.mask, explicitMaskId = _ref.maskId, transform = _ref.transform;
            var mainWidth = main.width, mainPath = main.icon;
            var maskWidth = mask.width, maskPath = mask.icon;
            var trans = transformForSvg({
                transform,
                containerWidth: maskWidth,
                iconWidth: mainWidth
            });
            var maskRect = {
                tag: "rect",
                attributes: _objectSpread({}, ALL_SPACE, {
                    fill: "white"
                })
            };
            var maskInnerGroupChildrenMixin = mainPath.children ? {
                children: mainPath.children.map(fillBlack)
            } : {};
            var maskInnerGroup = {
                tag: "g",
                attributes: _objectSpread({}, trans.inner),
                children: [ fillBlack(_objectSpread({
                    tag: mainPath.tag,
                    attributes: _objectSpread({}, mainPath.attributes, trans.path)
                }, maskInnerGroupChildrenMixin)) ]
            };
            var maskOuterGroup = {
                tag: "g",
                attributes: _objectSpread({}, trans.outer),
                children: [ maskInnerGroup ]
            };
            var maskId = "mask-".concat(explicitMaskId || nextUniqueId());
            var clipId = "clip-".concat(explicitMaskId || nextUniqueId());
            var maskTag = {
                tag: "mask",
                attributes: _objectSpread({}, ALL_SPACE, {
                    id: maskId,
                    maskUnits: "userSpaceOnUse",
                    maskContentUnits: "userSpaceOnUse"
                }),
                children: [ maskRect, maskOuterGroup ]
            };
            var defs = {
                tag: "defs",
                children: [ {
                    tag: "clipPath",
                    attributes: {
                        id: clipId
                    },
                    children: deGroup(maskPath)
                }, maskTag ]
            };
            children.push(defs, {
                tag: "rect",
                attributes: _objectSpread({
                    fill: "currentColor",
                    "clip-path": "url(#".concat(clipId, ")"),
                    mask: "url(#".concat(maskId, ")")
                }, ALL_SPACE)
            });
            return {
                children,
                attributes
            };
        }
        function makeIconStandard(_ref) {
            var children = _ref.children, attributes = _ref.attributes, main = _ref.main, transform = _ref.transform, styles = _ref.styles;
            var styleString = joinStyles(styles);
            if (styleString.length > 0) {
                attributes["style"] = styleString;
            }
            if (transformIsMeaningful(transform)) {
                var trans = transformForSvg({
                    transform,
                    containerWidth: main.width,
                    iconWidth: main.width
                });
                children.push({
                    tag: "g",
                    attributes: _objectSpread({}, trans.outer),
                    children: [ {
                        tag: "g",
                        attributes: _objectSpread({}, trans.inner),
                        children: [ {
                            tag: main.icon.tag,
                            children: main.icon.children,
                            attributes: _objectSpread({}, main.icon.attributes, trans.path)
                        } ]
                    } ]
                });
            } else {
                children.push(main.icon);
            }
            return {
                children,
                attributes
            };
        }
        function asIcon(_ref) {
            var children = _ref.children, main = _ref.main, mask = _ref.mask, attributes = _ref.attributes, styles = _ref.styles, transform = _ref.transform;
            if (transformIsMeaningful(transform) && main.found && !mask.found) {
                var width = main.width, height = main.height;
                var offset = {
                    x: width / height / 2,
                    y: .5
                };
                attributes["style"] = joinStyles(_objectSpread({}, styles, {
                    "transform-origin": "".concat(offset.x + transform.x / 16, "em ").concat(offset.y + transform.y / 16, "em")
                }));
            }
            return [ {
                tag: "svg",
                attributes,
                children
            } ];
        }
        function asSymbol(_ref) {
            var prefix = _ref.prefix, iconName = _ref.iconName, children = _ref.children, attributes = _ref.attributes, symbol = _ref.symbol;
            var id = symbol === true ? "".concat(prefix, "-").concat(fontawesome_svg_core_index_es_config.familyPrefix, "-").concat(iconName) : symbol;
            return [ {
                tag: "svg",
                attributes: {
                    style: "display: none;"
                },
                children: [ {
                    tag: "symbol",
                    attributes: _objectSpread({}, attributes, {
                        id
                    }),
                    children
                } ]
            } ];
        }
        function makeInlineSvgAbstract(params) {
            var _params$icons = params.icons, main = _params$icons.main, mask = _params$icons.mask, prefix = params.prefix, iconName = params.iconName, transform = params.transform, symbol = params.symbol, title = params.title, maskId = params.maskId, titleId = params.titleId, extra = params.extra, _params$watchable = params.watchable, watchable = _params$watchable === void 0 ? false : _params$watchable;
            var _ref = mask.found ? mask : main, width = _ref.width, height = _ref.height;
            var isUploadedIcon = prefix === "fak";
            var widthClass = isUploadedIcon ? "" : "fa-w-".concat(Math.ceil(width / height * 16));
            var attrClass = [ fontawesome_svg_core_index_es_config.replacementClass, iconName ? "".concat(fontawesome_svg_core_index_es_config.familyPrefix, "-").concat(iconName) : "", widthClass ].filter((function(c) {
                return extra.classes.indexOf(c) === -1;
            })).filter((function(c) {
                return c !== "" || !!c;
            })).concat(extra.classes).join(" ");
            var content = {
                children: [],
                attributes: _objectSpread({}, extra.attributes, {
                    "data-prefix": prefix,
                    "data-icon": iconName,
                    class: attrClass,
                    role: extra.attributes.role || "img",
                    xmlns: "http://www.w3.org/2000/svg",
                    viewBox: "0 0 ".concat(width, " ").concat(height)
                })
            };
            var uploadedIconWidthStyle = isUploadedIcon && !~extra.classes.indexOf("fa-fw") ? {
                width: "".concat(width / height * 16 * .0625, "em")
            } : {};
            if (watchable) {
                content.attributes[DATA_FA_I2SVG] = "";
            }
            if (title) content.children.push({
                tag: "title",
                attributes: {
                    id: content.attributes["aria-labelledby"] || "title-".concat(titleId || nextUniqueId())
                },
                children: [ title ]
            });
            var args = _objectSpread({}, content, {
                prefix,
                iconName,
                main,
                mask,
                maskId,
                transform,
                symbol,
                styles: _objectSpread({}, uploadedIconWidthStyle, extra.styles)
            });
            var _ref2 = mask.found && main.found ? makeIconMasking(args) : makeIconStandard(args), children = _ref2.children, attributes = _ref2.attributes;
            args.children = children;
            args.attributes = attributes;
            if (symbol) {
                return asSymbol(args);
            } else {
                return asIcon(args);
            }
        }
        function makeLayersTextAbstract(params) {
            var content = params.content, width = params.width, height = params.height, transform = params.transform, title = params.title, extra = params.extra, _params$watchable2 = params.watchable, watchable = _params$watchable2 === void 0 ? false : _params$watchable2;
            var attributes = _objectSpread({}, extra.attributes, title ? {
                title
            } : {}, {
                class: extra.classes.join(" ")
            });
            if (watchable) {
                attributes[DATA_FA_I2SVG] = "";
            }
            var styles = _objectSpread({}, extra.styles);
            if (transformIsMeaningful(transform)) {
                styles["transform"] = transformForCss({
                    transform,
                    startCentered: true,
                    width,
                    height
                });
                styles["-webkit-transform"] = styles["transform"];
            }
            var styleString = joinStyles(styles);
            if (styleString.length > 0) {
                attributes["style"] = styleString;
            }
            var val = [];
            val.push({
                tag: "span",
                attributes,
                children: [ content ]
            });
            if (title) {
                val.push({
                    tag: "span",
                    attributes: {
                        class: "sr-only"
                    },
                    children: [ title ]
                });
            }
            return val;
        }
        function makeLayersCounterAbstract(params) {
            var content = params.content, title = params.title, extra = params.extra;
            var attributes = _objectSpread({}, extra.attributes, title ? {
                title
            } : {}, {
                class: extra.classes.join(" ")
            });
            var styleString = joinStyles(extra.styles);
            if (styleString.length > 0) {
                attributes["style"] = styleString;
            }
            var val = [];
            val.push({
                tag: "span",
                attributes,
                children: [ content ]
            });
            if (title) {
                val.push({
                    tag: "span",
                    attributes: {
                        class: "sr-only"
                    },
                    children: [ title ]
                });
            }
            return val;
        }
        var noop$1 = function noop() {};
        var p = fontawesome_svg_core_index_es_config.measurePerformance && PERFORMANCE && PERFORMANCE.mark && PERFORMANCE.measure ? PERFORMANCE : {
            mark: noop$1,
            measure: noop$1
        };
        var preamble = 'FA "5.15.2"';
        var begin = function begin(name) {
            p.mark("".concat(preamble, " ").concat(name, " begins"));
            return function() {
                return end(name);
            };
        };
        var end = function end(name) {
            p.mark("".concat(preamble, " ").concat(name, " ends"));
            p.measure("".concat(preamble, " ").concat(name), "".concat(preamble, " ").concat(name, " begins"), "".concat(preamble, " ").concat(name, " ends"));
        };
        var perf = {
            begin,
            end
        };
        var bindInternal4 = function bindInternal4(func, thisContext) {
            return function(a, b, c, d) {
                return func.call(thisContext, a, b, c, d);
            };
        };
        var reduce = function fastReduceObject(subject, fn, initialValue, thisContext) {
            var keys = Object.keys(subject), length = keys.length, iterator = thisContext !== undefined ? bindInternal4(fn, thisContext) : fn, i, key, result;
            if (initialValue === undefined) {
                i = 1;
                result = subject[keys[0]];
            } else {
                i = 0;
                result = initialValue;
            }
            for (;i < length; i++) {
                key = keys[i];
                result = iterator(result, subject[key], key, subject);
            }
            return result;
        };
        function toHex(unicode) {
            var result = "";
            for (var i = 0; i < unicode.length; i++) {
                var hex = unicode.charCodeAt(i).toString(16);
                result += ("000" + hex).slice(-4);
            }
            return result;
        }
        function defineIcons(prefix, icons) {
            var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
            var _params$skipHooks = params.skipHooks, skipHooks = _params$skipHooks === void 0 ? false : _params$skipHooks;
            var normalized = Object.keys(icons).reduce((function(acc, iconName) {
                var icon = icons[iconName];
                var expanded = !!icon.icon;
                if (expanded) {
                    acc[icon.iconName] = icon.icon;
                } else {
                    acc[iconName] = icon;
                }
                return acc;
            }), {});
            if (typeof namespace.hooks.addPack === "function" && !skipHooks) {
                namespace.hooks.addPack(prefix, normalized);
            } else {
                namespace.styles[prefix] = _objectSpread({}, namespace.styles[prefix] || {}, normalized);
            }
            if (prefix === "fas") {
                defineIcons("fa", icons);
            }
        }
        var styles = namespace.styles, shims = namespace.shims;
        var _byUnicode = {};
        var _byLigature = {};
        var _byOldName = {};
        var index_es_build = function build() {
            var lookup = function lookup(reducer) {
                return reduce(styles, (function(o, style, prefix) {
                    o[prefix] = reduce(style, reducer, {});
                    return o;
                }), {});
            };
            _byUnicode = lookup((function(acc, icon, iconName) {
                if (icon[3]) {
                    acc[icon[3]] = iconName;
                }
                return acc;
            }));
            _byLigature = lookup((function(acc, icon, iconName) {
                var ligatures = icon[2];
                acc[iconName] = iconName;
                ligatures.forEach((function(ligature) {
                    acc[ligature] = iconName;
                }));
                return acc;
            }));
            var hasRegular = "far" in styles;
            _byOldName = reduce(shims, (function(acc, shim) {
                var oldName = shim[0];
                var prefix = shim[1];
                var iconName = shim[2];
                if (prefix === "far" && !hasRegular) {
                    prefix = "fas";
                }
                acc[oldName] = {
                    prefix,
                    iconName
                };
                return acc;
            }), {});
        };
        index_es_build();
        function byUnicode(prefix, unicode) {
            return (_byUnicode[prefix] || {})[unicode];
        }
        function byLigature(prefix, ligature) {
            return (_byLigature[prefix] || {})[ligature];
        }
        function byOldName(name) {
            return _byOldName[name] || {
                prefix: null,
                iconName: null
            };
        }
        var styles$1 = namespace.styles;
        var emptyCanonicalIcon = function emptyCanonicalIcon() {
            return {
                prefix: null,
                iconName: null,
                rest: []
            };
        };
        function getCanonicalIcon(values) {
            return values.reduce((function(acc, cls) {
                var iconName = getIconName(fontawesome_svg_core_index_es_config.familyPrefix, cls);
                if (styles$1[cls]) {
                    acc.prefix = cls;
                } else if (fontawesome_svg_core_index_es_config.autoFetchSvg && Object.keys(PREFIX_TO_STYLE).indexOf(cls) > -1) {
                    acc.prefix = cls;
                } else if (iconName) {
                    var shim = acc.prefix === "fa" ? byOldName(iconName) : {};
                    acc.iconName = shim.iconName || iconName;
                    acc.prefix = shim.prefix || acc.prefix;
                } else if (cls !== fontawesome_svg_core_index_es_config.replacementClass && cls.indexOf("fa-w-") !== 0) {
                    acc.rest.push(cls);
                }
                return acc;
            }), emptyCanonicalIcon());
        }
        function iconFromMapping(mapping, prefix, iconName) {
            if (mapping && mapping[prefix] && mapping[prefix][iconName]) {
                return {
                    prefix,
                    iconName,
                    icon: mapping[prefix][iconName]
                };
            }
        }
        function toHtml(abstractNodes) {
            var tag = abstractNodes.tag, _abstractNodes$attrib = abstractNodes.attributes, attributes = _abstractNodes$attrib === void 0 ? {} : _abstractNodes$attrib, _abstractNodes$childr = abstractNodes.children, children = _abstractNodes$childr === void 0 ? [] : _abstractNodes$childr;
            if (typeof abstractNodes === "string") {
                return htmlEscape(abstractNodes);
            } else {
                return "<".concat(tag, " ").concat(joinAttributes(attributes), ">").concat(children.map(toHtml).join(""), "</").concat(tag, ">");
            }
        }
        var noop$2 = function noop() {};
        function isWatched(node) {
            var i2svg = node.getAttribute ? node.getAttribute(DATA_FA_I2SVG) : null;
            return typeof i2svg === "string";
        }
        function getMutator() {
            if (fontawesome_svg_core_index_es_config.autoReplaceSvg === true) {
                return mutators.replace;
            }
            var mutator = mutators[fontawesome_svg_core_index_es_config.autoReplaceSvg];
            return mutator || mutators.replace;
        }
        var mutators = {
            replace: function replace(mutation) {
                var node = mutation[0];
                var abstract = mutation[1];
                var newOuterHTML = abstract.map((function(a) {
                    return toHtml(a);
                })).join("\n");
                if (node.parentNode && node.outerHTML) {
                    node.outerHTML = newOuterHTML + (fontawesome_svg_core_index_es_config.keepOriginalSource && node.tagName.toLowerCase() !== "svg" ? "\x3c!-- ".concat(node.outerHTML, " Font Awesome fontawesome.com --\x3e") : "");
                } else if (node.parentNode) {
                    var newNode = document.createElement("span");
                    node.parentNode.replaceChild(newNode, node);
                    newNode.outerHTML = newOuterHTML;
                }
            },
            nest: function nest(mutation) {
                var node = mutation[0];
                var abstract = mutation[1];
                if (~classArray(node).indexOf(fontawesome_svg_core_index_es_config.replacementClass)) {
                    return mutators.replace(mutation);
                }
                var forSvg = new RegExp("".concat(fontawesome_svg_core_index_es_config.familyPrefix, "-.*"));
                delete abstract[0].attributes.style;
                delete abstract[0].attributes.id;
                var splitClasses = abstract[0].attributes.class.split(" ").reduce((function(acc, cls) {
                    if (cls === fontawesome_svg_core_index_es_config.replacementClass || cls.match(forSvg)) {
                        acc.toSvg.push(cls);
                    } else {
                        acc.toNode.push(cls);
                    }
                    return acc;
                }), {
                    toNode: [],
                    toSvg: []
                });
                abstract[0].attributes.class = splitClasses.toSvg.join(" ");
                var newInnerHTML = abstract.map((function(a) {
                    return toHtml(a);
                })).join("\n");
                node.setAttribute("class", splitClasses.toNode.join(" "));
                node.setAttribute(DATA_FA_I2SVG, "");
                node.innerHTML = newInnerHTML;
            }
        };
        function performOperationSync(op) {
            op();
        }
        function perform(mutations, callback) {
            var callbackFunction = typeof callback === "function" ? callback : noop$2;
            if (mutations.length === 0) {
                callbackFunction();
            } else {
                var frame = performOperationSync;
                if (fontawesome_svg_core_index_es_config.mutateApproach === MUTATION_APPROACH_ASYNC) {
                    frame = WINDOW.requestAnimationFrame || performOperationSync;
                }
                frame((function() {
                    var mutator = getMutator();
                    var mark = perf.begin("mutate");
                    mutations.map(mutator);
                    mark();
                    callbackFunction();
                }));
            }
        }
        var disabled = false;
        function disableObservation() {
            disabled = true;
        }
        function enableObservation() {
            disabled = false;
        }
        var mo = null;
        function index_es_observe(options) {
            if (!MUTATION_OBSERVER) {
                return;
            }
            if (!fontawesome_svg_core_index_es_config.observeMutations) {
                return;
            }
            var treeCallback = options.treeCallback, nodeCallback = options.nodeCallback, pseudoElementsCallback = options.pseudoElementsCallback, _options$observeMutat = options.observeMutationsRoot, observeMutationsRoot = _options$observeMutat === void 0 ? DOCUMENT : _options$observeMutat;
            mo = new MUTATION_OBSERVER((function(objects) {
                if (disabled) return;
                toArray(objects).forEach((function(mutationRecord) {
                    if (mutationRecord.type === "childList" && mutationRecord.addedNodes.length > 0 && !isWatched(mutationRecord.addedNodes[0])) {
                        if (fontawesome_svg_core_index_es_config.searchPseudoElements) {
                            pseudoElementsCallback(mutationRecord.target);
                        }
                        treeCallback(mutationRecord.target);
                    }
                    if (mutationRecord.type === "attributes" && mutationRecord.target.parentNode && fontawesome_svg_core_index_es_config.searchPseudoElements) {
                        pseudoElementsCallback(mutationRecord.target.parentNode);
                    }
                    if (mutationRecord.type === "attributes" && isWatched(mutationRecord.target) && ~ATTRIBUTES_WATCHED_FOR_MUTATION.indexOf(mutationRecord.attributeName)) {
                        if (mutationRecord.attributeName === "class") {
                            var _getCanonicalIcon = getCanonicalIcon(classArray(mutationRecord.target)), prefix = _getCanonicalIcon.prefix, iconName = _getCanonicalIcon.iconName;
                            if (prefix) mutationRecord.target.setAttribute("data-prefix", prefix);
                            if (iconName) mutationRecord.target.setAttribute("data-icon", iconName);
                        } else {
                            nodeCallback(mutationRecord.target);
                        }
                    }
                }));
            }));
            if (!IS_DOM) return;
            mo.observe(observeMutationsRoot, {
                childList: true,
                attributes: true,
                characterData: true,
                subtree: true
            });
        }
        function disconnect() {
            if (!mo) return;
            mo.disconnect();
        }
        function styleParser(node) {
            var style = node.getAttribute("style");
            var val = [];
            if (style) {
                val = style.split(";").reduce((function(acc, style) {
                    var styles = style.split(":");
                    var prop = styles[0];
                    var value = styles.slice(1);
                    if (prop && value.length > 0) {
                        acc[prop] = value.join(":").trim();
                    }
                    return acc;
                }), {});
            }
            return val;
        }
        function classParser(node) {
            var existingPrefix = node.getAttribute("data-prefix");
            var existingIconName = node.getAttribute("data-icon");
            var innerText = node.innerText !== undefined ? node.innerText.trim() : "";
            var val = getCanonicalIcon(classArray(node));
            if (existingPrefix && existingIconName) {
                val.prefix = existingPrefix;
                val.iconName = existingIconName;
            }
            if (val.prefix && innerText.length > 1) {
                val.iconName = byLigature(val.prefix, node.innerText);
            } else if (val.prefix && innerText.length === 1) {
                val.iconName = byUnicode(val.prefix, toHex(node.innerText));
            }
            return val;
        }
        var parseTransformString = function parseTransformString(transformString) {
            var transform = {
                size: 16,
                x: 0,
                y: 0,
                flipX: false,
                flipY: false,
                rotate: 0
            };
            if (!transformString) {
                return transform;
            } else {
                return transformString.toLowerCase().split(" ").reduce((function(acc, n) {
                    var parts = n.toLowerCase().split("-");
                    var first = parts[0];
                    var rest = parts.slice(1).join("-");
                    if (first && rest === "h") {
                        acc.flipX = true;
                        return acc;
                    }
                    if (first && rest === "v") {
                        acc.flipY = true;
                        return acc;
                    }
                    rest = parseFloat(rest);
                    if (isNaN(rest)) {
                        return acc;
                    }
                    switch (first) {
                      case "grow":
                        acc.size = acc.size + rest;
                        break;

                      case "shrink":
                        acc.size = acc.size - rest;
                        break;

                      case "left":
                        acc.x = acc.x - rest;
                        break;

                      case "right":
                        acc.x = acc.x + rest;
                        break;

                      case "up":
                        acc.y = acc.y - rest;
                        break;

                      case "down":
                        acc.y = acc.y + rest;
                        break;

                      case "rotate":
                        acc.rotate = acc.rotate + rest;
                        break;
                    }
                    return acc;
                }), transform);
            }
        };
        function transformParser(node) {
            return parseTransformString(node.getAttribute("data-fa-transform"));
        }
        function symbolParser(node) {
            var symbol = node.getAttribute("data-fa-symbol");
            return symbol === null ? false : symbol === "" ? true : symbol;
        }
        function attributesParser(node) {
            var extraAttributes = toArray(node.attributes).reduce((function(acc, attr) {
                if (acc.name !== "class" && acc.name !== "style") {
                    acc[attr.name] = attr.value;
                }
                return acc;
            }), {});
            var title = node.getAttribute("title");
            var titleId = node.getAttribute("data-fa-title-id");
            if (fontawesome_svg_core_index_es_config.autoA11y) {
                if (title) {
                    extraAttributes["aria-labelledby"] = "".concat(fontawesome_svg_core_index_es_config.replacementClass, "-title-").concat(titleId || nextUniqueId());
                } else {
                    extraAttributes["aria-hidden"] = "true";
                    extraAttributes["focusable"] = "false";
                }
            }
            return extraAttributes;
        }
        function maskParser(node) {
            var mask = node.getAttribute("data-fa-mask");
            if (!mask) {
                return emptyCanonicalIcon();
            } else {
                return getCanonicalIcon(mask.split(" ").map((function(i) {
                    return i.trim();
                })));
            }
        }
        function blankMeta() {
            return {
                iconName: null,
                title: null,
                titleId: null,
                prefix: null,
                transform: meaninglessTransform,
                symbol: false,
                mask: null,
                maskId: null,
                extra: {
                    classes: [],
                    styles: {},
                    attributes: {}
                }
            };
        }
        function parseMeta(node) {
            var _classParser = classParser(node), iconName = _classParser.iconName, prefix = _classParser.prefix, extraClasses = _classParser.rest;
            var extraStyles = styleParser(node);
            var transform = transformParser(node);
            var symbol = symbolParser(node);
            var extraAttributes = attributesParser(node);
            var mask = maskParser(node);
            return {
                iconName,
                title: node.getAttribute("title"),
                titleId: node.getAttribute("data-fa-title-id"),
                prefix,
                transform,
                symbol,
                mask,
                maskId: node.getAttribute("data-fa-mask-id"),
                extra: {
                    classes: extraClasses,
                    styles: extraStyles,
                    attributes: extraAttributes
                }
            };
        }
        function MissingIcon(error) {
            this.name = "MissingIcon";
            this.message = error || "Icon unavailable";
            this.stack = (new Error).stack;
        }
        MissingIcon.prototype = Object.create(Error.prototype);
        MissingIcon.prototype.constructor = MissingIcon;
        var FILL = {
            fill: "currentColor"
        };
        var ANIMATION_BASE = {
            attributeType: "XML",
            repeatCount: "indefinite",
            dur: "2s"
        };
        var RING = {
            tag: "path",
            attributes: _objectSpread({}, FILL, {
                d: "M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"
            })
        };
        var OPACITY_ANIMATE = _objectSpread({}, ANIMATION_BASE, {
            attributeName: "opacity"
        });
        var DOT = {
            tag: "circle",
            attributes: _objectSpread({}, FILL, {
                cx: "256",
                cy: "364",
                r: "28"
            }),
            children: [ {
                tag: "animate",
                attributes: _objectSpread({}, ANIMATION_BASE, {
                    attributeName: "r",
                    values: "28;14;28;28;14;28;"
                })
            }, {
                tag: "animate",
                attributes: _objectSpread({}, OPACITY_ANIMATE, {
                    values: "1;0;1;1;0;1;"
                })
            } ]
        };
        var QUESTION = {
            tag: "path",
            attributes: _objectSpread({}, FILL, {
                opacity: "1",
                d: "M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"
            }),
            children: [ {
                tag: "animate",
                attributes: _objectSpread({}, OPACITY_ANIMATE, {
                    values: "1;0;0;0;0;1;"
                })
            } ]
        };
        var EXCLAMATION = {
            tag: "path",
            attributes: _objectSpread({}, FILL, {
                opacity: "0",
                d: "M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"
            }),
            children: [ {
                tag: "animate",
                attributes: _objectSpread({}, OPACITY_ANIMATE, {
                    values: "0;0;1;1;0;0;"
                })
            } ]
        };
        var missing = {
            tag: "g",
            children: [ RING, DOT, QUESTION, EXCLAMATION ]
        };
        var styles$2 = namespace.styles;
        function asFoundIcon(icon) {
            var width = icon[0];
            var height = icon[1];
            var _icon$slice = icon.slice(4), _icon$slice2 = _slicedToArray(_icon$slice, 1), vectorData = _icon$slice2[0];
            var element = null;
            if (Array.isArray(vectorData)) {
                element = {
                    tag: "g",
                    attributes: {
                        class: "".concat(fontawesome_svg_core_index_es_config.familyPrefix, "-").concat(DUOTONE_CLASSES.GROUP)
                    },
                    children: [ {
                        tag: "path",
                        attributes: {
                            class: "".concat(fontawesome_svg_core_index_es_config.familyPrefix, "-").concat(DUOTONE_CLASSES.SECONDARY),
                            fill: "currentColor",
                            d: vectorData[0]
                        }
                    }, {
                        tag: "path",
                        attributes: {
                            class: "".concat(fontawesome_svg_core_index_es_config.familyPrefix, "-").concat(DUOTONE_CLASSES.PRIMARY),
                            fill: "currentColor",
                            d: vectorData[1]
                        }
                    } ]
                };
            } else {
                element = {
                    tag: "path",
                    attributes: {
                        fill: "currentColor",
                        d: vectorData
                    }
                };
            }
            return {
                found: true,
                width,
                height,
                icon: element
            };
        }
        function findIcon(iconName, prefix) {
            return new picked((function(resolve, reject) {
                var val = {
                    found: false,
                    width: 512,
                    height: 512,
                    icon: missing
                };
                if (iconName && prefix && styles$2[prefix] && styles$2[prefix][iconName]) {
                    var icon = styles$2[prefix][iconName];
                    return resolve(asFoundIcon(icon));
                }
                if (iconName && prefix && !fontawesome_svg_core_index_es_config.showMissingIcons) {
                    reject(new MissingIcon("Icon is missing for prefix ".concat(prefix, " with icon name ").concat(iconName)));
                } else {
                    resolve(val);
                }
            }));
        }
        var styles$3 = namespace.styles;
        function generateSvgReplacementMutation(node, nodeMeta) {
            var iconName = nodeMeta.iconName, title = nodeMeta.title, titleId = nodeMeta.titleId, prefix = nodeMeta.prefix, transform = nodeMeta.transform, symbol = nodeMeta.symbol, mask = nodeMeta.mask, maskId = nodeMeta.maskId, extra = nodeMeta.extra;
            return new picked((function(resolve, reject) {
                picked.all([ findIcon(iconName, prefix), findIcon(mask.iconName, mask.prefix) ]).then((function(_ref) {
                    var _ref2 = _slicedToArray(_ref, 2), main = _ref2[0], mask = _ref2[1];
                    resolve([ node, makeInlineSvgAbstract({
                        icons: {
                            main,
                            mask
                        },
                        prefix,
                        iconName,
                        transform,
                        symbol,
                        mask,
                        maskId,
                        title,
                        titleId,
                        extra,
                        watchable: true
                    }) ]);
                }));
            }));
        }
        function generateLayersText(node, nodeMeta) {
            var title = nodeMeta.title, transform = nodeMeta.transform, extra = nodeMeta.extra;
            var width = null;
            var height = null;
            if (IS_IE) {
                var computedFontSize = parseInt(getComputedStyle(node).fontSize, 10);
                var boundingClientRect = node.getBoundingClientRect();
                width = boundingClientRect.width / computedFontSize;
                height = boundingClientRect.height / computedFontSize;
            }
            if (fontawesome_svg_core_index_es_config.autoA11y && !title) {
                extra.attributes["aria-hidden"] = "true";
            }
            return picked.resolve([ node, makeLayersTextAbstract({
                content: node.innerHTML,
                width,
                height,
                transform,
                title,
                extra,
                watchable: true
            }) ]);
        }
        function generateMutation(node) {
            var nodeMeta = parseMeta(node);
            if (~nodeMeta.extra.classes.indexOf(LAYERS_TEXT_CLASSNAME)) {
                return generateLayersText(node, nodeMeta);
            } else {
                return generateSvgReplacementMutation(node, nodeMeta);
            }
        }
        function onTree(root) {
            var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
            if (!IS_DOM) return;
            var htmlClassList = DOCUMENT.documentElement.classList;
            var hclAdd = function hclAdd(suffix) {
                return htmlClassList.add("".concat(HTML_CLASS_I2SVG_BASE_CLASS, "-").concat(suffix));
            };
            var hclRemove = function hclRemove(suffix) {
                return htmlClassList.remove("".concat(HTML_CLASS_I2SVG_BASE_CLASS, "-").concat(suffix));
            };
            var prefixes = fontawesome_svg_core_index_es_config.autoFetchSvg ? Object.keys(PREFIX_TO_STYLE) : Object.keys(styles$3);
            var prefixesDomQuery = [ ".".concat(LAYERS_TEXT_CLASSNAME, ":not([").concat(DATA_FA_I2SVG, "])") ].concat(prefixes.map((function(p) {
                return ".".concat(p, ":not([").concat(DATA_FA_I2SVG, "])");
            }))).join(", ");
            if (prefixesDomQuery.length === 0) {
                return;
            }
            var candidates = [];
            try {
                candidates = toArray(root.querySelectorAll(prefixesDomQuery));
            } catch (e) {}
            if (candidates.length > 0) {
                hclAdd("pending");
                hclRemove("complete");
            } else {
                return;
            }
            var mark = perf.begin("onTree");
            var mutations = candidates.reduce((function(acc, node) {
                try {
                    var mutation = generateMutation(node);
                    if (mutation) {
                        acc.push(mutation);
                    }
                } catch (e) {
                    if (!PRODUCTION) {
                        if (e instanceof MissingIcon) {
                            console.error(e);
                        }
                    }
                }
                return acc;
            }), []);
            return new picked((function(resolve, reject) {
                picked.all(mutations).then((function(resolvedMutations) {
                    perform(resolvedMutations, (function() {
                        hclAdd("active");
                        hclAdd("complete");
                        hclRemove("pending");
                        if (typeof callback === "function") callback();
                        mark();
                        resolve();
                    }));
                })).catch((function() {
                    mark();
                    reject();
                }));
            }));
        }
        function onNode(node) {
            var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
            generateMutation(node).then((function(mutation) {
                if (mutation) {
                    perform([ mutation ], callback);
                }
            }));
        }
        function replaceForPosition(node, position) {
            var pendingAttribute = "".concat(DATA_FA_PSEUDO_ELEMENT_PENDING).concat(position.replace(":", "-"));
            return new picked((function(resolve, reject) {
                if (node.getAttribute(pendingAttribute) !== null) {
                    return resolve();
                }
                var children = toArray(node.children);
                var alreadyProcessedPseudoElement = children.filter((function(c) {
                    return c.getAttribute(DATA_FA_PSEUDO_ELEMENT) === position;
                }))[0];
                var styles = WINDOW.getComputedStyle(node, position);
                var fontFamily = styles.getPropertyValue("font-family").match(FONT_FAMILY_PATTERN);
                var fontWeight = styles.getPropertyValue("font-weight");
                var content = styles.getPropertyValue("content");
                if (alreadyProcessedPseudoElement && !fontFamily) {
                    node.removeChild(alreadyProcessedPseudoElement);
                    return resolve();
                } else if (fontFamily && content !== "none" && content !== "") {
                    var _content = styles.getPropertyValue("content");
                    var prefix = ~[ "Solid", "Regular", "Light", "Duotone", "Brands", "Kit" ].indexOf(fontFamily[2]) ? STYLE_TO_PREFIX[fontFamily[2].toLowerCase()] : FONT_WEIGHT_TO_PREFIX[fontWeight];
                    var hexValue = toHex(_content.length === 3 ? _content.substr(1, 1) : _content);
                    var iconName = byUnicode(prefix, hexValue);
                    var iconIdentifier = iconName;
                    if (iconName && (!alreadyProcessedPseudoElement || alreadyProcessedPseudoElement.getAttribute(DATA_PREFIX) !== prefix || alreadyProcessedPseudoElement.getAttribute(DATA_ICON) !== iconIdentifier)) {
                        node.setAttribute(pendingAttribute, iconIdentifier);
                        if (alreadyProcessedPseudoElement) {
                            node.removeChild(alreadyProcessedPseudoElement);
                        }
                        var meta = blankMeta();
                        var extra = meta.extra;
                        extra.attributes[DATA_FA_PSEUDO_ELEMENT] = position;
                        findIcon(iconName, prefix).then((function(main) {
                            var abstract = makeInlineSvgAbstract(_objectSpread({}, meta, {
                                icons: {
                                    main,
                                    mask: emptyCanonicalIcon()
                                },
                                prefix,
                                iconName: iconIdentifier,
                                extra,
                                watchable: true
                            }));
                            var element = DOCUMENT.createElement("svg");
                            if (position === ":before") {
                                node.insertBefore(element, node.firstChild);
                            } else {
                                node.appendChild(element);
                            }
                            element.outerHTML = abstract.map((function(a) {
                                return toHtml(a);
                            })).join("\n");
                            node.removeAttribute(pendingAttribute);
                            resolve();
                        })).catch(reject);
                    } else {
                        resolve();
                    }
                } else {
                    resolve();
                }
            }));
        }
        function replace(node) {
            return picked.all([ replaceForPosition(node, ":before"), replaceForPosition(node, ":after") ]);
        }
        function processable(node) {
            return node.parentNode !== document.head && !~TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS.indexOf(node.tagName.toUpperCase()) && !node.getAttribute(DATA_FA_PSEUDO_ELEMENT) && (!node.parentNode || node.parentNode.tagName !== "svg");
        }
        function searchPseudoElements(root) {
            if (!IS_DOM) return;
            return new picked((function(resolve, reject) {
                var operations = toArray(root.querySelectorAll("*")).filter(processable).map(replace);
                var end = perf.begin("searchPseudoElements");
                disableObservation();
                picked.all(operations).then((function() {
                    end();
                    enableObservation();
                    resolve();
                })).catch((function() {
                    end();
                    enableObservation();
                    reject();
                }));
            }));
        }
        var baseStyles = 'svg:not(:root).svg-inline--fa {\n  overflow: visible;\n}\n\n.svg-inline--fa {\n  display: inline-block;\n  font-size: inherit;\n  height: 1em;\n  overflow: visible;\n  vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-lg {\n  vertical-align: -0.225em;\n}\n.svg-inline--fa.fa-w-1 {\n  width: 0.0625em;\n}\n.svg-inline--fa.fa-w-2 {\n  width: 0.125em;\n}\n.svg-inline--fa.fa-w-3 {\n  width: 0.1875em;\n}\n.svg-inline--fa.fa-w-4 {\n  width: 0.25em;\n}\n.svg-inline--fa.fa-w-5 {\n  width: 0.3125em;\n}\n.svg-inline--fa.fa-w-6 {\n  width: 0.375em;\n}\n.svg-inline--fa.fa-w-7 {\n  width: 0.4375em;\n}\n.svg-inline--fa.fa-w-8 {\n  width: 0.5em;\n}\n.svg-inline--fa.fa-w-9 {\n  width: 0.5625em;\n}\n.svg-inline--fa.fa-w-10 {\n  width: 0.625em;\n}\n.svg-inline--fa.fa-w-11 {\n  width: 0.6875em;\n}\n.svg-inline--fa.fa-w-12 {\n  width: 0.75em;\n}\n.svg-inline--fa.fa-w-13 {\n  width: 0.8125em;\n}\n.svg-inline--fa.fa-w-14 {\n  width: 0.875em;\n}\n.svg-inline--fa.fa-w-15 {\n  width: 0.9375em;\n}\n.svg-inline--fa.fa-w-16 {\n  width: 1em;\n}\n.svg-inline--fa.fa-w-17 {\n  width: 1.0625em;\n}\n.svg-inline--fa.fa-w-18 {\n  width: 1.125em;\n}\n.svg-inline--fa.fa-w-19 {\n  width: 1.1875em;\n}\n.svg-inline--fa.fa-w-20 {\n  width: 1.25em;\n}\n.svg-inline--fa.fa-pull-left {\n  margin-right: 0.3em;\n  width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n  margin-left: 0.3em;\n  width: auto;\n}\n.svg-inline--fa.fa-border {\n  height: 1.5em;\n}\n.svg-inline--fa.fa-li {\n  width: 2em;\n}\n.svg-inline--fa.fa-fw {\n  width: 1.25em;\n}\n\n.fa-layers svg.svg-inline--fa {\n  bottom: 0;\n  left: 0;\n  margin: auto;\n  position: absolute;\n  right: 0;\n  top: 0;\n}\n\n.fa-layers {\n  display: inline-block;\n  height: 1em;\n  position: relative;\n  text-align: center;\n  vertical-align: -0.125em;\n  width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n  -webkit-transform-origin: center center;\n          transform-origin: center center;\n}\n\n.fa-layers-counter, .fa-layers-text {\n  display: inline-block;\n  position: absolute;\n  text-align: center;\n}\n\n.fa-layers-text {\n  left: 50%;\n  top: 50%;\n  -webkit-transform: translate(-50%, -50%);\n          transform: translate(-50%, -50%);\n  -webkit-transform-origin: center center;\n          transform-origin: center center;\n}\n\n.fa-layers-counter {\n  background-color: #ff253a;\n  border-radius: 1em;\n  -webkit-box-sizing: border-box;\n          box-sizing: border-box;\n  color: #fff;\n  height: 1.5em;\n  line-height: 1;\n  max-width: 5em;\n  min-width: 1.5em;\n  overflow: hidden;\n  padding: 0.25em;\n  right: 0;\n  text-overflow: ellipsis;\n  top: 0;\n  -webkit-transform: scale(0.25);\n          transform: scale(0.25);\n  -webkit-transform-origin: top right;\n          transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n  bottom: 0;\n  right: 0;\n  top: auto;\n  -webkit-transform: scale(0.25);\n          transform: scale(0.25);\n  -webkit-transform-origin: bottom right;\n          transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n  bottom: 0;\n  left: 0;\n  right: auto;\n  top: auto;\n  -webkit-transform: scale(0.25);\n          transform: scale(0.25);\n  -webkit-transform-origin: bottom left;\n          transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n  right: 0;\n  top: 0;\n  -webkit-transform: scale(0.25);\n          transform: scale(0.25);\n  -webkit-transform-origin: top right;\n          transform-origin: top right;\n}\n\n.fa-layers-top-left {\n  left: 0;\n  right: auto;\n  top: 0;\n  -webkit-transform: scale(0.25);\n          transform: scale(0.25);\n  -webkit-transform-origin: top left;\n          transform-origin: top left;\n}\n\n.fa-lg {\n  font-size: 1.3333333333em;\n  line-height: 0.75em;\n  vertical-align: -0.0667em;\n}\n\n.fa-xs {\n  font-size: 0.75em;\n}\n\n.fa-sm {\n  font-size: 0.875em;\n}\n\n.fa-1x {\n  font-size: 1em;\n}\n\n.fa-2x {\n  font-size: 2em;\n}\n\n.fa-3x {\n  font-size: 3em;\n}\n\n.fa-4x {\n  font-size: 4em;\n}\n\n.fa-5x {\n  font-size: 5em;\n}\n\n.fa-6x {\n  font-size: 6em;\n}\n\n.fa-7x {\n  font-size: 7em;\n}\n\n.fa-8x {\n  font-size: 8em;\n}\n\n.fa-9x {\n  font-size: 9em;\n}\n\n.fa-10x {\n  font-size: 10em;\n}\n\n.fa-fw {\n  text-align: center;\n  width: 1.25em;\n}\n\n.fa-ul {\n  list-style-type: none;\n  margin-left: 2.5em;\n  padding-left: 0;\n}\n.fa-ul > li {\n  position: relative;\n}\n\n.fa-li {\n  left: -2em;\n  position: absolute;\n  text-align: center;\n  width: 2em;\n  line-height: inherit;\n}\n\n.fa-border {\n  border: solid 0.08em #eee;\n  border-radius: 0.1em;\n  padding: 0.2em 0.25em 0.15em;\n}\n\n.fa-pull-left {\n  float: left;\n}\n\n.fa-pull-right {\n  float: right;\n}\n\n.fa.fa-pull-left,\n.fas.fa-pull-left,\n.far.fa-pull-left,\n.fal.fa-pull-left,\n.fab.fa-pull-left {\n  margin-right: 0.3em;\n}\n.fa.fa-pull-right,\n.fas.fa-pull-right,\n.far.fa-pull-right,\n.fal.fa-pull-right,\n.fab.fa-pull-right {\n  margin-left: 0.3em;\n}\n\n.fa-spin {\n  -webkit-animation: fa-spin 2s infinite linear;\n          animation: fa-spin 2s infinite linear;\n}\n\n.fa-pulse {\n  -webkit-animation: fa-spin 1s infinite steps(8);\n          animation: fa-spin 1s infinite steps(8);\n}\n\n@-webkit-keyframes fa-spin {\n  0% {\n    -webkit-transform: rotate(0deg);\n            transform: rotate(0deg);\n  }\n  100% {\n    -webkit-transform: rotate(360deg);\n            transform: rotate(360deg);\n  }\n}\n\n@keyframes fa-spin {\n  0% {\n    -webkit-transform: rotate(0deg);\n            transform: rotate(0deg);\n  }\n  100% {\n    -webkit-transform: rotate(360deg);\n            transform: rotate(360deg);\n  }\n}\n.fa-rotate-90 {\n  -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";\n  -webkit-transform: rotate(90deg);\n          transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n  -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";\n  -webkit-transform: rotate(180deg);\n          transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n  -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";\n  -webkit-transform: rotate(270deg);\n          transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n  -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";\n  -webkit-transform: scale(-1, 1);\n          transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n  -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n  -webkit-transform: scale(1, -1);\n          transform: scale(1, -1);\n}\n\n.fa-flip-both, .fa-flip-horizontal.fa-flip-vertical {\n  -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n  -webkit-transform: scale(-1, -1);\n          transform: scale(-1, -1);\n}\n\n:root .fa-rotate-90,\n:root .fa-rotate-180,\n:root .fa-rotate-270,\n:root .fa-flip-horizontal,\n:root .fa-flip-vertical,\n:root .fa-flip-both {\n  -webkit-filter: none;\n          filter: none;\n}\n\n.fa-stack {\n  display: inline-block;\n  height: 2em;\n  position: relative;\n  width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n  bottom: 0;\n  left: 0;\n  margin: auto;\n  position: absolute;\n  right: 0;\n  top: 0;\n}\n\n.svg-inline--fa.fa-stack-1x {\n  height: 1em;\n  width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n  height: 2em;\n  width: 2.5em;\n}\n\n.fa-inverse {\n  color: #fff;\n}\n\n.sr-only {\n  border: 0;\n  clip: rect(0, 0, 0, 0);\n  height: 1px;\n  margin: -1px;\n  overflow: hidden;\n  padding: 0;\n  position: absolute;\n  width: 1px;\n}\n\n.sr-only-focusable:active, .sr-only-focusable:focus {\n  clip: auto;\n  height: auto;\n  margin: 0;\n  overflow: visible;\n  position: static;\n  width: auto;\n}\n\n.svg-inline--fa .fa-primary {\n  fill: var(--fa-primary-color, currentColor);\n  opacity: 1;\n  opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n  fill: var(--fa-secondary-color, currentColor);\n  opacity: 0.4;\n  opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n  opacity: 0.4;\n  opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n  opacity: 1;\n  opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n  fill: black;\n}\n\n.fad.fa-inverse {\n  color: #fff;\n}';
        function index_es_css() {
            var dfp = DEFAULT_FAMILY_PREFIX;
            var drc = DEFAULT_REPLACEMENT_CLASS;
            var fp = fontawesome_svg_core_index_es_config.familyPrefix;
            var rc = fontawesome_svg_core_index_es_config.replacementClass;
            var s = baseStyles;
            if (fp !== dfp || rc !== drc) {
                var dPatt = new RegExp("\\.".concat(dfp, "\\-"), "g");
                var customPropPatt = new RegExp("\\--".concat(dfp, "\\-"), "g");
                var rPatt = new RegExp("\\.".concat(drc), "g");
                s = s.replace(dPatt, ".".concat(fp, "-")).replace(customPropPatt, "--".concat(fp, "-")).replace(rPatt, ".".concat(rc));
            }
            return s;
        }
        var Library = function() {
            function Library() {
                _classCallCheck(this, Library);
                this.definitions = {};
            }
            _createClass(Library, [ {
                key: "add",
                value: function add() {
                    var _this = this;
                    for (var _len = arguments.length, definitions = new Array(_len), _key = 0; _key < _len; _key++) {
                        definitions[_key] = arguments[_key];
                    }
                    var additions = definitions.reduce(this._pullDefinitions, {});
                    Object.keys(additions).forEach((function(key) {
                        _this.definitions[key] = _objectSpread({}, _this.definitions[key] || {}, additions[key]);
                        defineIcons(key, additions[key]);
                        index_es_build();
                    }));
                }
            }, {
                key: "reset",
                value: function reset() {
                    this.definitions = {};
                }
            }, {
                key: "_pullDefinitions",
                value: function _pullDefinitions(additions, definition) {
                    var normalized = definition.prefix && definition.iconName && definition.icon ? {
                        0: definition
                    } : definition;
                    Object.keys(normalized).map((function(key) {
                        var _normalized$key = normalized[key], prefix = _normalized$key.prefix, iconName = _normalized$key.iconName, icon = _normalized$key.icon;
                        if (!additions[prefix]) additions[prefix] = {};
                        additions[prefix][iconName] = icon;
                    }));
                    return additions;
                }
            } ]);
            return Library;
        }();
        function ensureCss() {
            if (fontawesome_svg_core_index_es_config.autoAddCss && !_cssInserted) {
                insertCss(index_es_css());
                _cssInserted = true;
            }
        }
        function apiObject(val, abstractCreator) {
            Object.defineProperty(val, "abstract", {
                get: abstractCreator
            });
            Object.defineProperty(val, "html", {
                get: function get() {
                    return val.abstract.map((function(a) {
                        return toHtml(a);
                    }));
                }
            });
            Object.defineProperty(val, "node", {
                get: function get() {
                    if (!IS_DOM) return;
                    var container = DOCUMENT.createElement("div");
                    container.innerHTML = val.html;
                    return container.children;
                }
            });
            return val;
        }
        function findIconDefinition(iconLookup) {
            var _iconLookup$prefix = iconLookup.prefix, prefix = _iconLookup$prefix === void 0 ? "fa" : _iconLookup$prefix, iconName = iconLookup.iconName;
            if (!iconName) return;
            return iconFromMapping(library.definitions, prefix, iconName) || iconFromMapping(namespace.styles, prefix, iconName);
        }
        function resolveIcons(next) {
            return function(maybeIconDefinition) {
                var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
                var iconDefinition = (maybeIconDefinition || {}).icon ? maybeIconDefinition : findIconDefinition(maybeIconDefinition || {});
                var mask = params.mask;
                if (mask) {
                    mask = (mask || {}).icon ? mask : findIconDefinition(mask || {});
                }
                return next(iconDefinition, _objectSpread({}, params, {
                    mask
                }));
            };
        }
        var library = new Library;
        var noAuto = function noAuto() {
            fontawesome_svg_core_index_es_config.autoReplaceSvg = false;
            fontawesome_svg_core_index_es_config.observeMutations = false;
            disconnect();
        };
        var _cssInserted = false;
        var dom = {
            i2svg: function i2svg() {
                var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
                if (IS_DOM) {
                    ensureCss();
                    var _params$node = params.node, node = _params$node === void 0 ? DOCUMENT : _params$node, _params$callback = params.callback, callback = _params$callback === void 0 ? function() {} : _params$callback;
                    if (fontawesome_svg_core_index_es_config.searchPseudoElements) {
                        searchPseudoElements(node);
                    }
                    return onTree(node, callback);
                } else {
                    return picked.reject("Operation requires a DOM of some kind.");
                }
            },
            css: index_es_css,
            insertCss: function insertCss$$1() {
                if (!_cssInserted) {
                    insertCss(index_es_css());
                    _cssInserted = true;
                }
            },
            watch: function watch() {
                var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
                var autoReplaceSvgRoot = params.autoReplaceSvgRoot, observeMutationsRoot = params.observeMutationsRoot;
                if (fontawesome_svg_core_index_es_config.autoReplaceSvg === false) {
                    fontawesome_svg_core_index_es_config.autoReplaceSvg = true;
                }
                fontawesome_svg_core_index_es_config.observeMutations = true;
                domready((function() {
                    autoReplace({
                        autoReplaceSvgRoot
                    });
                    index_es_observe({
                        treeCallback: onTree,
                        nodeCallback: onNode,
                        pseudoElementsCallback: searchPseudoElements,
                        observeMutationsRoot
                    });
                }));
            }
        };
        var parse = {
            transform: function transform(transformString) {
                return parseTransformString(transformString);
            }
        };
        var icon = resolveIcons((function(iconDefinition) {
            var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
            var _params$transform = params.transform, transform = _params$transform === void 0 ? meaninglessTransform : _params$transform, _params$symbol = params.symbol, symbol = _params$symbol === void 0 ? false : _params$symbol, _params$mask = params.mask, mask = _params$mask === void 0 ? null : _params$mask, _params$maskId = params.maskId, maskId = _params$maskId === void 0 ? null : _params$maskId, _params$title = params.title, title = _params$title === void 0 ? null : _params$title, _params$titleId = params.titleId, titleId = _params$titleId === void 0 ? null : _params$titleId, _params$classes = params.classes, classes = _params$classes === void 0 ? [] : _params$classes, _params$attributes = params.attributes, attributes = _params$attributes === void 0 ? {} : _params$attributes, _params$styles = params.styles, styles = _params$styles === void 0 ? {} : _params$styles;
            if (!iconDefinition) return;
            var prefix = iconDefinition.prefix, iconName = iconDefinition.iconName, icon = iconDefinition.icon;
            return apiObject(_objectSpread({
                type: "icon"
            }, iconDefinition), (function() {
                ensureCss();
                if (fontawesome_svg_core_index_es_config.autoA11y) {
                    if (title) {
                        attributes["aria-labelledby"] = "".concat(fontawesome_svg_core_index_es_config.replacementClass, "-title-").concat(titleId || nextUniqueId());
                    } else {
                        attributes["aria-hidden"] = "true";
                        attributes["focusable"] = "false";
                    }
                }
                return makeInlineSvgAbstract({
                    icons: {
                        main: asFoundIcon(icon),
                        mask: mask ? asFoundIcon(mask.icon) : {
                            found: false,
                            width: null,
                            height: null,
                            icon: {}
                        }
                    },
                    prefix,
                    iconName,
                    transform: _objectSpread({}, meaninglessTransform, transform),
                    symbol,
                    title,
                    maskId,
                    titleId,
                    extra: {
                        attributes,
                        styles,
                        classes
                    }
                });
            }));
        }));
        var index_es_text = function text(content) {
            var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
            var _params$transform2 = params.transform, transform = _params$transform2 === void 0 ? meaninglessTransform : _params$transform2, _params$title2 = params.title, title = _params$title2 === void 0 ? null : _params$title2, _params$classes2 = params.classes, classes = _params$classes2 === void 0 ? [] : _params$classes2, _params$attributes2 = params.attributes, attributes = _params$attributes2 === void 0 ? {} : _params$attributes2, _params$styles2 = params.styles, styles = _params$styles2 === void 0 ? {} : _params$styles2;
            return apiObject({
                type: "text",
                content
            }, (function() {
                ensureCss();
                return makeLayersTextAbstract({
                    content,
                    transform: _objectSpread({}, meaninglessTransform, transform),
                    title,
                    extra: {
                        attributes,
                        styles,
                        classes: [ "".concat(fontawesome_svg_core_index_es_config.familyPrefix, "-layers-text") ].concat(_toConsumableArray(classes))
                    }
                });
            }));
        };
        var counter = function counter(content) {
            var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
            var _params$title3 = params.title, title = _params$title3 === void 0 ? null : _params$title3, _params$classes3 = params.classes, classes = _params$classes3 === void 0 ? [] : _params$classes3, _params$attributes3 = params.attributes, attributes = _params$attributes3 === void 0 ? {} : _params$attributes3, _params$styles3 = params.styles, styles = _params$styles3 === void 0 ? {} : _params$styles3;
            return apiObject({
                type: "counter",
                content
            }, (function() {
                ensureCss();
                return makeLayersCounterAbstract({
                    content: content.toString(),
                    title,
                    extra: {
                        attributes,
                        styles,
                        classes: [ "".concat(fontawesome_svg_core_index_es_config.familyPrefix, "-layers-counter") ].concat(_toConsumableArray(classes))
                    }
                });
            }));
        };
        var index_es_layer = function layer(assembler) {
            var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
            var _params$classes4 = params.classes, classes = _params$classes4 === void 0 ? [] : _params$classes4;
            return apiObject({
                type: "layer"
            }, (function() {
                ensureCss();
                var children = [];
                assembler((function(args) {
                    Array.isArray(args) ? args.map((function(a) {
                        children = children.concat(a.abstract);
                    })) : children = children.concat(args.abstract);
                }));
                return [ {
                    tag: "span",
                    attributes: {
                        class: [ "".concat(fontawesome_svg_core_index_es_config.familyPrefix, "-layers") ].concat(_toConsumableArray(classes)).join(" ")
                    },
                    children
                } ];
            }));
        };
        var api = {
            noAuto,
            config: fontawesome_svg_core_index_es_config,
            dom,
            library,
            parse,
            findIconDefinition,
            icon,
            text: index_es_text,
            counter,
            layer: index_es_layer,
            toHtml
        };
        var autoReplace = function autoReplace() {
            var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
            var _params$autoReplaceSv = params.autoReplaceSvgRoot, autoReplaceSvgRoot = _params$autoReplaceSv === void 0 ? DOCUMENT : _params$autoReplaceSv;
            if ((Object.keys(namespace.styles).length > 0 || fontawesome_svg_core_index_es_config.autoFetchSvg) && IS_DOM && fontawesome_svg_core_index_es_config.autoReplaceSvg) api.dom.i2svg({
                node: autoReplaceSvgRoot
            });
        };
        function react_fontawesome_index_es_typeof(obj) {
            if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
                react_fontawesome_index_es_typeof = function(obj) {
                    return typeof obj;
                };
            } else {
                react_fontawesome_index_es_typeof = function(obj) {
                    return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
                };
            }
            return react_fontawesome_index_es_typeof(obj);
        }
        function react_fontawesome_index_es_defineProperty(obj, key, value) {
            if (key in obj) {
                Object.defineProperty(obj, key, {
                    value,
                    enumerable: true,
                    configurable: true,
                    writable: true
                });
            } else {
                obj[key] = value;
            }
            return obj;
        }
        function index_es_ownKeys(object, enumerableOnly) {
            var keys = Object.keys(object);
            if (Object.getOwnPropertySymbols) {
                var symbols = Object.getOwnPropertySymbols(object);
                if (enumerableOnly) symbols = symbols.filter((function(sym) {
                    return Object.getOwnPropertyDescriptor(object, sym).enumerable;
                }));
                keys.push.apply(keys, symbols);
            }
            return keys;
        }
        function index_es_objectSpread2(target) {
            for (var i = 1; i < arguments.length; i++) {
                var source = arguments[i] != null ? arguments[i] : {};
                if (i % 2) {
                    index_es_ownKeys(Object(source), true).forEach((function(key) {
                        react_fontawesome_index_es_defineProperty(target, key, source[key]);
                    }));
                } else if (Object.getOwnPropertyDescriptors) {
                    Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
                } else {
                    index_es_ownKeys(Object(source)).forEach((function(key) {
                        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
                    }));
                }
            }
            return target;
        }
        function index_es_objectWithoutPropertiesLoose(source, excluded) {
            if (source == null) return {};
            var target = {};
            var sourceKeys = Object.keys(source);
            var key, i;
            for (i = 0; i < sourceKeys.length; i++) {
                key = sourceKeys[i];
                if (excluded.indexOf(key) >= 0) continue;
                target[key] = source[key];
            }
            return target;
        }
        function _objectWithoutProperties(source, excluded) {
            if (source == null) return {};
            var target = index_es_objectWithoutPropertiesLoose(source, excluded);
            var key, i;
            if (Object.getOwnPropertySymbols) {
                var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
                for (i = 0; i < sourceSymbolKeys.length; i++) {
                    key = sourceSymbolKeys[i];
                    if (excluded.indexOf(key) >= 0) continue;
                    if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
                    target[key] = source[key];
                }
            }
            return target;
        }
        function index_es_toConsumableArray(arr) {
            return index_es_arrayWithoutHoles(arr) || index_es_iterableToArray(arr) || index_es_nonIterableSpread();
        }
        function index_es_arrayWithoutHoles(arr) {
            if (Array.isArray(arr)) {
                for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
                return arr2;
            }
        }
        function index_es_iterableToArray(iter) {
            if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
        }
        function index_es_nonIterableSpread() {
            throw new TypeError("Invalid attempt to spread non-iterable instance");
        }
        function classList(props) {
            var _classes;
            var spin = props.spin, pulse = props.pulse, fixedWidth = props.fixedWidth, inverse = props.inverse, border = props.border, listItem = props.listItem, flip = props.flip, size = props.size, rotation = props.rotation, pull = props.pull;
            var classes = (_classes = {
                "fa-spin": spin,
                "fa-pulse": pulse,
                "fa-fw": fixedWidth,
                "fa-inverse": inverse,
                "fa-border": border,
                "fa-li": listItem,
                "fa-flip-horizontal": flip === "horizontal" || flip === "both",
                "fa-flip-vertical": flip === "vertical" || flip === "both"
            }, react_fontawesome_index_es_defineProperty(_classes, "fa-".concat(size), typeof size !== "undefined" && size !== null), 
            react_fontawesome_index_es_defineProperty(_classes, "fa-rotate-".concat(rotation), typeof rotation !== "undefined" && rotation !== null && rotation !== 0), 
            react_fontawesome_index_es_defineProperty(_classes, "fa-pull-".concat(pull), typeof pull !== "undefined" && pull !== null), 
            react_fontawesome_index_es_defineProperty(_classes, "fa-swap-opacity", props.swapOpacity), 
            _classes);
            return Object.keys(classes).map((function(key) {
                return classes[key] ? key : null;
            })).filter((function(key) {
                return key;
            }));
        }
        function _isNumerical(obj) {
            obj = obj - 0;
            return obj === obj;
        }
        function camelize(string) {
            if (_isNumerical(string)) {
                return string;
            }
            string = string.replace(/[\-_\s]+(.)?/g, (function(match, chr) {
                return chr ? chr.toUpperCase() : "";
            }));
            return string.substr(0, 1).toLowerCase() + string.substr(1);
        }
        function capitalize(val) {
            return val.charAt(0).toUpperCase() + val.slice(1);
        }
        function styleToObject(style) {
            return style.split(";").map((function(s) {
                return s.trim();
            })).filter((function(s) {
                return s;
            })).reduce((function(acc, pair) {
                var i = pair.indexOf(":");
                var prop = camelize(pair.slice(0, i));
                var value = pair.slice(i + 1).trim();
                prop.startsWith("webkit") ? acc[capitalize(prop)] = value : acc[prop] = value;
                return acc;
            }), {});
        }
        function convert(createElement, element) {
            var extraProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
            if (typeof element === "string") {
                return element;
            }
            var children = (element.children || []).map((function(child) {
                return convert(createElement, child);
            }));
            var mixins = Object.keys(element.attributes || {}).reduce((function(acc, key) {
                var val = element.attributes[key];
                switch (key) {
                  case "class":
                    acc.attrs["className"] = val;
                    delete element.attributes["class"];
                    break;

                  case "style":
                    acc.attrs["style"] = styleToObject(val);
                    break;

                  default:
                    if (key.indexOf("aria-") === 0 || key.indexOf("data-") === 0) {
                        acc.attrs[key.toLowerCase()] = val;
                    } else {
                        acc.attrs[camelize(key)] = val;
                    }
                }
                return acc;
            }), {
                attrs: {}
            });
            var _extraProps$style = extraProps.style, existingStyle = _extraProps$style === void 0 ? {} : _extraProps$style, remaining = _objectWithoutProperties(extraProps, [ "style" ]);
            mixins.attrs["style"] = index_es_objectSpread2({}, mixins.attrs["style"], {}, existingStyle);
            return createElement.apply(void 0, [ element.tag, index_es_objectSpread2({}, mixins.attrs, {}, remaining) ].concat(index_es_toConsumableArray(children)));
        }
        var index_es_PRODUCTION = false;
        try {
            index_es_PRODUCTION = "production" === "production";
        } catch (e) {}
        function log() {
            if (!index_es_PRODUCTION && console && typeof console.error === "function") {
                var _console;
                (_console = console).error.apply(_console, arguments);
            }
        }
        function normalizeIconArgs(icon) {
            if (parse.icon) {
                return parse.icon(icon);
            }
            if (icon === null) {
                return null;
            }
            if (react_fontawesome_index_es_typeof(icon) === "object" && icon.prefix && icon.iconName) {
                return icon;
            }
            if (Array.isArray(icon) && icon.length === 2) {
                return {
                    prefix: icon[0],
                    iconName: icon[1]
                };
            }
            if (typeof icon === "string") {
                return {
                    prefix: "fas",
                    iconName: icon
                };
            }
        }
        function objectWithKey(key, value) {
            return Array.isArray(value) && value.length > 0 || !Array.isArray(value) && value ? react_fontawesome_index_es_defineProperty({}, key, value) : {};
        }
        function FontAwesomeIcon(_ref) {
            var forwardedRef = _ref.forwardedRef, props = _objectWithoutProperties(_ref, [ "forwardedRef" ]);
            var iconArgs = props.icon, maskArgs = props.mask, symbol = props.symbol, className = props.className, title = props.title, titleId = props.titleId;
            var iconLookup = normalizeIconArgs(iconArgs);
            var classes = objectWithKey("classes", [].concat(index_es_toConsumableArray(classList(props)), index_es_toConsumableArray(className.split(" "))));
            var transform = objectWithKey("transform", typeof props.transform === "string" ? parse.transform(props.transform) : props.transform);
            var mask = objectWithKey("mask", normalizeIconArgs(maskArgs));
            var renderedIcon = icon(iconLookup, index_es_objectSpread2({}, classes, {}, transform, {}, mask, {
                symbol,
                title,
                titleId
            }));
            if (!renderedIcon) {
                log("Could not find icon", iconLookup);
                return null;
            }
            var abstract = renderedIcon.abstract;
            var extraProps = {
                ref: forwardedRef
            };
            Object.keys(props).forEach((function(key) {
                if (!FontAwesomeIcon.defaultProps.hasOwnProperty(key)) {
                    extraProps[key] = props[key];
                }
            }));
            return convertCurry(abstract[0], extraProps);
        }
        FontAwesomeIcon.displayName = "FontAwesomeIcon";
        FontAwesomeIcon.propTypes = {
            border: prop_types_default().bool,
            className: prop_types_default().string,
            mask: prop_types_default().oneOfType([ prop_types_default().object, prop_types_default().array, prop_types_default().string ]),
            fixedWidth: prop_types_default().bool,
            inverse: prop_types_default().bool,
            flip: prop_types_default().oneOf([ "horizontal", "vertical", "both" ]),
            icon: prop_types_default().oneOfType([ prop_types_default().object, prop_types_default().array, prop_types_default().string ]),
            listItem: prop_types_default().bool,
            pull: prop_types_default().oneOf([ "right", "left" ]),
            pulse: prop_types_default().bool,
            rotation: prop_types_default().oneOf([ 0, 90, 180, 270 ]),
            size: prop_types_default().oneOf([ "lg", "xs", "sm", "1x", "2x", "3x", "4x", "5x", "6x", "7x", "8x", "9x", "10x" ]),
            spin: prop_types_default().bool,
            symbol: prop_types_default().oneOfType([ prop_types_default().bool, prop_types_default().string ]),
            title: prop_types_default().string,
            transform: prop_types_default().oneOfType([ prop_types_default().string, prop_types_default().object ]),
            swapOpacity: prop_types_default().bool
        };
        FontAwesomeIcon.defaultProps = {
            border: false,
            className: "",
            mask: null,
            fixedWidth: false,
            inverse: false,
            flip: null,
            icon: null,
            listItem: false,
            pull: null,
            pulse: false,
            rotation: null,
            size: null,
            spin: false,
            symbol: false,
            title: "",
            transform: null,
            swapOpacity: false
        };
        var convertCurry = convert.bind(null, react.createElement);
        var faTimes = __webpack_require__(596);
        var ICON_SIZE = 14;
        var Wrapper = (0, styled_components_browser_esm.default)(Flex)(DismissableContainer_templateObject_1 || (DismissableContainer_templateObject_1 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\tposition: relative;\n\tmargin: 0;\n\tpadding: ", ";\n\tpadding-right: ", ";\n\tbox-shadow: 0 0 10px 0\n\t\t", ";\n\tborder-radius: 10px;\n\tborder: 1px solid\n\t\t", ";\n\tbackground-color: ", ";\n\tcolor: ", ";\n" ], [ "\n\tposition: relative;\n\tmargin: 0;\n\tpadding: ", ";\n\tpadding-right: ", ";\n\tbox-shadow: 0 0 10px 0\n\t\t", ";\n\tborder-radius: 10px;\n\tborder: 1px solid\n\t\t", ";\n\tbackground-color: ", ";\n\tcolor: ", ";\n" ])), (function(props) {
            return styledUtils_px(props.theme.space[3]);
        }), (function(props) {
            return styledUtils_px(props.hasDismissButton ? props.theme.space[4] : props.theme.space[3]);
        }), (function(props) {
            return opaque(props.theme.colors.quartenary.main, .15);
        }), (function(props) {
            return props.bordered ? props.solid ? getColor(props, "bg", "main") : props.theme.colors.quartenary.main : "transparent";
        }), (function(props) {
            return props.solid ? getColor(props, "bg", "light") : "white";
        }), (function(props) {
            return props.solid ? getColor(props, "bg", "dark") : props.color || "inherit";
        }));
        var DismissButton = (0, styled_components_browser_esm.default)(Button_Button)(DismissableContainer_templateObject_2 || (DismissableContainer_templateObject_2 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\tposition: absolute;\n\t& svg {\n\t\theight: ", ";\n\t\twidth: ", ";\n\t}\n\tfont-size: ", ";\n\tpadding: ", "; /* give more clickable surface area */\n\ttop: ", ";\n\tright: ", ";\n\ttransform: translate(0, -50%);\n" ], [ "\n\tposition: absolute;\n\t& svg {\n\t\theight: ", ";\n\t\twidth: ", ";\n\t}\n\tfont-size: ", ";\n\tpadding: ", "; /* give more clickable surface area */\n\ttop: ", ";\n\tright: ", ";\n\ttransform: translate(0, -50%);\n" ])), styledUtils_px(ICON_SIZE), styledUtils_px(ICON_SIZE), styledUtils_px(ICON_SIZE), (function(props) {
            return styledUtils_px(props.theme.space[2]);
        }), (function(props) {
            return styledUtils_px(props.theme.space[3] + props.baselineHeight / 2);
        }), (function(props) {
            return styledUtils_px(props.theme.space[3] - props.theme.space[2]);
        }));
        var DismissableContainer = (0, styled_components_browser_esm.withTheme)(react.forwardRef((function(_a, ref) {
            var children = _a.children, onDismiss = _a.onDismiss, baselineHeight = _a.baselineHeight, solid = _a.solid, theme = _a.theme, a11yTitle = _a.a11yTitle, bordered = _a.bordered, restProps = (0, 
            tslib_es6.__rest)(_a, [ "children", "onDismiss", "baselineHeight", "solid", "theme", "a11yTitle", "bordered" ]);
            var baseline = baselineHeight || theme.fontSizes[2] * theme.lineHeight;
            return react.createElement(Wrapper, (0, tslib_es6.__assign)({
                solid,
                bordered,
                hasDismissButton: Boolean(onDismiss),
                ref
            }, restProps), children, onDismiss && react.createElement(DismissButton, {
                title: a11yTitle || "Dismiss",
                a11yTitle: a11yTitle || "Dismiss",
                baselineHeight: baseline,
                color: solid ? getColor((0, tslib_es6.__assign)({
                    theme
                }, restProps), "bg", "dark") : undefined,
                primary: !solid,
                plain: true,
                onClick: onDismiss
            }, react.createElement(FontAwesomeIcon, {
                icon: faTimes.NB
            })));
        })));
        DismissableContainer.defaultProps = {
            bordered: true
        };
        var DismissableContainer_templateObject_1, DismissableContainer_templateObject_2;
        var Alert_getTitle = function(props) {
            if (props.prefix === false) {
                return;
            }
            if (props.prefix !== undefined) {
                return props.prefix;
            }
            return props.danger ? "Danger!" : props.warning ? "Warning!" : props.success ? "Success!" : props.info ? "Note!" : "";
        };
        var getIcon = function(props) {
            if (props.prefix === false) {
                return;
            }
            if (props.prefix !== undefined) {
                return;
            }
            return props.danger ? faBan.gP : props.warning ? faExclamationTriangle.eH : props.success ? faCheckCircle.f8 : props.info ? faLightbulb.X8 : "";
        };
        var BaseAlert = function(props) {
            var emphasized = props.emphasized, plaintext = props.plaintext, prefix = props.prefix, onDismiss = props.onDismiss, restProps = (0, 
            tslib_es6.__rest)(props, [ "emphasized", "plaintext", "prefix", "onDismiss" ]);
            var icon = getIcon(props);
            var title = plaintext ? null : Alert_getTitle(props);
            var mainColor = getColor(props, "color", "main");
            var darkColor = getColor(props, "color", "dark");
            var lineHeight = props.theme.fontSizes[2] * props.theme.lineHeight;
            if (plaintext) {
                return react.createElement(Flex, (0, tslib_es6.__assign)({}, restProps), icon && react.createElement(Txt, {
                    color: mainColor,
                    mb: "auto",
                    mr: 2
                }, react.createElement(FontAwesomeIcon, {
                    icon
                })), react.createElement(Txt.span, {
                    color: darkColor
                }, props.children));
            }
            return react.createElement(DismissableContainer, (0, tslib_es6.__assign)({
                baselineHeight: lineHeight,
                solid: emphasized,
                color: mainColor,
                onDismiss,
                a11yTitle: "Dismiss Alert"
            }, restProps), icon && react.createElement(Txt, {
                color: mainColor,
                mb: "auto",
                mr: 2
            }, react.createElement(FontAwesomeIcon, {
                icon
            })), react.createElement(Box, {
                color: darkColor,
                flex: 1
            }, title && react.createElement(Txt.span, {
                bold: true,
                mr: 1
            }, title), react.createElement(Txt.span, {
                color: emphasized ? darkColor : "text.main"
            }, props.children)));
        };
        var Alert = asRendition(BaseAlert, [], [ "bg" ]);
        var faSort = __webpack_require__(624);
        var every = __webpack_require__(597);
        var every_default = __webpack_require__.n(every);
        var filter = __webpack_require__(603);
        var filter_default = __webpack_require__.n(filter);
        var includes = __webpack_require__(605);
        var includes_default = __webpack_require__.n(includes);
        var isEqual = __webpack_require__(609);
        var isEqual_default = __webpack_require__.n(isEqual);
        var lodash_isPlainObject = __webpack_require__(471);
        var isPlainObject_default = __webpack_require__.n(lodash_isPlainObject);
        var map = __webpack_require__(610);
        var map_default = __webpack_require__.n(map);
        var lodash_reject = __webpack_require__(612);
        var reject_default = __webpack_require__.n(lodash_reject);
        var reverse = __webpack_require__(614);
        var reverse_default = __webpack_require__.n(reverse);
        var some = __webpack_require__(615);
        var some_default = __webpack_require__.n(some);
        var sortBy = __webpack_require__(617);
        var sortBy_default = __webpack_require__.n(sortBy);
        var useFormInput = function useFormInput(_, valueProp, initialValue) {
            var _useState = (0, react.useState)(valueProp !== undefined ? valueProp : initialValue), value = _useState[0], setValue = _useState[1];
            return [ valueProp !== undefined ? valueProp : value, function(nextValue) {
                if (initialValue !== undefined) setValue(nextValue);
            } ];
        };
        var useFormField = function useFormField(_ref) {
            var error = _ref.error, info = _ref.info;
            return {
                error,
                info
            };
        };
        var FormContext = react.createContext({
            useFormField,
            useFormInput
        });
        var StyledCheckBox_disabledStyle = "\n  opacity: 0.5;\n  cursor: default;\n";
        var StyledCheckBox_hoverStyle = (0, styled_components_browser_esm.css)([ ":hover input:not([disabled]) + div,:hover input:not([disabled]) + span{border-color:", ";}" ], (function(props) {
            return colors_normalizeColor(props.theme.checkBox.hover.border.color, props.theme);
        }));
        var StyledCheckBoxIcon = styled_components_browser_esm.default.svg.withConfig({
            displayName: "StyledCheckBox__StyledCheckBoxIcon",
            componentId: "sc-1dbk5ju-0"
        })([ "box-sizing:border-box;stroke-width:", ";stroke:", ";width:", ";height:", ";", ";" ], (function(props) {
            return props.theme.checkBox.check.thickness;
        }), (function(props) {
            return colors_normalizeColor(props.theme.checkBox.color || "control", props.theme);
        }), (function(props) {
            return props.theme.checkBox.icon.size || props.theme.checkBox.size;
        }), (function(props) {
            return props.theme.checkBox.icon.size || props.theme.checkBox.size;
        }), (function(props) {
            return props.theme.checkBox.icon.extend;
        }));
        StyledCheckBoxIcon.defaultProps = {};
        Object.setPrototypeOf(StyledCheckBoxIcon.defaultProps, default_props_defaultProps);
        var StyledCheckBoxContainer = styled_components_browser_esm.default.label.withConfig({
            displayName: "StyledCheckBox__StyledCheckBoxContainer",
            componentId: "sc-1dbk5ju-1"
        })([ "display:flex;flex-direction:row;align-items:center;user-select:none;width:fit-content;", " ", " ", " ", "" ], (function(props) {
            return props.disabled && StyledCheckBox_disabledStyle;
        }), (function(props) {
            return !props.disabled && "cursor: pointer;";
        }), (function(props) {
            return props.theme.checkBox.hover.border.color && StyledCheckBox_hoverStyle;
        }), (function(props) {
            return props.theme.checkBox.extend;
        }));
        StyledCheckBoxContainer.defaultProps = {};
        Object.setPrototypeOf(StyledCheckBoxContainer.defaultProps, default_props_defaultProps);
        var StyledCheckBoxInput = styled_components_browser_esm.default.input.withConfig({
            displayName: "StyledCheckBox__StyledCheckBoxInput",
            componentId: "sc-1dbk5ju-2"
        })([ "opacity:0;-moz-appearance:none;width:0;height:0;margin:0;", ":checked + span > span{left:calc( ", " - ", " );background:", ";}" ], (function(props) {
            return !props.disabled && "cursor: pointer;";
        }), (function(props) {
            return props.theme.checkBox.toggle.size;
        }), (function(props) {
            return props.theme.checkBox.size;
        }), (function(props) {
            return colors_normalizeColor(props.theme.checkBox.color || "control", props.theme);
        }));
        StyledCheckBoxInput.defaultProps = {};
        Object.setPrototypeOf(StyledCheckBoxInput.defaultProps, default_props_defaultProps);
        var StyledCheckBoxBox = styled_components_browser_esm.default.div.withConfig({
            displayName: "StyledCheckBox__StyledCheckBoxBox",
            componentId: "sc-1dbk5ju-3"
        })([ "", ";", ";" ], (function(props) {
            return props.focus && focusStyle();
        }), (function(props) {
            return props.theme.checkBox.check.extend;
        }));
        StyledCheckBoxBox.defaultProps = {};
        Object.setPrototypeOf(StyledCheckBoxBox.defaultProps, default_props_defaultProps);
        var StyledCheckBoxToggle = styled_components_browser_esm.default.span.withConfig({
            displayName: "StyledCheckBox__StyledCheckBoxToggle",
            componentId: "sc-1dbk5ju-4"
        })([ "box-sizing:border-box;vertical-align:middle;display:inline-block;width:", ";height:", ";border:", " solid;border-color:", ";border-radius:", ";background-color:", ";", ";", ";" ], (function(props) {
            return props.theme.checkBox.toggle.size;
        }), (function(props) {
            return props.theme.checkBox.size;
        }), (function(props) {
            return props.theme.checkBox.border.width;
        }), (function(props) {
            return colors_normalizeColor(props.theme.checkBox.border.color, props.theme);
        }), (function(props) {
            return props.theme.checkBox.toggle.radius;
        }), (function(props) {
            return props.theme.checkBox.toggle.background ? colors_normalizeColor(props.theme.checkBox.toggle.background, props.theme) : "transparent";
        }), (function(props) {
            return props.focus && focusStyle();
        }), (function(props) {
            return props.theme.checkBox.toggle.extend;
        }));
        StyledCheckBoxToggle.defaultProps = {};
        Object.setPrototypeOf(StyledCheckBoxToggle.defaultProps, default_props_defaultProps);
        var StyledCheckBoxKnob = styled_components_browser_esm.default.span.withConfig({
            displayName: "StyledCheckBox__StyledCheckBoxKnob",
            componentId: "sc-1dbk5ju-5"
        })([ "box-sizing:border-box;position:relative;display:inherit;top:-", ";left:-", ";transition:all 0.3s;width:", ";height:", ";background:", ";border-radius:", ";", ";" ], (function(props) {
            return props.theme.checkBox.border.width;
        }), (function(props) {
            return props.theme.checkBox.border.width;
        }), (function(props) {
            return props.theme.checkBox.size;
        }), (function(props) {
            return props.theme.checkBox.size;
        }), (function(props) {
            return colors_normalizeColor(props.theme.checkBox.toggle.color[props.theme.dark ? "dark" : "light"], props.theme);
        }), (function(props) {
            return props.theme.checkBox.toggle.radius;
        }), (function(props) {
            return props.theme.checkBox.toggle.knob.extend;
        }));
        StyledCheckBoxKnob.defaultProps = {};
        Object.setPrototypeOf(StyledCheckBoxKnob.defaultProps, default_props_defaultProps);
        var StyledCheckBox = styled_components_browser_esm.default.div.withConfig({
            displayName: "StyledCheckBox",
            componentId: "sc-1dbk5ju-6"
        })([ "flex-shrink:0;" ]);
        StyledCheckBox.defaultProps = {};
        Object.setPrototypeOf(StyledCheckBox.defaultProps, default_props_defaultProps);
        function CheckBox_extends() {
            CheckBox_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return CheckBox_extends.apply(this, arguments);
        }
        function CheckBox_objectWithoutPropertiesLoose(source, excluded) {
            if (source == null) return {};
            var target = {};
            var sourceKeys = Object.keys(source);
            var key, i;
            for (i = 0; i < sourceKeys.length; i++) {
                key = sourceKeys[i];
                if (excluded.indexOf(key) >= 0) continue;
                target[key] = source[key];
            }
            return target;
        }
        var stopLabelClick = function stopLabelClick(event) {
            if (event.target.type !== "checkbox") {
                event.stopPropagation();
            }
        };
        var CheckBox = (0, react.forwardRef)((function(_ref, ref) {
            var _ref2;
            var a11yTitle = _ref.a11yTitle, checkedProp = _ref.checked, disabled = _ref.disabled, focusProp = _ref.focus, id = _ref.id, label = _ref.label, name = _ref.name, _onBlur = _ref.onBlur, _onChange = _ref.onChange, _onFocus = _ref.onFocus, reverse = _ref.reverse, toggle = _ref.toggle, indeterminate = _ref.indeterminate, rest = CheckBox_objectWithoutPropertiesLoose(_ref, [ "a11yTitle", "checked", "disabled", "focus", "id", "label", "name", "onBlur", "onChange", "onFocus", "reverse", "toggle", "indeterminate" ]);
            var theme = (0, react.useContext)(styled_components_browser_esm.ThemeContext) || default_props_defaultProps.theme;
            var formContext = (0, react.useContext)(FormContext);
            var _formContext$useFormI = formContext.useFormInput(name, checkedProp, false), checked = _formContext$useFormI[0], setChecked = _formContext$useFormI[1];
            var _useState = (0, react.useState)(focusProp), focus = _useState[0], setFocus = _useState[1];
            (0, react.useEffect)((function() {
                return setFocus(focusProp);
            }), [ focusProp ]);
            (0, react.useEffect)((function() {
                if (checkedProp && indeterminate) {
                    console.warn('Checkbox cannot be "checked" and "indeterminate" at the same time.');
                }
                if (toggle && indeterminate) {
                    console.warn('Checkbox of type toggle does not have "indeterminate" state.');
                }
            }), [ checkedProp, toggle, indeterminate ]);
            var themeableProps = {
                checked,
                disabled,
                focus,
                reverse,
                toggle,
                indeterminate
            };
            var hidden;
            if (disabled && checked) {
                hidden = react.createElement("input", {
                    name,
                    type: "hidden",
                    value: "true"
                });
            }
            var _theme$checkBox$icons = theme.checkBox.icons, CheckedIcon = _theme$checkBox$icons.checked, IndeterminateIcon = _theme$checkBox$icons.indeterminate;
            var borderColor = colors_normalizeColor(theme.checkBox.border.color, theme);
            if (checked) {
                borderColor = colors_normalizeColor(theme.checkBox.color || "control", theme);
            }
            var visual = toggle ? react.createElement(StyledCheckBoxToggle, themeableProps, react.createElement(StyledCheckBoxKnob, themeableProps)) : react.createElement(StyledCheckBoxBox, CheckBox_extends({
                as: BoxWrapper,
                align: "center",
                justify: "center",
                width: theme.checkBox.size,
                height: theme.checkBox.size,
                border: {
                    size: theme.checkBox.border.width,
                    color: borderColor
                },
                round: theme.checkBox.check.radius
            }, themeableProps), !indeterminate && checked && (CheckedIcon ? react.createElement(CheckedIcon, {
                theme,
                as: StyledCheckBoxIcon
            }) : react.createElement(StyledCheckBoxIcon, CheckBox_extends({
                theme,
                viewBox: "0 0 24 24",
                preserveAspectRatio: "xMidYMid meet"
            }, themeableProps), react.createElement("path", {
                fill: "none",
                d: "M6,11.3 L10.3,16 L18,6.2"
            }))), !checked && indeterminate && (IndeterminateIcon ? react.createElement(IndeterminateIcon, {
                theme,
                as: StyledCheckBoxIcon
            }) : react.createElement(StyledCheckBoxIcon, CheckBox_extends({
                theme,
                viewBox: "0 0 24 24",
                preserveAspectRatio: "xMidYMid meet"
            }, themeableProps), react.createElement("path", {
                fill: "none",
                d: "M6,12 L18,12"
            }))));
            var side = reverse ? "left" : "right";
            var checkBoxNode = react.createElement(StyledCheckBox, CheckBox_extends({
                as: BoxWrapper,
                align: "center",
                justify: "center",
                margin: label && (_ref2 = {}, _ref2[side] = theme.checkBox.gap || "small", _ref2)
            }, themeableProps), react.createElement(StyledCheckBoxInput, CheckBox_extends({}, rest, {
                ref,
                type: "checkbox"
            }, removeUndefined({
                id,
                name,
                checked,
                disabled
            }), themeableProps, {
                onFocus: function onFocus(event) {
                    setFocus(true);
                    if (_onFocus) _onFocus(event);
                },
                onBlur: function onBlur(event) {
                    setFocus(false);
                    if (_onBlur) _onBlur(event);
                },
                onChange: function onChange(event) {
                    setChecked(event.target.checked);
                    if (_onChange) _onChange(event);
                }
            })), visual, hidden);
            var normalizedLabel = typeof label === "string" ? react.createElement("span", null, label) : label;
            var first = reverse ? normalizedLabel : checkBoxNode;
            var second = reverse ? checkBoxNode : normalizedLabel;
            return react.createElement(StyledCheckBoxContainer, CheckBox_extends({
                "aria-label": a11yTitle,
                reverse
            }, removeUndefined({
                htmlFor: id,
                disabled
            }), {
                checked,
                onClick: stopLabelClick
            }, themeableProps), first, second);
        }));
        CheckBox.displayName = "CheckBox";
        var CheckBoxDoc;
        if (false) {}
        var CheckBoxWrapper = CheckBoxDoc || CheckBox;
        var getHoverStyle = function(props) {
            return "\n\t& label:hover input:not([disabled]) + span > span {\n\t\tborder-color: " + props.theme.colors.primary.dark + ";\n\t\tbackground: " + props.theme.colors.primary.dark + ";\n\t}\n\t& label:hover input:not([disabled]) + div {\n\t\tborder-color: " + props.theme.colors.tertiary.main + "!important;\n\t}\n\t" + (props.isChecked ? "\n\t\t& label:hover input:not([disabled]) + div {\n\t\t\tborder-color: " + props.theme.colors.primary.dark + " !important;\n\t\t\tbackground: " + props.theme.colors.primary.dark + ";\n\t\t}\n\t\t" : "") + "\n";
        };
        var getBaseStyle = function(props) {
            return "\n\t/* for the checkbox */\n\t& > label > div > div,\n\t/* for the toggle */\n\t& > label > div > span {\n\t\tbackground-color: white;\n\t}\n\t& > label > span {\n\t\tfont-family: " + props.theme.font + ";\n\t\tfont-size: " + styledUtils_px(props.theme.fontSizes[2]) + ";\n\t}\n\t" + (props.isChecked ? "\n\t\t& label input + div {\n\t\t\tborder-color: " + props.theme.colors.primary.main + ";\n\t\t\tbackground: " + props.theme.colors.primary.main + ";\n\t\t\t> svg {\n\t\t\t\tstroke: #fff;\n\t\t\t}\n\t\t}\n\t\t" : "") + "\n\n\t& label[disabled] {\n\t\topacity: 0.4\n\t}\n";
        };
        var CheckboxWrapper = styled_components_browser_esm.default.div(Checkbox_templateObject_1 || (Checkbox_templateObject_1 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\t", "\n\t", "\n" ], [ "\n\t", "\n\t", "\n" ])), getBaseStyle, getHoverStyle);
        var BaseCheckbox = function(_a) {
            var className = _a.className, otherProps = (0, tslib_es6.__rest)(_a, [ "className" ]);
            return react.createElement(CheckboxWrapper, {
                isChecked: otherProps.checked,
                className
            }, react.createElement(CheckBoxWrapper, (0, tslib_es6.__assign)({}, otherProps)));
        };
        var Checkbox = asRendition(BaseCheckbox);
        var Checkbox_templateObject_1;
        var faChevronLeft = __webpack_require__(622);
        var faChevronRight = __webpack_require__(623);
        var ButtonGroup = (0, styled_components_browser_esm.default)(Flex)(ButtonGroup_templateObject_1 || (ButtonGroup_templateObject_1 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\t> * {\n\t\t&:first-child {\n\t\t\tborder-top-right-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;\n\t\t}\n\n\t\t&:last-child {\n\t\t\tborder-top-left-radius: 0;\n\t\t\tborder-bottom-left-radius: 0;\n\t\t}\n\n\t\t&:not(:last-child) {\n\t\t\tborder-right: 0;\n\t\t}\n\n\t\t&:not(:last-child):not(:first-child) {\n\t\t\tborder-radius: 0;\n\t\t}\n\n\t\t&:hover {\n\t\t\tz-index: 1;\n\t\t}\n\t}\n" ], [ "\n\t> * {\n\t\t&:first-child {\n\t\t\tborder-top-right-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;\n\t\t}\n\n\t\t&:last-child {\n\t\t\tborder-top-left-radius: 0;\n\t\t\tborder-bottom-left-radius: 0;\n\t\t}\n\n\t\t&:not(:last-child) {\n\t\t\tborder-right: 0;\n\t\t}\n\n\t\t&:not(:last-child):not(:first-child) {\n\t\t\tborder-radius: 0;\n\t\t}\n\n\t\t&:hover {\n\t\t\tz-index: 1;\n\t\t}\n\t}\n" ])));
        var ButtonGroup_templateObject_1;
        var BasePager = function(_a) {
            var totalItems = _a.totalItems, itemsPerPage = _a.itemsPerPage, page = _a.page, nextPage = _a.nextPage, prevPage = _a.prevPage, props = (0, 
            tslib_es6.__rest)(_a, [ "totalItems", "itemsPerPage", "page", "nextPage", "prevPage" ]);
            var lowerBound = page * itemsPerPage;
            var upperBound = Math.min((page + 1) * itemsPerPage, totalItems);
            return react.createElement(Flex, (0, tslib_es6.__assign)({
                justifyContent: "flex-end",
                alignItems: "center"
            }, props), react.createElement(Txt, {
                mr: 2
            }, react.createElement("strong", null, lowerBound + 1, " - ", upperBound), " ", "of ", react.createElement("strong", null, totalItems)), react.createElement(Flex, null, react.createElement(ButtonGroup, null, react.createElement(Button_Button, {
                quartenary: true,
                outline: true,
                className: "rendition-pager__btn--prev",
                disabled: totalItems <= itemsPerPage || page <= 0,
                onClick: function() {
                    return prevPage();
                },
                icon: react.createElement(FontAwesomeIcon, {
                    icon: faChevronLeft.A3
                })
            }), react.createElement(Button_Button, {
                quartenary: true,
                outline: true,
                className: "rendition-pager__btn--next",
                disabled: totalItems <= itemsPerPage || totalItems / itemsPerPage <= page + 1,
                onClick: function() {
                    return nextPage();
                },
                icon: react.createElement(FontAwesomeIcon, {
                    icon: faChevronRight._t
                })
            }))));
        };
        var Pager = BasePager;
        var renderField = function(row, column) {
            var value = get_default()(row, column.field);
            if (column.render) {
                return column.render(value, row);
            }
            return value == null ? "" : value;
        };
        var TableRow_CheckboxWrapper = styled_components_browser_esm.default.div(TableRow_templateObject_1 || (TableRow_templateObject_1 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\tdisplay: inline-block;\n\tvertical-align: middle;\n" ], [ "\n\tdisplay: inline-block;\n\tvertical-align: middle;\n" ])));
        var TableRow = function(_super) {
            (0, tslib_es6.__extends)(TableRow, _super);
            function TableRow() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            TableRow.prototype.render = function() {
                var _this = this;
                var _a = this.props, attributes = _a.attributes, checkboxAttributes = _a.checkboxAttributes, columns = _a.columns, className = _a.className, data = _a.data, href = _a.href, keyAttribute = _a.keyAttribute, isChecked = _a.isChecked, isHighlighted = _a.isHighlighted, isDisabled = _a.isDisabled, showCheck = _a.showCheck;
                return react.createElement("div", {
                    "data-display": "table-row",
                    "data-highlight": isChecked || isHighlighted,
                    className
                }, showCheck && react.createElement(TableRow_CheckboxWrapper, {
                    "data-display": "table-cell"
                }, react.createElement(Checkbox, (0, tslib_es6.__assign)({
                    checked: isChecked,
                    disabled: isDisabled,
                    "data-key": keyAttribute,
                    onChange: this.props.toggleChecked
                }, checkboxAttributes))), map_default()(columns, (function(column) {
                    var cellAttributes = typeof column.cellAttributes === "function" ? column.cellAttributes(data, get_default()(data, column.field)) : column.cellAttributes || {};
                    return react.createElement("a", (0, tslib_es6.__assign)({}, attributes, {
                        href,
                        "data-display": "table-cell",
                        "data-key": keyAttribute,
                        onClick: _this.props.onRowClick
                    }, cellAttributes, {
                        key: column.key || column.field
                    }), renderField(data, column));
                })));
            };
            return TableRow;
        }(react.PureComponent);
        var TableRow_templateObject_1;
        var highlightStyle = "\n\tbackground-color: " + dist_esm5_theme.colors.info.light + ";\n";
        var BaseTableWrapper = styled_components_browser_esm.default.div(Table_templateObject_1 || (Table_templateObject_1 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\toverflow-x: auto;\n\tmax-width: 100%;\n" ], [ "\n\toverflow-x: auto;\n\tmax-width: 100%;\n" ])));
        var Table_Base = styled_components_browser_esm.default.div(Table_templateObject_2 || (Table_templateObject_2 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\tdisplay: table;\n\twidth: 100%;\n\tborder-spacing: 0;\n\tborder-bottom: 1px solid ", ";\n\n\t> [data-display='table-head'] {\n\t\tdisplay: table-header-group;\n\t\tbackground-color: ", ";\n\n\t\t> [data-display='table-row'] {\n\t\t\tdisplay: table-row;\n\n\t\t\t> [data-display='table-cell'] {\n\t\t\t\tdisplay: table-cell;\n\t\t\t\tborder-bottom: 1px solid\n\t\t\t\t\t", ";\n\t\t\t\ttext-align: left;\n\t\t\t\tvertical-align: middle;\n\t\t\t\tpadding: 10px 20px;\n\t\t\t\tfont-size: ", ";\n\t\t\t}\n\n\t\t\t> [data-display='table-cell']:first-child {\n\t\t\t\tpadding-left: ", ";\n\t\t\t\t", ";\n\t\t\t}\n\n\t\t\t> [data-display='table-cell']:last-child {\n\t\t\t\tpadding-right: 40px;\n\t\t\t}\n\t\t}\n\t}\n\n\t> [data-display='table-body'] {\n\t\tdisplay: table-row-group;\n\n\t\t> [data-display='table-row'] {\n\t\t\tdisplay: table-row;\n\t\t\ttext-decoration: none;\n\t\t\tcolor: ", ";\n\t\t\tfont-size: ", ";\n\n\t\t\t> [data-display='table-cell'] {\n\t\t\t\tdisplay: table-cell;\n\t\t\t\ttext-align: left;\n\t\t\t\tvertical-align: middle;\n\t\t\t\tpadding: 14px 20px;\n\t\t\t\ttext-decoration: none;\n\t\t\t\tcolor: inherit;\n\t\t\t}\n\n\t\t\t> [data-display='table-cell']:first-child {\n\t\t\t\tpadding-left: ", ";\n\t\t\t\t", ";\n\t\t\t}\n\n\t\t\t> [data-display='table-cell']:last-child {\n\t\t\t\tpadding-right: 40px;\n\t\t\t}\n\n\t\t\t> a[data-display='table-cell'] {\n\t\t\t\tcursor: ", ";\n\t\t\t}\n\n\t\t\t&:nth-of-type(even) {\n\t\t\t\tbackground-color: ", ";\n\t\t\t}\n\n\t\t\t&:hover {\n\t\t\t\ttext-decoration: none;\n\t\t\t\t", ";\n\t\t\t}\n\n\t\t\t&[data-highlight='true'] {\n\t\t\t\t", ' > [data-display="table-cell"]:first-child {\n\t\t\t\t\tbox-shadow: inset 3px 0px 0 ', ";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n" ], [ "\n\tdisplay: table;\n\twidth: 100%;\n\tborder-spacing: 0;\n\tborder-bottom: 1px solid ", ";\n\n\t> [data-display='table-head'] {\n\t\tdisplay: table-header-group;\n\t\tbackground-color: ", ";\n\n\t\t> [data-display='table-row'] {\n\t\t\tdisplay: table-row;\n\n\t\t\t> [data-display='table-cell'] {\n\t\t\t\tdisplay: table-cell;\n\t\t\t\tborder-bottom: 1px solid\n\t\t\t\t\t", ";\n\t\t\t\ttext-align: left;\n\t\t\t\tvertical-align: middle;\n\t\t\t\tpadding: 10px 20px;\n\t\t\t\tfont-size: ", ";\n\t\t\t}\n\n\t\t\t> [data-display='table-cell']:first-child {\n\t\t\t\tpadding-left: ", ";\n\t\t\t\t", ";\n\t\t\t}\n\n\t\t\t> [data-display='table-cell']:last-child {\n\t\t\t\tpadding-right: 40px;\n\t\t\t}\n\t\t}\n\t}\n\n\t> [data-display='table-body'] {\n\t\tdisplay: table-row-group;\n\n\t\t> [data-display='table-row'] {\n\t\t\tdisplay: table-row;\n\t\t\ttext-decoration: none;\n\t\t\tcolor: ", ";\n\t\t\tfont-size: ", ";\n\n\t\t\t> [data-display='table-cell'] {\n\t\t\t\tdisplay: table-cell;\n\t\t\t\ttext-align: left;\n\t\t\t\tvertical-align: middle;\n\t\t\t\tpadding: 14px 20px;\n\t\t\t\ttext-decoration: none;\n\t\t\t\tcolor: inherit;\n\t\t\t}\n\n\t\t\t> [data-display='table-cell']:first-child {\n\t\t\t\tpadding-left: ", ";\n\t\t\t\t", ";\n\t\t\t}\n\n\t\t\t> [data-display='table-cell']:last-child {\n\t\t\t\tpadding-right: 40px;\n\t\t\t}\n\n\t\t\t> a[data-display='table-cell'] {\n\t\t\t\tcursor: ", ";\n\t\t\t}\n\n\t\t\t&:nth-of-type(even) {\n\t\t\t\tbackground-color: ", ";\n\t\t\t}\n\n\t\t\t&:hover {\n\t\t\t\ttext-decoration: none;\n\t\t\t\t", ";\n\t\t\t}\n\n\t\t\t&[data-highlight='true'] {\n\t\t\t\t", ' > [data-display="table-cell"]:first-child {\n\t\t\t\t\tbox-shadow: inset 3px 0px 0 ', ";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n" ])), (function(props) {
            return props.theme.colors.quartenary.main;
        }), (function(props) {
            return props.theme.colors.quartenary.light;
        }), (function(props) {
            return props.theme.colors.quartenary.main;
        }), (function(props) {
            return styledUtils_px(props.theme.fontSizes[2]);
        }), (function(props) {
            return props.hasCheckbox ? "20px" : "40px";
        }), (function(props) {
            return props.hasCheckbox ? "width: 60px" : "";
        }), (function(props) {
            return props.theme.colors.secondary.main;
        }), (function(props) {
            return styledUtils_px(props.theme.fontSizes[2]);
        }), (function(props) {
            return props.hasCheckbox ? "20px" : "40px";
        }), (function(props) {
            return props.hasCheckbox ? "width: 60px" : "";
        }), (function(props) {
            return props.hasRowClick || props.hasGetRowRef ? "pointer" : "auto";
        }), (function(props) {
            return props.theme.colors.quartenary.light;
        }), (function(props) {
            return props.hasRowClick || props.hasGetRowRef || props.hasCheckbox ? highlightStyle : "";
        }), highlightStyle, (function(props) {
            return props.theme.colors.info.main;
        }));
        var HeaderButton = (0, styled_components_browser_esm.default)(Button_Button)(Table_templateObject_3 || (Table_templateObject_3 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\tdisplay: block;\n" ], [ "\n\tdisplay: block;\n" ])));
        var Table = function(_super) {
            (0, tslib_es6.__extends)(Table, _super);
            function Table(props) {
                var _this = _super.call(this, props) || this;
                _this.getSelectedRows = function(selectedRows) {
                    var _a = _this.props, rowKey = _a.rowKey, data = _a.data;
                    if (!rowKey || (selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.length) === 0) {
                        return {
                            checkedItems: [],
                            allChecked: false
                        };
                    }
                    var selectedRowsIds = map_default()(selectedRows, rowKey);
                    var checkedItems = [];
                    var allChecked = false;
                    if (data) {
                        checkedItems = filter_default()(_this.props.data, (function(x) {
                            return includes_default()(selectedRowsIds, x[rowKey]);
                        }));
                        allChecked = data.length > 0 && checkedItems.length === data.length;
                    }
                    return {
                        checkedItems,
                        allChecked
                    };
                };
                _this.setRowSelection = function(selectedRows) {
                    _this.setState(_this.getSelectedRows(selectedRows));
                };
                _this.toggleAllChecked = function() {
                    var data = _this.props.data;
                    var allChecked = !_this.state.allChecked;
                    var checkedItems = allChecked ? (data || []).slice().filter((function(r) {
                        return !_this.isDisabled(r);
                    })) : [];
                    if (_this.props.onCheck) {
                        _this.props.onCheck(checkedItems);
                    }
                    _this.setState({
                        allChecked,
                        checkedItems
                    });
                };
                _this.toggleChecked = function(e) {
                    var _a;
                    var rowKey = _this.props.rowKey;
                    var key = e.currentTarget.dataset.key;
                    if (!rowKey || !key) {
                        return false;
                    }
                    var item = _this.getElementFromKey(key);
                    if (!item) {
                        return;
                    }
                    var identifier = item[rowKey];
                    var isChecked = !_this.isChecked(item);
                    var checkedItems = isChecked ? _this.state.checkedItems.concat(item) : reject_default()(_this.state.checkedItems, (_a = {}, 
                    _a[rowKey] = identifier, _a));
                    if (_this.props.onCheck) {
                        _this.props.onCheck(checkedItems);
                    }
                    _this.setState({
                        allChecked: _this.isEachRowChecked(checkedItems),
                        checkedItems
                    });
                };
                _this.toggleSort = function(e) {
                    var field = e.currentTarget.dataset.field;
                    var sort = _this.state.sort;
                    if (!field) {
                        return;
                    }
                    var nextSort = {
                        field,
                        reverse: false
                    };
                    if (sort.field === field) {
                        nextSort = {
                            field: sort.field,
                            reverse: !sort.reverse
                        };
                    }
                    _this.setState({
                        sort: nextSort
                    });
                    if (_this.props.onSort) {
                        _this.props.onSort(nextSort);
                    }
                };
                _this.onRowClick = function(e) {
                    if (!_this.props.onRowClick) {
                        return;
                    }
                    if (!_this.props.rowKey) {
                        return console.warn("onRowClick requires that you provide a `rowKey` property");
                    }
                    var key = e.currentTarget.dataset.key;
                    if (!key) {
                        return console.warn("onRowClick called on an element without a key set");
                    }
                    var row = _this.getElementFromKey(key);
                    if (row) {
                        _this.props.onRowClick(row, e);
                    }
                };
                _this.setPage = function(change) {
                    if (_this.props.onPageChange) {
                        _this.props.onPageChange(change);
                    }
                    _this.setState({
                        page: change
                    });
                };
                _this.resetPager = function() {
                    _this.setPage(0);
                };
                _this.incrementPage = function() {
                    _this.setPage(_this.state.page + 1);
                };
                _this.decrementPage = function() {
                    _this.setPage(_this.state.page - 1);
                };
                if (props.onCheck && !props.rowKey) {
                    throw new Error("A `rowKey` property must be provided if using `onCheck` with a Table component");
                }
                var sortState = props.sort || {
                    reverse: false,
                    field: null
                };
                _this.state = (0, tslib_es6.__assign)({
                    sort: sortState,
                    page: 0
                }, _this.getSelectedRows(props.checkedItems));
                return _this;
            }
            Table.prototype.componentDidUpdate = function(prevProps) {
                var _a, _b, _c;
                if (this.props.sort && !isEqual_default()(prevProps.sort, this.props.sort)) {
                    this.setState({
                        sort: this.props.sort
                    });
                }
                if (this.props.checkedItems && prevProps.checkedItems !== this.props.checkedItems) {
                    this.setRowSelection(this.props.checkedItems);
                }
                var totalItems = (_b = (_a = this.props.data) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
                var itemsPerPage = (_c = this.props.itemsPerPage) !== null && _c !== void 0 ? _c : 50;
                if (this.state.page !== 0 && totalItems <= this.state.page * itemsPerPage) {
                    this.resetPager();
                }
            };
            Table.prototype.isChecked = function(item) {
                var _a;
                var rowKey = this.props.rowKey;
                if (!rowKey) {
                    return false;
                }
                var identifier = item[rowKey];
                return some_default()(this.state.checkedItems, (_a = {}, _a[rowKey] = identifier, 
                _a));
            };
            Table.prototype.isHighlighted = function(item) {
                if (!this.props.highlightedRows || this.props.highlightedRows.length === 0) {
                    return false;
                }
                var rowKey = this.props.rowKey;
                if (!rowKey) {
                    return false;
                }
                var identifier = item[rowKey];
                return includes_default()(this.props.highlightedRows, identifier);
            };
            Table.prototype.isDisabled = function(item) {
                if (!this.props.disabledRows || this.props.disabledRows.length === 0) {
                    return false;
                }
                var rowKey = this.props.rowKey;
                if (!rowKey) {
                    return false;
                }
                var identifier = item[rowKey];
                return includes_default()(this.props.disabledRows, identifier);
            };
            Table.prototype.isEachRowChecked = function(checkedItems) {
                var rowKey = this.props.rowKey;
                if (!rowKey) {
                    return false;
                }
                var selectedKeys = map_default()(checkedItems, rowKey);
                return every_default()(this.props.data, (function(x) {
                    return includes_default()(selectedKeys, x[rowKey]);
                }));
            };
            Table.prototype.sortData = function(data) {
                var sort = this.state.sort;
                if (!sort || sort.field === null) {
                    return data;
                }
                var column = find_default()(this.props.columns, {
                    field: sort.field
                });
                if (!column) {
                    return data;
                }
                var collection;
                var columnAny = column || {};
                if ("sortable" in columnAny && typeof columnAny.sortable === "function") {
                    collection = data.slice().sort(columnAny.sortable);
                } else {
                    collection = sortBy_default()(data.slice(), (function(item) {
                        var sortableValue = item[sort.field];
                        return isPlainObject_default()(sortableValue) ? sortableValue.value : sortableValue;
                    }));
                }
                if (sort.reverse) {
                    reverse_default()(collection);
                }
                return collection;
            };
            Table.prototype.getElementFromKey = function(key) {
                var _a = this.props, data = _a.data, rowKey = _a.rowKey;
                if (!data) {
                    return;
                }
                if (rowKey) {
                    return find_default()(data, (function(element) {
                        return "" + element[rowKey] === key;
                    }));
                }
                return data[Number(key)];
            };
            Table.prototype.render = function() {
                var _this = this;
                var _a = this.props, columns = _a.columns, data = _a.data, usePager = _a.usePager, itemsPerPage = _a.itemsPerPage, pagerPosition = _a.pagerPosition, rowAnchorAttributes = _a.rowAnchorAttributes, rowKey = _a.rowKey, onCheck = _a.onCheck, onRowClick = _a.onRowClick, getRowHref = _a.getRowHref, getRowClass = _a.getRowClass, props = (0, 
                tslib_es6.__rest)(_a, [ "columns", "data", "usePager", "itemsPerPage", "pagerPosition", "rowAnchorAttributes", "rowKey", "onCheck", "onRowClick", "getRowHref", "getRowClass" ]);
                var _b = this.state, page = _b.page, sort = _b.sort;
                var items = data || [];
                var totalItems = items.length;
                var _itemsPerPage = itemsPerPage || 50;
                var _pagerPosition = pagerPosition || "top";
                var lowerBound = usePager ? page * _itemsPerPage : 0;
                var upperBound = usePager ? Math.min((page + 1) * _itemsPerPage, totalItems) : totalItems;
                var sortedData = this.sortData(items).slice(lowerBound, upperBound);
                var shouldShowPaper = !!usePager && totalItems > 0;
                return react.createElement(react.Fragment, null, shouldShowPaper && (_pagerPosition === "top" || _pagerPosition === "both") && react.createElement(Pager, {
                    totalItems,
                    itemsPerPage: _itemsPerPage,
                    page,
                    nextPage: this.incrementPage,
                    prevPage: this.decrementPage,
                    mb: 2
                }), react.createElement(BaseTableWrapper, null, react.createElement(Table_Base, (0, 
                tslib_es6.__assign)({}, props, {
                    hasRowClick: !!onRowClick,
                    hasGetRowRef: !!getRowHref,
                    hasCheckbox: !!onCheck
                }), react.createElement("div", {
                    "data-display": "table-head"
                }, react.createElement("div", {
                    "data-display": "table-row"
                }, onCheck && react.createElement(TableRow_CheckboxWrapper, {
                    "data-display": "table-cell"
                }, react.createElement(Checkbox, {
                    checked: this.state.allChecked,
                    onChange: this.toggleAllChecked
                })), map_default()(columns, (function(item) {
                    if (item.sortable) {
                        return react.createElement("div", {
                            "data-display": "table-cell",
                            key: item.key || item.field
                        }, react.createElement(HeaderButton, {
                            "data-field": item.field,
                            plain: true,
                            primary: sort.field === item.field,
                            onClick: _this.toggleSort
                        }, item.label || item.field, " ", react.createElement(FontAwesomeIcon, {
                            icon: faSort.Cm,
                            color: sort.field === item.field ? dist_esm5_theme.colors.info.main : ""
                        })));
                    }
                    return react.createElement("div", {
                        "data-display": "table-cell",
                        key: item.key || item.field
                    }, item.label || item.field);
                })))), react.createElement("div", {
                    "data-display": "table-body"
                }, this.props.tbodyPrefix, map_default()(sortedData, (function(row, i) {
                    var isChecked = onCheck ? _this.isChecked(row) : false;
                    var isHighlighted = _this.isHighlighted(row);
                    var isDisabled = _this.isDisabled(row);
                    var key = rowKey ? row[rowKey] : i;
                    var href = !!getRowHref ? getRowHref(row) : undefined;
                    var classNamesList = typeof getRowClass === "function" ? getRowClass(row) : [];
                    var className = Array.isArray(classNamesList) ? classNamesList.join(" ") : "";
                    return react.createElement(TableRow, {
                        isChecked,
                        isHighlighted,
                        isDisabled,
                        key,
                        keyAttribute: key,
                        href,
                        data: row,
                        showCheck: !!onCheck,
                        columns,
                        attributes: rowAnchorAttributes,
                        checkboxAttributes: _this.props.rowCheckboxAttributes,
                        toggleChecked: _this.toggleChecked,
                        onRowClick: _this.onRowClick,
                        className
                    });
                }))))), shouldShowPaper && (_pagerPosition === "bottom" || _pagerPosition === "both") && react.createElement(Pager, {
                    totalItems,
                    itemsPerPage: _itemsPerPage,
                    page,
                    nextPage: this.incrementPage,
                    prevPage: this.decrementPage,
                    mt: 2
                }));
            };
            return Table;
        }(react.Component);
        var Table_templateObject_1, Table_templateObject_2, Table_templateObject_3;
        const app_theme_colors = {
            dark: {
                foreground: "#fff",
                background: "#4d5057",
                soft: {
                    foreground: "#ddd",
                    background: "#64686a"
                },
                disabled: {
                    foreground: "#787c7f",
                    background: "#3a3c41"
                }
            },
            light: {
                foreground: "#666",
                background: "#fff",
                soft: {
                    foreground: "#b3b3b3"
                },
                disabled: {
                    foreground: "#787c7f",
                    background: "#d5d5d5"
                }
            },
            default: {
                foreground: "#b3b3b3",
                background: "#ececec"
            },
            primary: {
                foreground: "#fff",
                background: "#00aeef"
            },
            secondary: {
                foreground: "#000",
                background: "#ddd",
                main: "#fff"
            },
            warning: {
                foreground: "#fff",
                background: "#fca321"
            },
            danger: {
                foreground: "#fff",
                background: "#d9534f"
            },
            success: {
                foreground: "#fff",
                background: "#5fb835"
            }
        };
        const theme_font = "SourceSansPro";
        const theme_theme = lodash.merge({}, dist_esm5_theme, {
            colors: app_theme_colors,
            font: theme_font,
            header: {
                height: "40px"
            },
            global: {
                font: {
                    family: theme_font,
                    size: 16
                },
                text: {
                    medium: {
                        size: 16
                    }
                }
            },
            button: {
                border: {
                    width: "0",
                    radius: "24px"
                },
                disabled: {
                    opacity: 1
                },
                extend: () => `\n\t\t\twidth: 200px;\n\t\t\tfont-size: 16px;\n\n\t\t\t&& {\n\t\t\t\twidth: 200px;\n\t\t\t\theight: 48px;\n\t\t\t}\n\n\t\t\t:disabled {\n\t\t\t\tbackground-color: ${app_theme_colors.dark.disabled.background};\n\t\t\t\tcolor: ${app_theme_colors.dark.disabled.foreground};\n\t\t\t\topacity: 1;\n\n\t\t\t\t:hover {\n\t\t\t\t\tbackground-color: ${app_theme_colors.dark.disabled.background};\n\t\t\t\t\tcolor: ${app_theme_colors.dark.disabled.foreground};\n\t\t\t\t}\n\t\t\t}\n\t\t`
            },
            layer: {
                extend: () => `\n\t\t\t> div:first-child {\n\t\t\t\tbackground-color: transparent;\n\t\t\t}\n\t\t`
            }
        });
        const ThemedProvider = props => react.createElement(Provider, Object.assign({
            theme: theme_theme
        }, props));
        const styled_components_BaseButton = (0, styled_components_browser_esm.default)(Button_Button)`
	width: 200px;
	height: 48px;
	font-size: 16px;
`;
        const IconButton = (0, styled_components_browser_esm.default)((props => react.createElement(Button_Button, Object.assign({
            plain: true
        }, props))))`
	&&& {
		width: 24px;
		height: 24px;
		font-size: 24px;
		color: #fff;

		> svg {
			font-size: 1em;
		}
	}
`;
        const StepButton = (0, styled_components_browser_esm.default)((props => react.createElement(styled_components_BaseButton, Object.assign({}, props))))`
	color: #ffffff;
	font-size: 14px;
`;
        const ChangeButton = (0, styled_components_browser_esm.default)(Button_Button)`
	&& {
		border-radius: 24px;
		color: ${app_theme_colors.primary.background};
		padding: 0;
		height: 18px;
		font-size: 14px;

		&:enabled {
			&:hover,
			&:focus,
			&:active {
				color: #8f9297;
			}
		}
	}
`;
        const StepNameButton = (0, styled_components_browser_esm.default)(styled_components_BaseButton)`
	display: inline-flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	font-weight: normal;
	color: ${app_theme_colors.dark.foreground};

	&:enabled {
		&:hover,
		&:focus,
		&:active {
			color: #8f9297;
		}
	}
`;
        const Footer = (0, styled_components_browser_esm.default)(Txt)`
	margin-top: 10px;
	color: ${app_theme_colors.dark.disabled.foreground};
	font-size: 10px;
`;
        const DetailsText = props => react.createElement(Flex, Object.assign({
            alignItems: "center",
            color: app_theme_colors.dark.disabled.foreground
        }, props));
        const modalFooterShadowCss = styled_components_browser_esm.css`
	overflow: auto;
	background: 0, linear-gradient(rgba(255, 255, 255, 0), white 70%) 0 100%, 0,
		linear-gradient(rgba(255, 255, 255, 0), rgba(221, 225, 240, 0.5) 70%) 0 100%;
	background-repeat: no-repeat;
	background-size: 100% 40px, 100% 40px, 100% 8px, 100% 8px;

	background-repeat: no-repeat;
	background-color: white;
	background-size: 100% 40px, 100% 40px, 100% 8px, 100% 8px;
	background-attachment: local, local, scroll, scroll;
`;
        const styled_components_Modal = (0, styled_components_browser_esm.default)((({style, children, ...props}) => react.createElement(Modal, Object.assign({
            position: "top",
            width: "97vw",
            cancelButtonProps: {
                style: {
                    marginRight: "20px",
                    border: "solid 1px #2a506f"
                }
            },
            style: {
                height: "87.5vh",
                ...style
            }
        }, props), react.createElement(ScrollableFlex, {
            flexDirection: "column",
            width: "100%",
            height: "90%"
        }, children))))`
	> div {
		padding: 0;
		height: 99%;

		> div:first-child {
			height: 81%;
			padding: 24px 30px 0;
		}

		> h3 {
			margin: 0;
			padding: 24px 30px 0;
			height: 14.3%;
		}

		> div:first-child {
			height: 81%;
			padding: 24px 30px 0;
		}

		> div:nth-child(2) {
			height: 61%;
			padding: 0 30px;
			${modalFooterShadowCss}
		}

		> div:last-child {
			margin: 0;
			flex-direction: ${props => props.reverseFooterButtons ? "row-reverse" : "row"};
			border-radius: 0 0 7px 7px;
			height: 80px;
			background-color: #fff;
			justify-content: center;
			width: 100%;
		}

		::-webkit-scrollbar {
			display: none;
		}
	}
`;
        const ScrollableFlex = (0, styled_components_browser_esm.default)(Flex)`
	overflow: auto;

	::-webkit-scrollbar {
		display: none;
	}

	> div > div {
		/* This is required for the sticky table header in TargetsTable */
		overflow-x: visible;
	}
`;
        const styled_components_Alert = (0, styled_components_browser_esm.default)((props => react.createElement(Alert, Object.assign({
            warning: true,
            emphasized: true
        }, props))))`
	position: fixed;
	top: -40px;
	left: 50%;
	transform: translate(-50%, 0px);
	height: 30px;
	min-width: 50%;
	padding: 0px;
	justify-content: center;
	align-items: center;
	font-size: 14px;
	background-color: #fca321;
	text-align: center;

	* {
		color: #ffffff;
	}

	> div:first-child {
		display: none;
	}
`;
        const GenericTable = ({refFn, ...props}) => react.createElement("div", null, react.createElement(Table, Object.assign({
            ref: refFn
        }, props)));
        function StyledTable() {
            return (0, styled_components_browser_esm.default)((props => react.createElement(GenericTable, Object.assign({}, props))))`
		[data-display='table-head']
			> [data-display='table-row']
			> [data-display='table-cell'] {
			position: sticky;
			background-color: #f8f9fd;
			top: 0;
			z-index: 1;

			input[type='checkbox'] + div {
				display: ${props => props.multipleSelection ? "flex" : "none"};

				${props => props.multipleSelection && props.checkedRowsNumber !== 0 && props.checkedRowsNumber !== props.data.length ? `\n\t\t\t\t\t\tfont-weight: 600;\n\t\t\t\t\t\tcolor: ${app_theme_colors.primary.foreground};\n\t\t\t\t\t\tbackground: ${app_theme_colors.primary.background};\n\n\t\t\t\t\t\t::after {\n\t\t\t\t\t\t\tcontent: '–';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t` : ""}
				}
			}
		}

		[data-display='table-head'] > [data-display='table-row'],
		[data-display='table-body'] > [data-display='table-row'] {
			> [data-display='table-cell']:first-child {
				padding-left: 15px;
				width: 6%;
			}

			> [data-display='table-cell']:last-child {
				padding-right: 0;
			}
		}

		[data-display='table-body'] > [data-display='table-row'] {
			&:nth-of-type(2n) {
				background: transparent;
			}

			&[data-highlight='true'] {
				&.system {
					background-color: ${props => props.showWarnings ? "#fff5e6" : "#e8f5fc"};
				}

				> [data-display='table-cell']:first-child {
					box-shadow: none;
				}
			}
		}

		&& [data-display='table-row'] > [data-display='table-cell'] {
			padding: 6px 8px;
			color: #2a506f;
		}

		input[type='checkbox'] + div {
			border-radius: ${props => props.multipleSelection ? "4px" : "50%"};
		}
	`;
        }
        const styled_components_Table = props => {
            const TypedStyledFunctional = StyledTable();
            return react.createElement(TypedStyledFunctional, Object.assign({}, props));
        };
        const FlashAnother = props => react.createElement(styled_components_BaseButton, {
            primary: true,
            onClick: props.onClick
        }, "Flash another");
        function circle_extends() {
            circle_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return circle_extends.apply(this, arguments);
        }
        var circle_ref = react.createElement("path", {
            d: "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"
        });
        function SvgCircle(props) {
            return react.createElement("svg", circle_extends({
                xmlns: "http://www.w3.org/2000/svg",
                viewBox: "0 0 512 512"
            }, props), circle_ref);
        }
        const circle = SvgCircle;
        function check_circle_extends() {
            check_circle_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return check_circle_extends.apply(this, arguments);
        }
        var check_circle_ref = react.createElement("path", {
            d: "M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"
        });
        function SvgCheckCircle(props) {
            return react.createElement("svg", check_circle_extends({
                xmlns: "http://www.w3.org/2000/svg",
                viewBox: "0 0 512 512"
            }, props), check_circle_ref);
        }
        const check_circle = SvgCheckCircle;
        function times_circle_extends() {
            times_circle_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return times_circle_extends.apply(this, arguments);
        }
        var times_circle_ref = react.createElement("path", {
            d: "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z"
        });
        function SvgTimesCircle(props) {
            return react.createElement("svg", times_circle_extends({
                xmlns: "http://www.w3.org/2000/svg",
                viewBox: "0 0 512 512"
            }, props), times_circle_ref);
        }
        const times_circle = SvgTimesCircle;
        var Link_Base = styled_components_browser_esm.default.a(Link_templateObject_1 || (Link_templateObject_1 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\t", "\n\t", ";\n\t", "\n\t", "\n\n  text-decoration: ", ";\n\tcursor: ", ";\n\topacity: ", ";\n\tdisplay: inline-block;\n\n\t&:active,\n\t&:hover {\n\t\tcolor: ", ";\n\t}\n" ], [ "\n\t", "\n\t", ";\n\t", "\n\t", "\n\n  text-decoration: ", ";\n\tcursor: ", ";\n\topacity: ", ";\n\tdisplay: inline-block;\n\n\t&:active,\n\t&:hover {\n\t\tcolor: ", ";\n\t}\n" ])), align, styledUtils_monospace, caps, Txt_bold, (function(props) {
            return props.decor || "none";
        }), (function(props) {
            return props.disabled ? "not-allowed" : "pointer";
        }), (function(props) {
            return props.disabled ? .65 : 1;
        }), (function(props) {
            return !props.disabled && colorUtils_darken(get_default()(props.theme.colors, props.color) || props.color);
        }));
        var BaseLink = function(_a) {
            var is = _a.is, blank = _a.blank, children = _a.children, props = (0, tslib_es6.__rest)(_a, [ "is", "blank", "children" ]);
            if (props.disabled) {
                props = omit_default()(props, "href");
            }
            return react.createElement(Link_Base, (0, tslib_es6.__assign)({}, props, {
                as: is,
                rel: blank ? "noopener" : undefined,
                target: blank ? "_blank" : undefined
            }), children || props.href);
        };
        var Link_setDefaultProps = withProps((function(props) {
            return Object.assign({
                color: "primary.main"
            }, props);
        }));
        var Link = asRendition(BaseLink, [ Link_setDefaultProps ], [ "color" ]);
        var Link_templateObject_1;
        function flash_extends() {
            flash_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return flash_extends.apply(this, arguments);
        }
        var flash_ref = react.createElement("path", {
            d: "M16.005 10.697L21.129 0H8.775L0 18.32h11.649L8.11 40l18.804-29.367-10.91.064z",
            fill: "#FFF",
            fillRule: "evenodd"
        });
        function SvgFlash(props) {
            return react.createElement("svg", flash_extends({
                width: 27,
                height: 40,
                xmlns: "http://www.w3.org/2000/svg"
            }, props), flash_ref);
        }
        const flash = SvgFlash;
        function middleEllipsis(input, limit) {
            if (limit < 3) {
                throw new Error("middleEllipsis: Limit should be at least 3");
            }
            if (input.length <= limit) {
                return input;
            }
            const lengthOfTheSidesAfterTruncation = Math.floor((limit - 1) / 2);
            const finalLeftPart = input.slice(0, lengthOfTheSidesAfterTruncation);
            const finalRightPart = input.slice(input.length - lengthOfTheSidesAfterTruncation);
            return finalLeftPart + "…" + finalRightPart;
        }
        const ErrorsTable = (0, styled_components_browser_esm.default)((props => react.createElement(styled_components_Table, Object.assign({}, props))))`
	&&& [data-display='table-head'],
	&&& [data-display='table-body'] {
		> [data-display='table-row'] {
			> [data-display='table-cell'] {
				&:first-child {
					width: 30%;
				}

				&:nth-child(2) {
					width: 20%;
				}

				&:last-child {
					width: 50%;
				}
			}
		}
	}
`;
        const DoneIcon = props => {
            const svgProps = {
                width: "28px",
                fill: props.color,
                style: {
                    marginTop: "-25px",
                    marginLeft: "13px",
                    zIndex: 1
                }
            };
            return props.allFailed && !props.skipped ? react.createElement(times_circle, Object.assign({}, svgProps)) : react.createElement(check_circle, Object.assign({}, svgProps));
        };
        function formattedErrors(errors) {
            return errors.map((error => `${error.device}: ${error.message || error.code}`)).join("\n");
        }
        const columns = [ {
            field: "description",
            label: "Target"
        }, {
            field: "device",
            label: "Location"
        }, {
            field: "message",
            label: "Error",
            render: (message, {code}) => message !== null && message !== void 0 ? message : code
        } ];
        function getEffectiveSpeed(results) {
            var _a;
            const flashedSize = (_a = results.sourceMetadata.blockmappedSize) !== null && _a !== void 0 ? _a : results.sourceMetadata.size;
            const timeSpent = flashedSize / results.averageFlashingSpeed;
            return results.sourceMetadata.size / timeSpent;
        }
        function FlashResults({goToMain, image = "", errors, results, skip, ...props}) {
            const [showErrorsInfo, setShowErrorsInfo] = react.useState(false);
            const allFailed = !skip && results.devices.successful === 0;
            const someFailed = results.devices.failed !== 0 || errors.length !== 0;
            const effectiveSpeed = bytesToMegabytes(getEffectiveSpeed(results)).toFixed(1);
            return react.createElement(Flex, Object.assign({
                flexDirection: "column"
            }, props), react.createElement(Flex, {
                alignItems: "center",
                flexDirection: "column"
            }, react.createElement(Flex, {
                alignItems: "center",
                mt: "50px",
                mb: "32px",
                color: "#7e8085",
                flexDirection: "column"
            }, react.createElement(flash, {
                width: "40px",
                height: "40px",
                className: "disabled"
            }), react.createElement(DoneIcon, {
                skipped: skip,
                allFailed,
                color: allFailed || someFailed ? "#c6c8c9" : "#1ac135"
            }), react.createElement(Txt, null, middleEllipsis(image, 24))), react.createElement(Txt, {
                fontSize: 24,
                color: "#fff",
                mb: "17px"
            }, "Flash ", allFailed ? "Failed" : "Complete", "!"), skip ? react.createElement(Txt, {
                color: "#7e8085"
            }, "Validation has been skipped") : null), react.createElement(Flex, {
                flexDirection: "column",
                color: "#7e8085"
            }, results.devices.successful !== 0 ? react.createElement(Flex, {
                alignItems: "center"
            }, react.createElement(circle, {
                width: "14px",
                fill: "#1ac135"
            }), react.createElement(Txt, {
                ml: "10px",
                color: "#fff"
            }, results.devices.successful), react.createElement(Txt, {
                ml: "10px"
            }, progress.successful(results.devices.successful))) : null, errors.length !== 0 ? react.createElement(Flex, {
                alignItems: "center"
            }, react.createElement(circle, {
                width: "14px",
                fill: "#ff4444"
            }), react.createElement(Txt, {
                ml: "10px",
                color: "#fff"
            }, errors.length), react.createElement(Txt, {
                ml: "10px",
                tooltip: formattedErrors(errors)
            }, progress.failed(errors.length)), react.createElement(Link, {
                ml: "10px",
                onClick: () => setShowErrorsInfo(true)
            }, "more info")) : null, !allFailed && react.createElement(Txt, {
                fontSize: "10px",
                style: {
                    fontWeight: 500,
                    textAlign: "center"
                },
                tooltip: (0, lib_module.default)({
                    newline: " "
                })`
							The speed is calculated by dividing the image size by the flashing time.
							Disk images with ext partitions flash faster as we are able to skip unused parts.
						`
            }, "Effective speed: ", effectiveSpeed, " MB/s")), showErrorsInfo && react.createElement(styled_components_Modal, {
                titleElement: react.createElement(Flex, {
                    alignItems: "baseline",
                    mb: 18
                }, react.createElement(Txt, {
                    fontSize: 24,
                    align: "left"
                }, "Failed targets")),
                action: "Retry failed targets",
                cancel: () => setShowErrorsInfo(false),
                done: () => {
                    setShowErrorsInfo(false);
                    resetState();
                    getDrives().map((drive => {
                        deselectDrive(drive.device);
                        return drive.device;
                    })).filter((driveDevice => errors.some((error => error.device === driveDevice)))).forEach((driveDevice => selectDrive(driveDevice)));
                    goToMain();
                }
            }, react.createElement(ErrorsTable, {
                columns,
                data: errors
            })));
        }
        const ELECTRON_SESSION = "persist:success-banner";
        const ETCHER_VERSION_PARAM = "etcher-version";
        const API_VERSION_PARAM = "api-version";
        const OPT_OUT_ANALYTICS_PARAM = "optOutAnalytics";
        const API_VERSION = "2";
        class SafeWebview extends react.PureComponent {
            constructor(props) {
                super(props);
                this.webviewRef = react.createRef();
                this.state = {
                    shouldShow: true
                };
                const url = new window.URL(this.props.src);
                url.searchParams.set(ETCHER_VERSION_PARAM, external_package_json_.version);
                url.searchParams.set(API_VERSION_PARAM, API_VERSION);
                url.searchParams.set(OPT_OUT_ANALYTICS_PARAM, (!getSync("errorReporting")).toString());
                this.entryHref = url.href;
                this.didFailLoad = lodash.bind(this.didFailLoad, this);
                this.didGetResponseDetails = lodash.bind(this.didGetResponseDetails, this);
                this.session = external_electron_.remote.session.fromPartition(ELECTRON_SESSION, {
                    cache: false
                });
            }
            static logWebViewMessage(event) {
                console.log("Message from SafeWebview:", event.message);
            }
            render() {
                const {style = {
                    flex: this.state.shouldShow ? undefined : "0 1",
                    width: this.state.shouldShow ? undefined : "0",
                    height: this.state.shouldShow ? undefined : "0"
                }} = this.props;
                return react.createElement("webview", {
                    ref: this.webviewRef,
                    partition: ELECTRON_SESSION,
                    style
                });
            }
            componentDidMount() {
                if (this.webviewRef.current !== null) {
                    this.webviewRef.current.addEventListener("did-fail-load", this.didFailLoad);
                    this.webviewRef.current.addEventListener("new-window", SafeWebview.newWindow);
                    this.webviewRef.current.addEventListener("console-message", SafeWebview.logWebViewMessage);
                    this.session.webRequest.onCompleted(this.didGetResponseDetails);
                    this.webviewRef.current.src = this.entryHref;
                }
            }
            componentWillUnmount() {
                if (this.webviewRef.current !== null) {
                    this.webviewRef.current.removeEventListener("did-fail-load", this.didFailLoad);
                    this.webviewRef.current.removeEventListener("new-window", SafeWebview.newWindow);
                    this.webviewRef.current.removeEventListener("console-message", SafeWebview.logWebViewMessage);
                }
                this.session.webRequest.onCompleted(null);
            }
            didFailLoad() {
                this.setState({
                    shouldShow: false
                });
                if (this.props.onWebviewShow) {
                    this.props.onWebviewShow(false);
                }
            }
            didGetResponseDetails(event) {
                if (event.resourceType === "mainFrame") {
                    const HTTP_OK = 200;
                    logEvent("SafeWebview loaded", {
                        event
                    });
                    this.setState({
                        shouldShow: event.statusCode === HTTP_OK
                    });
                    if (this.props.onWebviewShow) {
                        this.props.onWebviewShow(event.statusCode === HTTP_OK);
                    }
                }
            }
            static async newWindow(event) {
                const url = new window.URL(event.url);
                if ((url.protocol === "http:" || url.protocol === "https:") && event.disposition === "foreground-tab" && !await get("disableExternalLinks")) {
                    external_electron_.shell.openExternal(url.href);
                }
            }
        }
        function restart(goToMain) {
            deselectAllDrives();
            logEvent("Restart");
            store.dispatch({
                type: Actions.SET_FLASHING_WORKFLOW_UUID,
                data: esm_browser_v4()
            });
            goToMain();
        }
        async function getSuccessBannerURL() {
            var _a;
            return (_a = await get("successBannerURL")) !== null && _a !== void 0 ? _a : "https://www.balena.io/etcher/success-banner?borderTop=false&darkBackground=true";
        }
        function FinishPage({goToMain}) {
            var _a;
            const [webviewShowing, setWebviewShowing] = react.useState(false);
            const [successBannerURL, setSuccessBannerURL] = react.useState("");
            (async () => {
                setSuccessBannerURL(await getSuccessBannerURL());
            })();
            const flashResults = getFlashResults();
            const errors = (store.getState().toJS().failedDeviceErrors || []).map((([, error]) => ({
                ...error
            })));
            const {averageSpeed, blockmappedSize, bytesWritten, failed, size} = getFlashState();
            const {skip, results = {
                bytesWritten,
                sourceMetadata: {
                    size,
                    blockmappedSize
                },
                averageFlashingSpeed: averageSpeed,
                devices: {
                    failed,
                    successful: 0
                }
            }} = flashResults;
            return react.createElement(Flex, {
                height: "100%",
                justifyContent: "space-between"
            }, react.createElement(Flex, {
                width: webviewShowing ? "36.2vw" : "100vw",
                height: "100vh",
                alignItems: "center",
                justifyContent: "center",
                flexDirection: "column",
                style: {
                    position: "absolute",
                    top: 0,
                    zIndex: 1,
                    boxShadow: "0 2px 15px 0 rgba(0, 0, 0, 0.2)"
                }
            }, react.createElement(FlashResults, {
                image: (_a = getImage()) === null || _a === void 0 ? void 0 : _a.name,
                results,
                skip,
                errors,
                mb: "32px",
                goToMain
            }), react.createElement(FlashAnother, {
                onClick: () => {
                    restart(goToMain);
                }
            })), successBannerURL.length && react.createElement(SafeWebview, {
                src: successBannerURL,
                onWebviewShow: setWebviewShowing,
                style: {
                    display: webviewShowing ? "flex" : "none",
                    position: "absolute",
                    right: 0,
                    bottom: 0,
                    width: "63.8vw",
                    height: "100vh"
                }
            }));
        }
        const finish = FinishPage;
        function drive_extends() {
            drive_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return drive_extends.apply(this, arguments);
        }
        var drive_ref = react.createElement("g", {
            fill: "#FFF"
        }, react.createElement("path", {
            d: "M21.343 112.528a4.192 4.192 0 014.195 4.189 4.199 4.199 0 01-4.195 4.201 4.2 4.2 0 01-4.199-4.201 4.192 4.192 0 014.199-4.189z"
        }), react.createElement("path", {
            d: "M131.246 110.53L119.604 5.8c-.354-3.185-3.557-5.8-7.124-5.8H21.754c-3.568 0-6.777 2.615-7.127 5.8L2.984 110.53c0 .129-.061.232-.061.359v11.667c0 6.437 5.237 11.673 11.667 11.673h105.05c6.431 0 11.667-5.236 11.667-11.673v-11.667c0-.127-.061-.237-.061-.359zm-5.772 12.026c0 3.222-2.631 5.84-5.84 5.84H14.59c-3.206 0-5.836-2.618-5.836-5.84v-11.667c0-3.221 2.63-5.839 5.836-5.839h105.05c3.203 0 5.834 2.618 5.834 5.839v11.667z"
        }));
        function SvgDrive(props) {
            return react.createElement("svg", drive_extends({
                xmlns: "http://www.w3.org/2000/svg",
                viewBox: "0 0 134.229 134.229"
            }, props), drive_ref);
        }
        const drive = SvgDrive;
        function image_extends() {
            image_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return image_extends.apply(this, arguments);
        }
        var image_ref = react.createElement("path", {
            d: "M21 7.516v7.972c0 1.26-.675 2.425-1.775 3.053l-6.947 3.988a3.58 3.58 0 01-3.55 0L1.78 18.541A3.52 3.52 0 010 15.488V7.516c0-1.26.68-2.425 1.78-3.053L8.727.475a3.558 3.558 0 013.55 0l6.948 3.988A3.515 3.515 0 0121 7.516zm-11.734 7.88a1.22 1.22 0 001.234 1.235c.671 0 1.234-.541 1.234-1.234v-3.01h3.075c.65 0 1.191-.52 1.191-1.191a1.2 1.2 0 00-1.19-1.191h-3.076v-3.01c0-.693-.563-1.234-1.234-1.234a1.22 1.22 0 00-1.234 1.234v3.01H6.19a1.2 1.2 0 00-1.191 1.19c0 .672.541 1.192 1.19 1.192h3.076v3.01z",
            fill: "#FFF"
        });
        function SvgImage(props) {
            return react.createElement("svg", image_extends({
                viewBox: "0 0 21 23",
                xmlns: "http://www.w3.org/2000/svg"
            }, props), image_ref);
        }
        const assets_image = SvgImage;
        const domParser = new window.DOMParser;
        const DEFAULT_SIZE = "40px";
        function tryParseSVGContents(contents) {
            if (contents === undefined) {
                return;
            }
            const doc = domParser.parseFromString(contents, "image/svg+xml");
            const parserError = doc.querySelector("parsererror");
            const svg = doc.querySelector("svg");
            if (!parserError && svg) {
                return `data:image/svg+xml,${encodeURIComponent(svg.outerHTML)}`;
            }
        }
        class SVGIcon extends react.PureComponent {
            render() {
                const svgData = tryParseSVGContents(this.props.contents);
                const {width, height, style = {}} = this.props;
                style.width = width || DEFAULT_SIZE;
                style.height = height || DEFAULT_SIZE;
                if (svgData !== undefined) {
                    return react.createElement("img", {
                        className: this.props.disabled ? "disabled" : "",
                        style,
                        src: svgData
                    });
                }
                const {fallback: FallbackSVG} = this.props;
                return react.createElement(FallbackSVG, {
                    style
                });
            }
        }
        class ReducedFlashingInfos extends react.Component {
            constructor(props) {
                super(props);
                this.state = {};
            }
            render() {
                const {imageName = ""} = this.props;
                return react.createElement(Flex, {
                    flexDirection: "column",
                    style: this.props.style ? this.props.style : undefined
                }, react.createElement(Flex, {
                    mb: 16
                }, react.createElement(SVGIcon, {
                    disabled: true,
                    width: "21px",
                    height: "21px",
                    contents: this.props.imageLogo,
                    fallback: assets_image,
                    style: {
                        marginRight: "9px"
                    }
                }), react.createElement(Txt, {
                    style: {
                        marginRight: "9px"
                    },
                    tooltip: {
                        text: imageName,
                        placement: "right"
                    }
                }, middleEllipsis(imageName, 16)), react.createElement(Txt, {
                    color: "#7e8085"
                }, this.props.imageSize)), react.createElement(Flex, null, react.createElement(drive, {
                    width: "21px",
                    height: "21px",
                    style: {
                        marginRight: "9px"
                    }
                }), react.createElement(Txt, {
                    tooltip: {
                        text: this.props.driveLabel,
                        placement: "right"
                    }
                }, middleEllipsis(this.props.driveTitle, 16))));
            }
        }
        function github_extends() {
            github_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return github_extends.apply(this, arguments);
        }
        var github_ref = react.createElement("path", {
            d: "M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"
        });
        function SvgGithub(props) {
            return react.createElement("svg", github_extends({
                xmlns: "http://www.w3.org/2000/svg",
                viewBox: "0 0 496 512"
            }, props), github_ref);
        }
        const github = SvgGithub;
        async function open_external_open(url) {
            if (await get("disableExternalLinks")) {
                return;
            }
            logEvent("Open external link", {
                url
            });
            if (url) {
                external_electron_.shell.openExternal(url);
            }
        }
        async function getSettingsList() {
            const list = [ {
                name: "errorReporting",
                label: "Anonymously report errors and usage statistics to balena.io"
            } ];
            if ([ "appimage", "nsis", "dmg" ].includes(external_package_json_.packageType)) {
                list.push({
                    name: "updatesEnabled",
                    label: "Auto-updates enabled"
                });
            }
            return list;
        }
        function SettingsModal({toggleModal}) {
            const [settingsList, setCurrentSettingsList] = react.useState([]);
            react.useEffect((() => {
                (async () => {
                    if (settingsList.length === 0) {
                        setCurrentSettingsList(await getSettingsList());
                    }
                })();
            }));
            const [currentSettings, setCurrentSettings] = react.useState({});
            react.useEffect((() => {
                (async () => {
                    if (lodash.isEmpty(currentSettings)) {
                        setCurrentSettings(await getAll());
                    }
                })();
            }));
            const toggleSetting = async setting => {
                const value = currentSettings[setting];
                logEvent("Toggle setting", {
                    setting,
                    value
                });
                await set(setting, !value);
                setCurrentSettings({
                    ...currentSettings,
                    [setting]: !value
                });
            };
            return react.createElement(styled_components_Modal, {
                titleElement: react.createElement(Txt, {
                    fontSize: 24,
                    mb: 24
                }, "Settings"),
                done: () => toggleModal(false)
            }, react.createElement(Flex, {
                flexDirection: "column"
            }, settingsList.map(((setting, i) => react.createElement(Flex, {
                key: setting.name,
                mb: 14
            }, react.createElement(Checkbox, {
                toggle: true,
                tabIndex: 6 + i,
                label: setting.label,
                checked: currentSettings[setting.name],
                onChange: () => toggleSetting(setting.name)
            })))), react.createElement(Flex, {
                mt: 18,
                alignItems: "center",
                color: "#00aeef",
                style: {
                    width: "fit-content",
                    cursor: "pointer",
                    fontSize: 14
                },
                onClick: () => open_external_open("https://github.com/balena-io/etcher/blob/master/CHANGELOG.md")
            }, react.createElement(github, {
                height: "1em",
                fill: "currentColor",
                style: {
                    marginRight: 8
                }
            }), react.createElement(Txt, {
                style: {
                    borderBottom: "1px solid #00aeef"
                }
            }, external_package_json_.version))));
        }
        function copy_extends() {
            copy_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return copy_extends.apply(this, arguments);
        }
        var copy_ref = react.createElement("path", {
            d: "M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 00358.059 0H352v96h96v-6.059a24 24 0 00-7.029-16.97z"
        });
        function SvgCopy(props) {
            return react.createElement("svg", copy_extends({
                xmlns: "http://www.w3.org/2000/svg",
                viewBox: "0 0 448 512"
            }, props), copy_ref);
        }
        const copy = SvgCopy;
        function file_extends() {
            file_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return file_extends.apply(this, arguments);
        }
        var file_ref = react.createElement("path", {
            d: "M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm160-14.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"
        });
        function SvgFile(props) {
            return react.createElement("svg", file_extends({
                xmlns: "http://www.w3.org/2000/svg",
                viewBox: "0 0 384 512"
            }, props), file_ref);
        }
        const file = SvgFile;
        function link_extends() {
            link_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return link_extends.apply(this, arguments);
        }
        var link_ref = react.createElement("path", {
            d: "M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 01-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0120.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0020.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 00-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"
        });
        function SvgLink(props) {
            return react.createElement("svg", link_extends({
                xmlns: "http://www.w3.org/2000/svg",
                viewBox: "0 0 512 512"
            }, props), link_ref);
        }
        const solid_link = SvgLink;
        function exclamation_triangle_extends() {
            exclamation_triangle_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return exclamation_triangle_extends.apply(this, arguments);
        }
        var exclamation_triangle_ref = react.createElement("path", {
            d: "M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"
        });
        function SvgExclamationTriangle(props) {
            return react.createElement("svg", exclamation_triangle_extends({
                xmlns: "http://www.w3.org/2000/svg",
                viewBox: "0 0 576 512"
            }, props), exclamation_triangle_ref);
        }
        const exclamation_triangle = SvgExclamationTriangle;
        function chevron_down_extends() {
            chevron_down_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return chevron_down_extends.apply(this, arguments);
        }
        var chevron_down_ref = react.createElement("path", {
            d: "M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z"
        });
        function SvgChevronDown(props) {
            return react.createElement("svg", chevron_down_extends({
                xmlns: "http://www.w3.org/2000/svg",
                viewBox: "0 0 448 512"
            }, props), chevron_down_ref);
        }
        const chevron_down = SvgChevronDown;
        function chevron_right_extends() {
            chevron_right_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return chevron_right_extends.apply(this, arguments);
        }
        var chevron_right_ref = react.createElement("path", {
            d: "M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"
        });
        function SvgChevronRight(props) {
            return react.createElement("svg", chevron_right_extends({
                xmlns: "http://www.w3.org/2000/svg",
                viewBox: "0 0 320 512"
            }, props), chevron_right_ref);
        }
        const chevron_right = SvgChevronRight;
        var Divider_Base = styled_components_browser_esm.default.hr(Divider_templateObject_1 || (Divider_templateObject_1 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\tborder: 0 none;\n\tborder-top: ", ";\n\twidth: 100%;\n\theight: 0;\n" ], [ "\n\tborder: 0 none;\n\tborder-top: ", ";\n\twidth: 100%;\n\theight: 0;\n" ])), (function(props) {
            return styledUtils_px(2 * (props.height || .5)) + " " + (props.type || "solid") + " " + (props.color || props.theme.colors.quartenary.main) + "}";
        }));
        var FlexBase = (0, styled_components_browser_esm.default)(Divider_Base)(Divider_templateObject_2 || (Divider_templateObject_2 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\tflex: 1 1 0;\n\tmargin: auto;\n" ], [ "\n\tflex: 1 1 0;\n\tmargin: auto;\n" ])));
        var BaseDivider = react.forwardRef((function(_a, ref) {
            var children = _a.children, className = _a.className, otherProps = (0, tslib_es6.__rest)(_a, [ "children", "className" ]);
            if (!children) {
                return react.createElement(Divider_Base, (0, tslib_es6.__assign)({
                    className
                }, otherProps, {
                    ref
                }));
            }
            if (typeof children !== "string") {
                throw new Error("The child element of the Divider component must be a string, received: " + typeof children);
            }
            return react.createElement(Flex, {
                className,
                width: "100%",
                flexDirection: "row",
                justifyContent: "center",
                ref
            }, react.createElement(FlexBase, (0, tslib_es6.__assign)({}, otherProps)), react.createElement(Txt.span, {
                color: "tertiary.main",
                px: 3
            }, children), react.createElement(FlexBase, (0, tslib_es6.__assign)({}, otherProps)));
        }));
        var Divider = asRendition(BaseDivider, [], [ "color", "height" ]);
        var Divider_templateObject_1, Divider_templateObject_2;
        var Card_Wrapper = (0, styled_components_browser_esm.default)(DismissableContainer)(Card_templateObject_1 || (Card_templateObject_1 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\t& {\n\t\tpadding: ", ";\n\t}\n" ], [ "\n\t& {\n\t\tpadding: ", ";\n\t}\n" ])), (function(props) {
            return props.small ? "24px" : "32px 44px";
        }));
        var BaseCard = function(_a) {
            var title = _a.title, cta = _a.cta, rows = _a.rows, children = _a.children, small = _a.small, props = (0, 
            tslib_es6.__rest)(_a, [ "title", "cta", "rows", "children", "small" ]);
            var hasHeader = title || cta;
            var isSmall = useBreakpoint(small);
            var Header = hasHeader && react.createElement(react.Fragment, null, react.createElement(Flex, {
                justifyContent: "space-between",
                alignItems: "center"
            }, react.createElement(Heading.h5, {
                fontSize: 4
            }, title), cta), react.createElement(Divider, {
                my: 2
            }));
            var Rows = rows && map_default()(rows, (function(row, index) {
                return react.createElement(Box, {
                    key: index,
                    fontSize: 2
                }, index > 0 && react.createElement(Divider, null), row);
            }));
            var Body = children && react.createElement(Box, {
                fontSize: 2,
                height: "100%"
            }, children);
            return react.createElement(Card_Wrapper, (0, tslib_es6.__assign)({
                small: isSmall
            }, props), react.createElement(Box, {
                width: "100%"
            }, Header, Rows, Body));
        };
        var Card = asRendition(BaseCard);
        var Card_templateObject_1;
        var fadeIn = (0, styled_components_browser_esm.keyframes)(animations_templateObject_1 || (animations_templateObject_1 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\tfrom {\n\t\topacity: 0;\n\t}\n\n\tto {\n\t\topacity: 1;\n\t}\n" ], [ "\n\tfrom {\n\t\topacity: 0;\n\t}\n\n\tto {\n\t\topacity: 1;\n\t}\n" ])));
        var fadeOut = (0, styled_components_browser_esm.keyframes)(animations_templateObject_2 || (animations_templateObject_2 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\tfrom {\n\t\topacity: 1;\n\t}\n\n\tto {\n\t\topacity: 0;\n\t}\n" ], [ "\n\tfrom {\n\t\topacity: 1;\n\t}\n\n\tto {\n\t\topacity: 0;\n\t}\n" ])));
        var rotate360 = (0, styled_components_browser_esm.keyframes)(animations_templateObject_3 || (animations_templateObject_3 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n  0% {transform: rotate(0deg)}\n  100% {transform: rotate(360deg)}\n" ], [ "\n  0% {transform: rotate(0deg)}\n  100% {transform: rotate(360deg)}\n" ])));
        var animations = (0, styled_components_browser_esm.css)(animations_templateObject_4 || (animations_templateObject_4 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\t.fadeIn {\n\t\tanimation: ", ";\n\t}\n\n\t.fadeOut {\n\t\tanimation: ", ";\n\t}\n\n\t.animated.faster {\n\t\tanimation-duration: 500ms;\n\t}\n" ], [ "\n\t.fadeIn {\n\t\tanimation: ", ";\n\t}\n\n\t.fadeOut {\n\t\tanimation: ", ";\n\t}\n\n\t.animated.faster {\n\t\tanimation-duration: 500ms;\n\t}\n" ])), fadeIn, fadeOut);
        var animations_templateObject_1, animations_templateObject_2, animations_templateObject_3, animations_templateObject_4;
        var CircleLoader = styled_components_browser_esm.default.div(Spinner_templateObject_1 || (Spinner_templateObject_1 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\tbackground: transparent !important;\n\twidth: ", ";\n\theight: ", ";\n\tborder: ", " solid;\n\tcolor: ", ";\n\tborder-radius: 100%;\n\tborder-bottom-color: transparent;\n\tdisplay: inline-block;\n\tanimation: ", " 1s 0s infinite linear;\n\tanimation-fill-mode: both;\n" ], [ "\n\tbackground: transparent !important;\n\twidth: ", ";\n\theight: ", ";\n\tborder: ", " solid;\n\tcolor: ", ";\n\tborder-radius: 100%;\n\tborder-bottom-color: transparent;\n\tdisplay: inline-block;\n\tanimation: ", " 1s 0s infinite linear;\n\tanimation-fill-mode: both;\n" ])), (function(props) {
            return styledUtils_px(props.emphasized ? 40 : 20);
        }), (function(props) {
            return styledUtils_px(props.emphasized ? 40 : 20);
        }), (function(props) {
            return styledUtils_px(props.emphasized ? 6 : 4);
        }), (function(props) {
            return props.theme.colors.tertiary.main;
        }), rotate360);
        var Container = styled_components_browser_esm.default.div(Spinner_templateObject_2 || (Spinner_templateObject_2 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\tposition: relative;\n" ], [ "\n\tposition: relative;\n" ])));
        var SpinnerContainer = (0, styled_components_browser_esm.default)(Flex)(Spinner_templateObject_3 || (Spinner_templateObject_3 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tbottom: 0;\n\tright: 0;\n\tz-index: 4;\n" ], [ "\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tbottom: 0;\n\tright: 0;\n\tz-index: 4;\n" ])));
        var ChildrenContainer = styled_components_browser_esm.default.div(Spinner_templateObject_4 || (Spinner_templateObject_4 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\topacity: ", ";\n\ttransition: opacity 250ms;\n\tz-index: 3;\n" ], [ "\n\topacity: ", ";\n\ttransition: opacity 250ms;\n\tz-index: 3;\n" ])), (function(props) {
            return props.show ? .4 : 1;
        }));
        var Spinner_Base = function(_a) {
            var label = _a.label, emphasized = _a.emphasized, otherProps = (0, tslib_es6.__rest)(_a, [ "label", "emphasized" ]);
            return react.createElement(Flex, (0, tslib_es6.__assign)({
                flexDirection: emphasized ? "column" : "row",
                justifyContent: "center",
                alignItems: "center",
                width: "fit-content"
            }, otherProps), react.createElement(CircleLoader, {
                emphasized
            }), label && react.createElement(Txt, {
                color: "text.light",
                ml: emphasized ? 0 : 2,
                mt: emphasized ? 2 : 0
            }, label));
        };
        var BaseSpinner = function(_a) {
            var _b = _a.show, show = _b === void 0 ? true : _b, emphasized = _a.emphasized, label = _a.label, children = _a.children, otherProps = (0, 
            tslib_es6.__rest)(_a, [ "show", "emphasized", "label", "children" ]);
            if (!children) {
                if (!show) {
                    return null;
                }
                return react.createElement(Spinner_Base, (0, tslib_es6.__assign)({
                    label,
                    emphasized
                }, otherProps));
            }
            return react.createElement(Container, (0, tslib_es6.__assign)({}, otherProps), show && react.createElement(SpinnerContainer, {
                justifyContent: "center",
                alignItems: "center"
            }, react.createElement(Spinner_Base, {
                label,
                emphasized
            })), react.createElement(ChildrenContainer, {
                show
            }, children));
        };
        var Spinner = asRendition(BaseSpinner);
        var Spinner_templateObject_1, Spinner_templateObject_2, Spinner_templateObject_3, Spinner_templateObject_4;
        var InfiniteScroll = function InfiniteScroll(_ref) {
            var children = _ref.children, _ref$items = _ref.items, items = _ref$items === void 0 ? [] : _ref$items, onMore = _ref.onMore, renderMarker = _ref.renderMarker, replace = _ref.replace, showProp = _ref.show, _ref$step = _ref.step, step = _ref$step === void 0 ? 50 : _ref$step;
            var _useState = (0, react.useState)(showProp), show = _useState[0], setShow = _useState[1];
            var lastPage = (0, react.useMemo)((function() {
                return Math.floor(items.length / step);
            }), [ items.length, step ]);
            var _useState2 = (0, react.useState)([ 0, show ? Math.floor((show + step) / step) - 1 : 0 ]), renderPageBounds = _useState2[0], setRenderPageBounds = _useState2[1];
            var _useState3 = (0, react.useState)([]), pageHeights = _useState3[0], setPageHeights = _useState3[1];
            var _useState4 = (0, react.useState)(0), pendingLength = _useState4[0], setPendingLength = _useState4[1];
            var aboveMarkerRef = (0, react.useRef)();
            var belowMarkerRef = (0, react.useRef)();
            (0, react.useEffect)((function() {
                var scrollParents;
                var evaluate = function evaluate() {
                    if (!scrollParents) return;
                    var scrollParent = scrollParents[0];
                    var top;
                    var height;
                    if (scrollParent === document) {
                        top = document.documentElement.scrollTop || document.body.scrollTop;
                        height = window.innerHeight;
                    } else {
                        top = scrollParent.scrollTop;
                        var rect = scrollParent.getBoundingClientRect();
                        height = rect.height;
                    }
                    var offset = height / 4;
                    var nextBeginPage = 0;
                    var index = 0;
                    var pagesHeight = pageHeights[index] || 0;
                    while (pageHeights[index + 1] && pagesHeight < top - offset) {
                        index += 1;
                        nextBeginPage += 1;
                        pagesHeight += pageHeights[index];
                    }
                    var nextEndPage = nextBeginPage;
                    while (pageHeights[index] !== undefined && pagesHeight < top + height + offset) {
                        index += 1;
                        nextEndPage += 1;
                        pagesHeight += pageHeights[index] || 0;
                    }
                    if (!replace) {
                        nextBeginPage = 0;
                        nextEndPage = Math.max(renderPageBounds[1], nextEndPage);
                    }
                    if (show) {
                        var showPage = Math.floor((show + step) / step) - 1;
                        nextBeginPage = Math.min(showPage, nextBeginPage);
                        nextEndPage = Math.max(showPage, nextEndPage);
                    }
                    if (nextBeginPage !== renderPageBounds[0] || nextEndPage !== renderPageBounds[1]) {
                        setRenderPageBounds([ nextBeginPage, nextEndPage ]);
                    }
                };
                var timer;
                var debounce = function debounce() {
                    clearTimeout(timer);
                    timer = setTimeout(evaluate, 10);
                };
                if (belowMarkerRef.current) {
                    scrollParents = findScrollParents(belowMarkerRef.current);
                    scrollParents.forEach((function(sp) {
                        return sp.addEventListener("scroll", debounce);
                    }));
                }
                window.addEventListener("resize", debounce);
                evaluate();
                return function() {
                    if (scrollParents) {
                        scrollParents.forEach((function(sp) {
                            return sp.removeEventListener("scroll", debounce);
                        }));
                    }
                    window.removeEventListener("resize", debounce);
                    clearTimeout(timer);
                };
            }), [ pageHeights, renderPageBounds, replace, show, step ]);
            (0, react.useEffect)((function() {
                if (onMore && renderPageBounds[1] === lastPage && items.length >= pendingLength) {
                    setPendingLength(items.length + 1);
                    onMore();
                }
            }), [ items.length, lastPage, onMore, pendingLength, renderPageBounds, step ]);
            (0, react.useLayoutEffect)((function() {
                var timer = setTimeout((function() {
                    if (show && belowMarkerRef.current) {
                        var showIndex = show - renderPageBounds[0] * step + (renderPageBounds[0] ? 1 : 0);
                        var showNode = belowMarkerRef.current.parentNode.children.item(showIndex);
                        if (showNode) {
                            var scrollParent = findScrollParent(showNode);
                            if (isNodeBeforeScroll(showNode, scrollParent)) {
                                showNode.scrollIntoView(true);
                            } else if (isNodeAfterScroll(showNode, scrollParent)) {
                                showNode.scrollIntoView(false);
                            }
                            setShow(undefined);
                        }
                    }
                }), 100);
                return function() {
                    return clearTimeout(timer);
                };
            }), [ renderPageBounds, show, step ]);
            (0, react.useLayoutEffect)((function() {
                if (!belowMarkerRef.current) return;
                var rendered = belowMarkerRef.current.parentNode.children;
                if ((aboveMarkerRef.current ? 1 : 0) + (renderPageBounds[1] - renderPageBounds[0] + 1) * step + 1 === rendered.length) {
                    var nextPageHeights;
                    var i = renderPageBounds[0];
                    var lastBottom;
                    while (i <= renderPageBounds[1]) {
                        var topIndex = (aboveMarkerRef.current ? 1 : 0) + (i - renderPageBounds[0]) * step;
                        var bottomIndex = Math.min(topIndex + step - 1, rendered.length - 1);
                        var top = lastBottom !== undefined ? lastBottom : rendered.item(topIndex).getBoundingClientRect().top;
                        var _rendered$item$getBou = rendered.item(bottomIndex).getBoundingClientRect(), bottom = _rendered$item$getBou.bottom;
                        var height = bottom - top;
                        if (bottom && (!pageHeights || pageHeights[i] !== height)) {
                            if (!nextPageHeights) nextPageHeights = [].concat(pageHeights || []);
                            nextPageHeights[i] = height;
                        }
                        lastBottom = bottom;
                        i += 1;
                    }
                    while (replace && i <= lastPage) {
                        if (!pageHeights[i] && pageHeights[i] !== pageHeights[0]) {
                            if (!nextPageHeights) nextPageHeights = [].concat(pageHeights || []);
                            var _nextPageHeights = nextPageHeights;
                            nextPageHeights[i] = _nextPageHeights[0];
                        }
                        i += 1;
                    }
                    if (nextPageHeights) setPageHeights(nextPageHeights);
                }
            }), [ lastPage, pageHeights, renderPageBounds, replace, step ]);
            var aboveHeight = (0, react.useMemo)((function() {
                if (!replace) return 0;
                var height = 0;
                var i = 0;
                while (i < renderPageBounds[0]) {
                    height += pageHeights[i] || 0;
                    i += 1;
                }
                return height;
            }), [ pageHeights, renderPageBounds, replace ]);
            var belowHeight = (0, react.useMemo)((function() {
                if (!replace) return 0;
                var height = 0;
                var i = renderPageBounds[1] + 1;
                while (i <= lastPage) {
                    height += pageHeights[i] || 0;
                    i += 1;
                }
                return height;
            }), [ lastPage, pageHeights, renderPageBounds, replace ]);
            var firstIndex = renderPageBounds[0] * step;
            var lastIndex = Math.min((renderPageBounds[1] + 1) * step, items.length) - 1;
            var result = [];
            if (aboveHeight) {
                var marker = react.createElement(BoxWrapper, {
                    key: "above",
                    ref: aboveMarkerRef,
                    flex: false,
                    height: aboveHeight + "px"
                });
                if (renderMarker) {
                    marker = react.cloneElement(renderMarker(marker), {
                        key: "above"
                    });
                }
                result.push(marker);
            }
            items.slice(firstIndex, lastIndex + 1).forEach((function(item, index) {
                var itemsIndex = firstIndex + index;
                var child = children(item, itemsIndex);
                result.push(child);
            }));
            if (replace || renderPageBounds[1] < lastPage || onMore) {
                var _marker = react.createElement(BoxWrapper, {
                    key: "below",
                    ref: !renderMarker && belowMarkerRef || undefined,
                    flex: false,
                    height: (belowHeight || 0) + "px"
                });
                if (renderMarker) {
                    var renderedMarker = renderMarker(_marker);
                    _marker = react.cloneElement(renderedMarker, {
                        key: "below",
                        ref: function ref(node) {
                            belowMarkerRef.current = node;
                            var ref = renderedMarker.ref;
                            if (typeof ref === "function") {
                                ref(node);
                            } else if (ref !== null) {
                                ref.current = node;
                            }
                        }
                    });
                }
                result.push(_marker);
            }
            return result;
        };
        var InfiniteScrollDoc;
        if (false) {}
        var InfiniteScrollWrapper = InfiniteScrollDoc || InfiniteScroll;
        var createAnnouncer = function createAnnouncer() {
            var announcer = document.createElement("div");
            announcer.id = "grommet-announcer";
            announcer.style.left = "-100%";
            announcer.style.right = "100%";
            announcer.style.position = "fixed";
            announcer.style["z-index"] = "-1";
            document.body.insertBefore(announcer, document.body.firstChild);
            return announcer;
        };
        var AnnounceContext = react.createContext((function(message, mode, timeout) {
            if (mode === void 0) {
                mode = "polite";
            }
            if (timeout === void 0) {
                timeout = 500;
            }
            var announcer = document.body.querySelector("#grommet-announcer[aria-live]") || createAnnouncer();
            announcer.setAttribute("aria-live", "off");
            announcer.innerHTML = message;
            announcer.setAttribute("aria-live", mode);
            setTimeout((function() {
                announcer.innerHTML = "";
            }), timeout);
        }));
        var getPlainStyle = function getPlainStyle(plain) {
            if (plain === "full") {
                return (0, styled_components_browser_esm.css)([ "", " padding:0;" ], plainInputStyle);
            }
            return plain && plainInputStyle;
        };
        var StyledTextInput = styled_components_browser_esm.default.input.withConfig({
            displayName: "StyledTextInput",
            componentId: "sc-1x30a0s-0"
        })([ "", " ", " ", " ", " ", ";", "" ], inputStyle, (function(props) {
            return getPlainStyle(props.plain);
        }), (function(props) {
            return props.icon && (props.reverse ? "padding-right: " + props.theme.global.edgeSize.large + ";" : "padding-left: " + props.theme.global.edgeSize.large + ";");
        }), (function(props) {
            return props.disabled && disabledStyle(props.theme.textInput.disabled && props.theme.textInput.disabled.opacity);
        }), (function(props) {
            return props.theme.textInput && props.theme.textInput.extend;
        }), (function(props) {
            return props.textAlign && textAlignStyle;
        }));
        StyledTextInput.defaultProps = {};
        Object.setPrototypeOf(StyledTextInput.defaultProps, default_props_defaultProps);
        var StyledTextInputContainer = styled_components_browser_esm.default.div.withConfig({
            displayName: "StyledTextInput__StyledTextInputContainer",
            componentId: "sc-1x30a0s-1"
        })([ "position:relative;width:100%;", ";" ], (function(props) {
            return props.theme.textInput && props.theme.textInput.container && props.theme.textInput.container.extend;
        }));
        StyledTextInputContainer.defaultProps = {};
        Object.setPrototypeOf(StyledTextInputContainer.defaultProps, default_props_defaultProps);
        var StyledPlaceholder = styled_components_browser_esm.default.div.withConfig({
            displayName: "StyledTextInput__StyledPlaceholder",
            componentId: "sc-1x30a0s-2"
        })([ "position:absolute;left:", "px;top:50%;transform:translateY(-50%);display:flex;justify-content:center;pointer-events:none;", ";" ], (function(props) {
            return parseMetricToNum(getInputPadBySide(props, "left")) - parseMetricToNum(props.theme.global.control.border.width);
        }), (function(props) {
            return props.theme.textInput && props.theme.textInput.placeholder && props.theme.textInput.placeholder.extend;
        }));
        StyledPlaceholder.defaultProps = {};
        Object.setPrototypeOf(StyledPlaceholder.defaultProps, default_props_defaultProps);
        var StyledIcon = styled_components_browser_esm.default.div.withConfig({
            displayName: "StyledTextInput__StyledIcon",
            componentId: "sc-1x30a0s-3"
        })([ "position:absolute;display:flex;justify:center;top:50%;transform:translateY(-50%);pointer-events:none;", "" ], (function(props) {
            return props.reverse ? "right: " + getInputPadBySide(props, "right") + ";" : "left: " + getInputPadBySide(props, "left") + ";";
        }));
        var StyledSuggestions = styled_components_browser_esm.default.ol.withConfig({
            displayName: "StyledTextInput__StyledSuggestions",
            componentId: "sc-1x30a0s-4"
        })([ "border-top-left-radius:0;border-top-right-radius:0;margin:0;padding:0;list-style-type:none;", ";" ], (function(props) {
            return props.theme.textInput && props.theme.textInput.suggestions && props.theme.textInput.suggestions.extend;
        }));
        StyledSuggestions.defaultProps = {};
        Object.setPrototypeOf(StyledSuggestions.defaultProps, default_props_defaultProps);
        function TextInput_extends() {
            TextInput_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return TextInput_extends.apply(this, arguments);
        }
        function TextInput_objectWithoutPropertiesLoose(source, excluded) {
            if (source == null) return {};
            var target = {};
            var sourceKeys = Object.keys(source);
            var key, i;
            for (i = 0; i < sourceKeys.length; i++) {
                key = sourceKeys[i];
                if (excluded.indexOf(key) >= 0) continue;
                target[key] = source[key];
            }
            return target;
        }
        var renderLabel = function renderLabel(suggestion) {
            if (suggestion && typeof suggestion === "object") {
                return suggestion.label || suggestion.value;
            }
            return suggestion;
        };
        var stringLabel = function stringLabel(suggestion) {
            if (suggestion && typeof suggestion === "object") {
                if (suggestion.label && typeof suggestion.label === "string") {
                    return suggestion.label;
                }
                return suggestion.value;
            }
            return suggestion;
        };
        var ContainerBox = (0, styled_components_browser_esm.default)(BoxWrapper).withConfig({
            displayName: "TextInput__ContainerBox",
            componentId: "sc-1ai0c08-0"
        })([ "", ";@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){width:100%;}" ], (function(props) {
            return props.dropHeight ? sizeStyle("max-height", props.dropHeight, props.theme) : "max-height: inherit;";
        }));
        var defaultDropAlign = {
            top: "bottom",
            left: "left"
        };
        var defaultMessages = {
            enterSelect: "(Press Enter to Select)",
            suggestionsCount: "suggestions available",
            suggestionsExist: "This input has suggestions use arrow keys to navigate",
            suggestionIsOpen: "Suggestions drop is open, continue to use arrow keys to navigate"
        };
        var TextInput = (0, react.forwardRef)((function(_ref, ref) {
            var a11yTitle = _ref.a11yTitle, defaultSuggestion = _ref.defaultSuggestion, defaultValue = _ref.defaultValue, _ref$dropAlign = _ref.dropAlign, dropAlign = _ref$dropAlign === void 0 ? defaultDropAlign : _ref$dropAlign, dropHeight = _ref.dropHeight, dropTarget = _ref.dropTarget, dropProps = _ref.dropProps, icon = _ref.icon, id = _ref.id, _ref$messages = _ref.messages, messages = _ref$messages === void 0 ? defaultMessages : _ref$messages, name = _ref.name, _onBlur = _ref.onBlur, onChange = _ref.onChange, _onFocus = _ref.onFocus, onKeyDown = _ref.onKeyDown, onSelect = _ref.onSelect, onSuggestionSelect = _ref.onSuggestionSelect, onSuggestionsClose = _ref.onSuggestionsClose, onSuggestionsOpen = _ref.onSuggestionsOpen, placeholder = _ref.placeholder, plain = _ref.plain, readOnly = _ref.readOnly, reverse = _ref.reverse, suggestions = _ref.suggestions, textAlign = _ref.textAlign, valueProp = _ref.value, rest = TextInput_objectWithoutPropertiesLoose(_ref, [ "a11yTitle", "defaultSuggestion", "defaultValue", "dropAlign", "dropHeight", "dropTarget", "dropProps", "icon", "id", "messages", "name", "onBlur", "onChange", "onFocus", "onKeyDown", "onSelect", "onSuggestionSelect", "onSuggestionsClose", "onSuggestionsOpen", "placeholder", "plain", "readOnly", "reverse", "suggestions", "textAlign", "value" ]);
            var theme = (0, react.useContext)(styled_components_browser_esm.ThemeContext) || default_props_defaultProps.theme;
            var announce = (0, react.useContext)(AnnounceContext);
            var formContext = (0, react.useContext)(FormContext);
            var inputRef = useForwardedRef(ref);
            var dropRef = (0, react.useRef)();
            var suggestionsRef = (0, react.useRef)();
            var _formContext$useFormI = formContext.useFormInput(readOnly ? undefined : name, valueProp), value = _formContext$useFormI[0], setValue = _formContext$useFormI[1];
            var _useState = (0, react.useState)(), focus = _useState[0], setFocus = _useState[1];
            var _useState2 = (0, react.useState)(false), showDrop = _useState2[0], setShowDrop = _useState2[1];
            var handleSuggestionSelect = (0, react.useMemo)((function() {
                return onSelect && !onSuggestionSelect ? onSelect : onSuggestionSelect;
            }), [ onSelect, onSuggestionSelect ]);
            var handleTextSelect = (0, react.useMemo)((function() {
                return onSelect && onSuggestionSelect ? onSelect : undefined;
            }), [ onSelect, onSuggestionSelect ]);
            var _useState3 = (0, react.useState)(), suggestionsAtClose = _useState3[0], setSuggestionsAtClose = _useState3[1];
            var openDrop = (0, react.useCallback)((function() {
                setShowDrop(true);
                announce(messages.suggestionIsOpen);
                announce(suggestions.length + " " + messages.suggestionsCount);
                if (onSuggestionsOpen) onSuggestionsOpen();
            }), [ announce, messages.suggestionsCount, messages.suggestionIsOpen, onSuggestionsOpen, suggestions ]);
            var closeDrop = (0, react.useCallback)((function() {
                setSuggestionsAtClose(suggestions);
                setShowDrop(false);
                if (messages.onSuggestionsClose) onSuggestionsClose();
                if (onSuggestionsClose) onSuggestionsClose();
            }), [ messages.onSuggestionsClose, onSuggestionsClose, suggestions ]);
            (0, react.useEffect)((function() {
                if (focus && !showDrop && suggestions && suggestions.length && (!suggestionsAtClose || suggestionsAtClose.length !== suggestions.length)) {
                    openDrop();
                }
            }), [ focus, openDrop, showDrop, suggestions, suggestionsAtClose ]);
            (0, react.useEffect)((function() {
                if (showDrop && (!suggestions || !suggestions.length)) closeDrop();
            }), [ closeDrop, showDrop, suggestions ]);
            var valueSuggestionIndex = (0, react.useMemo)((function() {
                return suggestions ? suggestions.map((function(suggestion) {
                    return typeof suggestion === "object" ? suggestion.value : suggestion;
                })).indexOf(value) : -1;
            }), [ suggestions, value ]);
            var resetSuggestionIndex = (0, react.useMemo)((function() {
                if (valueSuggestionIndex === -1 && typeof defaultSuggestion === "number") {
                    return defaultSuggestion;
                }
                return valueSuggestionIndex;
            }), [ defaultSuggestion, valueSuggestionIndex ]);
            var _useState4 = (0, react.useState)(resetSuggestionIndex), activeSuggestionIndex = _useState4[0], setActiveSuggestionIndex = _useState4[1];
            var _useState5 = (0, react.useState)(), mouseMovedSinceLastKey = _useState5[0], setMouseMovedSinceLastKey = _useState5[1];
            (0, react.useEffect)((function() {
                return setActiveSuggestionIndex(valueSuggestionIndex);
            }), [ valueSuggestionIndex ]);
            (0, react.useEffect)((function() {
                if (!showDrop) setActiveSuggestionIndex(resetSuggestionIndex);
            }), [ resetSuggestionIndex, showDrop ]);
            (0, react.useEffect)((function() {
                if (activeSuggestionIndex >= 0) {
                    var label = stringLabel(suggestions[activeSuggestionIndex]);
                    announce(label + " " + messages.enterSelect);
                }
            }), [ activeSuggestionIndex, announce, messages, suggestions ]);
            (0, react.useEffect)((function() {
                var timer = setTimeout((function() {
                    var list = suggestionsRef.current;
                    if (showDrop && activeSuggestionIndex !== -1 && list) {
                        var container = list.parentNode;
                        var item = list.children[activeSuggestionIndex];
                        if (container.scrollTo) {
                            if (isNodeAfterScroll(item, container)) container.scrollTo(0, item.offsetTop - (container.getBoundingClientRect().height - item.getBoundingClientRect().height)); else if (isNodeBeforeScroll(item, container)) container.scrollTo(0, item.offsetTop);
                        }
                    }
                }), 50);
                return function() {
                    return clearTimeout(timer);
                };
            }), [ activeSuggestionIndex, showDrop ]);
            var setValueFromSuggestion = function setValueFromSuggestion(event, suggestion) {
                inputRef.current.focus();
                inputRef.current.value = suggestion;
                closeDrop();
                if (handleSuggestionSelect) {
                    if (event.persist) event.persist();
                    var adjustedEvent = event;
                    adjustedEvent.suggestion = suggestion;
                    handleSuggestionSelect(adjustedEvent);
                }
                setValue(suggestion);
            };
            var onNextSuggestion = (0, react.useCallback)((function(event) {
                event.preventDefault();
                var nextActiveIndex = Math.min(activeSuggestionIndex + 1, suggestions.length - 1);
                setActiveSuggestionIndex(nextActiveIndex);
                setMouseMovedSinceLastKey(false);
            }), [ activeSuggestionIndex, suggestions ]);
            var onPreviousSuggestion = (0, react.useCallback)((function(event) {
                event.preventDefault();
                var nextActiveIndex = Math.max(activeSuggestionIndex - 1, 0);
                setActiveSuggestionIndex(nextActiveIndex);
                setMouseMovedSinceLastKey(false);
            }), [ activeSuggestionIndex ]);
            var _useState6 = (0, react.useState)(placeholder && typeof placeholder !== "string" && !(inputRef.current && inputRef.current.value) && !value), showStyledPlaceholder = _useState6[0], setShowStyledPlaceholder = _useState6[1];
            var drop;
            var extraProps = {
                onSelect: handleTextSelect
            };
            if (showDrop) {
                drop = react.createElement(DropWrapper, TextInput_extends({
                    ref: dropRef,
                    id: id ? "text-input-drop__" + id : undefined,
                    align: dropAlign,
                    responsive: false,
                    target: dropTarget || inputRef.current,
                    onClickOutside: closeDrop,
                    onEsc: closeDrop
                }, dropProps), react.createElement(ContainerBox, {
                    overflow: "auto",
                    dropHeight,
                    onMouseMove: function onMouseMove() {
                        return setMouseMovedSinceLastKey(true);
                    }
                }, react.createElement(StyledSuggestions, {
                    ref: suggestionsRef
                }, react.createElement(InfiniteScrollWrapper, {
                    items: suggestions,
                    step: theme.select.step,
                    show: activeSuggestionIndex !== -1 ? activeSuggestionIndex : undefined
                }, (function(suggestion, index, itemRef) {
                    var renderedLabel = renderLabel(suggestion);
                    var child;
                    if (typeof renderedLabel !== "string") child = renderedLabel; else if (!theme.button.option) child = react.createElement(BoxWrapper, {
                        align: "start",
                        pad: "small"
                    }, renderedLabel);
                    return react.createElement("li", {
                        key: stringLabel(suggestion) + "-" + index,
                        ref: itemRef
                    }, react.createElement(ButtonWrapper, {
                        active: activeSuggestionIndex === index,
                        fill: true,
                        plain: !child ? undefined : true,
                        align: "start",
                        kind: !child ? "option" : undefined,
                        label: !child ? renderedLabel : undefined,
                        onClick: function onClick(event) {
                            return setValueFromSuggestion(event, suggestion);
                        },
                        onMouseMove: mouseMovedSinceLastKey && activeSuggestionIndex !== index ? function() {
                            return setActiveSuggestionIndex(index);
                        } : undefined
                    }, child));
                })))));
            }
            var keyboardProps = {
                onKeyDown
            };
            if (showDrop) {
                keyboardProps.onEnter = function(event) {
                    event.preventDefault();
                    if (activeSuggestionIndex >= 0) setValueFromSuggestion(event, suggestions[activeSuggestionIndex]); else closeDrop();
                };
                if (activeSuggestionIndex > 0) keyboardProps.onUp = onPreviousSuggestion;
                if (activeSuggestionIndex < suggestions.length - 1) keyboardProps.onDown = onNextSuggestion;
                keyboardProps.onTab = closeDrop;
            } else if (suggestions && suggestions.length > 0) {
                keyboardProps.onDown = openDrop;
            }
            return react.createElement(StyledTextInputContainer, {
                plain
            }, showStyledPlaceholder && react.createElement(StyledPlaceholder, null, placeholder), icon && react.createElement(StyledIcon, {
                reverse,
                theme
            }, icon), react.createElement(KeyboardWrapper, TextInput_extends({
                target: focus ? "document" : undefined
            }, keyboardProps), react.createElement(StyledTextInput, TextInput_extends({
                "aria-label": a11yTitle,
                ref: inputRef,
                id,
                name,
                autoComplete: "off",
                plain,
                placeholder: typeof placeholder === "string" ? placeholder : undefined,
                icon,
                reverse,
                focus,
                textAlign
            }, rest, extraProps, {
                defaultValue: renderLabel(defaultValue),
                value: renderLabel(value),
                readOnly,
                onFocus: function onFocus(event) {
                    if (!focus) {
                        setFocus(true);
                        if (suggestions && suggestions.length > 0) {
                            announce(messages.suggestionsExist);
                            openDrop();
                        }
                        if (_onFocus) _onFocus(event);
                    }
                },
                onBlur: function onBlur(event) {
                    if (!event.relatedTarget || event.relatedTarget !== dropRef.current) {
                        setFocus(false);
                        if (_onBlur) _onBlur(event);
                    }
                },
                onChange: readOnly ? undefined : function(event) {
                    setShowStyledPlaceholder(placeholder && typeof placeholder !== "string" && !event.target.value);
                    setValue(event.target.value);
                    setActiveSuggestionIndex(-1);
                    if (onChange) onChange(event);
                }
            }))), drop);
        }));
        TextInput.displayName = "TextInput";
        var TextInputDoc;
        if (false) {}
        var TextInputWrapper = TextInputDoc || TextInput;
        var Input_getBorderColor = function(props) {
            if (props.invalid) {
                return props.theme.colors.danger.main;
            }
            if (props.valid) {
                return props.theme.colors.success.main;
            }
        };
        var StyledGrommetInput = (0, styled_components_browser_esm.default)(TextInputWrapper)(Input_templateObject_1 || (Input_templateObject_1 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\t", ";\n\t", ";\n\tpadding: ", ";\n\tpadding-left: 20px;\n\n\tcolor: ", ";\n\tcursor: ", ";\n\tborder-color: ", ";\n\n\t&:focus {\n\t\tborder-color: ", ";\n\t}\n" ], [ "\n\t", ";\n\t", ";\n\tpadding: ", ";\n\tpadding-left: 20px;\n\n\tcolor: ", ";\n\tcursor: ", ";\n\tborder-color: ", ";\n\n\t&:focus {\n\t\tborder-color: ", ";\n\t}\n" ])), styledUtils_monospace, emphasized, (function(props) {
            return props.emphasized ? "14px" : "10px";
        }), (function(props) {
            return props.theme.colors.text.main;
        }), (function(props) {
            return props.disabled ? "not-allowed" : "auto";
        }), Input_getBorderColor, (function(props) {
            return props.theme.colors.tertiary.main;
        }));
        var BaseInput = react.forwardRef((function(_a, ref) {
            var otherProps = (0, tslib_es6.__rest)(_a, []);
            return react.createElement(StyledGrommetInput, (0, tslib_es6.__assign)({}, otherProps, {
                ref
            }));
        }));
        var Input = asRendition(BaseInput);
        var Input_templateObject_1;
        var external_child_process_ = __webpack_require__(96);
        var tmp = __webpack_require__(97);
        var external_os_ = __webpack_require__(93);
        var external_util_ = __webpack_require__(58);
        const readFileAsync = (0, external_util_.promisify)(external_fs_.readFile);
        const execAsync = (0, external_util_.promisify)(external_child_process_.exec);
        async function getWmicNetworkDrivesOutput() {
            const options = {
                keepOpen: false,
                prefix: "tmp"
            };
            return (0, tmp.withTmpFile)(options, (async ({path}) => {
                const command = [ (0, external_path_.join)(external_process_.env.SystemRoot, "System32", "Wbem", "wmic"), "path", "Win32_LogicalDisk", "Where", 'DriveType="4"', "get", "DeviceID,ProviderName", ">", `"${path}"` ];
                await execAsync(command.join(" "), {
                    windowsHide: true
                });
                return readFileAsync(path, "ucs2");
            }));
        }
        async function getWindowsNetworkDrives(getWmicOutput) {
            const result = await getWmicOutput();
            const couples = (0, lodash.chain)(result).split("\n").slice(1).invokeMap(String.prototype.trim).compact().map((str => {
                const colonPosition = str.indexOf(":");
                if (colonPosition === -1) {
                    throw new Error(`Can't parse wmic output: ${result}`);
                }
                return [ str.slice(0, colonPosition + 1), (0, lodash.trim)(str.slice(colonPosition + 1)) ];
            })).filter((couple => couple[1].length > 0)).value();
            return new Map(couples);
        }
        async function replaceWindowsNetworkDriveLetter(filePath, getWmicOutput = getWmicNetworkDrivesOutput) {
            let result = filePath;
            if ((0, external_os_.platform)() === "win32") {
                const matches = /^([A-Z]+:)\\(.*)$/.exec(filePath);
                if (matches !== null) {
                    const [, drive, relativePath] = matches;
                    const drives = await getWindowsNetworkDrives(getWmicOutput);
                    const location = drives.get(drive);
                    if (location !== undefined) {
                        result = `${location}\\${relativePath}`;
                    }
                }
            }
            return result;
        }
        function src_extends() {
            src_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return src_extends.apply(this, arguments);
        }
        var src_ref = react.createElement("g", {
            fill: "none",
            fillRule: "evenodd"
        }, react.createElement("path", {
            d: "M30.88 39.87H7.517v23.209c0 .69.56 1.251 1.251 1.251h20.861a1.25 1.25 0 001.251-1.251V39.87zm-22.363 1H29.88v22.209a.25.25 0 01-.25.25H8.767l-.057-.006a.252.252 0 01-.194-.244v-22.21z",
            fill: "#2A506F",
            fillRule: "nonzero"
        }), react.createElement("path", {
            d: "M16.558 48.924h-3.967c-.583 0-1.055.472-1.055 1.055v2.732c0 .582.472 1.055 1.055 1.055h3.967c.582 0 1.054-.473 1.054-1.055v-2.732c0-.583-.472-1.055-1.054-1.055zm-3.967 1h3.967c.03 0 .054.024.054.055v2.732c0 .03-.025.055-.054.055h-3.967a.055.055 0 01-.055-.055v-2.732c0-.03.024-.055.055-.055zM25.97 48.924h-3.967c-.583 0-1.055.472-1.055 1.055v2.732c0 .582.472 1.055 1.055 1.055h3.967c.582 0 1.054-.473 1.054-1.055v-2.732c0-.583-.472-1.055-1.054-1.055zm-3.967 1h3.967c.03 0 .054.024.054.055v2.732c0 .03-.025.055-.054.055h-3.967a.055.055 0 01-.055-.055v-2.732c0-.03.024-.055.055-.055z",
            fill: "#2A506F",
            fillRule: "nonzero"
        }), react.createElement("path", {
            d: "M37.398 5.418v30.534a4.43 4.43 0 01-4.418 4.418H5.418A4.43 4.43 0 011 35.952V5.418A4.43 4.43 0 015.418 1H32.98a4.43 4.43 0 014.418 4.418",
            fill: "#2A506F"
        }), react.createElement("path", {
            d: "M32.98 0H5.418A5.43 5.43 0 000 5.418v30.534a5.43 5.43 0 005.418 5.418H32.98a5.43 5.43 0 005.418-5.418V5.418A5.43 5.43 0 0032.98 0zM5.418 2H32.98a3.43 3.43 0 013.418 3.418v30.534a3.43 3.43 0 01-3.418 3.418H5.418A3.43 3.43 0 012 35.952V5.418A3.43 3.43 0 015.418 2zM19.147 73.551a.5.5 0 01.492.41l.008.09v14.882a.5.5 0 01-.992.09l-.008-.09V74.051a.5.5 0 01.5-.5z",
            fill: "#2A506F",
            fillRule: "nonzero"
        }), react.createElement("path", {
            stroke: "#2A506F",
            strokeLinecap: "round",
            d: "M19.147 88.933l-4.615-4.719M19.147 88.933l4.719-4.615"
        }), react.createElement("path", {
            d: "M14.007 26.177c.51 0 .967-.071 1.37-.214s.747-.338 1.031-.589.504-.543.656-.877.229-.692.229-1.075c0-.354-.052-.666-.155-.936s-.243-.506-.42-.707-.388-.378-.634-.53-.505-.288-.78-.405l-1.37-.59c-.197-.078-.389-.164-.575-.258s-.359-.201-.516-.324-.282-.265-.376-.427-.14-.361-.14-.597c0-.442.165-.788.494-1.038s.764-.376 1.304-.376c.452 0 .857.08 1.215.243s.685.386.98.67l.663-.795c-.344-.354-.761-.641-1.252-.862s-1.027-.332-1.606-.332c-.442 0-.847.064-1.216.192s-.687.307-.957.538-.482.503-.634.817-.228.654-.228 1.017c0 .354.059.665.177.936s.27.503.456.7.398.363.634.5.466.256.692.354l1.385.604c.226.108.437.211.634.31s.366.208.508.33.255.271.339.443.125.38.125.626c0 .472-.177.852-.53 1.142s-.85.434-1.488.434c-.501 0-.985-.11-1.451-.331s-.872-.513-1.216-.877l-.737.855a4.646 4.646 0 003.389 1.43zM20.273 26v-4.597c.246-.609.533-1.036.862-1.281s.646-.369.95-.369c.148 0 .27.01.369.03s.206.049.324.088l.236-1.06a1.903 1.903 0 00-.766-.148c-.413 0-.793.133-1.142.398s-.646.624-.892 1.075h-.044l-.103-1.296h-1.002V26h1.208zm6.576.177c.432 0 .845-.081 1.238-.243s.751-.386 1.075-.67l-.53-.81c-.226.196-.479.365-.759.507s-.587.214-.92.214c-.325 0-.624-.066-.9-.199s-.508-.319-.7-.56-.34-.528-.449-.862-.162-.707-.162-1.12.057-.787.17-1.126.267-.631.464-.877.432-.435.707-.567.575-.2.899-.2c.285 0 .542.06.773.178s.45.27.656.456l.619-.795c-.256-.226-.55-.423-.884-.59s-.737-.25-1.208-.25c-.462 0-.902.083-1.319.25s-.783.413-1.098.737-.564.72-.751 1.186-.28 1-.28 1.599c0 .59.086 1.117.258 1.584s.408.859.707 1.178.656.563 1.068.73.855.25 1.326.25z",
            fill: "#fff",
            fillRule: "nonzero"
        }));
        function SvgSrc(props) {
            return react.createElement("svg", src_extends({
                viewBox: "0 0 39 90",
                xmlns: "http://www.w3.org/2000/svg"
            }, props), src_ref);
        }
        const src = SvgSrc;
        var shades = [ "#C7FFFF", "#BAECC2", "#FFD4F1", "#F1CDE3", "#D7E4FE", "#FFD5D2", "#CAE1AC", "#D6D3FA", "#C3C7CA", "#FFDA93", "#E1EEE5", "#DBE0E3", "#FEEC63", "#FBE6F4", "#FFECAE", "#F1CDFF", "#C3EFFF", "#F3E8FD", "#E0FEB4", "#FDE8E7", "#CAFECD", "#D7E46C", "#F7D8BA" ];
        var StyledBadge = (0, styled_components_browser_esm.default)(Txt.span)(Badge_templateObject_1 || (Badge_templateObject_1 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\tdisplay: inline-block;\n\tborder-radius: 1em;\n\tline-height: 1;\n" ], [ "\n\tdisplay: inline-block;\n\tborder-radius: 1em;\n\tline-height: 1;\n" ])));
        var BaseBadge = function(_a) {
            var children = _a.children, className = _a.className, shade = _a.shade, otherProps = (0, 
            tslib_es6.__rest)(_a, [ "children", "className", "shade" ]);
            if (typeof children !== "string") {
                throw new Error("The child element of the Badge component must be a string, received: " + typeof children);
            }
            var shadeHex = shades[(shade || 0) % shades.length];
            return react.createElement(StyledBadge, (0, tslib_es6.__assign)({
                className,
                py: 1,
                px: "12px",
                fontSize: 1,
                bg: shadeHex
            }, otherProps, {
                color: getLegibleTextColor(shadeHex)
            }), children);
        };
        var Badge = asRendition(BaseBadge);
        var Badge_templateObject_1;
        function isUsbbootDrive(drive) {
            return drive.progress !== undefined;
        }
        function isDriverlessDrive(drive) {
            return drive.link !== undefined;
        }
        function isDrivelistDrive(drive) {
            return typeof drive.size === "number";
        }
        const DrivesTable = (0, styled_components_browser_esm.default)((props => react.createElement(styled_components_Table, Object.assign({}, props))))`
	[data-display='table-head'],
	[data-display='table-body'] {
		> [data-display='table-row'] > [data-display='table-cell'] {
			&:nth-child(2) {
				width: 32%;
			}

			&:nth-child(3) {
				width: 15%;
			}

			&:nth-child(4) {
				width: 15%;
			}

			&:nth-child(5) {
				width: 32%;
			}
		}
	}
`;
        function badgeShadeFromStatus(status) {
            switch (status) {
              case compatibility.containsImage():
                return 16;

              case compatibility.system():
              case compatibility.tooSmall():
                return 5;

              default:
                return 14;
            }
        }
        const InitProgress = (0, styled_components_browser_esm.default)((({value, ...props}) => react.createElement("progress", Object.assign({
            max: "100",
            value
        }, props))))`
	/* Reset the default appearance */
	appearance: none;

	::-webkit-progress-bar {
		width: 130px;
		height: 4px;
		background-color: #dde1f0;
		border-radius: 14px;
	}

	::-webkit-progress-value {
		background-color: #1496e1;
		border-radius: 14px;
	}
`;
        function drive_selector_isSystemDrive(drive) {
            return isDrivelistDrive(drive) && drive.isSystem;
        }
        class DriveSelector extends react.Component {
            constructor(props) {
                super(props);
                const defaultMissingDriversModalState = {};
                const selectedList = this.props.selectedList || [];
                this.originalList = [ ...this.props.selectedList || [] ];
                this.state = {
                    drives: getDrives(),
                    image: getImage(),
                    missingDriversModal: defaultMissingDriversModalState,
                    selectedList,
                    showSystemDrives: false
                };
                this.tableColumns = [ {
                    field: "description",
                    label: "Name",
                    render: (description, drive) => {
                        if (isDrivelistDrive(drive)) {
                            const isLargeDrive = isDriveSizeLarge(drive);
                            const hasWarnings = this.props.showWarnings && (isLargeDrive || drive.isSystem);
                            return react.createElement(Flex, {
                                alignItems: "center"
                            }, hasWarnings && react.createElement(exclamation_triangle, {
                                height: "1em",
                                fill: drive.isSystem ? "#fca321" : "#8f9297"
                            }), react.createElement(Txt, {
                                ml: hasWarnings && 8 || 0
                            }, middleEllipsis(description, 32)));
                        }
                        return react.createElement(Txt, null, description);
                    }
                }, {
                    field: "description",
                    key: "size",
                    label: "Size",
                    render: (_description, drive) => {
                        if (isDrivelistDrive(drive) && drive.size !== null) {
                            return pretty_bytes(drive.size);
                        }
                    }
                }, {
                    field: "description",
                    key: "link",
                    label: "Location",
                    render: (_description, drive) => react.createElement(Txt, null, drive.displayName, isDriverlessDrive(drive) && react.createElement(react.Fragment, null, " ", "-", " ", react.createElement("b", null, react.createElement("a", {
                        onClick: () => this.installMissingDrivers(drive)
                    }, drive.linkCTA))))
                }, {
                    field: "description",
                    key: "extra",
                    label: react.createElement(react.Fragment, null),
                    render: (_description, drive) => {
                        if (isUsbbootDrive(drive)) {
                            return this.renderProgress(drive.progress);
                        } else if (isDrivelistDrive(drive)) {
                            return this.renderStatuses(drive);
                        }
                    }
                } ];
            }
            driveShouldBeDisabled(drive, image) {
                return isUsbbootDrive(drive) || isDriverlessDrive(drive) || !isDriveValid(drive, image, this.props.write) || this.props.write && drive.isReadOnly;
            }
            getDisplayedDrives(drives) {
                return drives.filter((drive => isUsbbootDrive(drive) || isDriverlessDrive(drive) || isDriveSelected(drive.device) || this.state.showSystemDrives || !drive.isSystem));
            }
            getDisabledDrives(drives, image) {
                return drives.filter((drive => this.driveShouldBeDisabled(drive, image))).map((drive => drive.displayName));
            }
            renderProgress(progress) {
                return react.createElement(Flex, {
                    flexDirection: "column"
                }, react.createElement(Txt, {
                    fontSize: 12
                }, "Initializing device"), react.createElement(InitProgress, {
                    value: progress
                }));
            }
            warningFromStatus(status, drive) {
                var _a, _b;
                switch (status) {
                  case compatibility.containsImage():
                    return warning.sourceDrive();

                  case compatibility.largeDrive():
                    return warning.largeDriveSize();

                  case compatibility.system():
                    return warning.systemDrive();

                  case compatibility.tooSmall():
                    const size = ((_a = this.state.image) === null || _a === void 0 ? void 0 : _a.recommendedDriveSize) || ((_b = this.state.image) === null || _b === void 0 ? void 0 : _b.size) || 0;
                    return warning.tooSmall({
                        size
                    }, drive);
                }
            }
            renderStatuses(drive) {
                const statuses = getDriveImageCompatibilityStatuses(drive, this.state.image, this.props.write).slice(0, 2);
                return react.createElement(react.Fragment, null, statuses.map((status => {
                    const badgeShade = badgeShadeFromStatus(status.message);
                    const warningMessage = this.warningFromStatus(status.message, {
                        device: drive.device,
                        size: drive.size || 0
                    });
                    return react.createElement(Badge, {
                        key: status.message,
                        shade: badgeShade,
                        mr: "8px",
                        tooltip: this.props.showWarnings ? warningMessage : ""
                    }, status.message);
                })));
            }
            installMissingDrivers(drive) {
                if (drive.link) {
                    logEvent("Open driver link modal", {
                        url: drive.link
                    });
                    this.setState({
                        missingDriversModal: {
                            drive
                        }
                    });
                }
            }
            componentDidMount() {
                this.unsubscribe = store.subscribe((() => {
                    const drives = getDrives();
                    const image = getImage();
                    this.setState({
                        drives,
                        image,
                        selectedList: this.props.updateSelectedList && this.props.updateSelectedList() || []
                    });
                }));
            }
            componentWillUnmount() {
                var _a;
                (_a = this.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(this);
            }
            render() {
                const {cancel, done, ...props} = this.props;
                const {selectedList, drives, image, missingDriversModal} = this.state;
                const displayedDrives = this.getDisplayedDrives(drives);
                const disabledDrives = this.getDisabledDrives(drives, image);
                const numberOfSystemDrives = drives.filter(drive_selector_isSystemDrive).length;
                const numberOfDisplayedSystemDrives = displayedDrives.filter(drive_selector_isSystemDrive).length;
                const numberOfHiddenSystemDrives = numberOfSystemDrives - numberOfDisplayedSystemDrives;
                const hasSystemDrives = selectedList.filter(drive_selector_isSystemDrive).length;
                const showWarnings = this.props.showWarnings && hasSystemDrives;
                return react.createElement(styled_components_Modal, Object.assign({
                    titleElement: react.createElement(Flex, {
                        alignItems: "baseline",
                        mb: 18
                    }, react.createElement(Txt, {
                        fontSize: 24,
                        align: "left"
                    }, this.props.titleLabel), react.createElement(Txt, {
                        fontSize: 11,
                        ml: 12,
                        color: "#5b82a7",
                        style: {
                            fontWeight: 600
                        }
                    }, drives.length, " found")),
                    titleDetails: react.createElement(Txt, {
                        fontSize: 11
                    }, getDrives().length, " found"),
                    cancel: () => cancel(this.originalList),
                    done: () => done(selectedList),
                    action: `Select (${selectedList.length})`,
                    primaryButtonProps: {
                        primary: !showWarnings,
                        warning: showWarnings,
                        disabled: !hasAvailableDrives()
                    }
                }, props), !hasAvailableDrives() ? react.createElement(Flex, {
                    flexDirection: "column",
                    justifyContent: "center",
                    alignItems: "center",
                    width: "100%"
                }, this.props.emptyListIcon, react.createElement("b", null, this.props.emptyListLabel)) : react.createElement(react.Fragment, null, react.createElement(DrivesTable, {
                    refFn: t => {
                        if (t !== null) {
                            t.setRowSelection(selectedList);
                        }
                    },
                    checkedRowsNumber: selectedList.length,
                    multipleSelection: this.props.multipleSelection,
                    columns: this.tableColumns,
                    data: displayedDrives,
                    disabledRows: disabledDrives,
                    getRowClass: row => isDrivelistDrive(row) && row.isSystem ? [ "system" ] : [],
                    rowKey: "displayName",
                    onCheck: rows => {
                        let newSelection = rows.filter(isDrivelistDrive);
                        if (this.props.multipleSelection) {
                            if (rows.length === 0) {
                                newSelection = [];
                            }
                            const deselecting = selectedList.filter((selected => newSelection.filter((row => row.device === selected.device)).length === 0));
                            const selecting = newSelection.filter((row => selectedList.filter((selected => row.device === selected.device)).length === 0));
                            deselecting.concat(selecting).forEach((row => {
                                if (this.props.onSelect) {
                                    this.props.onSelect(row);
                                }
                            }));
                            this.setState({
                                selectedList: newSelection
                            });
                            return;
                        }
                        if (this.props.onSelect) {
                            this.props.onSelect(newSelection[newSelection.length - 1]);
                        }
                        this.setState({
                            selectedList: newSelection.slice(newSelection.length - 1)
                        });
                    },
                    onRowClick: row => {
                        if (!isDrivelistDrive(row) || this.driveShouldBeDisabled(row, image)) {
                            return;
                        }
                        if (this.props.onSelect) {
                            this.props.onSelect(row);
                        }
                        const index = selectedList.findIndex((d => d.device === row.device));
                        const newList = this.props.multipleSelection ? [ ...selectedList ] : [];
                        if (index === -1) {
                            newList.push(row);
                        } else {
                            newList.splice(index, 1);
                        }
                        this.setState({
                            selectedList: newList
                        });
                    }
                }), numberOfHiddenSystemDrives > 0 && react.createElement(Link, {
                    mt: 15,
                    mb: 15,
                    fontSize: "14px",
                    onClick: () => this.setState({
                        showSystemDrives: true
                    })
                }, react.createElement(Flex, {
                    alignItems: "center"
                }, react.createElement(chevron_down, {
                    height: "1em",
                    fill: "currentColor"
                }), react.createElement(Txt, {
                    ml: 8
                }, "Show ", numberOfHiddenSystemDrives, " hidden")))), this.props.showWarnings && hasSystemDrives ? react.createElement(styled_components_Alert, {
                    className: "system-drive-alert",
                    style: {
                        width: "67%"
                    }
                }, "Selecting your system drive is dangerous and will erase your drive!") : null, missingDriversModal.drive !== undefined && react.createElement(styled_components_Modal, {
                    width: 400,
                    title: missingDriversModal.drive.linkTitle,
                    cancel: () => this.setState({
                        missingDriversModal: {}
                    }),
                    done: () => {
                        try {
                            if (missingDriversModal.drive !== undefined) {
                                open_external_open(missingDriversModal.drive.link);
                            }
                        } catch (error) {
                            logException(error);
                        } finally {
                            this.setState({
                                missingDriversModal: {}
                            });
                        }
                    },
                    action: "Yes, continue",
                    cancelButtonProps: {
                        children: "Cancel"
                    },
                    children: missingDriversModal.drive.linkMessage || `Etcher will open ${missingDriversModal.drive.link} in your browser`
                }));
            }
        }
        const recentUrlImagesKey = "recentUrlImages";
        function normalizeRecentUrlImages(urls) {
            if (!Array.isArray(urls)) {
                urls = [];
            }
            urls = urls.map((url => {
                try {
                    return new URL(url);
                } catch (error) {}
            })).filter((url => url !== undefined));
            urls = lodash.uniqBy(urls, (url => url.href));
            return urls.slice(urls.length - 5);
        }
        function getRecentUrlImages() {
            let urls = [];
            try {
                urls = JSON.parse(localStorage.getItem(recentUrlImagesKey) || "[]");
            } catch {}
            return normalizeRecentUrlImages(urls);
        }
        function setRecentUrlImages(urls) {
            const normalized = normalizeRecentUrlImages(urls.map((url => url.href)));
            localStorage.setItem(recentUrlImagesKey, JSON.stringify(normalized));
        }
        const isURL = imagePath => imagePath.startsWith("https://") || imagePath.startsWith("http://");
        const source_selector_Card = (0, styled_components_browser_esm.default)(Card)`
	hr {
		margin: 5px 0;
	}
`;
        const ModalText = styled_components_browser_esm.default.p`
	a {
		color: rgb(0, 174, 239);

		&:hover {
			color: rgb(0, 139, 191);
		}
	}
`;
        function getState() {
            const image = getImage();
            return {
                hasImage: hasImage(),
                imageName: image === null || image === void 0 ? void 0 : image.name,
                imageSize: image === null || image === void 0 ? void 0 : image.size
            };
        }
        function isString(value) {
            return typeof value === "string";
        }
        const URLSelector = ({done, cancel}) => {
            const [imageURL, setImageURL] = react.useState("");
            const [recentImages, setRecentImages] = react.useState([]);
            const [loading, setLoading] = react.useState(false);
            const [showBasicAuth, setShowBasicAuth] = react.useState(false);
            const [username, setUsername] = react.useState("");
            const [password, setPassword] = react.useState("");
            react.useEffect((() => {
                const fetchRecentUrlImages = async () => {
                    const recentUrlImages = await getRecentUrlImages();
                    setRecentImages(recentUrlImages);
                };
                fetchRecentUrlImages();
            }), []);
            return react.createElement(styled_components_Modal, {
                cancel,
                primaryButtonProps: {
                    disabled: loading || !imageURL
                },
                action: loading ? react.createElement(Spinner, null) : "OK",
                done: async () => {
                    setLoading(true);
                    const urlStrings = recentImages.map((url => url.href));
                    const normalizedRecentUrls = normalizeRecentUrlImages([ ...urlStrings, imageURL ]);
                    setRecentUrlImages(normalizedRecentUrls);
                    const auth = username ? {
                        username,
                        password
                    } : undefined;
                    await done(imageURL, auth);
                }
            }, react.createElement(Flex, {
                flexDirection: "column"
            }, react.createElement(Flex, {
                mb: 15,
                style: {
                    width: "100%"
                },
                flexDirection: "column"
            }, react.createElement(Txt, {
                mb: "10px",
                fontSize: "24px"
            }, "Use Image URL"), react.createElement(Input, {
                value: imageURL,
                placeholder: "Enter a valid URL",
                type: "text",
                onChange: evt => setImageURL(evt.target.value)
            }), react.createElement(Link, {
                mt: 15,
                mb: 15,
                fontSize: "14px",
                onClick: () => {
                    if (showBasicAuth) {
                        setUsername("");
                        setPassword("");
                    }
                    setShowBasicAuth(!showBasicAuth);
                }
            }, react.createElement(Flex, {
                alignItems: "center"
            }, showBasicAuth && react.createElement(chevron_down, {
                height: "1em",
                fill: "currentColor"
            }), !showBasicAuth && react.createElement(chevron_right, {
                height: "1em",
                fill: "currentColor"
            }), react.createElement(Txt, {
                ml: 8
            }, "Authentication"))), showBasicAuth && react.createElement(react.Fragment, null, react.createElement(Input, {
                mb: 15,
                value: username,
                placeholder: "Enter username",
                type: "text",
                onChange: evt => setUsername(evt.target.value)
            }), react.createElement(Input, {
                value: password,
                placeholder: "Enter password",
                type: "password",
                onChange: evt => setPassword(evt.target.value)
            }))), recentImages.length > 0 && react.createElement(Flex, {
                flexDirection: "column",
                height: "78.6%"
            }, react.createElement(Txt, {
                fontSize: 18
            }, "Recent"), react.createElement(ScrollableFlex, {
                flexDirection: "column"
            }, react.createElement(source_selector_Card, {
                p: "10px 15px",
                rows: recentImages.map((recent => react.createElement(Txt, {
                    key: recent.href,
                    onClick: () => {
                        setImageURL(recent.href);
                    },
                    style: {
                        overflowWrap: "break-word"
                    }
                }, recent.pathname.split("/").pop(), " - ", recent.href))).reverse()
            })))));
        };
        const FlowSelector = (0, styled_components_browser_esm.default)((({flow, ...props}) => react.createElement(StepButton, Object.assign({
            plain: !props.primary,
            primary: props.primary,
            onClick: evt => flow.onClick(evt),
            icon: flow.icon
        }, props), flow.label)))`
	border-radius: 24px;
	color: rgba(255, 255, 255, 0.7);

	:enabled:focus,
	:enabled:focus svg {
		color: ${app_theme_colors.primary.foreground} !important;
	}

	:enabled:hover {
		background-color: ${app_theme_colors.primary.background};
		color: ${app_theme_colors.primary.foreground};
		font-weight: 600;

		svg {
			color: ${app_theme_colors.primary.foreground}!important;
		}
	}
`;
        class SourceSelector extends react.Component {
            constructor(props) {
                super(props);
                this.state = {
                    ...getState(),
                    warning: null,
                    showImageDetails: false,
                    showURLSelector: false,
                    showDriveSelector: false,
                    defaultFlowActive: true,
                    imageSelectorOpen: false,
                    imageLoading: false
                };
                this.onSelectImage = this.onSelectImage.bind(this);
            }
            componentDidMount() {
                this.unsubscribe = observe((() => {
                    this.setState(getState());
                }));
                external_electron_.ipcRenderer.on("select-image", this.onSelectImage);
                external_electron_.ipcRenderer.send("source-selector-ready");
            }
            componentWillUnmount() {
                var _a;
                (_a = this.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(this);
                external_electron_.ipcRenderer.removeListener("select-image", this.onSelectImage);
            }
            async onSelectImage(_event, imagePath) {
                this.setState({
                    imageLoading: true
                });
                await this.selectSource(imagePath, isURL(imagePath) ? build.UI.Http : build.UI.File).promise;
                this.setState({
                    imageLoading: false
                });
            }
            async createSource(selected, SourceType, auth) {
                try {
                    selected = await replaceWindowsNetworkDriveLetter(selected);
                } catch (error) {
                    logException(error);
                }
                if (this.isJson(decodeURIComponent(selected))) {
                    const config = JSON.parse(decodeURIComponent(selected));
                    return new build.UI.Http({
                        url: config.url,
                        axiosInstance: axios_default().create(lodash.omit(config, [ "url" ]))
                    });
                }
                if (SourceType === build.UI.File) {
                    return new build.UI.File({
                        path: selected
                    });
                }
                return new build.UI.Http({
                    url: selected,
                    auth
                });
            }
            isJson(jsonString) {
                try {
                    JSON.parse(jsonString);
                } catch (e) {
                    return false;
                }
                return true;
            }
            reselectSource() {
                logEvent("Reselect image", {
                    previousImage: getImage()
                });
                deselectImage();
            }
            selectSource(selected, SourceType, auth) {
                let cancelled = false;
                return {
                    cancel: () => {
                        cancelled = true;
                    },
                    promise: (async () => {
                        const sourcePath = isString(selected) ? selected : selected.device;
                        let source;
                        let metadata;
                        if (isString(selected)) {
                            if (SourceType === build.UI.Http && !isURL(selected)) {
                                this.handleError("Unsupported protocol", selected, messages_error.unsupportedProtocol());
                                return;
                            }
                            if (looksLikeWindowsImage(selected)) {
                                logEvent("Possibly Windows image", {
                                    image: selected
                                });
                                this.setState({
                                    warning: {
                                        message: warning.looksLikeWindowsImage(),
                                        title: "Possible Windows image detected"
                                    }
                                });
                            }
                            source = await this.createSource(selected, SourceType, auth);
                            if (cancelled) {
                                return;
                            }
                            try {
                                const innerSource = await source.getInnerSource();
                                if (cancelled) {
                                    return;
                                }
                                metadata = await this.getMetadata(innerSource, selected);
                                if (cancelled) {
                                    return;
                                }
                                metadata.SourceType = SourceType;
                                if (!metadata.hasMBR && this.state.warning === null) {
                                    logEvent("Missing partition table", {
                                        metadata
                                    });
                                    this.setState({
                                        warning: {
                                            message: warning.missingPartitionTable(),
                                            title: "Missing partition table"
                                        }
                                    });
                                }
                            } catch (error) {
                                this.handleError("Error opening source", sourcePath, messages_error.openSource(sourcePath, error.message), error);
                            } finally {
                                try {
                                    await source.close();
                                } catch (error) {}
                            }
                        } else {
                            if (selected.partitionTableType === null) {
                                logEvent("Missing partition table", {
                                    selected
                                });
                                this.setState({
                                    warning: {
                                        message: warning.driveMissingPartitionTable(),
                                        title: "Missing partition table"
                                    }
                                });
                            }
                            metadata = {
                                path: selected.device,
                                displayName: selected.displayName,
                                description: selected.displayName,
                                size: selected.size,
                                SourceType: build.UI.BlockDevice,
                                drive: selected
                            };
                        }
                        if (metadata !== undefined) {
                            selectSource(metadata);
                            logEvent("Select image", {
                                image: {
                                    ...metadata,
                                    logo: Boolean(metadata.logo),
                                    blockMap: Boolean(metadata.blockMap)
                                }
                            });
                        }
                    })()
                };
            }
            handleError(title, sourcePath, description, error) {
                const imageError = createUserError({
                    title,
                    description
                });
                showError(imageError);
                if (error) {
                    logException(error);
                    return;
                }
                logEvent(title, {
                    path: sourcePath
                });
            }
            async getMetadata(source, selected) {
                const metadata = await source.getMetadata();
                const partitionTable = await source.getPartitionTable();
                if (partitionTable) {
                    metadata.hasMBR = true;
                    metadata.partitions = partitionTable.partitions;
                } else {
                    metadata.hasMBR = false;
                }
                if (isString(selected)) {
                    metadata.extension = external_path_.extname(selected).slice(1);
                    metadata.path = selected;
                }
                return metadata;
            }
            async openImageSelector() {
                logEvent("Open image selector");
                this.setState({
                    imageSelectorOpen: true
                });
                try {
                    const imagePath = await selectImage();
                    if (!imagePath) {
                        logEvent("Image selector closed");
                        return;
                    }
                    await this.selectSource(imagePath, build.UI.File).promise;
                } catch (error) {
                    report(error);
                } finally {
                    this.setState({
                        imageSelectorOpen: false
                    });
                }
            }
            async onDrop(event) {
                const [file] = event.dataTransfer.files;
                if (file) {
                    await this.selectSource(file.path, build.UI.File).promise;
                }
            }
            openURLSelector() {
                logEvent("Open image URL selector");
                this.setState({
                    showURLSelector: true
                });
            }
            openDriveSelector() {
                logEvent("Open drive selector");
                this.setState({
                    showDriveSelector: true
                });
            }
            onDragOver(event) {
                event.preventDefault();
            }
            onDragEnter(event) {
                event.preventDefault();
            }
            showSelectedImageDetails() {
                var _a;
                logEvent("Show selected image tooltip", {
                    imagePath: (_a = getImage()) === null || _a === void 0 ? void 0 : _a.path
                });
                this.setState({
                    showImageDetails: true
                });
            }
            setDefaultFlowActive(defaultFlowActive) {
                this.setState({
                    defaultFlowActive
                });
            }
            closeModal() {
                this.setState({
                    showDriveSelector: false
                });
            }
            render() {
                var _a;
                const {flashing} = this.props;
                const {showImageDetails, showURLSelector, showDriveSelector, imageLoading} = this.state;
                const selectionImage = getImage();
                let image = selectionImage !== undefined ? selectionImage : {};
                image = (_a = image.drive) !== null && _a !== void 0 ? _a : image;
                let cancelURLSelection = () => {};
                image.name = image.description || image.name;
                const imagePath = image.path || image.displayName || "";
                const imageBasename = external_path_.basename(imagePath);
                const imageName = image.name || "";
                const imageSize = image.size;
                const imageLogo = image.logo || "";
                return react.createElement(react.Fragment, null, react.createElement(Flex, {
                    flexDirection: "column",
                    alignItems: "center",
                    onDrop: evt => this.onDrop(evt),
                    onDragEnter: evt => this.onDragEnter(evt),
                    onDragOver: evt => this.onDragOver(evt)
                }, react.createElement(SVGIcon, {
                    contents: imageLogo,
                    fallback: assets_image,
                    style: {
                        marginBottom: 30
                    }
                }), selectionImage !== undefined || imageLoading ? react.createElement(react.Fragment, null, react.createElement(StepNameButton, {
                    plain: true,
                    onClick: () => this.showSelectedImageDetails(),
                    tooltip: imageName || imageBasename
                }, react.createElement(Spinner, {
                    show: imageLoading
                }, middleEllipsis(imageName || imageBasename, 20))), !flashing && !imageLoading && react.createElement(ChangeButton, {
                    plain: true,
                    mb: 14,
                    onClick: () => this.reselectSource()
                }, "Remove"), !lodash.isNil(imageSize) && !imageLoading && react.createElement(DetailsText, null, pretty_bytes(imageSize))) : react.createElement(react.Fragment, null, react.createElement(FlowSelector, {
                    disabled: this.state.imageSelectorOpen,
                    primary: this.state.defaultFlowActive,
                    key: "Flash from file",
                    flow: {
                        onClick: () => this.openImageSelector(),
                        label: "Flash from file",
                        icon: react.createElement(file, {
                            height: "1em",
                            fill: "currentColor"
                        })
                    },
                    onMouseEnter: () => this.setDefaultFlowActive(false),
                    onMouseLeave: () => this.setDefaultFlowActive(true)
                }), react.createElement(FlowSelector, {
                    key: "Flash from URL",
                    flow: {
                        onClick: () => this.openURLSelector(),
                        label: "Flash from URL",
                        icon: react.createElement(solid_link, {
                            height: "1em",
                            fill: "currentColor"
                        })
                    },
                    onMouseEnter: () => this.setDefaultFlowActive(false),
                    onMouseLeave: () => this.setDefaultFlowActive(true)
                }), react.createElement(FlowSelector, {
                    key: "Clone drive",
                    flow: {
                        onClick: () => this.openDriveSelector(),
                        label: "Clone drive",
                        icon: react.createElement(copy, {
                            height: "1em",
                            fill: "currentColor"
                        })
                    },
                    onMouseEnter: () => this.setDefaultFlowActive(false),
                    onMouseLeave: () => this.setDefaultFlowActive(true)
                }))), this.state.warning != null && react.createElement(Modal, {
                    style: {
                        boxShadow: "0 3px 7px rgba(0, 0, 0, 0.3)"
                    },
                    titleElement: react.createElement("span", null, react.createElement(exclamation_triangle, {
                        fill: "#fca321",
                        height: "1em"
                    }), " ", react.createElement("span", null, this.state.warning.title)),
                    action: "Continue",
                    cancel: () => {
                        this.setState({
                            warning: null
                        });
                        this.reselectSource();
                    },
                    done: () => {
                        this.setState({
                            warning: null
                        });
                    },
                    primaryButtonProps: {
                        warning: true,
                        primary: false
                    }
                }, react.createElement(ModalText, {
                    dangerouslySetInnerHTML: {
                        __html: this.state.warning.message
                    }
                })), showImageDetails && react.createElement(Modal, {
                    title: "Image",
                    done: () => {
                        this.setState({
                            showImageDetails: false
                        });
                    }
                }, react.createElement(Txt.p, null, react.createElement(Txt.span, {
                    bold: true
                }, "Name: "), react.createElement(Txt.span, null, imageName || imageBasename)), react.createElement(Txt.p, null, react.createElement(Txt.span, {
                    bold: true
                }, "Path: "), react.createElement(Txt.span, null, imagePath))), showURLSelector && react.createElement(URLSelector, {
                    cancel: () => {
                        cancelURLSelection();
                        this.setState({
                            showURLSelector: false
                        });
                    },
                    done: async (imageURL, auth) => {
                        if (!imageURL) {
                            logEvent("URL selector closed");
                        } else {
                            let promise;
                            ({promise, cancel: cancelURLSelection} = this.selectSource(imageURL, build.UI.Http, auth));
                            await promise;
                        }
                        this.setState({
                            showURLSelector: false
                        });
                    }
                }), showDriveSelector && react.createElement(DriveSelector, {
                    write: false,
                    multipleSelection: false,
                    titleLabel: "Select source",
                    emptyListLabel: "Plug a source drive",
                    emptyListIcon: react.createElement(src, {
                        width: "40px"
                    }),
                    cancel: originalList => {
                        var _a;
                        if (originalList.length) {
                            const originalSource = originalList[0];
                            if (((_a = selectionImage === null || selectionImage === void 0 ? void 0 : selectionImage.drive) === null || _a === void 0 ? void 0 : _a.device) !== originalSource.device) {
                                this.selectSource(originalSource, build.UI.BlockDevice);
                            }
                        } else {
                            deselectImage();
                        }
                        this.closeModal();
                    },
                    done: () => this.closeModal(),
                    onSelect: drive => {
                        var _a, _b;
                        if (drive) {
                            if (((_b = (_a = getImage()) === null || _a === void 0 ? void 0 : _a.drive) === null || _b === void 0 ? void 0 : _b.device) === (drive === null || drive === void 0 ? void 0 : drive.device)) {
                                return deselectImage();
                            }
                            this.selectSource(drive, build.UI.BlockDevice);
                        }
                    }
                }));
            }
        }
        function getDriveWarning(status) {
            switch (status.message) {
              case compatibility.containsImage():
                return warning.sourceDrive();

              case compatibility.largeDrive():
                return warning.largeDriveSize();

              case compatibility.system():
                return warning.systemDrive();

              default:
                return "";
            }
        }
        const DriveCompatibilityWarning = ({warnings, ...props}) => {
            const systemDrive = warnings.find((message => message === warning.systemDrive()));
            return react.createElement(Flex, Object.assign({
                tooltip: warnings.join(", ")
            }, props), react.createElement(exclamation_triangle, {
                fill: systemDrive ? "#fca321" : "#8f9297",
                height: "1em"
            }));
        };
        function TargetSelectorButton(props) {
            const targets = getSelectedDrives();
            if (targets.length === 1) {
                const target = targets[0];
                const warnings = getDriveImageCompatibilityStatuses(target, getImage(), true).map(getDriveWarning);
                return react.createElement(react.Fragment, null, react.createElement(StepNameButton, {
                    plain: true,
                    tooltip: props.tooltip
                }, warnings.length > 0 && react.createElement(DriveCompatibilityWarning, {
                    warnings,
                    mr: 2
                }), middleEllipsis(target.description, 20)), !props.flashing && react.createElement(ChangeButton, {
                    plain: true,
                    mb: 14,
                    onClick: props.reselectDrive
                }, "Change"), target.size != null && react.createElement(DetailsText, null, pretty_bytes(target.size)));
            }
            if (targets.length > 1) {
                const targetsTemplate = [];
                for (const target of targets) {
                    const warnings = getDriveImageCompatibilityStatuses(target, getImage(), true).map(getDriveWarning);
                    targetsTemplate.push(react.createElement(DetailsText, {
                        key: target.device,
                        tooltip: `${target.description} ${target.displayName} ${target.size != null ? pretty_bytes(target.size) : ""}`,
                        px: 21
                    }, warnings.length > 0 ? react.createElement(DriveCompatibilityWarning, {
                        warnings,
                        mr: 2
                    }) : null, react.createElement(Txt, {
                        mr: 2
                    }, middleEllipsis(target.description, 14)), target.size != null && react.createElement(Txt, null, pretty_bytes(target.size))));
                }
                return react.createElement(react.Fragment, null, react.createElement(StepNameButton, {
                    plain: true,
                    tooltip: props.tooltip
                }, targets.length, " Targets"), !props.flashing && react.createElement(ChangeButton, {
                    plain: true,
                    onClick: props.reselectDrive,
                    mb: 14
                }, "Change"), targetsTemplate);
            }
            return react.createElement(StepButton, {
                primary: true,
                tabIndex: targets.length > 0 ? -1 : 2,
                disabled: props.disabled,
                onClick: props.openDriveSelector
            }, "Select target");
        }
        function tgt_extends() {
            tgt_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return tgt_extends.apply(this, arguments);
        }
        var tgt_ref = react.createElement("g", {
            fill: "none",
            fillRule: "evenodd"
        }, react.createElement("path", {
            fill: "#2A506F",
            fillRule: "nonzero",
            d: "M31.38 39.87H8.017v23.21c0 .69.561 1.25 1.251 1.25H30.13a1.25 1.25 0 001.251-1.25V39.87zm-22.363 1H30.38v22.21a.25.25 0 01-.25.25H9.267l-.057-.007a.252.252 0 01-.194-.244V40.87z"
        }), react.createElement("path", {
            fill: "#2A506F",
            fillRule: "nonzero",
            d: "M17.058 48.925H13.09c-.583 0-1.055.471-1.055 1.055v2.732c0 .582.472 1.054 1.055 1.054h3.967c.582 0 1.054-.472 1.054-1.054v-2.733c0-.582-.472-1.054-1.054-1.054zm-3.967 1h3.967c.03 0 .054.024.054.055v2.732c0 .03-.025.054-.054.054H13.09a.055.055 0 01-.055-.054v-2.733c0-.03.024-.054.055-.054zm13.379-1h-3.967c-.583 0-1.055.471-1.055 1.055v2.732c0 .582.472 1.054 1.055 1.054h3.967c.582 0 1.054-.472 1.054-1.054v-2.733c0-.582-.472-1.054-1.054-1.054zm-3.967 1h3.967c.03 0 .054.024.054.055v2.732c0 .03-.025.054-.054.054h-3.967a.055.055 0 01-.055-.054v-2.733c0-.03.024-.054.055-.054z"
        }), react.createElement("path", {
            fill: "#2A506F",
            d: "M37.898 35.952a4.43 4.43 0 01-4.418 4.418H5.918A4.43 4.43 0 011.5 35.952V5.418A4.43 4.43 0 015.918 1H33.48a4.43 4.43 0 014.418 4.418v30.534z"
        }), react.createElement("path", {
            fill: "#2A506F",
            fillRule: "nonzero",
            d: "M33.48 0H5.918A5.431 5.431 0 00.5 5.418v30.534a5.431 5.431 0 005.418 5.418H33.48a5.431 5.431 0 005.418-5.418V5.418A5.431 5.431 0 0033.48 0zM5.918 2H33.48a3.43 3.43 0 013.418 3.418v30.534a3.43 3.43 0 01-3.418 3.418H5.918A3.43 3.43 0 012.5 35.952V5.418A3.43 3.43 0 015.918 2z"
        }), react.createElement("path", {
            fill: "#FFF",
            fillRule: "nonzero",
            d: "M14.067 25v-8.634h2.918v-1.031H9.913v1.031h2.917V25h1.237zm5.869 3.3a5.29 5.29 0 001.51-.199 3.765 3.765 0 001.142-.537c.314-.226.555-.489.722-.789.167-.3.25-.616.25-.95 0-.6-.208-1.034-.626-1.304-.417-.27-1.043-.405-1.878-.405H19.67c-.491 0-.825-.074-1.002-.221a.697.697 0 01-.265-.56c0-.196.044-.36.132-.493.089-.133.197-.253.324-.361.167.078.344.14.53.184.187.044.37.066.546.066a2.93 2.93 0 001.024-.177 2.55 2.55 0 00.832-.493c.236-.211.423-.472.56-.781.138-.31.207-.656.207-1.039 0-.304-.057-.584-.17-.84a2.068 2.068 0 00-.42-.633h1.474v-.928h-2.49a3.308 3.308 0 00-.465-.126 3.057 3.057 0 00-1.591.126 2.557 2.557 0 00-.862.508c-.245.22-.44.489-.582.803a2.547 2.547 0 00-.213 1.06c0 .433.096.813.287 1.142.192.33.405.592.641.789v.059a2.234 2.234 0 00-.53.53c-.167.226-.25.491-.25.796 0 .285.06.523.183.714a1.4 1.4 0 00.45.45v.059a2.93 2.93 0 00-.766.75c-.187.276-.28.566-.28.87 0 .315.07.59.213.825.143.236.344.437.604.604.26.167.572.293.936.376a5.37 5.37 0 001.208.125zm0-6.38a1.462 1.462 0 01-1.068-.456 1.528 1.528 0 01-.332-.538 2.052 2.052 0 01-.118-.714c0-.53.148-.94.442-1.23.295-.29.654-.435 1.076-.435.422 0 .78.145 1.076.434.294.29.442.7.442 1.23 0 .266-.04.504-.118.715a1.503 1.503 0 01-.818.877 1.462 1.462 0 01-.582.118zm.177 5.54c-.648 0-1.157-.112-1.525-.338-.368-.226-.553-.53-.553-.914 0-.206.06-.412.177-.619.118-.206.305-.402.56-.589.157.05.317.081.479.096.162.015.312.022.45.022h1.237c.471 0 .83.064 1.075.191.246.128.369.359.369.693 0 .186-.054.368-.162.545-.108.177-.26.332-.457.464-.197.133-.435.24-.715.324-.28.084-.591.125-.935.125zm7.077-2.283c.225 0 .454-.027.685-.081.23-.054.444-.116.64-.184l-.235-.914c-.118.05-.25.093-.398.133a1.619 1.619 0 01-.413.059c-.412 0-.7-.12-.861-.361-.162-.241-.244-.582-.244-1.024v-3.978h1.93v-.987h-1.93v-2.004h-1.016L25.2 17.84l-1.12.073v.914h1.06v3.963c0 .354.035.678.104.972.068.295.184.546.346.752.162.206.373.368.634.486.26.118.581.177.965.177z"
        }), react.createElement("path", {
            fill: "#2A506F",
            fillRule: "nonzero",
            d: "M19.647 73.55c.245 0 .45.178.492.41l.008.09v14.883a.5.5 0 01-.992.09l-.008-.09V74.05a.5.5 0 01.5-.5z"
        }), react.createElement("path", {
            fill: "#2A506F",
            fillRule: "nonzero",
            d: "M14.682 83.856a.5.5 0 01.639-.05l.068.058 4.615 4.719a.5.5 0 01-.646.757l-.068-.058-4.615-4.719a.5.5 0 01.007-.707z"
        }), react.createElement("path", {
            fill: "#2A506F",
            fillRule: "nonzero",
            d: "M24.016 83.96a.5.5 0 01.758.646l-.058.07-4.72 4.614a.5.5 0 01-.757-.646l.058-.069 4.72-4.615z"
        }));
        function SvgTgt(props) {
            return react.createElement("svg", tgt_extends({
                xmlns: "http://www.w3.org/2000/svg",
                width: 39,
                height: 90
            }, props), tgt_ref);
        }
        const tgt = SvgTgt;
        const getDriveListLabel = () => getSelectedDrives().map((drive => `${drive.description} (${drive.displayName})`)).join("\n");
        const getDriveSelectionStateSlice = () => ({
            driveListLabel: getDriveListLabel(),
            targets: getSelectedDrives(),
            image: getImage()
        });
        const TargetSelectorModal = props => react.createElement(DriveSelector, Object.assign({
            multipleSelection: true,
            titleLabel: "Select target",
            emptyListLabel: "Plug a target drive",
            emptyListIcon: react.createElement(tgt, {
                width: "40px"
            }),
            showWarnings: true,
            selectedList: getSelectedDrives(),
            updateSelectedList: getSelectedDrives
        }, props));
        const selectAllTargets = modalTargets => {
            const selectedDrivesFromState = getSelectedDrives();
            const deselected = selectedDrivesFromState.filter((drive => !modalTargets.find((modalTarget => modalTarget.device === drive.device))));
            deselected.forEach((drive => {
                logEvent("Toggle drive", {
                    drive,
                    previouslySelected: true
                });
                deselectDrive(drive.device);
            }));
            modalTargets.forEach((drive => {
                if (!isDriveSelected(drive.device)) {
                    logEvent("Toggle drive", {
                        drive,
                        previouslySelected: false
                    });
                }
                selectDrive(drive.device);
            }));
        };
        const TargetSelector = ({disabled, hasDrive, flashing}) => {
            const [{driveListLabel, targets}, setStateSlice] = react.useState(getDriveSelectionStateSlice());
            const [showTargetSelectorModal, setShowTargetSelectorModal] = react.useState(false);
            react.useEffect((() => observe((() => {
                setStateSlice(getDriveSelectionStateSlice());
            }))), []);
            const hasSystemDrives = targets.some((target => target.isSystem));
            return react.createElement(Flex, {
                flexDirection: "column",
                alignItems: "center"
            }, react.createElement(drive, {
                className: disabled ? "disabled" : "",
                width: "40px",
                style: {
                    marginBottom: 30
                }
            }), react.createElement(TargetSelectorButton, {
                disabled,
                show: !hasDrive,
                tooltip: driveListLabel,
                openDriveSelector: () => {
                    setShowTargetSelectorModal(true);
                },
                reselectDrive: () => {
                    logEvent("Reselect drive");
                    setShowTargetSelectorModal(true);
                },
                flashing,
                targets
            }), hasSystemDrives ? react.createElement(Txt, {
                color: "#fca321",
                style: {
                    position: "absolute",
                    bottom: "25px"
                }
            }, "Warning: ", warning.systemDrive()) : null, showTargetSelectorModal && react.createElement(TargetSelectorModal, {
                write: true,
                cancel: originalList => {
                    if (originalList.length) {
                        selectAllTargets(originalList);
                    } else {
                        deselectAllDrives();
                    }
                    setShowTargetSelectorModal(false);
                },
                done: modalTargets => {
                    if (modalTargets.length === 0) {
                        deselectAllDrives();
                    }
                    setShowTargetSelectorModal(false);
                },
                onSelect: drive => {
                    if (getSelectedDrives().find((selectedDrive => selectedDrive.device === drive.device))) {
                        return deselectDrive(drive.device);
                    }
                    selectDrive(drive.device);
                }
            }));
        };
        var transition = "width linear 250ms";
        var Bar = styled_components_browser_esm.default.div(ProgressBar_templateObject_1 || (ProgressBar_templateObject_1 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\tposition: relative;\n\theight: ", ";\n\toverflow: hidden;\n\tbackground: ", ";\n\ttransition: ", ";\n\ttext-align: center;\n" ], [ "\n\tposition: relative;\n\theight: ", ";\n\toverflow: hidden;\n\tbackground: ", ";\n\ttransition: ", ";\n\ttext-align: center;\n" ])), (function(props) {
            return styledUtils_px(props.emphasized ? props.theme.space[5] : props.theme.space[4]);
        }), (function(props) {
            return props.bg || props.theme.colors.primary.main;
        }), transition);
        var LoadingContent = styled_components_browser_esm.default.div(ProgressBar_templateObject_2 || (ProgressBar_templateObject_2 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tbottom: 0;\n\tright: 0;\n\ttext-align: center;\n\tcolor: #000;\n\ttext-shadow: 0 0 3px rgba(255, 255, 255, 0.5);\n" ], [ "\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tbottom: 0;\n\tright: 0;\n\ttext-align: center;\n\tcolor: #000;\n\ttext-shadow: 0 0 3px rgba(255, 255, 255, 0.5);\n" ])));
        var Content = styled_components_browser_esm.default.div(ProgressBar_templateObject_3 || (ProgressBar_templateObject_3 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\ttext-align: center;\n\tposition: absolute;\n\tleft: 0;\n\tbottom: 0;\n\ttop: 0;\n\ttext-shadow: 0 0 3px rgba(0, 0, 0, 0.5);\n\ttransition: ", ";\n" ], [ "\n\ttext-align: center;\n\tposition: absolute;\n\tleft: 0;\n\tbottom: 0;\n\ttop: 0;\n\ttext-shadow: 0 0 3px rgba(0, 0, 0, 0.5);\n\ttransition: ", ";\n" ])), transition);
        var Sleeve = styled_components_browser_esm.default.div(ProgressBar_templateObject_4 || (ProgressBar_templateObject_4 = (0, 
        tslib_es6.__makeTemplateObject)([ "\n\tposition: relative;\n\tborder-radius: ", ";\n\theight: ", ";\n\tline-height: ", ";\n\tbackground: ", ";\n\tfont-size: ", "em;\n\toverflow: hidden;\n" ], [ "\n\tposition: relative;\n\tborder-radius: ", ";\n\theight: ", ";\n\tline-height: ", ";\n\tbackground: ", ";\n\tfont-size: ", "em;\n\toverflow: hidden;\n" ])), (function(props) {
            return styledUtils_px(props.theme.radius);
        }), (function(props) {
            return styledUtils_px(props.emphasized ? props.theme.space[4] : props.theme.space[3]);
        }), (function(props) {
            return styledUtils_px(props.emphasized ? props.theme.space[4] : props.theme.space[3]);
        }), (function(props) {
            return props.theme.colors.quartenary.main;
        }), (function(props) {
            return props.emphasized ? 1 : .6;
        }));
        var getType = withProps((function(props) {
            var type = find_default()(Object.keys(props), (function(b) {
                return find_default()(Object.keys(props.theme.colors), (function(k) {
                    return k === b;
                }));
            }));
            return Object.assign({}, props, {
                type
            });
        }));
        var setTypeProps = withProps((function(_a) {
            var _b;
            var type = _a.type, theme = _a.theme, background = _a.background, color = _a.color;
            var themeBackground = (_b = theme.colors[type || "primary"]) === null || _b === void 0 ? void 0 : _b.main;
            return {
                color: color || "#fff",
                background: background || themeBackground
            };
        }));
        var ProgressBar_Base = function(_a) {
            var children = _a.children, background = _a.background, value = _a.value, props = (0, 
            tslib_es6.__rest)(_a, [ "children", "background", "value" ]);
            return react.createElement(Sleeve, (0, tslib_es6.__assign)({}, props), react.createElement(LoadingContent, null, children), react.createElement(Bar, {
                bg: background,
                style: {
                    width: value + "%"
                }
            }, react.createElement(Content, {
                style: {
                    width: (value && 100 * 100 / value) + "%"
                }
            }, children)));
        };
        var ProgressBar = asRendition(ProgressBar_Base, [ getType, setTypeProps ], [ "color" ]);
        var ProgressBar_templateObject_1, ProgressBar_templateObject_2, ProgressBar_templateObject_3, ProgressBar_templateObject_4;
        const FlashProgressBar = (0, styled_components_browser_esm.default)(ProgressBar)`
	> div {
		width: 100%;
		height: 12px;
		color: white !important;
		text-shadow: none !important;
		transition-duration: 0s;
		> div {
			transition-duration: 0s;
		}
	}

	width: 100%;
	height: 12px;
	margin-bottom: 6px;
	border-radius: 14px;
	font-size: 16px;
	line-height: 48px;

	background: #2f3033;
`;
        const progress_button_colors = {
            decompressing: "#00aeef",
            flashing: "#da60ff",
            verifying: "#1ac135"
        };
        const CancelButton = (0, styled_components_browser_esm.default)((({type, onClick, ...props}) => {
            const status = type === "verifying" ? "Skip" : "Cancel";
            return react.createElement(Button_Button, Object.assign({
                plain: true,
                onClick: () => onClick(status)
            }, props), status);
        }))`
	font-weight: 600;
	&&& {
		width: auto;
		height: auto;
		font-size: 14px;
	}
`;
        class ProgressButton extends react.PureComponent {
            render() {
                const percentage = this.props.percentage;
                const warning = this.props.warning;
                const {status, position} = fromFlashState({
                    type: this.props.type,
                    percentage,
                    position: this.props.position
                });
                const type = this.props.type || "default";
                if (this.props.active) {
                    return react.createElement(react.Fragment, null, react.createElement(Flex, {
                        alignItems: "baseline",
                        justifyContent: "space-between",
                        width: "100%",
                        style: {
                            marginTop: 42,
                            marginBottom: "6px",
                            fontSize: 16,
                            fontWeight: 600
                        }
                    }, react.createElement(Flex, null, react.createElement(Txt, {
                        color: "#fff"
                    }, status, " "), react.createElement(Txt, {
                        color: progress_button_colors[type]
                    }, position)), type && react.createElement(CancelButton, {
                        type,
                        onClick: this.props.cancel,
                        color: "#00aeef"
                    })), react.createElement(FlashProgressBar, {
                        background: progress_button_colors[type],
                        value: percentage
                    }));
                }
                return react.createElement(StepButton, {
                    primary: !warning,
                    warning,
                    onClick: this.props.callback,
                    disabled: this.props.disabled,
                    style: {
                        marginTop: 30
                    }
                }, "Flash!");
            }
        }
        var node_ipc = __webpack_require__(625);
        var semver = __webpack_require__(639);
        var sudo_prompt = __webpack_require__(686);
        var sudo_dirname = "lib\\shared\\catalina-sudo";
        const execFileAsync = (0, external_util_.promisify)(external_child_process_.execFile);
        const SUCCESSFUL_AUTH_MARKER = "AUTHENTICATION SUCCEEDED";
        const EXPECTED_SUCCESSFUL_AUTH_MARKER = `${SUCCESSFUL_AUTH_MARKER}\n`;
        async function sudo(command) {
            try {
                const {stdout, stderr} = await execFileAsync("sudo", [ "--askpass", "sh", "-c", `echo ${SUCCESSFUL_AUTH_MARKER} && ${command}` ], {
                    encoding: "utf8",
                    env: {
                        PATH: external_process_.env.PATH,
                        SUDO_ASKPASS: (0, external_path_.join)(getAppPath(), sudo_dirname, "sudo-askpass.osascript.js")
                    }
                });
                return {
                    cancelled: false,
                    stdout: stdout.slice(EXPECTED_SUCCESSFUL_AUTH_MARKER.length),
                    stderr
                };
            } catch (error) {
                if (error.code === 1) {
                    if (!error.stdout.startsWith(EXPECTED_SUCCESSFUL_AUTH_MARKER)) {
                        return {
                            cancelled: true
                        };
                    }
                    error.stdout = error.stdout.slice(EXPECTED_SUCCESSFUL_AUTH_MARKER.length);
                }
                throw error;
            }
        }
        const permissions_execAsync = (0, external_util_.promisify)(external_child_process_.exec);
        const permissions_execFileAsync = (0, external_util_.promisify)(external_child_process_.execFile);
        function sudoExecAsync(cmd, options) {
            return new Promise(((resolve, reject) => {
                sudo_prompt.G(cmd, options, ((error, stdout, stderr) => {
                    if (error != null) {
                        reject(error);
                    } else {
                        resolve({
                            stdout,
                            stderr
                        });
                    }
                }));
            }));
        }
        const UNIX_SUPERUSER_USER_ID = 0;
        async function isElevated() {
            if (external_os_.platform() === "win32") {
                try {
                    await permissions_execAsync("fltmc");
                } catch (error) {
                    if (error.code === external_os_.constants.errno.EPERM) {
                        return false;
                    }
                    throw error;
                }
                return true;
            }
            return process.geteuid() === UNIX_SUPERUSER_USER_ID;
        }
        function isElevatedUnixSync() {
            return process.geteuid() === UNIX_SUPERUSER_USER_ID;
        }
        function escapeSh(value) {
            return `'${String(value).replace(/'/g, "'\\''")}'`;
        }
        function escapeParamCmd(value) {
            return `"${String(value).replace(/"/g, '\\"')}"`;
        }
        function setEnvVarSh(value, name) {
            return `export ${name}=${escapeSh(value)}`;
        }
        function setEnvVarCmd(value, name) {
            return `set "${name}=${String(value)}"`;
        }
        function createLaunchScript(command, argv, environment) {
            const isWindows = external_os_.platform() === "win32";
            const lines = [];
            if (isWindows) {
                lines.push("chcp 65001");
            }
            const [setEnvVarFn, escapeFn] = isWindows ? [ setEnvVarCmd, escapeParamCmd ] : [ setEnvVarSh, escapeSh ];
            lines.push(...lodash.map(environment, setEnvVarFn));
            lines.push([ command, ...argv ].map(escapeFn).join(" "));
            return lines.join(external_os_.EOL);
        }
        async function elevateScriptWindows(path, name) {
            const cmd = [ "cmd", "/c", escapeParamCmd(path).replace(/&/g, "^&") ].join(" ");
            await sudoExecAsync(cmd, {
                name
            });
            return {
                cancelled: false
            };
        }
        async function elevateScriptUnix(path, name) {
            const cmd = [ "bash", escapeSh(path) ].join(" ");
            await sudoExecAsync(cmd, {
                name
            });
            return {
                cancelled: false
            };
        }
        async function elevateScriptCatalina(path) {
            const cmd = [ "bash", escapeSh(path) ].join(" ");
            try {
                const {cancelled} = await sudo(cmd);
                return {
                    cancelled
                };
            } catch (error) {
                throw createError({
                    title: error.stderr
                });
            }
        }
        async function elevateCommand(command, options) {
            if (await isElevated()) {
                await permissions_execFileAsync(command[0], command.slice(1), {
                    env: options.environment
                });
                return {
                    cancelled: false
                };
            }
            const isWindows = external_os_.platform() === "win32";
            const launchScript = createLaunchScript(command[0], command.slice(1), options.environment);
            return await (0, tmp.withTmpFile)({
                keepOpen: false,
                prefix: "balena-etcher-electron-",
                postfix: ".cmd"
            }, (async ({path}) => {
                await external_fs_.promises.writeFile(path, launchScript);
                if (isWindows) {
                    return elevateScriptWindows(path, options.applicationName);
                }
                if (external_os_.platform() === "darwin" && semver.compare(external_os_.release(), "19.0.0") >= 0) {
                    return elevateScriptCatalina(path);
                }
                try {
                    return await elevateScriptUnix(path, options.applicationName);
                } catch (error) {
                    console.log("error", error);
                    if (lodash.includes(error.message, "is not in the sudoers file")) {
                        throw createUserError({
                            title: "Your user doesn't have enough privileges to proceed",
                            description: "This application requires sudo privileges to be able to write to drives"
                        });
                    } else if (lodash.startsWith(error.message, "Command failed:")) {
                        throw createUserError({
                            title: "The elevated process died unexpectedly",
                            description: `The process error code was ${error.code}`
                        });
                    } else if (error.message === "User did not grant permission.") {
                        return {
                            cancelled: true
                        };
                    } else if (error.message === "No polkit authentication agent found.") {
                        throw createUserError({
                            title: "No polkit authentication agent found",
                            description: "Please install a polkit authentication agent for your desktop environment of choice to continue"
                        });
                    }
                    throw error;
                }
            }));
        }
        const THREADS_PER_CPU = 16;
        const IPC_SERVER_ID = `etcher-server-${process.pid}`;
        const IPC_CLIENT_ID = `etcher-client-${process.pid}`;
        node_ipc.config.id = IPC_SERVER_ID;
        node_ipc.config.socketRoot = external_path_.join(process.env.XDG_RUNTIME_DIR || external_os_.tmpdir(), external_path_.sep);
        node_ipc.config.silent = true;
        function handleErrorLogging(error, analyticsData) {
            const eventData = {
                ...analyticsData,
                flashInstanceUuid: getFlashUuid()
            };
            if (error.code === "EVALIDATION") {
                logEvent("Validation error", eventData);
            } else if (error.code === "EUNPLUGGED") {
                logEvent("Drive unplugged", eventData);
            } else if (error.code === "EIO") {
                logEvent("Input/output error", eventData);
            } else if (error.code === "ENOSPC") {
                logEvent("Out of space", eventData);
            } else if (error.code === "ECHILDDIED") {
                logEvent("Child died unexpectedly", eventData);
            } else {
                logEvent("Flash error", {
                    ...eventData,
                    error: toJSON(error)
                });
            }
        }
        function terminateServer() {
            for (const socket of node_ipc.server.sockets) {
                socket.destroy();
            }
            node_ipc.server.stop();
        }
        function writerArgv() {
            let entryPoint = external_path_.join(getAppPath(), "generated", "child-writer.js");
            if (external_os_.platform() === "linux" && process.env.APPIMAGE && process.env.APPDIR) {
                entryPoint = entryPoint.replace(process.env.APPDIR, "");
                return [ process.env.APPIMAGE, "-e", `require(\`\${process.env.APPDIR}${entryPoint}\`)` ];
            } else {
                return [ process.argv[0], entryPoint ];
            }
        }
        function writerEnv() {
            return {
                IPC_SERVER_ID,
                IPC_CLIENT_ID,
                IPC_SOCKET_ROOT: node_ipc.config.socketRoot,
                ELECTRON_RUN_AS_NODE: "1",
                UV_THREADPOOL_SIZE: (external_os_.cpus().length * THREADS_PER_CPU).toString(),
                SKIP: "1",
                ...process.platform === "win32" ? {} : process.env
            };
        }
        async function performWrite(image, drives, onProgress) {
            let cancelled = false;
            let skip = false;
            node_ipc.serve();
            const {autoBlockmapping, decompressFirst} = await getAll();
            return await new Promise(((resolve, reject) => {
                node_ipc.server.on("error", (error => {
                    terminateServer();
                    const errorObject = fromJSON(error);
                    reject(errorObject);
                }));
                node_ipc.server.on("log", (message => {
                    console.log(message);
                }));
                const flashResults = {};
                const analyticsData = {
                    image,
                    drives,
                    driveCount: drives.length,
                    uuid: getFlashUuid(),
                    flashInstanceUuid: getFlashUuid()
                };
                node_ipc.server.on("fail", (({device, error}) => {
                    if (device.devicePath) {
                        addFailedDeviceError({
                            device,
                            error
                        });
                    }
                    handleErrorLogging(error, analyticsData);
                }));
                node_ipc.server.on("done", (event => {
                    event.results.errors = event.results.errors.map((data => fromJSON(data)));
                    flashResults.results = event.results;
                }));
                node_ipc.server.on("abort", (() => {
                    terminateServer();
                    cancelled = true;
                }));
                node_ipc.server.on("skip", (() => {
                    terminateServer();
                    skip = true;
                }));
                node_ipc.server.on("state", onProgress);
                node_ipc.server.on("ready", ((_data, socket) => {
                    node_ipc.server.emit(socket, "write", {
                        image,
                        destinations: drives,
                        SourceType: image.SourceType.name,
                        autoBlockmapping,
                        decompressFirst
                    });
                }));
                const argv = writerArgv();
                node_ipc.server.on("start", (async () => {
                    console.log(`Elevating command: ${argv.join(" ")}`);
                    const env = writerEnv();
                    try {
                        const results = await elevateCommand(argv, {
                            applicationName: external_package_json_.displayName,
                            environment: env
                        });
                        flashResults.cancelled = cancelled || results.cancelled;
                        flashResults.skip = skip;
                    } catch (error) {
                        const SIGKILL_EXIT_CODE = 137;
                        if (error.code === SIGKILL_EXIT_CODE) {
                            error.code = "ECHILDDIED";
                        }
                        reject(error);
                    } finally {
                        console.log("Terminating IPC server");
                        terminateServer();
                    }
                    console.log("Flash results", flashResults);
                    if (!flashResults.cancelled && !flashResults.skip && flashResults.results === undefined) {
                        reject(createUserError({
                            title: "The writer process ended unexpectedly",
                            description: "Please try again, and contact the Etcher team if the problem persists"
                        }));
                        return;
                    }
                    resolve(flashResults);
                }));
                node_ipc.server.start();
            }));
        }
        async function image_writer_flash(image, drives, write = performWrite) {
            if (isFlashing()) {
                throw new Error("There is already a flash in progress");
            }
            await setFlashingFlag();
            setDevicePaths(drives.map((d => d.devicePath)).filter((p => p != null)));
            const analyticsData = {
                image,
                drives,
                driveCount: drives.length,
                uuid: getFlashUuid(),
                status: "started",
                flashInstanceUuid: getFlashUuid()
            };
            logEvent("Flash", analyticsData);
            try {
                const result = await write(image, drives, setProgressState);
                await unsetFlashingFlag(result);
            } catch (error) {
                await unsetFlashingFlag({
                    cancelled: false,
                    errorCode: error.code
                });
                window_progress_clear();
                const {results = {}} = getFlashResults();
                const eventData = {
                    ...analyticsData,
                    errors: results.errors,
                    devices: results.devices,
                    status: "failed",
                    error
                };
                logEvent("Write failed", eventData);
                throw error;
            }
            window_progress_clear();
            if (wasLastFlashCancelled()) {
                const eventData = {
                    ...analyticsData,
                    status: "cancel"
                };
                logEvent("Elevation cancelled", eventData);
            } else {
                const {results = {}} = getFlashResults();
                const eventData = {
                    ...analyticsData,
                    errors: results.errors,
                    devices: results.devices,
                    status: "finished",
                    bytesWritten: results.bytesWritten,
                    sourceMetadata: results.sourceMetadata
                };
                logEvent("Done", eventData);
            }
        }
        async function cancel(type) {
            var _a;
            const status = type.toLowerCase();
            const drives = getSelectedDevices();
            const analyticsData = {
                image: (_a = getImage()) === null || _a === void 0 ? void 0 : _a.path,
                drives,
                driveCount: drives.length,
                uuid: getFlashUuid(),
                flashInstanceUuid: getFlashUuid(),
                status
            };
            logEvent("Cancel", analyticsData);
            try {
                const [socket] = node_ipc.server.sockets;
                if (socket !== undefined) {
                    node_ipc.server.emit(socket, status);
                }
            } catch (error) {
                logException(error);
            }
        }
        async function send(title, body, icon) {
            if (!await get("desktopNotifications")) {
                return;
            }
            if (external_electron_.remote.app.dock) {
                external_electron_.remote.app.dock.bounce();
            }
            return new window.Notification(title, {
                body,
                icon
            });
        }
        const DriveStatusWarningModal = ({done, cancel, isSystem, drivesWithWarnings}) => {
            let warningSubtitle = "You are about to erase an unusually large drive";
            let warningCta = "Are you sure the selected drive is not a storage drive?";
            if (isSystem) {
                warningSubtitle = "You are about to erase your computer's drives";
                warningCta = "Are you sure you want to flash your system drive?";
            }
            return react.createElement(styled_components_Modal, {
                footerShadow: false,
                reverseFooterButtons: true,
                done,
                cancel,
                cancelButtonProps: {
                    primary: false,
                    warning: true,
                    children: "Change target"
                },
                action: "Yes, I'm sure",
                primaryButtonProps: {
                    primary: false,
                    outline: true
                }
            }, react.createElement(Flex, {
                flexDirection: "column",
                alignItems: "center",
                justifyContent: "center",
                width: "100%"
            }, react.createElement(Flex, {
                flexDirection: "column"
            }, react.createElement(exclamation_triangle, {
                height: "2em",
                fill: "#fca321"
            }), react.createElement(Txt, {
                fontSize: "24px",
                color: "#fca321"
            }, "WARNING!")), react.createElement(Txt, {
                fontSize: "24px"
            }, warningSubtitle), react.createElement(ScrollableFlex, {
                flexDirection: "column",
                backgroundColor: "#fff5e6",
                m: "2em 0",
                p: "1em 2em",
                width: "420px",
                maxHeight: "100px"
            }, drivesWithWarnings.map(((drive, i, array) => react.createElement(react.Fragment, null, react.createElement(Flex, {
                justifyContent: "space-between",
                alignItems: "baseline"
            }, react.createElement("strong", null, middleEllipsis(drive.description, 28)), " ", drive.size && pretty_bytes(drive.size) + " ", react.createElement(Badge, {
                shade: 5
            }, drive.statuses[0].message)), i !== array.length - 1 ? react.createElement("hr", {
                style: {
                    width: "100%"
                }
            }) : null)))), react.createElement(Txt, {
                style: {
                    fontWeight: 600
                }
            }, warningCta)));
        };
        const drive_status_warning_modal = DriveStatusWarningModal;
        const COMPLETED_PERCENTAGE = 100;
        const SPEED_PRECISION = 2;
        const getErrorMessageFromCode = errorCode => {
            if (errorCode === "EVALIDATION") {
                return messages_error.validation();
            } else if (errorCode === "EUNPLUGGED") {
                return messages_error.driveUnplugged();
            } else if (errorCode === "EIO") {
                return messages_error.inputOutput();
            } else if (errorCode === "ENOSPC") {
                return messages_error.notEnoughSpaceInDrive();
            } else if (errorCode === "ECHILDDIED") {
                return messages_error.childWriterDied();
            }
            return "";
        };
        function notifySuccess(iconPath, basename, drives, devices) {
            send("Flash complete!", info.flashComplete(basename, drives, devices), iconPath);
        }
        function notifyFailure(iconPath, basename, drives) {
            send("Oops! Looks like the flash failed.", messages_error.flashFailure(basename, drives), iconPath);
        }
        async function flashImageToDrive(isFlashing, goToSuccess) {
            const devices = getSelectedDevices();
            const image = getImage();
            const drives = getDrives().filter((drive => devices.includes(drive.device)));
            if (drives.length === 0 || isFlashing) {
                return "";
            }
            scanner.stop();
            const iconPath = external_path_.join("media", "icon.png");
            const basename = external_path_.basename(image.path);
            try {
                await image_writer_flash(image, drives);
                if (!wasLastFlashCancelled()) {
                    const {results = {
                        devices: {
                            successful: 0,
                            failed: 0
                        }
                    }, skip, cancelled} = getFlashResults();
                    if (!skip && !cancelled) {
                        if (results.devices.successful > 0) {
                            notifySuccess(iconPath, basename, drives, results.devices);
                        } else {
                            notifyFailure(iconPath, basename, drives);
                        }
                    }
                    goToSuccess();
                }
            } catch (error) {
                notifyFailure(iconPath, basename, drives);
                let errorMessage = getErrorMessageFromCode(error.code);
                if (!errorMessage) {
                    error.image = basename;
                    logException(error);
                    errorMessage = messages_error.genericFlashError(error);
                }
                return errorMessage;
            } finally {
                setDrives([]);
                scanner.start();
            }
            return "";
        }
        const formatSeconds = totalSeconds => {
            if (typeof totalSeconds !== "number" || !Number.isFinite(totalSeconds)) {
                return "";
            }
            const minutes = Math.floor(totalSeconds / 60);
            const seconds = Math.floor(totalSeconds - minutes * 60);
            return `${minutes}m${seconds}s`;
        };
        class FlashStep extends react.PureComponent {
            constructor(props) {
                super(props);
                this.state = {
                    warningMessage: false,
                    errorMessage: "",
                    showDriveSelectorModal: false,
                    systemDrives: false,
                    drivesWithWarnings: []
                };
            }
            async handleWarningResponse(shouldContinue) {
                this.setState({
                    warningMessage: false
                });
                if (!shouldContinue) {
                    this.setState({
                        showDriveSelectorModal: true
                    });
                    return;
                }
                this.setState({
                    errorMessage: await flashImageToDrive(this.props.isFlashing, this.props.goToSuccess)
                });
            }
            handleFlashErrorResponse(shouldRetry) {
                this.setState({
                    errorMessage: ""
                });
                resetState();
                if (shouldRetry) {
                    logEvent("Restart after failure");
                } else {
                    clear();
                }
            }
            hasListWarnings(drives) {
                if (drives.length === 0 || isFlashing()) {
                    return;
                }
                return drives.filter((drive => drive.isSystem)).length > 0;
            }
            async tryFlash() {
                const drives = getSelectedDrives().map((drive => ({
                    ...drive,
                    statuses: getDriveImageCompatibilityStatuses(drive, undefined, true)
                })));
                if (drives.length === 0 || this.props.isFlashing) {
                    return;
                }
                const hasDangerStatus = drives.some((drive => drive.statuses.length > 0));
                if (hasDangerStatus) {
                    const systemDrives = drives.some((drive => drive.statuses.includes(statuses.system)));
                    this.setState({
                        systemDrives,
                        drivesWithWarnings: drives.filter((driveWithWarnings => driveWithWarnings.isSystem || !systemDrives && driveWithWarnings.statuses.includes(statuses.large))),
                        warningMessage: true
                    });
                    return;
                }
                this.setState({
                    errorMessage: await flashImageToDrive(this.props.isFlashing, this.props.goToSuccess)
                });
            }
            render() {
                return react.createElement(react.Fragment, null, react.createElement(Flex, {
                    flexDirection: "column",
                    alignItems: "start",
                    width: this.props.width,
                    style: this.props.style
                }, react.createElement(flash, {
                    width: "40px",
                    className: this.props.shouldFlashStepBeDisabled ? "disabled" : "",
                    style: {
                        margin: "0 auto"
                    }
                }), react.createElement(ProgressButton, {
                    type: this.props.step,
                    active: this.props.isFlashing,
                    percentage: this.props.percentage,
                    position: this.props.position,
                    disabled: this.props.shouldFlashStepBeDisabled,
                    cancel,
                    warning: this.hasListWarnings(getSelectedDrives()),
                    callback: () => this.tryFlash()
                }), !lodash.isNil(this.props.speed) && this.props.percentage !== COMPLETED_PERCENTAGE && react.createElement(Flex, {
                    justifyContent: "space-between",
                    fontSize: "14px",
                    color: "#7e8085",
                    width: "100%"
                }, react.createElement(Txt, null, this.props.speed.toFixed(SPEED_PRECISION), " MB/s"), !lodash.isNil(this.props.eta) && react.createElement(Txt, null, "ETA: ", formatSeconds(this.props.eta))), Boolean(this.props.failed) && react.createElement(Flex, {
                    color: "#fff",
                    alignItems: "center",
                    mt: 35
                }, react.createElement(circle, {
                    height: "1em",
                    fill: "#ff4444"
                }), react.createElement(Txt, {
                    ml: 10
                }, this.props.failed), react.createElement(Txt, {
                    ml: 10
                }, progress.failed(this.props.failed)))), this.state.warningMessage && react.createElement(drive_status_warning_modal, {
                    done: () => this.handleWarningResponse(true),
                    cancel: () => this.handleWarningResponse(false),
                    isSystem: this.state.systemDrives,
                    drivesWithWarnings: this.state.drivesWithWarnings
                }), this.state.errorMessage && react.createElement(Modal, {
                    width: 400,
                    titleElement: "Attention",
                    cancel: () => this.handleFlashErrorResponse(false),
                    done: () => this.handleFlashErrorResponse(true),
                    action: "Retry"
                }, react.createElement(Txt, null, this.state.errorMessage.split("\n").map(((message, key) => react.createElement("p", {
                    key
                }, message))))), this.state.showDriveSelectorModal && react.createElement(TargetSelectorModal, {
                    write: true,
                    cancel: () => this.setState({
                        showDriveSelectorModal: false
                    }),
                    done: modalTargets => {
                        selectAllTargets(modalTargets);
                        this.setState({
                            showDriveSelectorModal: false
                        });
                    }
                }));
            }
        }
        function etcher_extends() {
            etcher_extends = Object.assign || function(target) {
                for (var i = 1; i < arguments.length; i++) {
                    var source = arguments[i];
                    for (var key in source) {
                        if (Object.prototype.hasOwnProperty.call(source, key)) {
                            target[key] = source[key];
                        }
                    }
                }
                return target;
            };
            return etcher_extends.apply(this, arguments);
        }
        var etcher_ref = react.createElement("style", null, ".etcher_svg__st5{fill:#a5de37}.etcher_svg__st6{fill:#c8f178}");
        var _ref2 = react.createElement("g", {
            id: "etcher_svg__Ebene_1"
        }, react.createElement("path", {
            d: "M88.8 19.7h6.7v11.1h.1c.7-1 1.7-1.7 2.9-2.3 1.2-.5 2.5-.9 3.8-1.1.3 0 .7-.1 1-.1h.9c4.1 0 7.5 1.4 10.1 4.1 2.6 2.7 3.9 5.9 3.9 9.4 0 .5 0 1.1-.1 1.6-.1.6-.2 1.1-.4 1.7-.3 1.1-.7 2.2-1.2 3.2s-1.2 2-1.9 2.7c-1.2 1.4-2.8 2.4-4.6 3.1-1.8.7-3.7 1.1-5.6 1.1-1.9 0-3.7-.3-5.3-1-1.6-.7-3-1.7-4.1-3.2h-.1v3.4h-6.2V19.7zm8.8 15.7c-1.7 1.4-2.5 3.1-2.5 5.2 0 2.2.8 4.1 2.3 5.6 1.5 1.5 3.6 2.3 6.1 2.3 2.4 0 4.3-.7 5.8-2.2 1.5-1.4 2.2-3.2 2.2-5.4 0-2.1-.7-3.9-2.2-5.4-1.5-1.5-3.4-2.2-5.8-2.2-2.3 0-4.2.7-5.9 2.1zm52.7 18.2h-6.2v-3.4h-.1c-.8 1.1-1.9 2-3.3 2.7-1.4.7-2.8 1.2-4.3 1.4-.3 0-.6.1-.9.1h-.9c-2.2 0-4.1-.4-5.8-1.1-1.7-.7-3.2-1.8-4.4-3.1-1.1-1.2-2-2.6-2.6-4.2-.6-1.6-.9-3.3-.9-5 0-1.8.3-3.4.8-4.9.6-1.5 1.5-2.9 2.7-4.2 1.4-1.5 3-2.6 4.7-3.3 1.7-.7 3.6-1.1 5.7-1.1 1.9 0 3.7.4 5.3 1.1 1.6.7 3 1.8 4.1 3.3v-3.6h6.2v25.3zM144 40.8c0-2.1-.7-3.9-2.2-5.3-1.5-1.5-3.4-2.2-5.8-2.1-2.5 0-4.5.7-6 2.2-1.6 1.5-2.3 3.4-2.3 5.6 0 2.1.8 3.8 2.4 5.2 1.6 1.4 3.6 2.1 5.8 2.1 2.4 0 4.4-.7 5.9-2.2 1.4-1.4 2.2-3.3 2.2-5.5zm11.3-21.1h6.7v33.9h-6.7V19.7zm18 23.9c.5 1.5 1.4 2.7 2.8 3.6 1.4.9 2.9 1.3 4.6 1.3 1.3 0 2.5-.2 3.6-.6 1.1-.4 2-.9 2.6-1.6h7.4c-.8 2.3-2.5 4.2-5.1 5.8-2.6 1.6-5.3 2.4-8.3 2.4-4.1 0-7.5-1.3-10.4-3.9-2.9-2.6-4.3-5.7-4.3-9.4 0-3.8 1.4-7 4.3-9.7 2.9-2.7 6.4-4 10.5-4 4 0 7.4 1.3 10.2 4 2.8 2.7 4.2 5.8 4.2 9.3 0 .4 0 .8-.1 1.2-.1.4-.1.8-.2 1.1 0 .1-.1.2-.1.3v.3h-21.7zm15.3-5.4c-.5-1.5-1.5-2.7-2.9-3.5-1.4-.9-3-1.3-4.7-1.3h-.4c-1.6.1-3.1.6-4.5 1.4-1.4.9-2.4 2-2.8 3.4h15.3zm11.1-10h6.2v2.3h.1c.8-.9 1.8-1.7 3-2.2 1.3-.5 2.6-.8 4-.9h1.4c1.3.1 2.6.4 3.9 1 1.3.5 2.3 1.3 3.3 2.2.1.1.3.2.4.3.1.1.2.2.3.4 1.1 1.4 1.7 2.8 1.9 4.4s.3 3.1.3 4.8v13.1h-6.7V40.4c0-.4 0-.9-.1-1.3-.1-.7-.2-1.3-.4-1.9-.2-.6-.4-1.2-.8-1.7-.4-.6-1-1.1-1.8-1.5-.8-.4-1.5-.6-2.3-.6h-1c-.8.1-1.5.3-2.3.7-.7.4-1.3.9-1.7 1.5-.3.5-.6 1.1-.8 1.7-.2.7-.3 1.3-.3 2v14.3h-6.7V28.2zm58.5 25.4H252v-3.4h-.1c-.8 1.1-1.9 2-3.3 2.7-1.4.7-2.8 1.2-4.3 1.4-.3 0-.6.1-.9.1h-.9c-2.2 0-4.1-.4-5.8-1.1-1.7-.7-3.2-1.8-4.4-3.1-1.1-1.2-2-2.6-2.6-4.2-.6-1.6-.9-3.3-.9-5 0-1.8.3-3.4.8-4.9.6-1.5 1.5-2.9 2.7-4.2 1.4-1.5 3-2.6 4.7-3.3 1.7-.7 3.6-1.1 5.7-1.1 1.9 0 3.7.4 5.3 1.1 1.6.7 3 1.8 4.1 3.3v-3.6h6.2v25.3zm-6.4-12.8c0-2.1-.7-3.9-2.2-5.3-1.5-1.5-3.4-2.2-5.8-2.1-2.5 0-4.5.7-6 2.2-1.6 1.5-2.3 3.4-2.3 5.6 0 2.1.8 3.8 2.4 5.2 1.6 1.4 3.6 2.1 5.8 2.1 2.4 0 4.4-.7 5.9-2.2 1.5-1.4 2.2-3.3 2.2-5.5z",
            fill: "#fff"
        }), react.createElement("path", {
            className: "etcher_svg__st5",
            d: "M34.9 43.9v20.6c.9-.2 1.7-.4 2.5-.9l17.1-9.8c2.5-1.4 4-4.1 4-7V27.3c0-.8-.1-1.6-.4-2.3L39.6 35.7c-3.9 2.7-4.7 5.2-4.7 8.2z"
        }), react.createElement("path", {
            className: "etcher_svg__st6",
            d: "M64.9 21l-6.8 3.9c.2.7.4 1.5.4 2.3v19.6c0 2.9-1.6 5.6-4 7l-17.1 9.8c-.8.4-1.6.7-2.5.9v7.8c1.2-.2 2.4-.6 3.4-1.2l22.2-12.7c3.1-1.8 5-5.1 5-8.7V24.3c0-1.1-.2-2.2-.6-3.3z"
        }), react.createElement("path", {
            className: "etcher_svg__st5",
            d: "M33.3 37.4c1-1.6 2.5-3.1 4.7-4.4l18.7-10.8c-.6-.8-1.4-1.5-2.2-2l-17.1-9.8c-2.5-1.4-5.6-1.4-8.1 0l-17 9.8c-.9.5-1.6 1.2-2.3 2L28.6 33c2.2 1.4 3.7 2.8 4.7 4.4z"
        }), react.createElement("path", {
            className: "etcher_svg__st6",
            d: "M12.3 20.3l17-9.8c2.5-1.4 5.6-1.4 8.1 0l17.1 9.8c.9.5 1.6 1.2 2.2 2l6.8-3.9c-.8-1.1-1.8-2-3-2.6L38.3 2.9c-3.1-1.8-6.9-1.8-10 0l-22 12.8c-1.2.7-2.2 1.6-3 2.7l6.8 3.9c.5-.8 1.3-1.5 2.2-2zm17 43.3l-17-9.8c-2.5-1.4-4-4.1-4-7V27.2c0-.8.1-1.5.3-2.2l-6.8-3.9c-.4 1.1-.6 2.1-.6 3.2v25.5c0 3.6 1.9 6.9 5 8.6l22.1 12.7c1 .6 2.2 1 3.4 1.2v-7.8c-.8-.1-1.6-.4-2.4-.9z"
        }), react.createElement("path", {
            className: "etcher_svg__st5",
            d: "M27 35.6L8.6 25c-.2.7-.3 1.5-.3 2.2v19.6c0 2.9 1.5 5.6 4 7l17 9.8c.8.4 1.6.7 2.5.9V43.9c-.1-3-.9-5.5-4.8-8.3zm240.6-16.2H287v7.7h-10.6v5.3h10.3v7.7h-10.3V46H287v7.7h-19.4V19.4zm26.7 14.4h-3.8V28h3.8v-8.5h7.7V28h3.7v5.8H302v19.8h-7.7V33.8zm40.2 10.1c-1.4 5.8-6.5 10.6-13.4 10.6-7.8 0-13.7-6.1-13.7-13.7 0-7.5 5.9-13.6 13.5-13.6 6.8 0 12.3 4.5 13.6 10.8h-7.8c-.8-1.8-2.4-3.6-5.5-3.6-1.8-.1-3.3.6-4.4 1.8-1.1 1.2-1.7 2.9-1.7 4.7 0 3.7 2.4 6.5 6.1 6.5 3.2 0 4.7-1.8 5.5-3.4h7.8zm3.5-24.5h7.7v10.9c1.4-2.3 4-3.2 6.7-3.2 3.9 0 6.2 1.4 7.6 3.6 1.4 2.2 1.8 5.3 1.8 8.5v14.3h-7.7v-14c0-1.4-.2-2.8-.8-3.7-.6-1-1.7-1.6-3.3-1.6-2.1 0-3.2 1-3.7 2.1-.6 1.1-.6 2.4-.6 3v14.2H338V19.4zm35.5 24.1c.3 2.7 2.9 4.5 5.9 4.5 2.4 0 3.7-1.1 4.7-2.4h7.9c-1.2 2.9-3 5.1-5.2 6.6-2.1 1.5-4.7 2.3-7.3 2.3-7.3 0-13.6-6-13.6-13.6 0-7.2 5.6-13.8 13.4-13.8 3.9 0 7.3 1.5 9.7 4.1 3.2 3.5 4.2 7.6 3.6 12.3h-19.1zm11.5-5.9c-.2-1.2-1.8-4.1-5.7-4.1-4 0-5.5 2.9-5.7 4.1H385zm12-9.6h7.2v2.9c.7-1.4 2.1-3.7 6.5-3.7v7.7h-.3c-3.9 0-5.8 1.4-5.8 5v13.8H397V28z"
        }));
        function SvgEtcher(props) {
            return react.createElement("svg", etcher_extends({
                xmlns: "http://www.w3.org/2000/svg",
                viewBox: "0 0 412.1 74"
            }, props), etcher_ref, _ref2);
        }
        const etcher = SvgEtcher;
        const Icon = (0, styled_components_browser_esm.default)(IconButton)`
	margin-right: 20px;
`;
        function getDrivesTitle() {
            const drives = getSelectedDrives();
            if (drives.length === 1) {
                return drives[0].description || "Untitled Device";
            }
            if (drives.length === 0) {
                return "No targets found";
            }
            return `${drives.length} Targets`;
        }
        function getImageBasename(image) {
            if (image === undefined) {
                return "";
            }
            if (image.drive) {
                return image.drive.description;
            }
            const imageBasename = external_path_.basename(image.path);
            return image.name || imageBasename;
        }
        const StepBorder = styled_components_browser_esm.default.div`
	position: relative;
	height: 2px;
	background-color: ${props => props.disabled ? props.theme.colors.dark.disabled.foreground : props.theme.colors.dark.foreground};
	width: 120px;
	top: 19px;

	left: ${props => props.left ? "-67px" : undefined};
	margin-right: ${props => props.left ? "-120px" : undefined};
	right: ${props => props.right ? "-67px" : undefined};
	margin-left: ${props => props.right ? "-120px" : undefined};
`;
        class MainPage extends react.Component {
            constructor(props) {
                super(props);
                this.state = {
                    current: "main",
                    isWebviewShowing: false,
                    hideSettings: true,
                    ...this.stateHelper()
                };
            }
            stateHelper() {
                const image = getImage();
                return {
                    isFlashing: isFlashing(),
                    hasImage: hasImage(),
                    hasDrive: hasDrive(),
                    imageLogo: image === null || image === void 0 ? void 0 : image.logo,
                    imageSize: image === null || image === void 0 ? void 0 : image.size,
                    imageName: getImageBasename(getImage()),
                    driveTitle: getDrivesTitle(),
                    driveLabel: getDriveListLabel()
                };
            }
            async getFeaturedProjectURL() {
                const url = new URL(await get("featuredProjectEndpoint") || "https://assets.balena.io/etcher-featured/index.html");
                url.searchParams.append("borderRight", "false");
                url.searchParams.append("darkBackground", "true");
                return url.toString();
            }
            async componentDidMount() {
                observe((() => {
                    this.setState(this.stateHelper());
                }));
                this.setState({
                    featuredProjectURL: await this.getFeaturedProjectURL()
                });
            }
            renderMain() {
                const state = getFlashState();
                const shouldDriveStepBeDisabled = !this.state.hasImage;
                const shouldFlashStepBeDisabled = !this.state.hasImage || !this.state.hasDrive;
                const notFlashingOrSplitView = !this.state.isFlashing || !this.state.isWebviewShowing;
                return react.createElement(Flex, {
                    m: `110px ${this.state.isWebviewShowing ? 35 : 55}px`,
                    justifyContent: "space-between"
                }, notFlashingOrSplitView && react.createElement(react.Fragment, null, react.createElement(SourceSelector, {
                    flashing: this.state.isFlashing
                }), react.createElement(Flex, null, react.createElement(StepBorder, {
                    disabled: shouldDriveStepBeDisabled,
                    left: true
                })), react.createElement(TargetSelector, {
                    disabled: shouldDriveStepBeDisabled,
                    hasDrive: this.state.hasDrive,
                    flashing: this.state.isFlashing
                }), react.createElement(Flex, null, react.createElement(StepBorder, {
                    disabled: shouldFlashStepBeDisabled,
                    right: true
                }))), this.state.isFlashing && this.state.isWebviewShowing && react.createElement(Flex, {
                    style: {
                        position: "absolute",
                        top: 0,
                        left: 0,
                        width: "36.2vw",
                        height: "100vh",
                        zIndex: 1,
                        boxShadow: "0 2px 15px 0 rgba(0, 0, 0, 0.2)"
                    }
                }, react.createElement(ReducedFlashingInfos, {
                    imageLogo: this.state.imageLogo,
                    imageName: this.state.imageName,
                    imageSize: typeof this.state.imageSize === "number" ? pretty_bytes(this.state.imageSize) : "",
                    driveTitle: this.state.driveTitle,
                    driveLabel: this.state.driveLabel,
                    style: {
                        position: "absolute",
                        color: "#fff",
                        left: 35,
                        top: 72
                    }
                })), this.state.isFlashing && this.state.featuredProjectURL && react.createElement(SafeWebview, {
                    src: this.state.featuredProjectURL,
                    onWebviewShow: isWebviewShowing => {
                        this.setState({
                            isWebviewShowing
                        });
                    },
                    style: {
                        position: "absolute",
                        right: 0,
                        bottom: 0,
                        width: "63.8vw",
                        height: "100vh"
                    }
                }), react.createElement(FlashStep, {
                    width: this.state.isWebviewShowing ? "220px" : "200px",
                    goToSuccess: () => this.setState({
                        current: "success"
                    }),
                    shouldFlashStepBeDisabled,
                    isFlashing: this.state.isFlashing,
                    step: state.type,
                    percentage: state.percentage,
                    position: state.position,
                    failed: state.failed,
                    speed: state.speed,
                    eta: state.eta,
                    style: {
                        zIndex: 1
                    }
                }));
            }
            renderSuccess() {
                return react.createElement(finish, {
                    goToMain: () => {
                        resetState();
                        this.setState({
                            current: "main"
                        });
                    }
                });
            }
            render() {
                return react.createElement(ThemedProvider, {
                    style: {
                        height: "100%",
                        width: "100%"
                    }
                }, react.createElement(Flex, {
                    justifyContent: "space-between",
                    alignItems: "center",
                    paddingTop: "14px",
                    style: {
                        WebkitAppRegion: "drag",
                        position: "relative",
                        zIndex: 2
                    }
                }, react.createElement(Flex, {
                    width: "100%"
                }), react.createElement(Flex, {
                    width: "100%",
                    alignItems: "center",
                    justifyContent: "center"
                }, react.createElement(etcher, {
                    width: "123px",
                    height: "22px",
                    style: {
                        cursor: "pointer"
                    },
                    onClick: () => open_external_open("https://www.balena.io/etcher?ref=etcher_footer"),
                    tabIndex: 100
                })), react.createElement(Flex, {
                    width: "100%",
                    alignItems: "center",
                    justifyContent: "flex-end"
                }, react.createElement(Icon, {
                    icon: react.createElement(cog, {
                        height: "1em",
                        fill: "currentColor"
                    }),
                    plain: true,
                    tabIndex: 5,
                    onClick: () => this.setState({
                        hideSettings: false
                    }),
                    style: {
                        WebkitAppRegion: "no-drag"
                    }
                }), !getSync("disableExternalLinks") && react.createElement(Icon, {
                    icon: react.createElement(question_circle, {
                        height: "1em",
                        fill: "currentColor"
                    }),
                    onClick: () => {
                        var _a;
                        return open_external_open(((_a = getImage()) === null || _a === void 0 ? void 0 : _a.supportUrl) || "https://github.com/balena-io/etcher/blob/master/SUPPORT.md");
                    },
                    tabIndex: 6,
                    style: {
                        WebkitAppRegion: "no-drag"
                    }
                }))), this.state.hideSettings ? null : react.createElement(SettingsModal, {
                    toggleModal: value => {
                        this.setState({
                            hideSettings: !value
                        });
                    }
                }), this.state.current === "main" ? this.renderMain() : this.renderSuccess());
            }
        }
        const main_MainPage = MainPage;
        var injectStylesIntoStyleTag = __webpack_require__(687);
        var injectStylesIntoStyleTag_default = __webpack_require__.n(injectStylesIntoStyleTag);
        var main = __webpack_require__(688);
        var options = {};
        options.insert = "head";
        options.singleton = false;
        var update = injectStylesIntoStyleTag_default()(main.Z, options);
        const css_main = main.Z.locals || {};
        window.addEventListener("unhandledrejection", (event => {
            const error = event.reason || event;
            logException(error);
            event.preventDefault();
        }));
        store.dispatch({
            type: Actions.SET_APPLICATION_SESSION_UUID,
            data: esm_browser_v4()
        });
        store.dispatch({
            type: Actions.SET_FLASHING_WORKFLOW_UUID,
            data: esm_browser_v4()
        });
        const applicationSessionUuid = store.getState().toJS().applicationSessionUuid;
        const flashingWorkflowUuid = store.getState().toJS().flashingWorkflowUuid;
        console.log(lib_module.default`
	${lib_module.default}
	 _____ _       _
	|  ___| |     | |
	| |__ | |_ ___| |__   ___ _ __
	|  __|| __/ __| '_ \\ / _ \\ '__|
	| |___| || (__| | | |  __/ |
	\\____/ \\__\\___|_| |_|\\___|_|

	Interested in joining the Etcher team?
	Drop us a line at join+etcher@balena.io

	Version = ${external_package_json_.version}, Type = ${external_package_json_.packageType}
`);
        const currentVersion = external_package_json_.version;
        logEvent("Application start", {
            packageType: external_package_json_.packageType,
            version: currentVersion
        });
        const debouncedLog = lodash.debounce(console.log, 1e3, {
            maxWait: 1e3
        });
        function pluralize(word, quantity) {
            return `${quantity} ${word}${quantity === 1 ? "" : "s"}`;
        }
        observe((() => {
            if (!isFlashing()) {
                return;
            }
            const currentFlashState = getFlashState();
            window_progress_set(currentFlashState);
            let eta = "";
            if (currentFlashState.eta !== undefined) {
                eta = `eta in ${currentFlashState.eta.toFixed(0)}s`;
            }
            let active = "";
            if (currentFlashState.type !== "decompressing") {
                active = pluralize("device", currentFlashState.active);
            }
            debouncedLog((0, lib_module.default)({
                newline: " "
            })`
		${lodash.capitalize(currentFlashState.type)}
		${active},
		${currentFlashState.percentage}%
		at
		${(currentFlashState.speed || 0).toFixed(2)}
		MB/s
		(total ${(currentFlashState.speed * currentFlashState.active).toFixed(2)} MB/s)
		${eta}
		with
		${pluralize("failed device", currentFlashState.failed)}
	`);
        }));
        const USB_ID_RADIX = 16;
        const USB_ID_LENGTH = 4;
        function usbIdToString(id) {
            return `0x${lodash.padStart(id.toString(USB_ID_RADIX), USB_ID_LENGTH, "0")}`;
        }
        const USB_PRODUCT_ID_BCM2708_BOOT = 10083;
        const USB_PRODUCT_ID_BCM2710_BOOT = 10084;
        const COMPUTE_MODULE_DESCRIPTIONS = {
            [USB_PRODUCT_ID_BCM2708_BOOT]: "Compute Module 1",
            [USB_PRODUCT_ID_BCM2710_BOOT]: "Compute Module 3"
        };
        async function driveIsAllowed(drive) {
            const driveBlacklist = await get("driveBlacklist") || [];
            return !(driveBlacklist.includes(drive.devicePath) || driveBlacklist.includes(drive.device) || driveBlacklist.includes(drive.raw));
        }
        function prepareDrive(drive) {
            if (drive instanceof build.UI.BlockDevice) {
                return drive.drive;
            } else if (drive instanceof build.UI.UsbbootDrive) {
                drive.device = drive.usbDevice.portId;
                drive.size = null;
                drive.progress = 0;
                drive.disabled = true;
                drive.on("progress", (progress => {
                    updateDriveProgress(drive, progress);
                }));
                return drive;
            } else if (drive instanceof build.UI.DriverlessDevice) {
                const description = COMPUTE_MODULE_DESCRIPTIONS[drive.deviceDescriptor.idProduct.toString()] || "Compute Module";
                return {
                    device: `${usbIdToString(drive.deviceDescriptor.idVendor)}:${usbIdToString(drive.deviceDescriptor.idProduct)}`,
                    displayName: "Missing drivers",
                    description,
                    mountpoints: [],
                    isReadOnly: false,
                    isSystem: false,
                    disabled: true,
                    icon: "warning",
                    size: null,
                    link: "https://www.raspberrypi.org/documentation/hardware/computemodule/cm-emmc-flashing.md",
                    linkCTA: "Install",
                    linkTitle: "Install missing drivers",
                    linkMessage: lib_module.default`
				Would you like to download the necessary drivers from the Raspberry Pi Foundation?
				This will open your browser.


				Once opened, download and run the installer from the "Windows Installer" section to install the drivers
			`
                };
            }
        }
        function app_setDrives(drives) {
            setDrives(lodash.values(drives));
        }
        function app_getDrives() {
            return lodash.keyBy(getDrives(), "device");
        }
        async function addDrive(drive) {
            const preparedDrive = prepareDrive(drive);
            if (!await driveIsAllowed(preparedDrive)) {
                return;
            }
            const drives = app_getDrives();
            drives[preparedDrive.device] = preparedDrive;
            app_setDrives(drives);
        }
        function removeDrive(drive) {
            if (drive instanceof build.UI.BlockDevice && isSourceDrive(drive.drive, getImage())) {
                deselectImage();
            }
            const preparedDrive = prepareDrive(drive);
            const drives = app_getDrives();
            delete drives[preparedDrive.device];
            app_setDrives(drives);
        }
        function updateDriveProgress(drive, progress) {
            const drives = app_getDrives();
            const driveInMap = drives[drive.device];
            if (driveInMap) {
                drives[drive.device] = {
                    ...driveInMap,
                    progress
                };
                app_setDrives(drives);
            }
        }
        scanner.on("attach", addDrive);
        scanner.on("detach", removeDrive);
        scanner.on("error", (error => {
            scanner.stop();
            return report(error);
        }));
        scanner.start();
        let popupExists = false;
        window.addEventListener("beforeunload", (async event => {
            if (!isFlashing() || popupExists) {
                logEvent("Close application", {
                    isFlashing: isFlashing()
                });
                return;
            }
            event.returnValue = false;
            popupExists = true;
            logEvent("Close attempt while flashing");
            try {
                const confirmed = await showWarning({
                    confirmationLabel: "Yes, quit",
                    rejectionLabel: "Cancel",
                    title: "Are you sure you want to close Etcher?",
                    description: warning.exitWhileFlashing()
                });
                if (confirmed) {
                    logEvent("Close confirmed while flashing", {
                        flashInstanceUuid: getFlashUuid()
                    });
                    external_electron_.remote.process.exit(SUCCESS);
                }
                logEvent("Close rejected while flashing", {
                    applicationSessionUuid,
                    flashingWorkflowUuid
                });
                popupExists = false;
            } catch (error) {
                report(error);
            }
        }));
        async function app_main() {
            await init();
            react_dom.render(react.createElement(main_MainPage), document.getElementById("main"), (async () => {
                const fullscreen = await get("fullscreen");
                const width = fullscreen ? window.screen.width : window.outerWidth;
                try {
                    external_electron_.webFrame.setZoomFactor(width / DEFAULT_WIDTH);
                } catch (err) {}
            }));
        }
        if (false) {}
        app_main();
    })();
})();