diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 70ce1cb3..00000000 --- a/.babelrc +++ /dev/null @@ -1,18 +0,0 @@ -{ - "presets": [ - "es2015", - "es2016", - "react" - ], - "comments": false, - "compact": false, - "retainLines": false, - "sourceType": "script", - "sourceMaps": true, - "plugins": [ - "transform-async-to-generator", - ["inline-replace-variables", { - "__VERSION__": "5.3.0" - }] - ] -} diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a10e582..d5366a40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ -next +6.0.0 ===== - You can now open single tabs from your saved sessions +- Experimental: Try to restore window names and colors after a browser restart +- Fix: Vertical layout takes now the full width in popups +- Fix: Vertical view has now nicer separators when used in full window, that take the whole screen width - Fix: Sometimes favicons would not load properly - Fix: Make sure session tabs are fully restored before closing the popup - Fix: Moving many tabs could stop early because of popup closing in the meantime @@ -11,6 +14,18 @@ next - Fix: Windows that were too big for the current monitor, would not be restored - Fix: Don't animate scrolling if animations are disabled - Fix: Dragging tabs would sometimes drop them in the wrong location, now they will be added to the closest tab in the new window +- Fix: Favicons sometimes stuck, based on browser cache +- Fix: Also use favicon url based on pending url if tab is loading +- Fix: Don't attempt to show empty favicon +- Fix: pending urls not being read when calculating window title +- Fix: window title not updating after tabs fully loaded +- Fix: IPs being shown as weird numbers in window title/name +- Fix: title being based on whole url, instead of hostname while tab was loading +- Fix: Try to find nicer window title if it matches hostname +- Fix: Group by top-Ips, like 192.168.*.* +- Fix: If you selected incognito tabs and normal tabs based on a search, and tried to move them to one window then it + would fail because they can't be mixed together. Now it will open 2 windows - one with normal tabs, one with incognito + tabs. 5.3.0 ===== diff --git a/build.mjs b/build.mjs new file mode 100644 index 00000000..ed0849a7 --- /dev/null +++ b/build.mjs @@ -0,0 +1,37 @@ +import * as esbuild from 'esbuild' + +await esbuild.build({ + entryPoints: ['src/popup/popup.tsx'], + bundle: true, + sourcemap: true, + target: 'chrome88', + outfile: 'dist/popup/popup.js', + define: { + 'process.env.VERSION': '"' + process.env.npm_package_version + '"', + 'process.env.NODE_ENV': '"production"' + } +}) + +await esbuild.build({ + entryPoints: ['src/service_worker/service_worker.ts'], + bundle: true, + sourcemap: true, + target: 'chrome88', + outfile: 'dist/service_worker/service_worker.js', + define: { + 'process.env.VERSION': '"' + process.env.npm_package_version + '"', + 'process.env.NODE_ENV': '"production"' + }, +}) + +await esbuild.build({ + entryPoints: ['src/popup/options.js'], + bundle: true, + sourcemap: true, + target: 'chrome88', + outfile: 'dist/popup/options.js', + define: { + 'process.env.VERSION': '"' + process.env.npm_package_version + '"', + 'process.env.NODE_ENV': '"production"' + } +}) diff --git a/changelog.html b/changelog.html index e1c516de..59a2f5b8 100644 --- a/changelog.html +++ b/changelog.html @@ -19,7 +19,7 @@
-

Tab Manager Plus 5.3.0

+

Tab Manager Plus 6.0.0

@@ -36,9 +36,12 @@

Here's what's planned for future versions

Here's what's new since the last time

-

next

+

6.0.0

5.3.0

diff --git a/dist/popup/options.js b/dist/popup/options.js new file mode 100644 index 00000000..eb533242 --- /dev/null +++ b/dist/popup/options.js @@ -0,0 +1,6 @@ +"use strict"; +(() => { + // src/popup/options.js + window.optionPage = true; +})(); +//# sourceMappingURL=options.js.map diff --git a/dist/popup/options.js.map b/dist/popup/options.js.map new file mode 100644 index 00000000..6894095f --- /dev/null +++ b/dist/popup/options.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../src/popup/options.js"], + "sourcesContent": ["\"use strict\";\nwindow.optionPage = true;"], + "mappings": ";;;AACA,SAAO,aAAa;", + "names": [] +} diff --git a/dist/popup/popup.js b/dist/popup/popup.js new file mode 100644 index 00000000..f03d4eb5 --- /dev/null +++ b/dist/popup/popup.js @@ -0,0 +1,10555 @@ +"use strict"; +(() => { + var __create = Object.create; + var __defProp = Object.defineProperty; + var __getOwnPropDesc = Object.getOwnPropertyDescriptor; + var __getOwnPropNames = Object.getOwnPropertyNames; + var __getProtoOf = Object.getPrototypeOf; + var __hasOwnProp = Object.prototype.hasOwnProperty; + var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; + }; + var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; + }; + var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod + )); + + // node_modules/webextension-polyfill/dist/browser-polyfill.js + var require_browser_polyfill = __commonJS({ + "node_modules/webextension-polyfill/dist/browser-polyfill.js"(exports, module) { + (function(global, factory) { + if (typeof define === "function" && define.amd) { + define("webextension-polyfill", ["module"], factory); + } else if (typeof exports !== "undefined") { + factory(module); + } else { + var mod = { + exports: {} + }; + factory(mod); + global.browser = mod.exports; + } + })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : exports, function(module2) { + "use strict"; + if (!(globalThis.chrome && globalThis.chrome.runtime && globalThis.chrome.runtime.id)) { + throw new Error("This script should only be loaded in a browser extension."); + } + if (!(globalThis.browser && globalThis.browser.runtime && globalThis.browser.runtime.id)) { + const CHROME_SEND_MESSAGE_CALLBACK_NO_RESPONSE_MESSAGE = "The message port closed before a response was received."; + const wrapAPIs = (extensionAPIs) => { + const apiMetadata = { + "alarms": { + "clear": { + "minArgs": 0, + "maxArgs": 1 + }, + "clearAll": { + "minArgs": 0, + "maxArgs": 0 + }, + "get": { + "minArgs": 0, + "maxArgs": 1 + }, + "getAll": { + "minArgs": 0, + "maxArgs": 0 + } + }, + "bookmarks": { + "create": { + "minArgs": 1, + "maxArgs": 1 + }, + "get": { + "minArgs": 1, + "maxArgs": 1 + }, + "getChildren": { + "minArgs": 1, + "maxArgs": 1 + }, + "getRecent": { + "minArgs": 1, + "maxArgs": 1 + }, + "getSubTree": { + "minArgs": 1, + "maxArgs": 1 + }, + "getTree": { + "minArgs": 0, + "maxArgs": 0 + }, + "move": { + "minArgs": 2, + "maxArgs": 2 + }, + "remove": { + "minArgs": 1, + "maxArgs": 1 + }, + "removeTree": { + "minArgs": 1, + "maxArgs": 1 + }, + "search": { + "minArgs": 1, + "maxArgs": 1 + }, + "update": { + "minArgs": 2, + "maxArgs": 2 + } + }, + "browserAction": { + "disable": { + "minArgs": 0, + "maxArgs": 1, + "fallbackToNoCallback": true + }, + "enable": { + "minArgs": 0, + "maxArgs": 1, + "fallbackToNoCallback": true + }, + "getBadgeBackgroundColor": { + "minArgs": 1, + "maxArgs": 1 + }, + "getBadgeText": { + "minArgs": 1, + "maxArgs": 1 + }, + "getPopup": { + "minArgs": 1, + "maxArgs": 1 + }, + "getTitle": { + "minArgs": 1, + "maxArgs": 1 + }, + "openPopup": { + "minArgs": 0, + "maxArgs": 0 + }, + "setBadgeBackgroundColor": { + "minArgs": 1, + "maxArgs": 1, + "fallbackToNoCallback": true + }, + "setBadgeText": { + "minArgs": 1, + "maxArgs": 1, + "fallbackToNoCallback": true + }, + "setIcon": { + "minArgs": 1, + "maxArgs": 1 + }, + "setPopup": { + "minArgs": 1, + "maxArgs": 1, + "fallbackToNoCallback": true + }, + "setTitle": { + "minArgs": 1, + "maxArgs": 1, + "fallbackToNoCallback": true + } + }, + "browsingData": { + "remove": { + "minArgs": 2, + "maxArgs": 2 + }, + "removeCache": { + "minArgs": 1, + "maxArgs": 1 + }, + "removeCookies": { + "minArgs": 1, + "maxArgs": 1 + }, + "removeDownloads": { + "minArgs": 1, + "maxArgs": 1 + }, + "removeFormData": { + "minArgs": 1, + "maxArgs": 1 + }, + "removeHistory": { + "minArgs": 1, + "maxArgs": 1 + }, + "removeLocalStorage": { + "minArgs": 1, + "maxArgs": 1 + }, + "removePasswords": { + "minArgs": 1, + "maxArgs": 1 + }, + "removePluginData": { + "minArgs": 1, + "maxArgs": 1 + }, + "settings": { + "minArgs": 0, + "maxArgs": 0 + } + }, + "commands": { + "getAll": { + "minArgs": 0, + "maxArgs": 0 + } + }, + "contextMenus": { + "remove": { + "minArgs": 1, + "maxArgs": 1 + }, + "removeAll": { + "minArgs": 0, + "maxArgs": 0 + }, + "update": { + "minArgs": 2, + "maxArgs": 2 + } + }, + "cookies": { + "get": { + "minArgs": 1, + "maxArgs": 1 + }, + "getAll": { + "minArgs": 1, + "maxArgs": 1 + }, + "getAllCookieStores": { + "minArgs": 0, + "maxArgs": 0 + }, + "remove": { + "minArgs": 1, + "maxArgs": 1 + }, + "set": { + "minArgs": 1, + "maxArgs": 1 + } + }, + "devtools": { + "inspectedWindow": { + "eval": { + "minArgs": 1, + "maxArgs": 2, + "singleCallbackArg": false + } + }, + "panels": { + "create": { + "minArgs": 3, + "maxArgs": 3, + "singleCallbackArg": true + }, + "elements": { + "createSidebarPane": { + "minArgs": 1, + "maxArgs": 1 + } + } + } + }, + "downloads": { + "cancel": { + "minArgs": 1, + "maxArgs": 1 + }, + "download": { + "minArgs": 1, + "maxArgs": 1 + }, + "erase": { + "minArgs": 1, + "maxArgs": 1 + }, + "getFileIcon": { + "minArgs": 1, + "maxArgs": 2 + }, + "open": { + "minArgs": 1, + "maxArgs": 1, + "fallbackToNoCallback": true + }, + "pause": { + "minArgs": 1, + "maxArgs": 1 + }, + "removeFile": { + "minArgs": 1, + "maxArgs": 1 + }, + "resume": { + "minArgs": 1, + "maxArgs": 1 + }, + "search": { + "minArgs": 1, + "maxArgs": 1 + }, + "show": { + "minArgs": 1, + "maxArgs": 1, + "fallbackToNoCallback": true + } + }, + "extension": { + "isAllowedFileSchemeAccess": { + "minArgs": 0, + "maxArgs": 0 + }, + "isAllowedIncognitoAccess": { + "minArgs": 0, + "maxArgs": 0 + } + }, + "history": { + "addUrl": { + "minArgs": 1, + "maxArgs": 1 + }, + "deleteAll": { + "minArgs": 0, + "maxArgs": 0 + }, + "deleteRange": { + "minArgs": 1, + "maxArgs": 1 + }, + "deleteUrl": { + "minArgs": 1, + "maxArgs": 1 + }, + "getVisits": { + "minArgs": 1, + "maxArgs": 1 + }, + "search": { + "minArgs": 1, + "maxArgs": 1 + } + }, + "i18n": { + "detectLanguage": { + "minArgs": 1, + "maxArgs": 1 + }, + "getAcceptLanguages": { + "minArgs": 0, + "maxArgs": 0 + } + }, + "identity": { + "launchWebAuthFlow": { + "minArgs": 1, + "maxArgs": 1 + } + }, + "idle": { + "queryState": { + "minArgs": 1, + "maxArgs": 1 + } + }, + "management": { + "get": { + "minArgs": 1, + "maxArgs": 1 + }, + "getAll": { + "minArgs": 0, + "maxArgs": 0 + }, + "getSelf": { + "minArgs": 0, + "maxArgs": 0 + }, + "setEnabled": { + "minArgs": 2, + "maxArgs": 2 + }, + "uninstallSelf": { + "minArgs": 0, + "maxArgs": 1 + } + }, + "notifications": { + "clear": { + "minArgs": 1, + "maxArgs": 1 + }, + "create": { + "minArgs": 1, + "maxArgs": 2 + }, + "getAll": { + "minArgs": 0, + "maxArgs": 0 + }, + "getPermissionLevel": { + "minArgs": 0, + "maxArgs": 0 + }, + "update": { + "minArgs": 2, + "maxArgs": 2 + } + }, + "pageAction": { + "getPopup": { + "minArgs": 1, + "maxArgs": 1 + }, + "getTitle": { + "minArgs": 1, + "maxArgs": 1 + }, + "hide": { + "minArgs": 1, + "maxArgs": 1, + "fallbackToNoCallback": true + }, + "setIcon": { + "minArgs": 1, + "maxArgs": 1 + }, + "setPopup": { + "minArgs": 1, + "maxArgs": 1, + "fallbackToNoCallback": true + }, + "setTitle": { + "minArgs": 1, + "maxArgs": 1, + "fallbackToNoCallback": true + }, + "show": { + "minArgs": 1, + "maxArgs": 1, + "fallbackToNoCallback": true + } + }, + "permissions": { + "contains": { + "minArgs": 1, + "maxArgs": 1 + }, + "getAll": { + "minArgs": 0, + "maxArgs": 0 + }, + "remove": { + "minArgs": 1, + "maxArgs": 1 + }, + "request": { + "minArgs": 1, + "maxArgs": 1 + } + }, + "runtime": { + "getBackgroundPage": { + "minArgs": 0, + "maxArgs": 0 + }, + "getPlatformInfo": { + "minArgs": 0, + "maxArgs": 0 + }, + "openOptionsPage": { + "minArgs": 0, + "maxArgs": 0 + }, + "requestUpdateCheck": { + "minArgs": 0, + "maxArgs": 0 + }, + "sendMessage": { + "minArgs": 1, + "maxArgs": 3 + }, + "sendNativeMessage": { + "minArgs": 2, + "maxArgs": 2 + }, + "setUninstallURL": { + "minArgs": 1, + "maxArgs": 1 + } + }, + "sessions": { + "getDevices": { + "minArgs": 0, + "maxArgs": 1 + }, + "getRecentlyClosed": { + "minArgs": 0, + "maxArgs": 1 + }, + "restore": { + "minArgs": 0, + "maxArgs": 1 + } + }, + "storage": { + "local": { + "clear": { + "minArgs": 0, + "maxArgs": 0 + }, + "get": { + "minArgs": 0, + "maxArgs": 1 + }, + "getBytesInUse": { + "minArgs": 0, + "maxArgs": 1 + }, + "remove": { + "minArgs": 1, + "maxArgs": 1 + }, + "set": { + "minArgs": 1, + "maxArgs": 1 + } + }, + "managed": { + "get": { + "minArgs": 0, + "maxArgs": 1 + }, + "getBytesInUse": { + "minArgs": 0, + "maxArgs": 1 + } + }, + "sync": { + "clear": { + "minArgs": 0, + "maxArgs": 0 + }, + "get": { + "minArgs": 0, + "maxArgs": 1 + }, + "getBytesInUse": { + "minArgs": 0, + "maxArgs": 1 + }, + "remove": { + "minArgs": 1, + "maxArgs": 1 + }, + "set": { + "minArgs": 1, + "maxArgs": 1 + } + } + }, + "tabs": { + "captureVisibleTab": { + "minArgs": 0, + "maxArgs": 2 + }, + "create": { + "minArgs": 1, + "maxArgs": 1 + }, + "detectLanguage": { + "minArgs": 0, + "maxArgs": 1 + }, + "discard": { + "minArgs": 0, + "maxArgs": 1 + }, + "duplicate": { + "minArgs": 1, + "maxArgs": 1 + }, + "executeScript": { + "minArgs": 1, + "maxArgs": 2 + }, + "get": { + "minArgs": 1, + "maxArgs": 1 + }, + "getCurrent": { + "minArgs": 0, + "maxArgs": 0 + }, + "getZoom": { + "minArgs": 0, + "maxArgs": 1 + }, + "getZoomSettings": { + "minArgs": 0, + "maxArgs": 1 + }, + "goBack": { + "minArgs": 0, + "maxArgs": 1 + }, + "goForward": { + "minArgs": 0, + "maxArgs": 1 + }, + "highlight": { + "minArgs": 1, + "maxArgs": 1 + }, + "insertCSS": { + "minArgs": 1, + "maxArgs": 2 + }, + "move": { + "minArgs": 2, + "maxArgs": 2 + }, + "query": { + "minArgs": 1, + "maxArgs": 1 + }, + "reload": { + "minArgs": 0, + "maxArgs": 2 + }, + "remove": { + "minArgs": 1, + "maxArgs": 1 + }, + "removeCSS": { + "minArgs": 1, + "maxArgs": 2 + }, + "sendMessage": { + "minArgs": 2, + "maxArgs": 3 + }, + "setZoom": { + "minArgs": 1, + "maxArgs": 2 + }, + "setZoomSettings": { + "minArgs": 1, + "maxArgs": 2 + }, + "update": { + "minArgs": 1, + "maxArgs": 2 + } + }, + "topSites": { + "get": { + "minArgs": 0, + "maxArgs": 0 + } + }, + "webNavigation": { + "getAllFrames": { + "minArgs": 1, + "maxArgs": 1 + }, + "getFrame": { + "minArgs": 1, + "maxArgs": 1 + } + }, + "webRequest": { + "handlerBehaviorChanged": { + "minArgs": 0, + "maxArgs": 0 + } + }, + "windows": { + "create": { + "minArgs": 0, + "maxArgs": 1 + }, + "get": { + "minArgs": 1, + "maxArgs": 2 + }, + "getAll": { + "minArgs": 0, + "maxArgs": 1 + }, + "getCurrent": { + "minArgs": 0, + "maxArgs": 1 + }, + "getLastFocused": { + "minArgs": 0, + "maxArgs": 1 + }, + "remove": { + "minArgs": 1, + "maxArgs": 1 + }, + "update": { + "minArgs": 2, + "maxArgs": 2 + } + } + }; + if (Object.keys(apiMetadata).length === 0) { + throw new Error("api-metadata.json has not been included in browser-polyfill"); + } + class DefaultWeakMap extends WeakMap { + constructor(createItem, items = void 0) { + super(items); + this.createItem = createItem; + } + get(key) { + if (!this.has(key)) { + this.set(key, this.createItem(key)); + } + return super.get(key); + } + } + const isThenable = (value) => { + return value && typeof value === "object" && typeof value.then === "function"; + }; + const makeCallback = (promise, metadata) => { + return (...callbackArgs) => { + if (extensionAPIs.runtime.lastError) { + promise.reject(new Error(extensionAPIs.runtime.lastError.message)); + } else if (metadata.singleCallbackArg || callbackArgs.length <= 1 && metadata.singleCallbackArg !== false) { + promise.resolve(callbackArgs[0]); + } else { + promise.resolve(callbackArgs); + } + }; + }; + const pluralizeArguments = (numArgs) => numArgs == 1 ? "argument" : "arguments"; + const wrapAsyncFunction = (name, metadata) => { + return function asyncFunctionWrapper(target, ...args) { + if (args.length < metadata.minArgs) { + throw new Error(`Expected at least ${metadata.minArgs} ${pluralizeArguments(metadata.minArgs)} for ${name}(), got ${args.length}`); + } + if (args.length > metadata.maxArgs) { + throw new Error(`Expected at most ${metadata.maxArgs} ${pluralizeArguments(metadata.maxArgs)} for ${name}(), got ${args.length}`); + } + return new Promise((resolve, reject) => { + if (metadata.fallbackToNoCallback) { + try { + target[name](...args, makeCallback({ + resolve, + reject + }, metadata)); + } catch (cbError) { + console.warn(`${name} API method doesn't seem to support the callback parameter, falling back to call it without a callback: `, cbError); + target[name](...args); + metadata.fallbackToNoCallback = false; + metadata.noCallback = true; + resolve(); + } + } else if (metadata.noCallback) { + target[name](...args); + resolve(); + } else { + target[name](...args, makeCallback({ + resolve, + reject + }, metadata)); + } + }); + }; + }; + const wrapMethod = (target, method, wrapper) => { + return new Proxy(method, { + apply(targetMethod, thisObj, args) { + return wrapper.call(thisObj, target, ...args); + } + }); + }; + let hasOwnProperty = Function.call.bind(Object.prototype.hasOwnProperty); + const wrapObject = (target, wrappers = {}, metadata = {}) => { + let cache = /* @__PURE__ */ Object.create(null); + let handlers = { + has(proxyTarget2, prop) { + return prop in target || prop in cache; + }, + get(proxyTarget2, prop, receiver) { + if (prop in cache) { + return cache[prop]; + } + if (!(prop in target)) { + return void 0; + } + let value = target[prop]; + if (typeof value === "function") { + if (typeof wrappers[prop] === "function") { + value = wrapMethod(target, target[prop], wrappers[prop]); + } else if (hasOwnProperty(metadata, prop)) { + let wrapper = wrapAsyncFunction(prop, metadata[prop]); + value = wrapMethod(target, target[prop], wrapper); + } else { + value = value.bind(target); + } + } else if (typeof value === "object" && value !== null && (hasOwnProperty(wrappers, prop) || hasOwnProperty(metadata, prop))) { + value = wrapObject(value, wrappers[prop], metadata[prop]); + } else if (hasOwnProperty(metadata, "*")) { + value = wrapObject(value, wrappers[prop], metadata["*"]); + } else { + Object.defineProperty(cache, prop, { + configurable: true, + enumerable: true, + get() { + return target[prop]; + }, + set(value2) { + target[prop] = value2; + } + }); + return value; + } + cache[prop] = value; + return value; + }, + set(proxyTarget2, prop, value, receiver) { + if (prop in cache) { + cache[prop] = value; + } else { + target[prop] = value; + } + return true; + }, + defineProperty(proxyTarget2, prop, desc) { + return Reflect.defineProperty(cache, prop, desc); + }, + deleteProperty(proxyTarget2, prop) { + return Reflect.deleteProperty(cache, prop); + } + }; + let proxyTarget = Object.create(target); + return new Proxy(proxyTarget, handlers); + }; + const wrapEvent = (wrapperMap) => ({ + addListener(target, listener, ...args) { + target.addListener(wrapperMap.get(listener), ...args); + }, + hasListener(target, listener) { + return target.hasListener(wrapperMap.get(listener)); + }, + removeListener(target, listener) { + target.removeListener(wrapperMap.get(listener)); + } + }); + const onRequestFinishedWrappers = new DefaultWeakMap((listener) => { + if (typeof listener !== "function") { + return listener; + } + return function onRequestFinished(req) { + const wrappedReq = wrapObject(req, {}, { + getContent: { + minArgs: 0, + maxArgs: 0 + } + }); + listener(wrappedReq); + }; + }); + const onMessageWrappers = new DefaultWeakMap((listener) => { + if (typeof listener !== "function") { + return listener; + } + return function onMessage(message, sender, sendResponse) { + let didCallSendResponse = false; + let wrappedSendResponse; + let sendResponsePromise = new Promise((resolve) => { + wrappedSendResponse = function(response) { + didCallSendResponse = true; + resolve(response); + }; + }); + let result; + try { + result = listener(message, sender, wrappedSendResponse); + } catch (err) { + result = Promise.reject(err); + } + const isResultThenable = result !== true && isThenable(result); + if (result !== true && !isResultThenable && !didCallSendResponse) { + return false; + } + const sendPromisedResult = (promise) => { + promise.then((msg) => { + sendResponse(msg); + }, (error) => { + let message2; + if (error && (error instanceof Error || typeof error.message === "string")) { + message2 = error.message; + } else { + message2 = "An unexpected error occurred"; + } + sendResponse({ + __mozWebExtensionPolyfillReject__: true, + message: message2 + }); + }).catch((err) => { + console.error("Failed to send onMessage rejected reply", err); + }); + }; + if (isResultThenable) { + sendPromisedResult(result); + } else { + sendPromisedResult(sendResponsePromise); + } + return true; + }; + }); + const wrappedSendMessageCallback = ({ + reject, + resolve + }, reply) => { + if (extensionAPIs.runtime.lastError) { + if (extensionAPIs.runtime.lastError.message === CHROME_SEND_MESSAGE_CALLBACK_NO_RESPONSE_MESSAGE) { + resolve(); + } else { + reject(new Error(extensionAPIs.runtime.lastError.message)); + } + } else if (reply && reply.__mozWebExtensionPolyfillReject__) { + reject(new Error(reply.message)); + } else { + resolve(reply); + } + }; + const wrappedSendMessage = (name, metadata, apiNamespaceObj, ...args) => { + if (args.length < metadata.minArgs) { + throw new Error(`Expected at least ${metadata.minArgs} ${pluralizeArguments(metadata.minArgs)} for ${name}(), got ${args.length}`); + } + if (args.length > metadata.maxArgs) { + throw new Error(`Expected at most ${metadata.maxArgs} ${pluralizeArguments(metadata.maxArgs)} for ${name}(), got ${args.length}`); + } + return new Promise((resolve, reject) => { + const wrappedCb = wrappedSendMessageCallback.bind(null, { + resolve, + reject + }); + args.push(wrappedCb); + apiNamespaceObj.sendMessage(...args); + }); + }; + const staticWrappers = { + devtools: { + network: { + onRequestFinished: wrapEvent(onRequestFinishedWrappers) + } + }, + runtime: { + onMessage: wrapEvent(onMessageWrappers), + onMessageExternal: wrapEvent(onMessageWrappers), + sendMessage: wrappedSendMessage.bind(null, "sendMessage", { + minArgs: 1, + maxArgs: 3 + }) + }, + tabs: { + sendMessage: wrappedSendMessage.bind(null, "sendMessage", { + minArgs: 2, + maxArgs: 3 + }) + } + }; + const settingMetadata = { + clear: { + minArgs: 1, + maxArgs: 1 + }, + get: { + minArgs: 1, + maxArgs: 1 + }, + set: { + minArgs: 1, + maxArgs: 1 + } + }; + apiMetadata.privacy = { + network: { + "*": settingMetadata + }, + services: { + "*": settingMetadata + }, + websites: { + "*": settingMetadata + } + }; + return wrapObject(extensionAPIs, staticWrappers, apiMetadata); + }; + module2.exports = wrapAPIs(chrome); + } else { + module2.exports = globalThis.browser; + } + }); + } + }); + + // node_modules/object-assign/index.js + var require_object_assign = __commonJS({ + "node_modules/object-assign/index.js"(exports, module) { + "use strict"; + var getOwnPropertySymbols = Object.getOwnPropertySymbols; + var hasOwnProperty = Object.prototype.hasOwnProperty; + var propIsEnumerable = Object.prototype.propertyIsEnumerable; + function toObject(val) { + if (val === null || val === void 0) { + 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; + }; + } + }); + + // node_modules/react/cjs/react.production.min.js + var require_react_production_min = __commonJS({ + "node_modules/react/cjs/react.production.min.js"(exports, module) { + "use strict"; + var h = require_object_assign(); + var n = "function" === typeof Symbol && Symbol.for; + var p = n ? Symbol.for("react.element") : 60103; + var q = n ? Symbol.for("react.portal") : 60106; + var r = n ? Symbol.for("react.fragment") : 60107; + var t = n ? Symbol.for("react.strict_mode") : 60108; + var u = n ? Symbol.for("react.profiler") : 60114; + var v = n ? Symbol.for("react.provider") : 60109; + var w = n ? Symbol.for("react.context") : 60110; + var x = n ? Symbol.for("react.forward_ref") : 60112; + var y = n ? Symbol.for("react.suspense") : 60113; + n && Symbol.for("react.suspense_list"); + var z = n ? Symbol.for("react.memo") : 60115; + var aa = n ? Symbol.for("react.lazy") : 60116; + n && Symbol.for("react.fundamental"); + n && Symbol.for("react.responder"); + n && Symbol.for("react.scope"); + var A = "function" === typeof Symbol && Symbol.iterator; + function B(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 C = { isMounted: function() { + return false; + }, enqueueForceUpdate: function() { + }, enqueueReplaceState: function() { + }, enqueueSetState: function() { + } }; + var D = {}; + function E(a, b, c) { + this.props = a; + this.context = b; + this.refs = D; + this.updater = c || C; + } + E.prototype.isReactComponent = {}; + E.prototype.setState = function(a, b) { + if ("object" !== typeof a && "function" !== typeof a && null != a) throw Error(B(85)); + this.updater.enqueueSetState(this, a, b, "setState"); + }; + E.prototype.forceUpdate = function(a) { + this.updater.enqueueForceUpdate(this, a, "forceUpdate"); + }; + function F() { + } + F.prototype = E.prototype; + function G(a, b, c) { + this.props = a; + this.context = b; + this.refs = D; + this.updater = c || C; + } + var H = G.prototype = new F(); + H.constructor = G; + h(H, E.prototype); + H.isPureReactComponent = true; + var I = { current: null }; + var J = { current: null }; + var K = Object.prototype.hasOwnProperty; + var L = { key: true, ref: true, __self: true, __source: true }; + function M(a, b, c) { + var e, d = {}, g = null, l = null; + if (null != b) for (e in void 0 !== b.ref && (l = 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 k = Array(f), m = 0; m < f; m++) k[m] = arguments[m + 2]; + d.children = k; + } + 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: l, props: d, _owner: J.current }; + } + function ba(a, b) { + return { $$typeof: p, type: a.type, key: b, ref: a.ref, props: a.props, _owner: a._owner }; + } + function N(a) { + return "object" === typeof a && null !== a && a.$$typeof === p; + } + function escape(a) { + var b = { "=": "=0", ":": "=2" }; + return "$" + ("" + a).replace(/[=:]/g, function(a2) { + return b[a2]; + }); + } + var O = /\/+/g; + var P = []; + function Q(a, b, c, e) { + if (P.length) { + var d = P.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 R(a) { + a.result = null; + a.keyPrefix = null; + a.func = null; + a.context = null; + a.count = 0; + 10 > P.length && P.push(a); + } + function S(a, b, c, e) { + var d = typeof a; + if ("undefined" === d || "boolean" === d) a = null; + var g = false; + if (null === a) g = true; + else switch (d) { + case "string": + case "number": + g = true; + break; + case "object": + switch (a.$$typeof) { + case p: + case q: + g = true; + } + } + if (g) return c(e, a, "" === b ? "." + T(a, 0) : b), 1; + g = 0; + b = "" === b ? "." : b + ":"; + if (Array.isArray(a)) for (var l = 0; l < a.length; l++) { + d = a[l]; + var f = b + T(d, l); + g += S(d, f, c, e); + } + else if (null === a || "object" !== typeof a ? f = null : (f = A && a[A] || a["@@iterator"], f = "function" === typeof f ? f : null), "function" === typeof f) for (a = f.call(a), l = 0; !(d = a.next()).done; ) d = d.value, f = b + T(d, l++), g += S(d, f, c, e); + else if ("object" === d) throw c = "" + a, Error(B(31, "[object Object]" === c ? "object with keys {" + Object.keys(a).join(", ") + "}" : c, "")); + return g; + } + function U(a, b, c) { + return null == a ? 0 : S(a, "", b, c); + } + function T(a, b) { + return "object" === typeof a && null !== a && null != a.key ? escape(a.key) : b.toString(36); + } + function ca(a, b) { + a.func.call(a.context, b, a.count++); + } + function da(a, b, c) { + var e = a.result, d = a.keyPrefix; + a = a.func.call(a.context, b, a.count++); + Array.isArray(a) ? V(a, e, c, function(a2) { + return a2; + }) : null != a && (N(a) && (a = ba(a, d + (!a.key || b && b.key === a.key ? "" : ("" + a.key).replace(O, "$&/") + "/") + c)), e.push(a)); + } + function V(a, b, c, e, d) { + var g = ""; + null != c && (g = ("" + c).replace(O, "$&/") + "/"); + b = Q(b, g, e, d); + U(a, da, b); + R(b); + } + function W() { + var a = I.current; + if (null === a) throw Error(B(321)); + return a; + } + var X = { + Children: { map: function(a, b, c) { + if (null == a) return a; + var e = []; + V(a, e, null, b, c); + return e; + }, forEach: function(a, b, c) { + if (null == a) return a; + b = Q(null, null, b, c); + U(a, ca, b); + R(b); + }, count: function(a) { + return U(a, function() { + return null; + }, null); + }, toArray: function(a) { + var b = []; + V(a, b, null, function(a2) { + return a2; + }); + return b; + }, only: function(a) { + if (!N(a)) throw Error(B(143)); + return a; + } }, + createRef: function() { + return { current: null }; + }, + Component: E, + PureComponent: G, + 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; + }, + forwardRef: function(a) { + return { $$typeof: x, render: a }; + }, + lazy: function(a) { + return { $$typeof: aa, _ctor: a, _status: -1, _result: null }; + }, + memo: function(a, b) { + return { $$typeof: z, type: a, compare: void 0 === b ? null : b }; + }, + useCallback: function(a, b) { + return W().useCallback(a, b); + }, + useContext: function(a, b) { + return W().useContext(a, b); + }, + useEffect: function(a, b) { + return W().useEffect(a, b); + }, + useImperativeHandle: function(a, b, c) { + return W().useImperativeHandle(a, b, c); + }, + useDebugValue: function() { + }, + useLayoutEffect: function(a, b) { + return W().useLayoutEffect(a, b); + }, + useMemo: function(a, b) { + return W().useMemo(a, b); + }, + useReducer: function(a, b, c) { + return W().useReducer(a, b, c); + }, + useRef: function(a) { + return W().useRef(a); + }, + useState: function(a) { + return W().useState(a); + }, + Fragment: r, + Profiler: u, + StrictMode: t, + Suspense: y, + createElement: M, + cloneElement: function(a, b, c) { + if (null === a || void 0 === a) throw Error(B(267, a)); + var e = h({}, a.props), d = a.key, g = a.ref, l = a._owner; + if (null != b) { + void 0 !== b.ref && (g = b.ref, l = J.current); + void 0 !== b.key && (d = "" + b.key); + if (a.type && a.type.defaultProps) var f = a.type.defaultProps; + for (k in b) K.call(b, k) && !L.hasOwnProperty(k) && (e[k] = void 0 === b[k] && void 0 !== f ? f[k] : b[k]); + } + var k = arguments.length - 2; + if (1 === k) e.children = c; + else if (1 < k) { + f = Array(k); + for (var m = 0; m < k; m++) f[m] = arguments[m + 2]; + e.children = f; + } + return { $$typeof: p, type: a.type, key: d, ref: g, props: e, _owner: l }; + }, + createFactory: function(a) { + var b = M.bind(null, a); + b.type = a; + return b; + }, + isValidElement: N, + version: "16.11.0", + __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: { ReactCurrentDispatcher: I, ReactCurrentBatchConfig: { suspense: null }, ReactCurrentOwner: J, IsSomeRendererActing: { current: false }, assign: h } + }; + var Y = { default: X }; + var Z = Y && X || Y; + module.exports = Z.default || Z; + } + }); + + // node_modules/react/index.js + var require_react = __commonJS({ + "node_modules/react/index.js"(exports, module) { + "use strict"; + if (true) { + module.exports = require_react_production_min(); + } else { + module.exports = null; + } + } + }); + + // node_modules/scheduler/cjs/scheduler.production.min.js + var require_scheduler_production_min = __commonJS({ + "node_modules/scheduler/cjs/scheduler.production.min.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var f; + var g; + var h; + var k; + var l; + if ("undefined" === typeof window || "function" !== typeof MessageChannel) { + p = null, q = null, t = function() { + if (null !== p) try { + var a = exports.unstable_now(); + p(true, 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 false; + }; + l = exports.unstable_forceFrameRate = function() { + }; + } else { + w = window.performance, x = window.Date, y = window.setTimeout, z = window.clearTimeout, A = window.requestAnimationFrame, B = window.cancelAnimationFrame; + "undefined" !== typeof console && ("function" !== typeof A && 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 B && 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 { + C = x.now(); + exports.unstable_now = function() { + return x.now() - C; + }; + } + D = false, E = null, F = -1, G = 5, H = 0; + k = function() { + return exports.unstable_now() >= H; + }; + 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") : G = 0 < a ? Math.floor(1e3 / a) : 33.33; + }; + I = new MessageChannel(), J = I.port2; + I.port1.onmessage = function() { + if (null !== E) { + var a = exports.unstable_now(); + H = a + G; + try { + E(true, a) ? J.postMessage(null) : (D = false, E = null); + } catch (b) { + throw J.postMessage(null), b; + } + } else D = false; + }; + f = function(a) { + E = a; + D || (D = true, J.postMessage(null)); + }; + g = function(a, b) { + F = y(function() { + a(exports.unstable_now()); + }, b); + }; + h = function() { + z(F); + F = -1; + }; + } + var p; + var q; + var t; + var u; + var w; + var x; + var y; + var z; + var A; + var B; + var C; + var D; + var E; + var F; + var G; + var H; + var I; + var J; + function K(a, b) { + var c = a.length; + a.push(b); + a: for (; ; ) { + var d = Math.floor((c - 1) / 2), e = a[d]; + if (void 0 !== e && 0 < L(e, b)) a[d] = b, a[c] = e, c = d; + else break a; + } + } + function M(a) { + a = a[0]; + return void 0 === a ? null : a; + } + function N(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 > L(n, c)) void 0 !== r && 0 > L(r, n) ? (a[d] = r, a[v] = c, d = v) : (a[d] = n, a[m] = c, d = m); + else if (void 0 !== r && 0 > L(r, c)) a[d] = r, a[v] = c, d = v; + else break a; + } + } + return b; + } + return null; + } + function L(a, b) { + var c = a.sortIndex - b.sortIndex; + return 0 !== c ? c : a.id - b.id; + } + var O = []; + var P = []; + var Q = 1; + var R = null; + var S = 3; + var T = false; + var U = false; + var V = false; + function W(a) { + for (var b = M(P); null !== b; ) { + if (null === b.callback) N(P); + else if (b.startTime <= a) N(P), b.sortIndex = b.expirationTime, K(O, b); + else break; + b = M(P); + } + } + function X(a) { + V = false; + W(a); + if (!U) if (null !== M(O)) U = true, f(Y); + else { + var b = M(P); + null !== b && g(X, b.startTime - a); + } + } + function Y(a, b) { + U = false; + V && (V = false, h()); + T = true; + var c = S; + try { + W(b); + for (R = M(O); null !== R && (!(R.expirationTime > b) || a && !k()); ) { + var d = R.callback; + if (null !== d) { + R.callback = null; + S = R.priorityLevel; + var e = d(R.expirationTime <= b); + b = exports.unstable_now(); + "function" === typeof e ? R.callback = e : R === M(O) && N(O); + W(b); + } else N(O); + R = M(O); + } + if (null !== R) var m = true; + else { + var n = M(P); + null !== n && g(X, n.startTime - b); + m = false; + } + return m; + } finally { + R = null, S = c, T = false; + } + } + function Z(a) { + switch (a) { + case 1: + return -1; + case 2: + return 250; + case 5: + return 1073741823; + case 4: + return 1e4; + default: + return 5e3; + } + } + var aa = l; + exports.unstable_ImmediatePriority = 1; + exports.unstable_UserBlockingPriority = 2; + exports.unstable_NormalPriority = 3; + exports.unstable_IdlePriority = 5; + exports.unstable_LowPriority = 4; + exports.unstable_runWithPriority = function(a, b) { + switch (a) { + case 1: + case 2: + case 3: + case 4: + case 5: + break; + default: + a = 3; + } + var c = S; + S = a; + try { + return b(); + } finally { + S = c; + } + }; + exports.unstable_next = function(a) { + switch (S) { + case 1: + case 2: + case 3: + var b = 3; + break; + default: + b = S; + } + var c = S; + S = b; + try { + return a(); + } finally { + S = 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 : Z(a); + } else c = Z(a), e = d; + c = e + c; + a = { id: Q++, callback: b, priorityLevel: a, startTime: e, expirationTime: c, sortIndex: -1 }; + e > d ? (a.sortIndex = e, K(P, a), null === M(O) && a === M(P) && (V ? h() : V = true, g(X, e - d))) : (a.sortIndex = c, K(O, a), U || T || (U = true, f(Y))); + return a; + }; + exports.unstable_cancelCallback = function(a) { + a.callback = null; + }; + exports.unstable_wrapCallback = function(a) { + var b = S; + return function() { + var c = S; + S = b; + try { + return a.apply(this, arguments); + } finally { + S = c; + } + }; + }; + exports.unstable_getCurrentPriorityLevel = function() { + return S; + }; + exports.unstable_shouldYield = function() { + var a = exports.unstable_now(); + W(a); + var b = M(O); + return b !== R && null !== R && null !== b && null !== b.callback && b.startTime <= a && b.expirationTime < R.expirationTime || k(); + }; + exports.unstable_requestPaint = aa; + exports.unstable_continueExecution = function() { + U || T || (U = true, f(Y)); + }; + exports.unstable_pauseExecution = function() { + }; + exports.unstable_getFirstCallbackNode = function() { + return M(O); + }; + exports.unstable_Profiling = null; + } + }); + + // node_modules/scheduler/index.js + var require_scheduler = __commonJS({ + "node_modules/scheduler/index.js"(exports, module) { + "use strict"; + if (true) { + module.exports = require_scheduler_production_min(); + } else { + module.exports = null; + } + } + }); + + // node_modules/react-dom/cjs/react-dom.production.min.js + var require_react_dom_production_min = __commonJS({ + "node_modules/react-dom/cjs/react-dom.production.min.js"(exports, module) { + "use strict"; + var aa = require_react(); + var n = require_object_assign(); + var q = require_scheduler(); + 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)); + var ba = null; + var ca = {}; + function da() { + if (ba) for (var a in ca) { + var b = ca[a], c = ba.indexOf(a); + if (!(-1 < c)) throw Error(u(96, a)); + if (!ea[c]) { + if (!b.extractEvents) throw Error(u(97, a)); + ea[c] = b; + c = b.eventTypes; + for (var d in c) { + var e = void 0; + var f = c[d], g = b, h = d; + if (fa.hasOwnProperty(h)) throw Error(u(99, h)); + fa[h] = f; + var k = f.phasedRegistrationNames; + if (k) { + for (e in k) k.hasOwnProperty(e) && ha(k[e], g, h); + e = true; + } else f.registrationName ? (ha(f.registrationName, g, h), e = true) : e = false; + if (!e) throw Error(u(98, d, a)); + } + } + } + } + function ha(a, b, c) { + if (ia[a]) throw Error(u(100, a)); + ia[a] = b; + ja[a] = b.eventTypes[c].dependencies; + } + var ea = []; + var fa = {}; + var ia = {}; + var ja = {}; + function ka(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 la = false; + var ma = null; + var na = false; + var oa = null; + var pa = { onError: function(a) { + la = true; + ma = a; + } }; + function qa(a, b, c, d, e, f, g, h, k) { + la = false; + ma = null; + ka.apply(pa, arguments); + } + function ra(a, b, c, d, e, f, g, h, k) { + qa.apply(this, arguments); + if (la) { + if (la) { + var l = ma; + la = false; + ma = null; + } else throw Error(u(198)); + na || (na = true, oa = l); + } + } + var sa = null; + var ua = null; + var va = null; + function wa(a, b, c) { + var d = a.type || "unknown-event"; + a.currentTarget = va(c); + ra(d, b, void 0, a); + a.currentTarget = null; + } + function xa(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 ya(a, b, c) { + Array.isArray(a) ? a.forEach(b, c) : a && b.call(c, a); + } + var za = null; + function Aa(a) { + if (a) { + var b = a._dispatchListeners, c = a._dispatchInstances; + if (Array.isArray(b)) for (var d = 0; d < b.length && !a.isPropagationStopped(); d++) wa(a, b[d], c[d]); + else b && wa(a, b, c); + a._dispatchListeners = null; + a._dispatchInstances = null; + a.isPersistent() || a.constructor.release(a); + } + } + function Ba(a) { + null !== a && (za = xa(za, a)); + a = za; + za = null; + if (a) { + ya(a, Aa); + if (za) throw Error(u(95)); + if (na) throw a = oa, na = false, oa = null, a; + } + } + var Ca = { injectEventPluginOrder: function(a) { + if (ba) throw Error(u(101)); + ba = Array.prototype.slice.call(a); + da(); + }, injectEventPluginsByName: function(a) { + var b = false, c; + for (c in a) if (a.hasOwnProperty(c)) { + var d = a[c]; + if (!ca.hasOwnProperty(c) || ca[c] !== d) { + if (ca[c]) throw Error(u(102, c)); + ca[c] = d; + b = true; + } + } + b && da(); + } }; + function Da(a, b) { + var c = a.stateNode; + if (!c) return null; + var d = sa(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": + (d = !d.disabled) || (a = a.type, d = !("button" === a || "input" === a || "select" === a || "textarea" === a)); + a = !d; + break a; + default: + a = false; + } + if (a) return null; + if (c && "function" !== typeof c) throw Error(u(231, b, typeof c)); + return c; + } + var Ea = aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + Ea.hasOwnProperty("ReactCurrentDispatcher") || (Ea.ReactCurrentDispatcher = { current: null }); + Ea.hasOwnProperty("ReactCurrentBatchConfig") || (Ea.ReactCurrentBatchConfig = { suspense: null }); + var Fa = /^(.*)[\\\/]/; + var w = "function" === typeof Symbol && Symbol.for; + var Ga = w ? Symbol.for("react.element") : 60103; + var Ha = w ? Symbol.for("react.portal") : 60106; + var Ia = w ? Symbol.for("react.fragment") : 60107; + var Ja = w ? Symbol.for("react.strict_mode") : 60108; + var Ka = w ? Symbol.for("react.profiler") : 60114; + var La = w ? Symbol.for("react.provider") : 60109; + var Ma = w ? Symbol.for("react.context") : 60110; + var Na = w ? Symbol.for("react.concurrent_mode") : 60111; + var Oa = w ? Symbol.for("react.forward_ref") : 60112; + var Pa = w ? Symbol.for("react.suspense") : 60113; + var Qa = w ? Symbol.for("react.suspense_list") : 60120; + var Ra = w ? Symbol.for("react.memo") : 60115; + var Sa = w ? Symbol.for("react.lazy") : 60116; + w && Symbol.for("react.fundamental"); + w && Symbol.for("react.responder"); + w && Symbol.for("react.scope"); + var Ta = "function" === typeof Symbol && Symbol.iterator; + function Ua(a) { + if (null === a || "object" !== typeof a) return null; + a = Ta && a[Ta] || a["@@iterator"]; + return "function" === typeof a ? a : null; + } + function Va(a) { + if (-1 === a._status) { + a._status = 0; + var b = a._ctor; + b = b(); + a._result = b; + b.then(function(b2) { + 0 === a._status && (b2 = b2.default, a._status = 1, a._result = b2); + }, function(b2) { + 0 === a._status && (a._status = 2, a._result = b2); + }); + } + } + function Wa(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 Ia: + return "Fragment"; + case Ha: + return "Portal"; + case Ka: + return "Profiler"; + case Ja: + return "StrictMode"; + case Pa: + return "Suspense"; + case Qa: + return "SuspenseList"; + } + if ("object" === typeof a) switch (a.$$typeof) { + case Ma: + return "Context.Consumer"; + case La: + return "Context.Provider"; + case Oa: + var b = a.render; + b = b.displayName || b.name || ""; + return a.displayName || ("" !== b ? "ForwardRef(" + b + ")" : "ForwardRef"); + case Ra: + return Wa(a.type); + case Sa: + if (a = 1 === a._status ? a._result : null) return Wa(a); + } + return null; + } + function Xa(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 = Wa(a.type); + c = null; + d && (c = Wa(d.type)); + d = f; + f = ""; + e ? f = " (at " + e.fileName.replace(Fa, "") + ":" + e.lineNumber + ")" : c && (f = " (created by " + c + ")"); + c = "\n in " + (d || "Unknown") + f; + } + b += c; + a = a.return; + } while (a); + return b; + } + var Ya = !("undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement); + var Za = null; + var $a = null; + var ab = null; + function bb(a) { + if (a = ua(a)) { + if ("function" !== typeof Za) throw Error(u(280)); + var b = sa(a.stateNode); + Za(a.stateNode, a.type, b); + } + } + function cb(a) { + $a ? ab ? ab.push(a) : ab = [a] : $a = a; + } + function db() { + if ($a) { + var a = $a, b = ab; + ab = $a = null; + bb(a); + if (b) for (a = 0; a < b.length; a++) bb(b[a]); + } + } + function eb(a, b) { + return a(b); + } + function fb(a, b, c, d) { + return a(b, c, d); + } + function gb() { + } + var hb = eb; + var ib = false; + var jb = false; + function kb() { + if (null !== $a || null !== ab) gb(), db(); + } + var lb = /^[: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]*$/; + var mb = Object.prototype.hasOwnProperty; + var nb = {}; + var ob = {}; + function pb(a) { + if (mb.call(ob, a)) return true; + if (mb.call(nb, a)) return false; + if (lb.test(a)) return ob[a] = true; + nb[a] = true; + return false; + } + function qb(a, b, c, d) { + if (null !== c && 0 === c.type) return false; + switch (typeof b) { + case "function": + case "symbol": + return true; + case "boolean": + if (d) return false; + if (null !== c) return !c.acceptsBooleans; + a = a.toLowerCase().slice(0, 5); + return "data-" !== a && "aria-" !== a; + default: + return false; + } + } + function rb(a, b, c, d) { + if (null === b || "undefined" === typeof b || qb(a, b, c, d)) return true; + if (d) return false; + if (null !== c) switch (c.type) { + case 3: + return !b; + case 4: + return false === b; + case 5: + return isNaN(b); + case 6: + return isNaN(b) || 1 > b; + } + return false; + } + function B(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 D = {}; + "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a) { + D[a] = new B(a, 0, false, a, null, false); + }); + [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(a) { + var b = a[0]; + D[b] = new B(b, 1, false, a[1], null, false); + }); + ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(a) { + D[a] = new B(a, 2, false, a.toLowerCase(), null, false); + }); + ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(a) { + D[a] = new B(a, 2, false, a, null, false); + }); + "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) { + D[a] = new B(a, 3, false, a.toLowerCase(), null, false); + }); + ["checked", "multiple", "muted", "selected"].forEach(function(a) { + D[a] = new B(a, 3, true, a, null, false); + }); + ["capture", "download"].forEach(function(a) { + D[a] = new B(a, 4, false, a, null, false); + }); + ["cols", "rows", "size", "span"].forEach(function(a) { + D[a] = new B(a, 6, false, a, null, false); + }); + ["rowSpan", "start"].forEach(function(a) { + D[a] = new B(a, 5, false, a.toLowerCase(), null, false); + }); + var sb = /[\-:]([a-z])/g; + function tb(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( + sb, + tb + ); + D[b] = new B(b, 1, false, a, null, false); + }); + "xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a) { + var b = a.replace(sb, tb); + D[b] = new B(b, 1, false, a, "http://www.w3.org/1999/xlink", false); + }); + ["xml:base", "xml:lang", "xml:space"].forEach(function(a) { + var b = a.replace(sb, tb); + D[b] = new B(b, 1, false, a, "http://www.w3.org/XML/1998/namespace", false); + }); + ["tabIndex", "crossOrigin"].forEach(function(a) { + D[a] = new B(a, 1, false, a.toLowerCase(), null, false); + }); + D.xlinkHref = new B("xlinkHref", 1, false, "xlink:href", "http://www.w3.org/1999/xlink", true); + ["src", "href", "action", "formAction"].forEach(function(a) { + D[a] = new B(a, 1, false, a.toLowerCase(), null, true); + }); + function ub(a) { + switch (typeof a) { + case "boolean": + case "number": + case "object": + case "string": + case "undefined": + return a; + default: + return ""; + } + } + function vb(a, b, c, d) { + var e = D.hasOwnProperty(b) ? D[b] : null; + var f = null !== e ? 0 === e.type : d ? false : !(2 < b.length) || "o" !== b[0] && "O" !== b[0] || "n" !== b[1] && "N" !== b[1] ? false : true; + f || (rb(b, c, e, d) && (c = null), d || null === e ? pb(b) && (null === c ? a.removeAttribute(b) : a.setAttribute(b, "" + c)) : e.mustUseProperty ? a[e.propertyName] = null === c ? 3 === e.type ? false : "" : c : (b = e.attributeName, d = e.attributeNamespace, null === c ? a.removeAttribute(b) : (e = e.type, c = 3 === e || 4 === e && true === c ? "" : "" + c, d ? a.setAttributeNS(d, b, c) : a.setAttribute(b, c)))); + } + function wb(a) { + var b = a.type; + return (a = a.nodeName) && "input" === a.toLowerCase() && ("checkbox" === b || "radio" === b); + } + function xb(a) { + var b = wb(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: true, get: function() { + return e.call(this); + }, set: function(a2) { + d = "" + a2; + f.call(this, a2); + } }); + Object.defineProperty(a, b, { enumerable: c.enumerable }); + return { getValue: function() { + return d; + }, setValue: function(a2) { + d = "" + a2; + }, stopTracking: function() { + a._valueTracker = null; + delete a[b]; + } }; + } + } + function yb(a) { + a._valueTracker || (a._valueTracker = xb(a)); + } + function zb(a) { + if (!a) return false; + var b = a._valueTracker; + if (!b) return true; + var c = b.getValue(); + var d = ""; + a && (d = wb(a) ? a.checked ? "true" : "false" : a.value); + a = d; + return a !== c ? (b.setValue(a), true) : false; + } + function Ab(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 Bb(a, b) { + var c = null == b.defaultValue ? "" : b.defaultValue, d = null != b.checked ? b.checked : b.defaultChecked; + c = ub(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 Cb(a, b) { + b = b.checked; + null != b && vb(a, "checked", b, false); + } + function Eb(a, b) { + Cb(a, b); + var c = ub(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") ? Fb(a, b.type, c) : b.hasOwnProperty("defaultValue") && Fb(a, b.type, ub(b.defaultValue)); + null == b.checked && null != b.defaultChecked && (a.defaultChecked = !!b.defaultChecked); + } + function Gb(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.defaultChecked; + a.defaultChecked = !!a._wrapperState.initialChecked; + "" !== c && (a.name = c); + } + function Fb(a, b, c) { + if ("number" !== b || a.ownerDocument.activeElement !== a) null == c ? a.defaultValue = "" + a._wrapperState.initialValue : a.defaultValue !== "" + c && (a.defaultValue = "" + c); + } + function Hb(a) { + var b = ""; + aa.Children.forEach(a, function(a2) { + null != a2 && (b += a2); + }); + return b; + } + function Ib(a, b) { + a = n({ children: void 0 }, b); + if (b = Hb(b.children)) a.children = b; + return a; + } + function Jb(a, b, c, d) { + a = a.options; + if (b) { + b = {}; + for (var e = 0; e < c.length; e++) b["$" + c[e]] = true; + 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 = true); + } else { + c = "" + ub(c); + b = null; + for (e = 0; e < a.length; e++) { + if (a[e].value === c) { + a[e].selected = true; + d && (a[e].defaultSelected = true); + return; + } + null !== b || a[e].disabled || (b = a[e]); + } + null !== b && (b.selected = true); + } + } + function Kb(a, b) { + if (null != b.dangerouslySetInnerHTML) throw Error(u(91)); + return n({}, b, { value: void 0, defaultValue: void 0, children: "" + a._wrapperState.initialValue }); + } + function Lb(a, b) { + var c = b.value; + if (null == c) { + c = b.defaultValue; + b = b.children; + if (null != b) { + if (null != c) throw Error(u(92)); + if (Array.isArray(b)) { + if (!(1 >= b.length)) throw Error(u(93)); + b = b[0]; + } + c = b; + } + null == c && (c = ""); + } + a._wrapperState = { initialValue: ub(c) }; + } + function Mb(a, b) { + var c = ub(b.value), d = ub(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 Nb(a) { + var b = a.textContent; + b === a._wrapperState.initialValue && "" !== b && null !== b && (a.value = b); + } + var Ob = { html: "http://www.w3.org/1999/xhtml", mathml: "http://www.w3.org/1998/Math/MathML", svg: "http://www.w3.org/2000/svg" }; + function Pb(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 Qb(a, b) { + return null == a || "http://www.w3.org/1999/xhtml" === a ? Pb(b) : "http://www.w3.org/2000/svg" === a && "foreignObject" === b ? "http://www.w3.org/1999/xhtml" : a; + } + var Rb; + var Sb = 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 !== Ob.svg || "innerHTML" in a) a.innerHTML = b; + else { + Rb = Rb || document.createElement("div"); + Rb.innerHTML = "" + b.valueOf().toString() + ""; + for (b = Rb.firstChild; a.firstChild; ) a.removeChild(a.firstChild); + for (; b.firstChild; ) a.appendChild(b.firstChild); + } + }); + function Tb(a, b) { + if (b) { + var c = a.firstChild; + if (c && c === a.lastChild && 3 === c.nodeType) { + c.nodeValue = b; + return; + } + } + a.textContent = b; + } + function Ub(a, b) { + var c = {}; + c[a.toLowerCase()] = b.toLowerCase(); + c["Webkit" + a] = "webkit" + b; + c["Moz" + a] = "moz" + b; + return c; + } + var Vb = { animationend: Ub("Animation", "AnimationEnd"), animationiteration: Ub("Animation", "AnimationIteration"), animationstart: Ub("Animation", "AnimationStart"), transitionend: Ub("Transition", "TransitionEnd") }; + var Wb = {}; + var Xb = {}; + Ya && (Xb = document.createElement("div").style, "AnimationEvent" in window || (delete Vb.animationend.animation, delete Vb.animationiteration.animation, delete Vb.animationstart.animation), "TransitionEvent" in window || delete Vb.transitionend.transition); + function Yb(a) { + if (Wb[a]) return Wb[a]; + if (!Vb[a]) return a; + var b = Vb[a], c; + for (c in b) if (b.hasOwnProperty(c) && c in Xb) return Wb[a] = b[c]; + return a; + } + var Zb = Yb("animationend"); + var $b = Yb("animationiteration"); + var ac = Yb("animationstart"); + var bc = Yb("transitionend"); + var dc = "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "); + function ec(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 fc(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 gc(a) { + if (ec(a) !== a) throw Error(u(188)); + } + function hc(a) { + var b = a.alternate; + if (!b) { + b = ec(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 gc(e), a; + if (f === d) return gc(e), b; + f = f.sibling; + } + throw Error(u(188)); + } + if (c.return !== d.return) c = e, d = f; + else { + for (var g = false, h = e.child; h; ) { + if (h === c) { + g = true; + c = e; + d = f; + break; + } + if (h === d) { + g = true; + d = e; + c = f; + break; + } + h = h.sibling; + } + if (!g) { + for (h = f.child; h; ) { + if (h === c) { + g = true; + c = f; + d = e; + break; + } + if (h === d) { + g = true; + 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 ic(a) { + a = hc(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; + } + var jc; + var kc; + var lc; + var mc = false; + var nc = []; + var oc = null; + var pc = null; + var qc = null; + var rc = /* @__PURE__ */ new Map(); + var sc = /* @__PURE__ */ new Map(); + var tc = []; + var uc = "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(" "); + var vc = "focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture".split(" "); + function wc(a) { + var b = xc(a); + uc.forEach(function(c) { + yc(c, a, b); + }); + vc.forEach(function(c) { + yc(c, a, b); + }); + } + function zc(a, b, c, d) { + return { blockedOn: a, topLevelType: b, eventSystemFlags: c | 32, nativeEvent: d }; + } + function Ac(a, b) { + switch (a) { + case "focus": + case "blur": + oc = null; + break; + case "dragenter": + case "dragleave": + pc = null; + break; + case "mouseover": + case "mouseout": + qc = null; + break; + case "pointerover": + case "pointerout": + rc.delete(b.pointerId); + break; + case "gotpointercapture": + case "lostpointercapture": + sc.delete(b.pointerId); + } + } + function Bc(a, b, c, d, e) { + if (null === a || a.nativeEvent !== e) return a = zc(b, c, d, e), null !== b && (b = Cc(b), null !== b && kc(b)), a; + a.eventSystemFlags |= d; + return a; + } + function Dc(a, b, c, d) { + switch (b) { + case "focus": + return oc = Bc(oc, a, b, c, d), true; + case "dragenter": + return pc = Bc(pc, a, b, c, d), true; + case "mouseover": + return qc = Bc(qc, a, b, c, d), true; + case "pointerover": + var e = d.pointerId; + rc.set(e, Bc(rc.get(e) || null, a, b, c, d)); + return true; + case "gotpointercapture": + return e = d.pointerId, sc.set(e, Bc(sc.get(e) || null, a, b, c, d)), true; + } + return false; + } + function Ec(a) { + var b = Fc(a.target); + if (null !== b) { + var c = ec(b); + if (null !== c) { + if (b = c.tag, 13 === b) { + if (b = fc(c), null !== b) { + a.blockedOn = b; + q.unstable_runWithPriority(a.priority, function() { + lc(c); + }); + return; + } + } else if (3 === b && c.stateNode.hydrate) { + a.blockedOn = 3 === c.tag ? c.stateNode.containerInfo : null; + return; + } + } + } + a.blockedOn = null; + } + function Gc(a) { + if (null !== a.blockedOn) return false; + var b = Hc(a.topLevelType, a.eventSystemFlags, a.nativeEvent); + if (null !== b) { + var c = Cc(b); + null !== c && kc(c); + a.blockedOn = b; + return false; + } + return true; + } + function Ic(a, b, c) { + Gc(a) && c.delete(b); + } + function Jc() { + for (mc = false; 0 < nc.length; ) { + var a = nc[0]; + if (null !== a.blockedOn) { + a = Cc(a.blockedOn); + null !== a && jc(a); + break; + } + var b = Hc(a.topLevelType, a.eventSystemFlags, a.nativeEvent); + null !== b ? a.blockedOn = b : nc.shift(); + } + null !== oc && Gc(oc) && (oc = null); + null !== pc && Gc(pc) && (pc = null); + null !== qc && Gc(qc) && (qc = null); + rc.forEach(Ic); + sc.forEach(Ic); + } + function Kc(a, b) { + a.blockedOn === b && (a.blockedOn = null, mc || (mc = true, q.unstable_scheduleCallback(q.unstable_NormalPriority, Jc))); + } + function Lc(a) { + function b(b2) { + return Kc(b2, a); + } + if (0 < nc.length) { + Kc(nc[0], a); + for (var c = 1; c < nc.length; c++) { + var d = nc[c]; + d.blockedOn === a && (d.blockedOn = null); + } + } + null !== oc && Kc(oc, a); + null !== pc && Kc(pc, a); + null !== qc && Kc(qc, a); + rc.forEach(b); + sc.forEach(b); + for (c = 0; c < tc.length; c++) d = tc[c], d.blockedOn === a && (d.blockedOn = null); + for (; 0 < tc.length && (c = tc[0], null === c.blockedOn); ) Ec(c), null === c.blockedOn && tc.shift(); + } + function Mc(a) { + a = a.target || a.srcElement || window; + a.correspondingUseElement && (a = a.correspondingUseElement); + return 3 === a.nodeType ? a.parentNode : a; + } + function Nc(a) { + do + a = a.return; + while (a && 5 !== a.tag); + return a ? a : null; + } + function Oc(a, b, c) { + if (b = Da(a, c.dispatchConfig.phasedRegistrationNames[b])) c._dispatchListeners = xa(c._dispatchListeners, b), c._dispatchInstances = xa(c._dispatchInstances, a); + } + function Pc(a) { + if (a && a.dispatchConfig.phasedRegistrationNames) { + for (var b = a._targetInst, c = []; b; ) c.push(b), b = Nc(b); + for (b = c.length; 0 < b--; ) Oc(c[b], "captured", a); + for (b = 0; b < c.length; b++) Oc(c[b], "bubbled", a); + } + } + function Qc(a, b, c) { + a && c && c.dispatchConfig.registrationName && (b = Da(a, c.dispatchConfig.registrationName)) && (c._dispatchListeners = xa(c._dispatchListeners, b), c._dispatchInstances = xa(c._dispatchInstances, a)); + } + function Rc(a) { + a && a.dispatchConfig.registrationName && Qc(a._targetInst, null, a); + } + function Sc(a) { + ya(a, Pc); + } + function Tc() { + return true; + } + function Uc() { + return false; + } + function E(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 : false === c.returnValue) ? Tc : Uc; + this.isPropagationStopped = Uc; + return this; + } + n(E.prototype, { preventDefault: function() { + this.defaultPrevented = true; + var a = this.nativeEvent; + a && (a.preventDefault ? a.preventDefault() : "unknown" !== typeof a.returnValue && (a.returnValue = false), this.isDefaultPrevented = Tc); + }, stopPropagation: function() { + var a = this.nativeEvent; + a && (a.stopPropagation ? a.stopPropagation() : "unknown" !== typeof a.cancelBubble && (a.cancelBubble = true), this.isPropagationStopped = Tc); + }, persist: function() { + this.isPersistent = Tc; + }, isPersistent: Uc, 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 = Uc; + this._dispatchInstances = this._dispatchListeners = null; + } }); + E.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 }; + E.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; + Vc(c); + return c; + }; + Vc(E); + function Wc(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 Xc(a) { + if (!(a instanceof this)) throw Error(u(279)); + a.destructor(); + 10 > this.eventPool.length && this.eventPool.push(a); + } + function Vc(a) { + a.eventPool = []; + a.getPooled = Wc; + a.release = Xc; + } + var Yc = E.extend({ animationName: null, elapsedTime: null, pseudoElement: null }); + var Zc = E.extend({ clipboardData: function(a) { + return "clipboardData" in a ? a.clipboardData : window.clipboardData; + } }); + var $c = E.extend({ view: null, detail: null }); + var ad = $c.extend({ relatedTarget: null }); + function bd(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 cd = { Esc: "Escape", Spacebar: " ", Left: "ArrowLeft", Up: "ArrowUp", Right: "ArrowRight", Down: "ArrowDown", Del: "Delete", Win: "OS", Menu: "ContextMenu", Apps: "ContextMenu", Scroll: "ScrollLock", MozPrintableKey: "Unidentified" }; + var ed = { + 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" + }; + var fd = { Alt: "altKey", Control: "ctrlKey", Meta: "metaKey", Shift: "shiftKey" }; + function gd(a) { + var b = this.nativeEvent; + return b.getModifierState ? b.getModifierState(a) : (a = fd[a]) ? !!b[a] : false; + } + function hd() { + return gd; + } + var id = $c.extend({ key: function(a) { + if (a.key) { + var b = cd[a.key] || a.key; + if ("Unidentified" !== b) return b; + } + return "keypress" === a.type ? (a = bd(a), 13 === a ? "Enter" : String.fromCharCode(a)) : "keydown" === a.type || "keyup" === a.type ? ed[a.keyCode] || "Unidentified" : ""; + }, location: null, ctrlKey: null, shiftKey: null, altKey: null, metaKey: null, repeat: null, locale: null, getModifierState: hd, charCode: function(a) { + return "keypress" === a.type ? bd(a) : 0; + }, keyCode: function(a) { + return "keydown" === a.type || "keyup" === a.type ? a.keyCode : 0; + }, which: function(a) { + return "keypress" === a.type ? bd(a) : "keydown" === a.type || "keyup" === a.type ? a.keyCode : 0; + } }); + var jd = 0; + var kd = 0; + var ld = false; + var md = false; + var nd = $c.extend({ screenX: null, screenY: null, clientX: null, clientY: null, pageX: null, pageY: null, ctrlKey: null, shiftKey: null, altKey: null, metaKey: null, getModifierState: hd, 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 = jd; + jd = a.screenX; + return ld ? "mousemove" === a.type ? a.screenX - b : 0 : (ld = true, 0); + }, movementY: function(a) { + if ("movementY" in a) return a.movementY; + var b = kd; + kd = a.screenY; + return md ? "mousemove" === a.type ? a.screenY - b : 0 : (md = true, 0); + } }); + var od = nd.extend({ pointerId: null, width: null, height: null, pressure: null, tangentialPressure: null, tiltX: null, tiltY: null, twist: null, pointerType: null, isPrimary: null }); + var pd = nd.extend({ dataTransfer: null }); + var qd = $c.extend({ touches: null, targetTouches: null, changedTouches: null, altKey: null, metaKey: null, ctrlKey: null, shiftKey: null, getModifierState: hd }); + var rd = E.extend({ + propertyName: null, + elapsedTime: null, + pseudoElement: null + }); + var sd = nd.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 }); + var td = [["blur", "blur", 0], ["cancel", "cancel", 0], ["click", "click", 0], ["close", "close", 0], ["contextmenu", "contextMenu", 0], ["copy", "copy", 0], ["cut", "cut", 0], ["auxclick", "auxClick", 0], ["dblclick", "doubleClick", 0], [ + "dragend", + "dragEnd", + 0 + ], ["dragstart", "dragStart", 0], ["drop", "drop", 0], ["focus", "focus", 0], ["input", "input", 0], ["invalid", "invalid", 0], ["keydown", "keyDown", 0], ["keypress", "keyPress", 0], ["keyup", "keyUp", 0], ["mousedown", "mouseDown", 0], ["mouseup", "mouseUp", 0], ["paste", "paste", 0], ["pause", "pause", 0], ["play", "play", 0], ["pointercancel", "pointerCancel", 0], ["pointerdown", "pointerDown", 0], ["pointerup", "pointerUp", 0], ["ratechange", "rateChange", 0], ["reset", "reset", 0], ["seeked", "seeked", 0], ["submit", "submit", 0], [ + "touchcancel", + "touchCancel", + 0 + ], ["touchend", "touchEnd", 0], ["touchstart", "touchStart", 0], ["volumechange", "volumeChange", 0], ["drag", "drag", 1], ["dragenter", "dragEnter", 1], ["dragexit", "dragExit", 1], ["dragleave", "dragLeave", 1], ["dragover", "dragOver", 1], ["mousemove", "mouseMove", 1], ["mouseout", "mouseOut", 1], ["mouseover", "mouseOver", 1], ["pointermove", "pointerMove", 1], ["pointerout", "pointerOut", 1], ["pointerover", "pointerOver", 1], ["scroll", "scroll", 1], ["toggle", "toggle", 1], ["touchmove", "touchMove", 1], ["wheel", "wheel", 1], [ + "abort", + "abort", + 2 + ], [Zb, "animationEnd", 2], [$b, "animationIteration", 2], [ac, "animationStart", 2], ["canplay", "canPlay", 2], ["canplaythrough", "canPlayThrough", 2], ["durationchange", "durationChange", 2], ["emptied", "emptied", 2], ["encrypted", "encrypted", 2], ["ended", "ended", 2], ["error", "error", 2], ["gotpointercapture", "gotPointerCapture", 2], ["load", "load", 2], ["loadeddata", "loadedData", 2], ["loadedmetadata", "loadedMetadata", 2], ["loadstart", "loadStart", 2], ["lostpointercapture", "lostPointerCapture", 2], ["playing", "playing", 2], [ + "progress", + "progress", + 2 + ], ["seeking", "seeking", 2], ["stalled", "stalled", 2], ["suspend", "suspend", 2], ["timeupdate", "timeUpdate", 2], [bc, "transitionEnd", 2], ["waiting", "waiting", 2]]; + var ud = {}; + var vd = {}; + var xd = 0; + for (; xd < td.length; xd++) { + yd = td[xd], zd = yd[0], Ad = yd[1], Bd = yd[2], Cd = "on" + (Ad[0].toUpperCase() + Ad.slice(1)), Dd = { phasedRegistrationNames: { bubbled: Cd, captured: Cd + "Capture" }, dependencies: [zd], eventPriority: Bd }; + ud[Ad] = Dd; + vd[zd] = Dd; + } + var yd; + var zd; + var Ad; + var Bd; + var Cd; + var Dd; + var Ed = { eventTypes: ud, getEventPriority: function(a) { + a = vd[a]; + return void 0 !== a ? a.eventPriority : 2; + }, extractEvents: function(a, b, c, d) { + var e = vd[a]; + if (!e) return null; + switch (a) { + case "keypress": + if (0 === bd(c)) return null; + case "keydown": + case "keyup": + a = id; + break; + case "blur": + case "focus": + a = ad; + 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 = nd; + break; + case "drag": + case "dragend": + case "dragenter": + case "dragexit": + case "dragleave": + case "dragover": + case "dragstart": + case "drop": + a = pd; + break; + case "touchcancel": + case "touchend": + case "touchmove": + case "touchstart": + a = qd; + break; + case Zb: + case $b: + case ac: + a = Yc; + break; + case bc: + a = rd; + break; + case "scroll": + a = $c; + break; + case "wheel": + a = sd; + break; + case "copy": + case "cut": + case "paste": + a = Zc; + break; + case "gotpointercapture": + case "lostpointercapture": + case "pointercancel": + case "pointerdown": + case "pointermove": + case "pointerout": + case "pointerover": + case "pointerup": + a = od; + break; + default: + a = E; + } + b = a.getPooled(e, b, c, d); + Sc(b); + return b; + } }; + var Fd = q.unstable_UserBlockingPriority; + var Gd = q.unstable_runWithPriority; + var Hd = Ed.getEventPriority; + var Id = 10; + var Jd = []; + function Kd(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 = Fc(d); + } while (c); + for (c = 0; c < a.ancestors.length; c++) { + b = a.ancestors[c]; + var e = Mc(a.nativeEvent); + d = a.topLevelType; + for (var f = a.nativeEvent, g = a.eventSystemFlags, h = null, k = 0; k < ea.length; k++) { + var l = ea[k]; + l && (l = l.extractEvents(d, b, f, e, g)) && (h = xa(h, l)); + } + Ba(h); + } + } + var Ld = true; + function F(a, b) { + Md(b, a, false); + } + function Md(a, b, c) { + switch (Hd(b)) { + case 0: + var d = Nd.bind(null, b, 1); + break; + case 1: + d = Od.bind(null, b, 1); + break; + default: + d = Pd.bind(null, b, 1); + } + c ? a.addEventListener(b, d, true) : a.addEventListener(b, d, false); + } + function Nd(a, b, c) { + ib || gb(); + var d = Pd, e = ib; + ib = true; + try { + fb(d, a, b, c); + } finally { + (ib = e) || kb(); + } + } + function Od(a, b, c) { + Gd(Fd, Pd.bind(null, a, b, c)); + } + function Qd(a, b, c, d) { + if (Jd.length) { + var e = Jd.pop(); + e.topLevelType = a; + e.eventSystemFlags = b; + e.nativeEvent = c; + e.targetInst = d; + a = e; + } else a = { topLevelType: a, eventSystemFlags: b, nativeEvent: c, targetInst: d, ancestors: [] }; + try { + if (b = Kd, c = a, jb) b(c, void 0); + else { + jb = true; + try { + hb(b, c, void 0); + } finally { + jb = false, kb(); + } + } + } finally { + a.topLevelType = null, a.nativeEvent = null, a.targetInst = null, a.ancestors.length = 0, Jd.length < Id && Jd.push(a); + } + } + function Pd(a, b, c) { + if (Ld) if (0 < nc.length && -1 < uc.indexOf(a)) a = zc(null, a, b, c), nc.push(a); + else { + var d = Hc(a, b, c); + null === d ? Ac(a, c) : -1 < uc.indexOf(a) ? (a = zc(d, a, b, c), nc.push(a)) : Dc(d, a, b, c) || (Ac(a, c), Qd(a, b, c, null)); + } + } + function Hc(a, b, c) { + var d = Mc(c); + d = Fc(d); + if (null !== d) { + var e = ec(d); + if (null === e) d = null; + else { + var f = e.tag; + if (13 === f) { + d = fc(e); + if (null !== d) return d; + d = null; + } else if (3 === f) { + if (e.stateNode.hydrate) return 3 === e.tag ? e.stateNode.containerInfo : null; + d = null; + } else e !== d && (d = null); + } + } + Qd(a, b, c, d); + return null; + } + function Rd(a) { + if (!Ya) return false; + 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 Sd = new ("function" === typeof WeakMap ? WeakMap : Map)(); + function xc(a) { + var b = Sd.get(a); + void 0 === b && (b = /* @__PURE__ */ new Set(), Sd.set(a, b)); + return b; + } + function yc(a, b, c) { + if (!c.has(a)) { + switch (a) { + case "scroll": + Md(b, "scroll", true); + break; + case "focus": + case "blur": + Md(b, "focus", true); + Md(b, "blur", true); + c.add("blur"); + c.add("focus"); + break; + case "cancel": + case "close": + Rd(a) && Md(b, a, true); + break; + case "invalid": + case "submit": + case "reset": + break; + default: + -1 === dc.indexOf(a) && F(a, b); + } + c.add(a); + } + } + var Td = { + animationIterationCount: true, + borderImageOutset: true, + borderImageSlice: true, + borderImageWidth: true, + boxFlex: true, + boxFlexGroup: true, + boxOrdinalGroup: true, + columnCount: true, + columns: true, + flex: true, + flexGrow: true, + flexPositive: true, + flexShrink: true, + flexNegative: true, + flexOrder: true, + gridArea: true, + gridRow: true, + gridRowEnd: true, + gridRowSpan: true, + gridRowStart: true, + gridColumn: true, + gridColumnEnd: true, + gridColumnSpan: true, + gridColumnStart: true, + fontWeight: true, + lineClamp: true, + lineHeight: true, + opacity: true, + order: true, + orphans: true, + tabSize: true, + widows: true, + zIndex: true, + zoom: true, + fillOpacity: true, + floodOpacity: true, + stopOpacity: true, + strokeDasharray: true, + strokeDashoffset: true, + strokeMiterlimit: true, + strokeOpacity: true, + strokeWidth: true + }; + var Ud = ["Webkit", "ms", "Moz", "O"]; + Object.keys(Td).forEach(function(a) { + Ud.forEach(function(b) { + b = b + a.charAt(0).toUpperCase() + a.substring(1); + Td[b] = Td[a]; + }); + }); + function Vd(a, b, c) { + return null == b || "boolean" === typeof b || "" === b ? "" : c || "number" !== typeof b || 0 === b || Td.hasOwnProperty(a) && Td[a] ? ("" + b).trim() : b + "px"; + } + function Wd(a, b) { + a = a.style; + for (var c in b) if (b.hasOwnProperty(c)) { + var d = 0 === c.indexOf("--"), e = Vd(c, b[c], d); + "float" === c && (c = "cssFloat"); + d ? a.setProperty(c, e) : a[c] = e; + } + } + var Xd = n({ menuitem: true }, { area: true, base: true, br: true, col: true, embed: true, hr: true, img: true, input: true, keygen: true, link: true, meta: true, param: true, source: true, track: true, wbr: true }); + function Yd(a, b) { + if (b) { + if (Xd[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 Zd(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 false; + default: + return true; + } + } + function $d(a, b) { + a = 9 === a.nodeType || 11 === a.nodeType ? a : a.ownerDocument; + var c = xc(a); + b = ja[b]; + for (var d = 0; d < b.length; d++) yc(b[d], a, c); + } + function ae() { + } + function be(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 ce(a) { + for (; a && a.firstChild; ) a = a.firstChild; + return a; + } + function de(a, b) { + var c = ce(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 = ce(c); + } + } + function ee(a, b) { + return a && b ? a === b ? true : a && 3 === a.nodeType ? false : b && 3 === b.nodeType ? ee(a, b.parentNode) : "contains" in a ? a.contains(b) : a.compareDocumentPosition ? !!(a.compareDocumentPosition(b) & 16) : false : false; + } + function fe() { + for (var a = window, b = be(); b instanceof a.HTMLIFrameElement; ) { + try { + var c = "string" === typeof b.contentWindow.location.href; + } catch (d) { + c = false; + } + if (c) a = b.contentWindow; + else break; + b = be(a.document); + } + return b; + } + function ge(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 he = "$"; + var ie = "/$"; + var je = "$?"; + var ke = "$!"; + var le = null; + var me = null; + function ne(a, b) { + switch (a) { + case "button": + case "input": + case "select": + case "textarea": + return !!b.autoFocus; + } + return false; + } + function oe(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 pe = "function" === typeof setTimeout ? setTimeout : void 0; + var qe = "function" === typeof clearTimeout ? clearTimeout : void 0; + function re(a) { + for (; null != a; a = a.nextSibling) { + var b = a.nodeType; + if (1 === b || 3 === b) break; + } + return a; + } + function se(a) { + a = a.previousSibling; + for (var b = 0; a; ) { + if (8 === a.nodeType) { + var c = a.data; + if (c === he || c === ke || c === je) { + if (0 === b) return a; + b--; + } else c === ie && b++; + } + a = a.previousSibling; + } + return null; + } + var te = Math.random().toString(36).slice(2); + var ue = "__reactInternalInstance$" + te; + var ve = "__reactEventHandlers$" + te; + var we = "__reactContainere$" + te; + function Fc(a) { + var b = a[ue]; + if (b) return b; + for (var c = a.parentNode; c; ) { + if (b = c[we] || c[ue]) { + c = b.alternate; + if (null !== b.child || null !== c && null !== c.child) for (a = se(a); null !== a; ) { + if (c = a[ue]) return c; + a = se(a); + } + return b; + } + a = c; + c = a.parentNode; + } + return null; + } + function Cc(a) { + a = a[ue] || a[we]; + return !a || 5 !== a.tag && 6 !== a.tag && 13 !== a.tag && 3 !== a.tag ? null : a; + } + function xe(a) { + if (5 === a.tag || 6 === a.tag) return a.stateNode; + throw Error(u(33)); + } + function ye(a) { + return a[ve] || null; + } + var ze = null; + var Ae = null; + var Be = null; + function Ce() { + if (Be) return Be; + var a, b = Ae, c = b.length, d, e = "value" in ze ? ze.value : ze.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 Be = e.slice(a, 1 < d ? 1 - d : void 0); + } + var De = E.extend({ data: null }); + var Ee = E.extend({ data: null }); + var Fe = [9, 13, 27, 32]; + var Ge = Ya && "CompositionEvent" in window; + var He = null; + Ya && "documentMode" in document && (He = document.documentMode); + var Ie = Ya && "TextEvent" in window && !He; + var Je = Ya && (!Ge || He && 8 < He && 11 >= He); + var Ke = String.fromCharCode(32); + var Le = { 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(" ") } }; + var Me = false; + function Ne(a, b) { + switch (a) { + case "keyup": + return -1 !== Fe.indexOf(b.keyCode); + case "keydown": + return 229 !== b.keyCode; + case "keypress": + case "mousedown": + case "blur": + return true; + default: + return false; + } + } + function Oe(a) { + a = a.detail; + return "object" === typeof a && "data" in a ? a.data : null; + } + var Pe = false; + function Qe(a, b) { + switch (a) { + case "compositionend": + return Oe(b); + case "keypress": + if (32 !== b.which) return null; + Me = true; + return Ke; + case "textInput": + return a = b.data, a === Ke && Me ? null : a; + default: + return null; + } + } + function Re(a, b) { + if (Pe) return "compositionend" === a || !Ge && Ne(a, b) ? (a = Ce(), Be = Ae = ze = null, Pe = false, 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 Je && "ko" !== b.locale ? null : b.data; + default: + return null; + } + } + var Se = { eventTypes: Le, extractEvents: function(a, b, c, d) { + var e; + if (Ge) b: { + switch (a) { + case "compositionstart": + var f = Le.compositionStart; + break b; + case "compositionend": + f = Le.compositionEnd; + break b; + case "compositionupdate": + f = Le.compositionUpdate; + break b; + } + f = void 0; + } + else Pe ? Ne(a, c) && (f = Le.compositionEnd) : "keydown" === a && 229 === c.keyCode && (f = Le.compositionStart); + f ? (Je && "ko" !== c.locale && (Pe || f !== Le.compositionStart ? f === Le.compositionEnd && Pe && (e = Ce()) : (ze = d, Ae = "value" in ze ? ze.value : ze.textContent, Pe = true)), f = De.getPooled( + f, + b, + c, + d + ), e ? f.data = e : (e = Oe(c), null !== e && (f.data = e)), Sc(f), e = f) : e = null; + (a = Ie ? Qe(a, c) : Re(a, c)) ? (b = Ee.getPooled(Le.beforeInput, b, c, d), b.data = a, Sc(b)) : b = null; + return null === e ? b : null === b ? e : [e, b]; + } }; + var Te = { color: true, date: true, datetime: true, "datetime-local": true, email: true, month: true, number: true, password: true, range: true, search: true, tel: true, text: true, time: true, url: true, week: true }; + function Ue(a) { + var b = a && a.nodeName && a.nodeName.toLowerCase(); + return "input" === b ? !!Te[a.type] : "textarea" === b ? true : false; + } + var Ve = { change: { phasedRegistrationNames: { bubbled: "onChange", captured: "onChangeCapture" }, dependencies: "blur change click focus input keydown keyup selectionchange".split(" ") } }; + function We(a, b, c) { + a = E.getPooled(Ve.change, a, b, c); + a.type = "change"; + cb(c); + Sc(a); + return a; + } + var Xe = null; + var Ye = null; + function Ze(a) { + Ba(a); + } + function $e(a) { + var b = xe(a); + if (zb(b)) return a; + } + function af(a, b) { + if ("change" === a) return b; + } + var bf = false; + Ya && (bf = Rd("input") && (!document.documentMode || 9 < document.documentMode)); + function cf() { + Xe && (Xe.detachEvent("onpropertychange", df), Ye = Xe = null); + } + function df(a) { + if ("value" === a.propertyName && $e(Ye)) if (a = We(Ye, a, Mc(a)), ib) Ba(a); + else { + ib = true; + try { + eb(Ze, a); + } finally { + ib = false, kb(); + } + } + } + function ef(a, b, c) { + "focus" === a ? (cf(), Xe = b, Ye = c, Xe.attachEvent("onpropertychange", df)) : "blur" === a && cf(); + } + function ff(a) { + if ("selectionchange" === a || "keyup" === a || "keydown" === a) return $e(Ye); + } + function gf(a, b) { + if ("click" === a) return $e(b); + } + function hf(a, b) { + if ("input" === a || "change" === a) return $e(b); + } + var jf = { eventTypes: Ve, _isInputEventSupported: bf, extractEvents: function(a, b, c, d) { + var e = b ? xe(b) : window, f = e.nodeName && e.nodeName.toLowerCase(); + if ("select" === f || "input" === f && "file" === e.type) var g = af; + else if (Ue(e)) if (bf) g = hf; + else { + g = ff; + var h = ef; + } + else (f = e.nodeName) && "input" === f.toLowerCase() && ("checkbox" === e.type || "radio" === e.type) && (g = gf); + if (g && (g = g(a, b))) return We(g, c, d); + h && h(a, e, b); + "blur" === a && (a = e._wrapperState) && a.controlled && "number" === e.type && Fb(e, "number", e.value); + } }; + var kf = { mouseEnter: { + registrationName: "onMouseEnter", + dependencies: ["mouseout", "mouseover"] + }, mouseLeave: { registrationName: "onMouseLeave", dependencies: ["mouseout", "mouseover"] }, pointerEnter: { registrationName: "onPointerEnter", dependencies: ["pointerout", "pointerover"] }, pointerLeave: { registrationName: "onPointerLeave", dependencies: ["pointerout", "pointerover"] } }; + var lf; + var mf = { eventTypes: kf, 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; + e = d.window === d ? d : (e = d.ownerDocument) ? e.defaultView || e.parentWindow : window; + if (g) { + if (g = b, b = (b = c.relatedTarget || c.toElement) ? Fc(b) : null, null !== b && (f = ec(b), b !== f || 5 !== b.tag && 6 !== b.tag)) b = null; + } else g = null; + if (g === b) return null; + if ("mouseout" === a || "mouseover" === a) { + var h = nd; + var k = kf.mouseLeave; + var l = kf.mouseEnter; + var m = "mouse"; + } else if ("pointerout" === a || "pointerover" === a) h = od, k = kf.pointerLeave, l = kf.pointerEnter, m = "pointer"; + a = null == g ? e : xe(g); + e = null == b ? e : xe(b); + k = h.getPooled(k, g, c, d); + k.type = m + "leave"; + k.target = a; + k.relatedTarget = e; + d = h.getPooled(l, b, c, d); + d.type = m + "enter"; + d.target = e; + d.relatedTarget = a; + h = g; + m = b; + if (h && m) a: { + l = h; + a = m; + g = 0; + for (b = l; b; b = Nc(b)) g++; + b = 0; + for (e = a; e; e = Nc(e)) b++; + for (; 0 < g - b; ) l = Nc(l), g--; + for (; 0 < b - g; ) a = Nc(a), b--; + for (; g--; ) { + if (l === a || l === a.alternate) break a; + l = Nc(l); + a = Nc(a); + } + l = null; + } + else l = null; + a = l; + for (l = []; h && h !== a; ) { + g = h.alternate; + if (null !== g && g === a) break; + l.push(h); + h = Nc(h); + } + for (h = []; m && m !== a; ) { + g = m.alternate; + if (null !== g && g === a) break; + h.push(m); + m = Nc(m); + } + for (m = 0; m < l.length; m++) Qc(l[m], "bubbled", k); + for (m = h.length; 0 < m--; ) Qc(h[m], "captured", d); + if (c === lf) return lf = null, [k]; + lf = c; + return [k, d]; + } }; + function nf(a, b) { + return a === b && (0 !== a || 1 / a === 1 / b) || a !== a && b !== b; + } + var of = "function" === typeof Object.is ? Object.is : nf; + var pf = Object.prototype.hasOwnProperty; + function qf(a, b) { + if (of(a, b)) return true; + if ("object" !== typeof a || null === a || "object" !== typeof b || null === b) return false; + var c = Object.keys(a), d = Object.keys(b); + if (c.length !== d.length) return false; + for (d = 0; d < c.length; d++) if (!pf.call(b, c[d]) || !of(a[c[d]], b[c[d]])) return false; + return true; + } + var rf = Ya && "documentMode" in document && 11 >= document.documentMode; + var sf = { select: { phasedRegistrationNames: { bubbled: "onSelect", captured: "onSelectCapture" }, dependencies: "blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ") } }; + var tf = null; + var uf = null; + var vf = null; + var wf = false; + function xf(a, b) { + var c = b.window === b ? b.document : 9 === b.nodeType ? b : b.ownerDocument; + if (wf || null == tf || tf !== be(c)) return null; + c = tf; + "selectionStart" in c && ge(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 vf && qf(vf, c) ? null : (vf = c, a = E.getPooled(sf.select, uf, a, b), a.type = "select", a.target = tf, Sc(a), a); + } + var yf = { eventTypes: sf, extractEvents: function(a, b, c, d) { + var e = d.window === d ? d.document : 9 === d.nodeType ? d : d.ownerDocument, f; + if (!(f = !e)) { + a: { + e = xc(e); + f = ja.onSelect; + for (var g = 0; g < f.length; g++) if (!e.has(f[g])) { + e = false; + break a; + } + e = true; + } + f = !e; + } + if (f) return null; + e = b ? xe(b) : window; + switch (a) { + case "focus": + if (Ue(e) || "true" === e.contentEditable) tf = e, uf = b, vf = null; + break; + case "blur": + vf = uf = tf = null; + break; + case "mousedown": + wf = true; + break; + case "contextmenu": + case "mouseup": + case "dragend": + return wf = false, xf(c, d); + case "selectionchange": + if (rf) break; + case "keydown": + case "keyup": + return xf(c, d); + } + return null; + } }; + Ca.injectEventPluginOrder("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")); + var zf = Cc; + sa = ye; + ua = zf; + va = xe; + Ca.injectEventPluginsByName({ SimpleEventPlugin: Ed, EnterLeaveEventPlugin: mf, ChangeEventPlugin: jf, SelectEventPlugin: yf, BeforeInputEventPlugin: Se }); + var Af = []; + var Bf = -1; + function G(a) { + 0 > Bf || (a.current = Af[Bf], Af[Bf] = null, Bf--); + } + function I(a, b) { + Bf++; + Af[Bf] = a.current; + a.current = b; + } + var Cf = {}; + var J = { current: Cf }; + var K = { current: false }; + var Df = Cf; + function Ef(a, b) { + var c = a.type.contextTypes; + if (!c) return Cf; + 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 Ff(a) { + G(K, a); + G(J, a); + } + function Gf(a) { + G(K, a); + G(J, a); + } + function Hf(a, b, c) { + if (J.current !== Cf) throw Error(u(168)); + I(J, b, a); + I(K, c, a); + } + function If(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, Wa(b) || "Unknown", e)); + return n({}, c, {}, d); + } + function Jf(a) { + var b = a.stateNode; + b = b && b.__reactInternalMemoizedMergedChildContext || Cf; + Df = J.current; + I(J, b, a); + I(K, K.current, a); + return true; + } + function Kf(a, b, c) { + var d = a.stateNode; + if (!d) throw Error(u(169)); + c ? (b = If(a, b, Df), d.__reactInternalMemoizedMergedChildContext = b, G(K, a), G(J, a), I(J, b, a)) : G(K, a); + I(K, c, a); + } + var Lf = q.unstable_runWithPriority; + var Mf = q.unstable_scheduleCallback; + var Nf = q.unstable_cancelCallback; + var Of = q.unstable_shouldYield; + var Pf = q.unstable_requestPaint; + var Qf = q.unstable_now; + var Rf = q.unstable_getCurrentPriorityLevel; + var Sf = q.unstable_ImmediatePriority; + var Tf = q.unstable_UserBlockingPriority; + var Uf = q.unstable_NormalPriority; + var Vf = q.unstable_LowPriority; + var Wf = q.unstable_IdlePriority; + var Xf = {}; + var Yf = void 0 !== Pf ? Pf : function() { + }; + var Zf = null; + var $f = null; + var ag = false; + var bg = Qf(); + var cg = 1e4 > bg ? Qf : function() { + return Qf() - bg; + }; + function dg() { + switch (Rf()) { + case Sf: + return 99; + case Tf: + return 98; + case Uf: + return 97; + case Vf: + return 96; + case Wf: + return 95; + default: + throw Error(u(332)); + } + } + function eg(a) { + switch (a) { + case 99: + return Sf; + case 98: + return Tf; + case 97: + return Uf; + case 96: + return Vf; + case 95: + return Wf; + default: + throw Error(u(332)); + } + } + function fg(a, b) { + a = eg(a); + return Lf(a, b); + } + function gg(a, b, c) { + a = eg(a); + return Mf(a, b, c); + } + function hg(a) { + null === Zf ? (Zf = [a], $f = Mf(Sf, ig)) : Zf.push(a); + return Xf; + } + function jg() { + if (null !== $f) { + var a = $f; + $f = null; + Nf(a); + } + ig(); + } + function ig() { + if (!ag && null !== Zf) { + ag = true; + var a = 0; + try { + var b = Zf; + fg(99, function() { + for (; a < b.length; a++) { + var c = b[a]; + do + c = c(true); + while (null !== c); + } + }); + Zf = null; + } catch (c) { + throw null !== Zf && (Zf = Zf.slice(a + 1)), Mf(Sf, jg), c; + } finally { + ag = false; + } + } + } + var kg = 3; + function lg(a, b, c) { + c /= 10; + return 1073741821 - (((1073741821 - a + b / 10) / c | 0) + 1) * c; + } + function mg(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 ng = { current: null }; + var og = null; + var pg = null; + var qg = null; + function rg() { + qg = pg = og = null; + } + function sg(a, b) { + var c = a.type._context; + I(ng, c._currentValue, a); + c._currentValue = b; + } + function tg(a) { + var b = ng.current; + G(ng, a); + a.type._context._currentValue = b; + } + function ug(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 vg(a, b) { + og = a; + qg = pg = null; + a = a.dependencies; + null !== a && null !== a.firstContext && (a.expirationTime >= b && (wg = true), a.firstContext = null); + } + function xg(a, b) { + if (qg !== a && false !== b && 0 !== b) { + if ("number" !== typeof b || 1073741823 === b) qg = a, b = 1073741823; + b = { context: a, observedBits: b, next: null }; + if (null === pg) { + if (null === og) throw Error(u(308)); + pg = b; + og.dependencies = { expirationTime: 0, firstContext: b, responders: null }; + } else pg = pg.next = b; + } + return a._currentValue; + } + var yg = false; + function zg(a) { + return { baseState: a, firstUpdate: null, lastUpdate: null, firstCapturedUpdate: null, lastCapturedUpdate: null, firstEffect: null, lastEffect: null, firstCapturedEffect: null, lastCapturedEffect: null }; + } + function Ag(a) { + return { baseState: a.baseState, firstUpdate: a.firstUpdate, lastUpdate: a.lastUpdate, firstCapturedUpdate: null, lastCapturedUpdate: null, firstEffect: null, lastEffect: null, firstCapturedEffect: null, lastCapturedEffect: null }; + } + function Bg(a, b) { + return { expirationTime: a, suspenseConfig: b, tag: 0, payload: null, callback: null, next: null, nextEffect: null }; + } + function Cg(a, b) { + null === a.lastUpdate ? a.firstUpdate = a.lastUpdate = b : (a.lastUpdate.next = b, a.lastUpdate = b); + } + function Dg(a, b) { + var c = a.alternate; + if (null === c) { + var d = a.updateQueue; + var e = null; + null === d && (d = a.updateQueue = zg(a.memoizedState)); + } else d = a.updateQueue, e = c.updateQueue, null === d ? null === e ? (d = a.updateQueue = zg(a.memoizedState), e = c.updateQueue = zg(c.memoizedState)) : d = a.updateQueue = Ag(e) : null === e && (e = c.updateQueue = Ag(d)); + null === e || d === e ? Cg(d, b) : null === d.lastUpdate || null === e.lastUpdate ? (Cg(d, b), Cg(e, b)) : (Cg(d, b), e.lastUpdate = b); + } + function Eg(a, b) { + var c = a.updateQueue; + c = null === c ? a.updateQueue = zg(a.memoizedState) : Fg(a, c); + null === c.lastCapturedUpdate ? c.firstCapturedUpdate = c.lastCapturedUpdate = b : (c.lastCapturedUpdate.next = b, c.lastCapturedUpdate = b); + } + function Fg(a, b) { + var c = a.alternate; + null !== c && b === c.updateQueue && (b = a.updateQueue = Ag(b)); + return b; + } + function Gg(a, b, c, d, e, f) { + switch (c.tag) { + case 1: + return a = c.payload, "function" === typeof a ? a.call(f, d, e) : a; + case 3: + a.effectTag = a.effectTag & -4097 | 64; + case 0: + a = c.payload; + e = "function" === typeof a ? a.call(f, d, e) : a; + if (null === e || void 0 === e) break; + return n({}, d, e); + case 2: + yg = true; + } + return d; + } + function Hg(a, b, c, d, e) { + yg = false; + b = Fg(a, b); + for (var f = b.baseState, g = null, h = 0, k = b.firstUpdate, l = f; null !== k; ) { + var m = k.expirationTime; + m < e ? (null === g && (g = k, f = l), h < m && (h = m)) : (Ig(m, k.suspenseConfig), l = Gg(a, b, k, l, c, d), null !== k.callback && (a.effectTag |= 32, k.nextEffect = null, null === b.lastEffect ? b.firstEffect = b.lastEffect = k : (b.lastEffect.nextEffect = k, b.lastEffect = k))); + k = k.next; + } + m = null; + for (k = b.firstCapturedUpdate; null !== k; ) { + var C = k.expirationTime; + C < e ? (null === m && (m = k, null === g && (f = l)), h < C && (h = C)) : (l = Gg(a, b, k, l, c, d), null !== k.callback && (a.effectTag |= 32, k.nextEffect = null, null === b.lastCapturedEffect ? b.firstCapturedEffect = b.lastCapturedEffect = k : (b.lastCapturedEffect.nextEffect = k, b.lastCapturedEffect = k))); + k = k.next; + } + null === g && (b.lastUpdate = null); + null === m ? b.lastCapturedUpdate = null : a.effectTag |= 32; + null === g && null === m && (f = l); + b.baseState = f; + b.firstUpdate = g; + b.firstCapturedUpdate = m; + Jg(h); + a.expirationTime = h; + a.memoizedState = l; + } + function Kg(a, b, c) { + null !== b.firstCapturedUpdate && (null !== b.lastUpdate && (b.lastUpdate.next = b.firstCapturedUpdate, b.lastUpdate = b.lastCapturedUpdate), b.firstCapturedUpdate = b.lastCapturedUpdate = null); + Lg(b.firstEffect, c); + b.firstEffect = b.lastEffect = null; + Lg(b.firstCapturedEffect, c); + b.firstCapturedEffect = b.lastCapturedEffect = null; + } + function Lg(a, b) { + for (; null !== a; ) { + var c = a.callback; + if (null !== c) { + a.callback = null; + var d = b; + if ("function" !== typeof c) throw Error(u(191, c)); + c.call(d); + } + a = a.nextEffect; + } + } + var Mg = Ea.ReactCurrentBatchConfig; + var Ng = new aa.Component().refs; + function Og(a, b, c, d) { + b = a.memoizedState; + c = c(d, b); + c = null === c || void 0 === c ? b : n({}, b, c); + a.memoizedState = c; + d = a.updateQueue; + null !== d && 0 === a.expirationTime && (d.baseState = c); + } + var Sg = { isMounted: function(a) { + return (a = a._reactInternalFiber) ? ec(a) === a : false; + }, enqueueSetState: function(a, b, c) { + a = a._reactInternalFiber; + var d = Pg(), e = Mg.suspense; + d = Qg(d, a, e); + e = Bg(d, e); + e.payload = b; + void 0 !== c && null !== c && (e.callback = c); + Dg(a, e); + Rg(a, d); + }, enqueueReplaceState: function(a, b, c) { + a = a._reactInternalFiber; + var d = Pg(), e = Mg.suspense; + d = Qg(d, a, e); + e = Bg(d, e); + e.tag = 1; + e.payload = b; + void 0 !== c && null !== c && (e.callback = c); + Dg(a, e); + Rg(a, d); + }, enqueueForceUpdate: function(a, b) { + a = a._reactInternalFiber; + var c = Pg(), d = Mg.suspense; + c = Qg(c, a, d); + d = Bg(c, d); + d.tag = 2; + void 0 !== b && null !== b && (d.callback = b); + Dg(a, d); + Rg(a, c); + } }; + function Tg(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 ? !qf(c, d) || !qf(e, f) : true; + } + function Ug(a, b, c) { + var d = false, e = Cf; + var f = b.contextType; + "object" === typeof f && null !== f ? f = xg(f) : (e = L(b) ? Df : J.current, d = b.contextTypes, f = (d = null !== d && void 0 !== d) ? Ef(a, e) : Cf); + b = new b(c, f); + a.memoizedState = null !== b.state && void 0 !== b.state ? b.state : null; + b.updater = Sg; + a.stateNode = b; + b._reactInternalFiber = a; + d && (a = a.stateNode, a.__reactInternalMemoizedUnmaskedChildContext = e, a.__reactInternalMemoizedMaskedChildContext = f); + return b; + } + function Vg(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 && Sg.enqueueReplaceState(b, b.state, null); + } + function Wg(a, b, c, d) { + var e = a.stateNode; + e.props = c; + e.state = a.memoizedState; + e.refs = Ng; + var f = b.contextType; + "object" === typeof f && null !== f ? e.context = xg(f) : (f = L(b) ? Df : J.current, e.context = Ef(a, f)); + f = a.updateQueue; + null !== f && (Hg(a, f, c, e, d), e.state = a.memoizedState); + f = b.getDerivedStateFromProps; + "function" === typeof f && (Og(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 && Sg.enqueueReplaceState(e, e.state, null), f = a.updateQueue, null !== f && (Hg(a, f, c, e, d), e.state = a.memoizedState)); + "function" === typeof e.componentDidMount && (a.effectTag |= 4); + } + var Xg = Array.isArray; + function Yg(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(a2) { + var b2 = d.refs; + b2 === Ng && (b2 = d.refs = {}); + null === a2 ? delete b2[e] : b2[e] = a2; + }; + b._stringRef = e; + return b; + } + if ("string" !== typeof a) throw Error(u(284)); + if (!c._owner) throw Error(u(290, a)); + } + return a; + } + function Zg(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 $g(a) { + function b(b2, c2) { + if (a) { + var d2 = b2.lastEffect; + null !== d2 ? (d2.nextEffect = c2, b2.lastEffect = c2) : b2.firstEffect = b2.lastEffect = c2; + c2.nextEffect = null; + c2.effectTag = 8; + } + } + function c(c2, d2) { + if (!a) return null; + for (; null !== d2; ) b(c2, d2), d2 = d2.sibling; + return null; + } + function d(a2, b2) { + for (a2 = /* @__PURE__ */ new Map(); null !== b2; ) null !== b2.key ? a2.set(b2.key, b2) : a2.set(b2.index, b2), b2 = b2.sibling; + return a2; + } + function e(a2, b2, c2) { + a2 = ah(a2, b2, c2); + a2.index = 0; + a2.sibling = null; + return a2; + } + function f(b2, c2, d2) { + b2.index = d2; + if (!a) return c2; + d2 = b2.alternate; + if (null !== d2) return d2 = d2.index, d2 < c2 ? (b2.effectTag = 2, c2) : d2; + b2.effectTag = 2; + return c2; + } + function g(b2) { + a && null === b2.alternate && (b2.effectTag = 2); + return b2; + } + function h(a2, b2, c2, d2) { + if (null === b2 || 6 !== b2.tag) return b2 = bh(c2, a2.mode, d2), b2.return = a2, b2; + b2 = e(b2, c2, d2); + b2.return = a2; + return b2; + } + function k(a2, b2, c2, d2) { + if (null !== b2 && b2.elementType === c2.type) return d2 = e(b2, c2.props, d2), d2.ref = Yg(a2, b2, c2), d2.return = a2, d2; + d2 = ch(c2.type, c2.key, c2.props, null, a2.mode, d2); + d2.ref = Yg(a2, b2, c2); + d2.return = a2; + return d2; + } + function l(a2, b2, c2, d2) { + if (null === b2 || 4 !== b2.tag || b2.stateNode.containerInfo !== c2.containerInfo || b2.stateNode.implementation !== c2.implementation) return b2 = dh(c2, a2.mode, d2), b2.return = a2, b2; + b2 = e(b2, c2.children || [], d2); + b2.return = a2; + return b2; + } + function m(a2, b2, c2, d2, f2) { + if (null === b2 || 7 !== b2.tag) return b2 = eh(c2, a2.mode, d2, f2), b2.return = a2, b2; + b2 = e(b2, c2, d2); + b2.return = a2; + return b2; + } + function C(a2, b2, c2) { + if ("string" === typeof b2 || "number" === typeof b2) return b2 = bh("" + b2, a2.mode, c2), b2.return = a2, b2; + if ("object" === typeof b2 && null !== b2) { + switch (b2.$$typeof) { + case Ga: + return c2 = ch(b2.type, b2.key, b2.props, null, a2.mode, c2), c2.ref = Yg(a2, null, b2), c2.return = a2, c2; + case Ha: + return b2 = dh(b2, a2.mode, c2), b2.return = a2, b2; + } + if (Xg(b2) || Ua(b2)) return b2 = eh(b2, a2.mode, c2, null), b2.return = a2, b2; + Zg(a2, b2); + } + return null; + } + function y(a2, b2, c2, d2) { + var e2 = null !== b2 ? b2.key : null; + if ("string" === typeof c2 || "number" === typeof c2) return null !== e2 ? null : h(a2, b2, "" + c2, d2); + if ("object" === typeof c2 && null !== c2) { + switch (c2.$$typeof) { + case Ga: + return c2.key === e2 ? c2.type === Ia ? m(a2, b2, c2.props.children, d2, e2) : k(a2, b2, c2, d2) : null; + case Ha: + return c2.key === e2 ? l(a2, b2, c2, d2) : null; + } + if (Xg(c2) || Ua(c2)) return null !== e2 ? null : m(a2, b2, c2, d2, null); + Zg(a2, c2); + } + return null; + } + function H(a2, b2, c2, d2, e2) { + if ("string" === typeof d2 || "number" === typeof d2) return a2 = a2.get(c2) || null, h(b2, a2, "" + d2, e2); + if ("object" === typeof d2 && null !== d2) { + switch (d2.$$typeof) { + case Ga: + return a2 = a2.get(null === d2.key ? c2 : d2.key) || null, d2.type === Ia ? m(b2, a2, d2.props.children, e2, d2.key) : k(b2, a2, d2, e2); + case Ha: + return a2 = a2.get(null === d2.key ? c2 : d2.key) || null, l(b2, a2, d2, e2); + } + if (Xg(d2) || Ua(d2)) return a2 = a2.get(c2) || null, m(b2, a2, d2, e2, null); + Zg(b2, d2); + } + return null; + } + function z(e2, g2, h2, k2) { + for (var l2 = null, m2 = null, r = g2, x = g2 = 0, A = null; null !== r && x < h2.length; x++) { + r.index > x ? (A = r, r = null) : A = r.sibling; + var p = y(e2, r, h2[x], k2); + if (null === p) { + null === r && (r = A); + break; + } + a && r && null === p.alternate && b(e2, r); + g2 = f(p, g2, x); + null === m2 ? l2 = p : m2.sibling = p; + m2 = p; + r = A; + } + if (x === h2.length) return c(e2, r), l2; + if (null === r) { + for (; x < h2.length; x++) r = C(e2, h2[x], k2), null !== r && (g2 = f(r, g2, x), null === m2 ? l2 = r : m2.sibling = r, m2 = r); + return l2; + } + for (r = d(e2, r); x < h2.length; x++) A = H(r, e2, x, h2[x], k2), null !== A && (a && null !== A.alternate && r.delete(null === A.key ? x : A.key), g2 = f(A, g2, x), null === m2 ? l2 = A : m2.sibling = A, m2 = A); + a && r.forEach(function(a2) { + return b(e2, a2); + }); + return l2; + } + function ta(e2, g2, h2, k2) { + var l2 = Ua(h2); + if ("function" !== typeof l2) throw Error(u(150)); + h2 = l2.call(h2); + if (null == h2) throw Error(u(151)); + for (var m2 = l2 = null, r = g2, x = g2 = 0, A = null, p = h2.next(); null !== r && !p.done; x++, p = h2.next()) { + r.index > x ? (A = r, r = null) : A = r.sibling; + var z2 = y(e2, r, p.value, k2); + if (null === z2) { + null === r && (r = A); + break; + } + a && r && null === z2.alternate && b(e2, r); + g2 = f(z2, g2, x); + null === m2 ? l2 = z2 : m2.sibling = z2; + m2 = z2; + r = A; + } + if (p.done) return c(e2, r), l2; + if (null === r) { + for (; !p.done; x++, p = h2.next()) p = C(e2, p.value, k2), null !== p && (g2 = f(p, g2, x), null === m2 ? l2 = p : m2.sibling = p, m2 = p); + return l2; + } + for (r = d(e2, r); !p.done; x++, p = h2.next()) p = H(r, e2, x, p.value, k2), null !== p && (a && null !== p.alternate && r.delete(null === p.key ? x : p.key), g2 = f(p, g2, x), null === m2 ? l2 = p : m2.sibling = p, m2 = p); + a && r.forEach(function(a2) { + return b(e2, a2); + }); + return l2; + } + return function(a2, d2, f2, h2) { + var k2 = "object" === typeof f2 && null !== f2 && f2.type === Ia && null === f2.key; + k2 && (f2 = f2.props.children); + var l2 = "object" === typeof f2 && null !== f2; + if (l2) switch (f2.$$typeof) { + case Ga: + a: { + l2 = f2.key; + for (k2 = d2; null !== k2; ) { + if (k2.key === l2) if (7 === k2.tag ? f2.type === Ia : k2.elementType === f2.type) { + c(a2, k2.sibling); + d2 = e(k2, f2.type === Ia ? f2.props.children : f2.props, h2); + d2.ref = Yg(a2, k2, f2); + d2.return = a2; + a2 = d2; + break a; + } else { + c( + a2, + k2 + ); + break; + } + else b(a2, k2); + k2 = k2.sibling; + } + f2.type === Ia ? (d2 = eh(f2.props.children, a2.mode, h2, f2.key), d2.return = a2, a2 = d2) : (h2 = ch(f2.type, f2.key, f2.props, null, a2.mode, h2), h2.ref = Yg(a2, d2, f2), h2.return = a2, a2 = h2); + } + return g(a2); + case Ha: + a: { + for (k2 = f2.key; null !== d2; ) { + if (d2.key === k2) if (4 === d2.tag && d2.stateNode.containerInfo === f2.containerInfo && d2.stateNode.implementation === f2.implementation) { + c(a2, d2.sibling); + d2 = e(d2, f2.children || [], h2); + d2.return = a2; + a2 = d2; + break a; + } else { + c(a2, d2); + break; + } + else b(a2, d2); + d2 = d2.sibling; + } + d2 = dh(f2, a2.mode, h2); + d2.return = a2; + a2 = d2; + } + return g(a2); + } + if ("string" === typeof f2 || "number" === typeof f2) return f2 = "" + f2, null !== d2 && 6 === d2.tag ? (c(a2, d2.sibling), d2 = e(d2, f2, h2), d2.return = a2, a2 = d2) : (c(a2, d2), d2 = bh(f2, a2.mode, h2), d2.return = a2, a2 = d2), g(a2); + if (Xg(f2)) return z(a2, d2, f2, h2); + if (Ua(f2)) return ta(a2, d2, f2, h2); + l2 && Zg(a2, f2); + if ("undefined" === typeof f2 && !k2) switch (a2.tag) { + case 1: + case 0: + throw a2 = a2.type, Error(u(152, a2.displayName || a2.name || "Component")); + } + return c(a2, d2); + }; + } + var fh = $g(true); + var gh = $g(false); + var hh = {}; + var ih = { current: hh }; + var jh = { current: hh }; + var kh = { current: hh }; + function lh(a) { + if (a === hh) throw Error(u(174)); + return a; + } + function mh(a, b) { + I(kh, b, a); + I(jh, a, a); + I(ih, hh, a); + var c = b.nodeType; + switch (c) { + case 9: + case 11: + b = (b = b.documentElement) ? b.namespaceURI : Qb(null, ""); + break; + default: + c = 8 === c ? b.parentNode : b, b = c.namespaceURI || null, c = c.tagName, b = Qb(b, c); + } + G(ih, a); + I(ih, b, a); + } + function nh(a) { + G(ih, a); + G(jh, a); + G(kh, a); + } + function oh(a) { + lh(kh.current); + var b = lh(ih.current); + var c = Qb(b, a.type); + b !== c && (I(jh, a, a), I(ih, c, a)); + } + function ph(a) { + jh.current === a && (G(ih, a), G(jh, a)); + } + var M = { current: 0 }; + function qh(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 === je || c.data === ke)) 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 rh(a, b) { + return { responder: a, props: b }; + } + var sh = Ea.ReactCurrentDispatcher; + var N = Ea.ReactCurrentBatchConfig; + var th = 0; + var uh = null; + var O = null; + var vh = null; + var wh = null; + var P = null; + var xh = null; + var yh = 0; + var zh = null; + var Ah = 0; + var Bh = false; + var Ch = null; + var Gh = 0; + function Q() { + throw Error(u(321)); + } + function Hh(a, b) { + if (null === b) return false; + for (var c = 0; c < b.length && c < a.length; c++) if (!of(a[c], b[c])) return false; + return true; + } + function Ih(a, b, c, d, e, f) { + th = f; + uh = b; + vh = null !== a ? a.memoizedState : null; + sh.current = null === vh ? Jh : Kh; + b = c(d, e); + if (Bh) { + do + Bh = false, Gh += 1, vh = null !== a ? a.memoizedState : null, xh = wh, zh = P = O = null, sh.current = Kh, b = c(d, e); + while (Bh); + Ch = null; + Gh = 0; + } + sh.current = Lh; + a = uh; + a.memoizedState = wh; + a.expirationTime = yh; + a.updateQueue = zh; + a.effectTag |= Ah; + a = null !== O && null !== O.next; + th = 0; + xh = P = wh = vh = O = uh = null; + yh = 0; + zh = null; + Ah = 0; + if (a) throw Error(u(300)); + return b; + } + function Mh() { + sh.current = Lh; + th = 0; + xh = P = wh = vh = O = uh = null; + yh = 0; + zh = null; + Ah = 0; + Bh = false; + Ch = null; + Gh = 0; + } + function Nh() { + var a = { memoizedState: null, baseState: null, queue: null, baseUpdate: null, next: null }; + null === P ? wh = P = a : P = P.next = a; + return P; + } + function Oh() { + if (null !== xh) P = xh, xh = P.next, O = vh, vh = null !== O ? O.next : null; + else { + if (null === vh) throw Error(u(310)); + O = vh; + var a = { memoizedState: O.memoizedState, baseState: O.baseState, queue: O.queue, baseUpdate: O.baseUpdate, next: null }; + P = null === P ? wh = a : P.next = a; + vh = O.next; + } + return P; + } + function Ph(a, b) { + return "function" === typeof b ? b(a) : b; + } + function Qh(a) { + var b = Oh(), c = b.queue; + if (null === c) throw Error(u(311)); + c.lastRenderedReducer = a; + if (0 < Gh) { + var d = c.dispatch; + if (null !== Ch) { + var e = Ch.get(c); + if (void 0 !== e) { + Ch.delete(c); + var f = b.memoizedState; + do + f = a(f, e.action), e = e.next; + while (null !== e); + of(f, b.memoizedState) || (wg = true); + b.memoizedState = f; + b.baseUpdate === c.last && (b.baseState = f); + c.lastRenderedState = f; + return [f, d]; + } + } + return [b.memoizedState, d]; + } + d = c.last; + var g = b.baseUpdate; + f = b.baseState; + null !== g ? (null !== d && (d.next = null), d = g.next) : d = null !== d ? d.next : null; + if (null !== d) { + var h = e = null, k = d, l = false; + do { + var m = k.expirationTime; + m < th ? (l || (l = true, h = g, e = f), m > yh && (yh = m, Jg(yh))) : (Ig(m, k.suspenseConfig), f = k.eagerReducer === a ? k.eagerState : a(f, k.action)); + g = k; + k = k.next; + } while (null !== k && k !== d); + l || (h = g, e = f); + of(f, b.memoizedState) || (wg = true); + b.memoizedState = f; + b.baseUpdate = h; + b.baseState = e; + c.lastRenderedState = f; + } + return [b.memoizedState, c.dispatch]; + } + function Rh(a) { + var b = Nh(); + "function" === typeof a && (a = a()); + b.memoizedState = b.baseState = a; + a = b.queue = { last: null, dispatch: null, lastRenderedReducer: Ph, lastRenderedState: a }; + a = a.dispatch = Sh.bind(null, uh, a); + return [b.memoizedState, a]; + } + function Th(a) { + return Qh(Ph, a); + } + function Uh(a, b, c, d) { + a = { tag: a, create: b, destroy: c, deps: d, next: null }; + null === zh ? (zh = { lastEffect: null }, zh.lastEffect = a.next = a) : (b = zh.lastEffect, null === b ? zh.lastEffect = a.next = a : (c = b.next, b.next = a, a.next = c, zh.lastEffect = a)); + return a; + } + function Vh(a, b, c, d) { + var e = Nh(); + Ah |= a; + e.memoizedState = Uh(b, c, void 0, void 0 === d ? null : d); + } + function Wh(a, b, c, d) { + var e = Oh(); + d = void 0 === d ? null : d; + var f = void 0; + if (null !== O) { + var g = O.memoizedState; + f = g.destroy; + if (null !== d && Hh(d, g.deps)) { + Uh(0, c, f, d); + return; + } + } + Ah |= a; + e.memoizedState = Uh(b, c, f, d); + } + function Xh(a, b) { + return Vh(516, 192, a, b); + } + function Yh(a, b) { + return Wh(516, 192, a, b); + } + function Zh(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 $h() { + } + function ai(a, b) { + Nh().memoizedState = [a, void 0 === b ? null : b]; + return a; + } + function bi(a, b) { + var c = Oh(); + b = void 0 === b ? null : b; + var d = c.memoizedState; + if (null !== d && null !== b && Hh(b, d[1])) return d[0]; + c.memoizedState = [a, b]; + return a; + } + function Sh(a, b, c) { + if (!(25 > Gh)) throw Error(u(301)); + var d = a.alternate; + if (a === uh || null !== d && d === uh) if (Bh = true, a = { expirationTime: th, suspenseConfig: null, action: c, eagerReducer: null, eagerState: null, next: null }, null === Ch && (Ch = /* @__PURE__ */ new Map()), c = Ch.get(b), void 0 === c) Ch.set(b, a); + else { + for (b = c; null !== b.next; ) b = b.next; + b.next = a; + } + else { + var e = Pg(), f = Mg.suspense; + e = Qg(e, a, f); + f = { expirationTime: e, suspenseConfig: f, action: c, eagerReducer: null, eagerState: null, next: null }; + var g = b.last; + if (null === g) f.next = f; + else { + var h = g.next; + null !== h && (f.next = h); + g.next = f; + } + b.last = f; + if (0 === a.expirationTime && (null === d || 0 === d.expirationTime) && (d = b.lastRenderedReducer, null !== d)) try { + var k = b.lastRenderedState, l = d(k, c); + f.eagerReducer = d; + f.eagerState = l; + if (of(l, k)) return; + } catch (m) { + } finally { + } + Rg(a, e); + } + } + var Lh = { readContext: xg, 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 }; + var Jh = { readContext: xg, useCallback: ai, useContext: xg, useEffect: Xh, useImperativeHandle: function(a, b, c) { + c = null !== c && void 0 !== c ? c.concat([a]) : null; + return Vh(4, 36, Zh.bind(null, b, a), c); + }, useLayoutEffect: function(a, b) { + return Vh(4, 36, a, b); + }, useMemo: function(a, b) { + var c = Nh(); + b = void 0 === b ? null : b; + a = a(); + c.memoizedState = [a, b]; + return a; + }, useReducer: function(a, b, c) { + var d = Nh(); + b = void 0 !== c ? c(b) : b; + d.memoizedState = d.baseState = b; + a = d.queue = { last: null, dispatch: null, lastRenderedReducer: a, lastRenderedState: b }; + a = a.dispatch = Sh.bind(null, uh, a); + return [d.memoizedState, a]; + }, useRef: function(a) { + var b = Nh(); + a = { current: a }; + return b.memoizedState = a; + }, useState: Rh, useDebugValue: $h, useResponder: rh, useDeferredValue: function(a, b) { + var c = Rh(a), d = c[0], e = c[1]; + Xh(function() { + q.unstable_next(function() { + var c2 = N.suspense; + N.suspense = void 0 === b ? null : b; + try { + e(a); + } finally { + N.suspense = c2; + } + }); + }, [a, b]); + return d; + }, useTransition: function(a) { + var b = Rh(false), c = b[0], d = b[1]; + return [ai(function(b2) { + d(true); + q.unstable_next(function() { + var c2 = N.suspense; + N.suspense = void 0 === a ? null : a; + try { + d(false), b2(); + } finally { + N.suspense = c2; + } + }); + }, [a, c]), c]; + } }; + var Kh = { readContext: xg, useCallback: bi, useContext: xg, useEffect: Yh, useImperativeHandle: function(a, b, c) { + c = null !== c && void 0 !== c ? c.concat([a]) : null; + return Wh(4, 36, Zh.bind(null, b, a), c); + }, useLayoutEffect: function(a, b) { + return Wh(4, 36, a, b); + }, useMemo: function(a, b) { + var c = Oh(); + b = void 0 === b ? null : b; + var d = c.memoizedState; + if (null !== d && null !== b && Hh(b, d[1])) return d[0]; + a = a(); + c.memoizedState = [a, b]; + return a; + }, useReducer: Qh, useRef: function() { + return Oh().memoizedState; + }, useState: Th, useDebugValue: $h, useResponder: rh, useDeferredValue: function(a, b) { + var c = Th(a), d = c[0], e = c[1]; + Yh(function() { + q.unstable_next(function() { + var c2 = N.suspense; + N.suspense = void 0 === b ? null : b; + try { + e(a); + } finally { + N.suspense = c2; + } + }); + }, [a, b]); + return d; + }, useTransition: function(a) { + var b = Th(false), c = b[0], d = b[1]; + return [bi(function(b2) { + d(true); + q.unstable_next(function() { + var c2 = N.suspense; + N.suspense = void 0 === a ? null : a; + try { + d(false), b2(); + } finally { + N.suspense = c2; + } + }); + }, [a, c]), c]; + } }; + var ci = null; + var di = null; + var ei = false; + function fi(a, b) { + var c = gi(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 hi(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, true) : false; + case 6: + return b = "" === a.pendingProps || 3 !== b.nodeType ? null : b, null !== b ? (a.stateNode = b, true) : false; + case 13: + return false; + default: + return false; + } + } + function ii(a) { + if (ei) { + var b = di; + if (b) { + var c = b; + if (!hi(a, b)) { + b = re(c.nextSibling); + if (!b || !hi(a, b)) { + a.effectTag = a.effectTag & -1025 | 2; + ei = false; + ci = a; + return; + } + fi(ci, c); + } + ci = a; + di = re(b.firstChild); + } else a.effectTag = a.effectTag & -1025 | 2, ei = false, ci = a; + } + } + function ji(a) { + for (a = a.return; null !== a && 5 !== a.tag && 3 !== a.tag && 13 !== a.tag; ) a = a.return; + ci = a; + } + function ki(a) { + if (a !== ci) return false; + if (!ei) return ji(a), ei = true, false; + var b = a.type; + if (5 !== a.tag || "head" !== b && "body" !== b && !oe(b, a.memoizedProps)) for (b = di; b; ) fi(a, b), b = re(b.nextSibling); + ji(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 === ie) { + if (0 === b) { + di = re(a.nextSibling); + break a; + } + b--; + } else c !== he && c !== ke && c !== je || b++; + } + a = a.nextSibling; + } + di = null; + } + } else di = ci ? re(a.stateNode.nextSibling) : null; + return true; + } + function li() { + di = ci = null; + ei = false; + } + var mi = Ea.ReactCurrentOwner; + var wg = false; + function R(a, b, c, d) { + b.child = null === a ? gh(b, null, c, d) : fh(b, a.child, c, d); + } + function ni(a, b, c, d, e) { + c = c.render; + var f = b.ref; + vg(b, e); + d = Ih(a, b, c, d, f, e); + if (null !== a && !wg) return b.updateQueue = a.updateQueue, b.effectTag &= -517, a.expirationTime <= e && (a.expirationTime = 0), oi(a, b, e); + b.effectTag |= 1; + R(a, b, d, e); + return b.child; + } + function pi(a, b, c, d, e, f) { + if (null === a) { + var g = c.type; + if ("function" === typeof g && !qi(g) && void 0 === g.defaultProps && null === c.compare && void 0 === c.defaultProps) return b.tag = 15, b.type = g, ri(a, b, g, d, e, f); + a = ch(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 : qf, c(e, d) && a.ref === b.ref)) return oi(a, b, f); + b.effectTag |= 1; + a = ah(g, d, f); + a.ref = b.ref; + a.return = b; + return b.child = a; + } + function ri(a, b, c, d, e, f) { + return null !== a && qf(a.memoizedProps, d) && a.ref === b.ref && (wg = false, e < f) ? oi(a, b, f) : si(a, b, c, d, f); + } + function ti(a, b) { + var c = b.ref; + if (null === a && null !== c || null !== a && a.ref !== c) b.effectTag |= 128; + } + function si(a, b, c, d, e) { + var f = L(c) ? Df : J.current; + f = Ef(b, f); + vg(b, e); + c = Ih(a, b, c, d, f, e); + if (null !== a && !wg) return b.updateQueue = a.updateQueue, b.effectTag &= -517, a.expirationTime <= e && (a.expirationTime = 0), oi(a, b, e); + b.effectTag |= 1; + R(a, b, c, e); + return b.child; + } + function ui(a, b, c, d, e) { + if (L(c)) { + var f = true; + Jf(b); + } else f = false; + vg(b, e); + if (null === b.stateNode) null !== a && (a.alternate = null, b.alternate = null, b.effectTag |= 2), Ug(b, c, d, e), Wg(b, c, d, e), d = true; + 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 = xg(l) : (l = L(c) ? Df : J.current, l = Ef(b, l)); + var m = c.getDerivedStateFromProps, C = "function" === typeof m || "function" === typeof g.getSnapshotBeforeUpdate; + C || "function" !== typeof g.UNSAFE_componentWillReceiveProps && "function" !== typeof g.componentWillReceiveProps || (h !== d || k !== l) && Vg(b, g, d, l); + yg = false; + var y = b.memoizedState; + k = g.state = y; + var H = b.updateQueue; + null !== H && (Hg(b, H, d, g, e), k = b.memoizedState); + h !== d || y !== k || K.current || yg ? ("function" === typeof m && (Og(b, c, m, d), k = b.memoizedState), (h = yg || Tg(b, c, h, d, y, k, l)) ? (C || "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 = false); + } else g = b.stateNode, h = b.memoizedProps, g.props = b.type === b.elementType ? h : mg(b.type, h), k = g.context, l = c.contextType, "object" === typeof l && null !== l ? l = xg(l) : (l = L(c) ? Df : J.current, l = Ef(b, l)), m = c.getDerivedStateFromProps, (C = "function" === typeof m || "function" === typeof g.getSnapshotBeforeUpdate) || "function" !== typeof g.UNSAFE_componentWillReceiveProps && "function" !== typeof g.componentWillReceiveProps || (h !== d || k !== l) && Vg(b, g, d, l), yg = false, k = b.memoizedState, y = g.state = k, H = b.updateQueue, null !== H && (Hg(b, H, d, g, e), y = b.memoizedState), h !== d || k !== y || K.current || yg ? ("function" === typeof m && (Og(b, c, m, d), y = b.memoizedState), (m = yg || Tg(b, c, h, d, k, y, l)) ? (C || "function" !== typeof g.UNSAFE_componentWillUpdate && "function" !== typeof g.componentWillUpdate || ("function" === typeof g.componentWillUpdate && g.componentWillUpdate(d, y, l), "function" === typeof g.UNSAFE_componentWillUpdate && g.UNSAFE_componentWillUpdate(d, y, 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 = y), g.props = d, g.state = y, 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 = false); + return vi(a, b, c, d, f, e); + } + function vi(a, b, c, d, e, f) { + ti(a, b); + var g = 0 !== (b.effectTag & 64); + if (!d && !g) return e && Kf(b, c, false), oi(a, b, f); + d = b.stateNode; + mi.current = b; + var h = g && "function" !== typeof c.getDerivedStateFromError ? null : d.render(); + b.effectTag |= 1; + null !== a && g ? (b.child = fh(b, a.child, null, f), b.child = fh(b, null, h, f)) : R(a, b, h, f); + b.memoizedState = d.state; + e && Kf(b, c, true); + return b.child; + } + function wi(a) { + var b = a.stateNode; + b.pendingContext ? Hf(a, b.pendingContext, b.pendingContext !== b.context) : b.context && Hf(a, b.context, false); + mh(a, b.containerInfo); + } + var xi = { dehydrated: null, retryTime: 0 }; + function yi(a, b, c) { + var d = b.mode, e = b.pendingProps, f = M.current, g = false, h; + (h = 0 !== (b.effectTag & 64)) || (h = 0 !== (f & 2) && (null === a || null !== a.memoizedState)); + h ? (g = true, b.effectTag &= -65) : null !== a && null === a.memoizedState || void 0 === e.fallback || true === e.unstable_avoidThisFallback || (f |= 1); + I(M, f & 1, b); + if (null === a) { + void 0 !== e.fallback && ii(b); + if (g) { + g = e.fallback; + e = eh(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 = eh(g, d, c, null); + c.return = b; + e.sibling = c; + b.memoizedState = xi; + b.child = e; + return c; + } + d = e.children; + b.memoizedState = null; + return b.child = gh(b, null, d, c); + } + if (null !== a.memoizedState) { + a = a.child; + d = a.sibling; + if (g) { + e = e.fallback; + c = ah(a, a.pendingProps, 0); + 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 = ah(d, e, d.expirationTime); + d.return = b; + c.sibling = d; + c.childExpirationTime = 0; + b.memoizedState = xi; + b.child = c; + return d; + } + c = fh(b, a.child, e.children, c); + b.memoizedState = null; + return b.child = c; + } + a = a.child; + if (g) { + g = e.fallback; + e = eh(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 = eh(g, d, c, null); + c.return = b; + e.sibling = c; + c.effectTag |= 2; + e.childExpirationTime = 0; + b.memoizedState = xi; + b.child = e; + return c; + } + b.memoizedState = null; + return b.child = fh(b, a, e.children, c); + } + function zi(a, b) { + a.expirationTime < b && (a.expirationTime = b); + var c = a.alternate; + null !== c && c.expirationTime < b && (c.expirationTime = b); + ug(a.return, b); + } + function Ai(a, b, c, d, e, f) { + var g = a.memoizedState; + null === g ? a.memoizedState = { isBackwards: b, rendering: null, last: d, tail: c, tailExpiration: 0, tailMode: e, lastEffect: f } : (g.isBackwards = b, g.rendering = null, g.last = d, g.tail = c, g.tailExpiration = 0, g.tailMode = e, g.lastEffect = f); + } + function Bi(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 && zi(a, c); + else if (19 === a.tag) zi(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, b); + 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 === qh(a) && (e = c), c = c.sibling; + c = e; + null === c ? (e = b.child, b.child = null) : (e = c.sibling, c.sibling = null); + Ai(b, false, 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 === qh(a)) { + b.child = e; + break; + } + a = e.sibling; + e.sibling = c; + c = e; + e = a; + } + Ai(b, true, c, null, f, b.lastEffect); + break; + case "together": + Ai(b, false, null, null, void 0, b.lastEffect); + break; + default: + b.memoizedState = null; + } + return b.child; + } + function oi(a, b, c) { + null !== a && (b.dependencies = a.dependencies); + var d = b.expirationTime; + 0 !== d && Jg(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 = ah(a, a.pendingProps, a.expirationTime); + b.child = c; + for (c.return = b; null !== a.sibling; ) a = a.sibling, c = c.sibling = ah(a, a.pendingProps, a.expirationTime), c.return = b; + c.sibling = null; + } + return b.child; + } + function Ci(a) { + a.effectTag |= 4; + } + var Hi; + var Ii; + var Ji; + var Ki; + Hi = 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; + } + }; + Ii = function() { + }; + Ji = function(a, b, c, d, e) { + var f = a.memoizedProps; + if (f !== d) { + var g = b.stateNode; + lh(ih.current); + a = null; + switch (c) { + case "input": + f = Ab(g, f); + d = Ab(g, d); + a = []; + break; + case "option": + f = Ib(g, f); + d = Ib(g, d); + a = []; + break; + case "select": + f = n({}, f, { value: void 0 }); + d = n({}, d, { value: void 0 }); + a = []; + break; + case "textarea": + f = Kb(g, f); + d = Kb(g, d); + a = []; + break; + default: + "function" !== typeof f.onClick && "function" === typeof d.onClick && (g.onclick = ae); + } + Yd(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 && (ia.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 && (ia.hasOwnProperty(h) ? (null != l && $d(e, h), a || g === l || (a = [])) : (a = a || []).push(h, l)); + } + c && (a = a || []).push("style", c); + e = a; + (b.updateQueue = e) && Ci(b); + } + }; + Ki = function(a, b, c, d) { + c !== d && Ci(b); + }; + function Li(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 Mi(a) { + switch (a.tag) { + case 1: + L(a.type) && Ff(a); + var b = a.effectTag; + return b & 4096 ? (a.effectTag = b & -4097 | 64, a) : null; + case 3: + nh(a); + Gf(a); + b = a.effectTag; + if (0 !== (b & 64)) throw Error(u(285)); + a.effectTag = b & -4097 | 64; + return a; + case 5: + return ph(a), null; + case 13: + return G(M, a), b = a.effectTag, b & 4096 ? (a.effectTag = b & -4097 | 64, a) : null; + case 19: + return G(M, a), null; + case 4: + return nh(a), null; + case 10: + return tg(a), null; + default: + return null; + } + } + function Ni(a, b) { + return { value: a, source: b, stack: Xa(b) }; + } + var Oi = "function" === typeof WeakSet ? WeakSet : Set; + function Pi(a, b) { + var c = b.source, d = b.stack; + null === d && null !== c && (d = Xa(c)); + null !== c && Wa(c.type); + b = b.value; + null !== a && 1 === a.tag && Wa(a.type); + try { + console.error(b); + } catch (e) { + setTimeout(function() { + throw e; + }); + } + } + function Qi(a, b) { + try { + b.props = a.memoizedProps, b.state = a.memoizedState, b.componentWillUnmount(); + } catch (c) { + Ri(a, c); + } + } + function Si(a) { + var b = a.ref; + if (null !== b) if ("function" === typeof b) try { + b(null); + } catch (c) { + Ri(a, c); + } + else b.current = null; + } + function Ti(a, b) { + switch (b.tag) { + case 0: + case 11: + case 15: + Ui(2, 0, b); + break; + 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 : mg(b.type, c), d); + a.__reactInternalSnapshotBeforeUpdate = b; + } + break; + case 3: + case 5: + case 6: + case 4: + case 17: + break; + default: + throw Error(u(163)); + } + } + function Ui(a, b, c) { + c = c.updateQueue; + c = null !== c ? c.lastEffect : null; + if (null !== c) { + var d = c = c.next; + do { + if (0 !== (d.tag & a)) { + var e = d.destroy; + d.destroy = void 0; + void 0 !== e && e(); + } + 0 !== (d.tag & b) && (e = d.create, d.destroy = e()); + d = d.next; + } while (d !== c); + } + } + function Vi(a, b, c) { + "function" === typeof Wi && Wi(b); + switch (b.tag) { + case 0: + case 11: + case 14: + case 15: + a = b.updateQueue; + if (null !== a && (a = a.lastEffect, null !== a)) { + var d = a.next; + fg(97 < c ? 97 : c, function() { + var a2 = d; + do { + var c2 = a2.destroy; + if (void 0 !== c2) { + var g = b; + try { + c2(); + } catch (h) { + Ri(g, h); + } + } + a2 = a2.next; + } while (a2 !== d); + }); + } + break; + case 1: + Si(b); + c = b.stateNode; + "function" === typeof c.componentWillUnmount && Qi(b, c); + break; + case 5: + Si(b); + break; + case 4: + Xi(a, b, c); + } + } + function Yi(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; + null !== b && Yi(b); + } + function Zi(a) { + return 5 === a.tag || 3 === a.tag || 4 === a.tag; + } + function $i(a) { + a: { + for (var b = a.return; null !== b; ) { + if (Zi(b)) { + var c = b; + break a; + } + b = b.return; + } + throw Error(u(160)); + } + b = c.stateNode; + switch (c.tag) { + case 5: + var d = false; + break; + case 3: + b = b.containerInfo; + d = true; + break; + case 4: + b = b.containerInfo; + d = true; + break; + default: + throw Error(u(161)); + } + c.effectTag & 16 && (Tb(b, ""), c.effectTag &= -17); + a: b: for (c = a; ; ) { + for (; null === c.sibling; ) { + if (null === c.return || Zi(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; + } + } + for (var e = a; ; ) { + var f = 5 === e.tag || 6 === e.tag; + if (f) { + var g = f ? e.stateNode : e.stateNode.instance; + if (c) if (d) { + f = b; + var h = g; + g = c; + 8 === f.nodeType ? f.parentNode.insertBefore(h, g) : f.insertBefore(h, g); + } else b.insertBefore(g, c); + else d ? (h = b, 8 === h.nodeType ? (f = h.parentNode, f.insertBefore(g, h)) : (f = h, f.appendChild(g)), h = h._reactRootContainer, null !== h && void 0 !== h || null !== f.onclick || (f.onclick = ae)) : b.appendChild(g); + } else if (4 !== e.tag && null !== e.child) { + e.child.return = e; + e = e.child; + continue; + } + if (e === a) break; + for (; null === e.sibling; ) { + if (null === e.return || e.return === a) return; + e = e.return; + } + e.sibling.return = e.return; + e = e.sibling; + } + } + function Xi(a, b, c) { + for (var d = b, e = false, 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 = false; + break a; + case 3: + f = f.containerInfo; + g = true; + break a; + case 4: + f = f.containerInfo; + g = true; + break a; + } + e = e.return; + } + e = true; + } + if (5 === d.tag || 6 === d.tag) { + a: for (var h = a, k = d, l = c, m = k; ; ) if (Vi(h, m, l), null !== m.child && 4 !== m.tag) m.child.return = m, m = m.child; + else { + if (m === k) break; + 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 = true; + d.child.return = d; + d = d.child; + continue; + } + } else if (Vi(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 = false); + } + d.sibling.return = d.return; + d = d.sibling; + } + } + function aj(a, b) { + switch (b.tag) { + case 0: + case 11: + case 14: + case 15: + Ui(4, 8, b); + break; + case 1: + break; + 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[ve] = d; + "input" === a && "radio" === d.type && null != d.name && Cb(c, d); + Zd(a, e); + b = Zd(a, d); + for (e = 0; e < f.length; e += 2) { + var g = f[e], h = f[e + 1]; + "style" === g ? Wd(c, h) : "dangerouslySetInnerHTML" === g ? Sb(c, h) : "children" === g ? Tb(c, h) : vb(c, g, h, b); + } + switch (a) { + case "input": + Eb(c, d); + break; + case "textarea": + Mb( + c, + d + ); + break; + case "select": + b = c._wrapperState.wasMultiple, c._wrapperState.wasMultiple = !!d.multiple, a = d.value, null != a ? Jb(c, !!d.multiple, a, false) : b !== !!d.multiple && (null != d.defaultValue ? Jb(c, !!d.multiple, d.defaultValue, true) : Jb(c, !!d.multiple, d.multiple ? [] : "", false)); + } + } + } + break; + case 6: + if (null === b.stateNode) throw Error(u(162)); + b.stateNode.nodeValue = b.memoizedProps; + break; + case 3: + b = b.stateNode; + b.hydrate && (b.hydrate = false, Lc(b.containerInfo)); + break; + case 12: + break; + case 13: + c = b; + null === b.memoizedState ? d = false : (d = true, c = b.child, bj = cg()); + 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 = Vd("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 a; + for (; null === a.sibling; ) { + if (null === a.return || a.return === c) break a; + a = a.return; + } + a.sibling.return = a.return; + a = a.sibling; + } + cj(b); + break; + case 19: + cj(b); + break; + case 17: + break; + case 20: + break; + case 21: + break; + default: + throw Error(u(163)); + } + } + function cj(a) { + var b = a.updateQueue; + if (null !== b) { + a.updateQueue = null; + var c = a.stateNode; + null === c && (c = a.stateNode = new Oi()); + b.forEach(function(b2) { + var d = dj.bind(null, a, b2); + c.has(b2) || (c.add(b2), b2.then(d, d)); + }); + } + } + var ej = "function" === typeof WeakMap ? WeakMap : Map; + function fj(a, b, c) { + c = Bg(c, null); + c.tag = 3; + c.payload = { element: null }; + var d = b.value; + c.callback = function() { + gj || (gj = true, hj = d); + Pi(a, b); + }; + return c; + } + function ij(a, b, c) { + c = Bg(c, null); + c.tag = 3; + var d = a.type.getDerivedStateFromError; + if ("function" === typeof d) { + var e = b.value; + c.payload = function() { + Pi(a, b); + return d(e); + }; + } + var f = a.stateNode; + null !== f && "function" === typeof f.componentDidCatch && (c.callback = function() { + "function" !== typeof d && (null === jj ? jj = /* @__PURE__ */ new Set([this]) : jj.add(this), Pi(a, b)); + var c2 = b.stack; + this.componentDidCatch(b.value, { componentStack: null !== c2 ? c2 : "" }); + }); + return c; + } + var kj = Math.ceil; + var lj = Ea.ReactCurrentDispatcher; + var mj = Ea.ReactCurrentOwner; + var S = 0; + var nj = 8; + var oj = 16; + var pj = 32; + var qj = 0; + var rj = 1; + var sj = 2; + var tj = 3; + var uj = 4; + var vj = 5; + var T = S; + var U = null; + var V = null; + var W = 0; + var X = qj; + var wj = null; + var xj = 1073741823; + var yj = 1073741823; + var zj = null; + var Aj = 0; + var Bj = false; + var bj = 0; + var Cj = 500; + var Y = null; + var gj = false; + var hj = null; + var jj = null; + var Dj = false; + var Ej = null; + var Fj = 90; + var Gj = null; + var Hj = 0; + var Ij = null; + var Jj = 0; + function Pg() { + return (T & (oj | pj)) !== S ? 1073741821 - (cg() / 10 | 0) : 0 !== Jj ? Jj : Jj = 1073741821 - (cg() / 10 | 0); + } + function Qg(a, b, c) { + b = b.mode; + if (0 === (b & 2)) return 1073741823; + var d = dg(); + if (0 === (b & 4)) return 99 === d ? 1073741823 : 1073741822; + if ((T & oj) !== S) return W; + if (null !== c) a = lg(a, c.timeoutMs | 0 || 5e3, 250); + else switch (d) { + case 99: + a = 1073741823; + break; + case 98: + a = lg(a, 150, 100); + break; + case 97: + case 96: + a = lg(a, 5e3, 250); + break; + case 95: + a = 2; + break; + default: + throw Error(u(326)); + } + null !== U && a === W && --a; + return a; + } + function Rg(a, b) { + if (50 < Hj) throw Hj = 0, Ij = null, Error(u(185)); + a = Kj(a, b); + if (null !== a) { + var c = dg(); + 1073741823 === b ? (T & nj) !== S && (T & (oj | pj)) === S ? Lj(a) : (Z(a), T === S && jg()) : Z(a); + (T & 4) === S || 98 !== c && 99 !== c || (null === Gj ? Gj = /* @__PURE__ */ new Map([[a, b]]) : (c = Gj.get(a), (void 0 === c || c > b) && Gj.set(a, b))); + } + } + function Kj(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 && (U === e && (Jg(b), X === uj && Mj(e, W)), Nj(e, b)); + return e; + } + function Oj(a) { + var b = a.lastExpiredTime; + if (0 !== b) return b; + b = a.firstPendingTime; + if (!Pj(a, b)) return b; + b = a.lastPingedTime; + a = a.nextKnownPendingLevel; + return b > a ? b : a; + } + function Z(a) { + if (0 !== a.lastExpiredTime) a.callbackExpirationTime = 1073741823, a.callbackPriority = 99, a.callbackNode = hg(Lj.bind(null, a)); + else { + var b = Oj(a), c = a.callbackNode; + if (0 === b) null !== c && (a.callbackNode = null, a.callbackExpirationTime = 0, a.callbackPriority = 90); + else { + var d = Pg(); + 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 !== Xf && Nf(c); + } + a.callbackExpirationTime = b; + a.callbackPriority = d; + b = 1073741823 === b ? hg(Lj.bind(null, a)) : gg(d, Qj.bind(null, a), { timeout: 10 * (1073741821 - b) - cg() }); + a.callbackNode = b; + } + } + } + function Qj(a, b) { + Jj = 0; + if (b) return b = Pg(), Rj(a, b), Z(a), null; + var c = Oj(a); + if (0 !== c) { + b = a.callbackNode; + if ((T & (oj | pj)) !== S) throw Error(u(327)); + Sj(); + a === U && c === W || Tj(a, c); + if (null !== V) { + var d = T; + T |= oj; + var e = Uj(a); + do + try { + Vj(); + break; + } catch (h) { + Wj(a, h); + } + while (1); + rg(); + T = d; + lj.current = e; + if (X === rj) throw b = wj, Tj(a, c), Mj(a, c), Z(a), b; + if (null === V) switch (e = a.finishedWork = a.current.alternate, a.finishedExpirationTime = c, d = X, U = null, d) { + case qj: + case rj: + throw Error(u(345)); + case sj: + Rj(a, 2 < c ? 2 : c); + break; + case tj: + Mj(a, c); + d = a.lastSuspendedTime; + c === d && (a.nextKnownPendingLevel = Xj(e)); + if (1073741823 === xj && (e = bj + Cj - cg(), 10 < e)) { + if (Bj) { + var f = a.lastPingedTime; + if (0 === f || f >= c) { + a.lastPingedTime = c; + Tj(a, c); + break; + } + } + f = Oj(a); + if (0 !== f && f !== c) break; + if (0 !== d && d !== c) { + a.lastPingedTime = d; + break; + } + a.timeoutHandle = pe(Yj.bind(null, a), e); + break; + } + Yj(a); + break; + case uj: + Mj(a, c); + d = a.lastSuspendedTime; + c === d && (a.nextKnownPendingLevel = Xj(e)); + if (Bj && (e = a.lastPingedTime, 0 === e || e >= c)) { + a.lastPingedTime = c; + Tj(a, c); + break; + } + e = Oj(a); + if (0 !== e && e !== c) break; + if (0 !== d && d !== c) { + a.lastPingedTime = d; + break; + } + 1073741823 !== yj ? d = 10 * (1073741821 - yj) - cg() : 1073741823 === xj ? d = 0 : (d = 10 * (1073741821 - xj) - 5e3, e = cg(), 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 * kj(d / 1960)) - d, c < d && (d = c)); + if (10 < d) { + a.timeoutHandle = pe(Yj.bind(null, a), d); + break; + } + Yj(a); + break; + case vj: + if (1073741823 !== xj && null !== zj) { + f = xj; + var g = zj; + d = g.busyMinDurationMs | 0; + 0 >= d ? d = 0 : (e = g.busyDelayMs | 0, f = cg() - (10 * (1073741821 - f) - (g.timeoutMs | 0 || 5e3)), d = f <= e ? 0 : e + d - f); + if (10 < d) { + Mj(a, c); + a.timeoutHandle = pe(Yj.bind(null, a), d); + break; + } + } + Yj(a); + break; + default: + throw Error(u(329)); + } + Z(a); + if (a.callbackNode === b) return Qj.bind(null, a); + } + } + return null; + } + function Lj(a) { + var b = a.lastExpiredTime; + b = 0 !== b ? b : 1073741823; + if (a.finishedExpirationTime === b) Yj(a); + else { + if ((T & (oj | pj)) !== S) throw Error(u(327)); + Sj(); + a === U && b === W || Tj(a, b); + if (null !== V) { + var c = T; + T |= oj; + var d = Uj(a); + do + try { + Zj(); + break; + } catch (e) { + Wj(a, e); + } + while (1); + rg(); + T = c; + lj.current = d; + if (X === rj) throw c = wj, Tj(a, b), Mj(a, b), Z(a), c; + if (null !== V) throw Error(u(261)); + a.finishedWork = a.current.alternate; + a.finishedExpirationTime = b; + U = null; + Yj(a); + Z(a); + } + } + return null; + } + function ak() { + if (null !== Gj) { + var a = Gj; + Gj = null; + a.forEach(function(a2, c) { + Rj(c, a2); + Z(c); + }); + jg(); + } + } + function bk(a, b) { + var c = T; + T |= 1; + try { + return a(b); + } finally { + T = c, T === S && jg(); + } + } + function ck(a, b) { + var c = T; + T &= -2; + T |= nj; + try { + return a(b); + } finally { + T = c, T === S && jg(); + } + } + function Tj(a, b) { + a.finishedWork = null; + a.finishedExpirationTime = 0; + var c = a.timeoutHandle; + -1 !== c && (a.timeoutHandle = -1, qe(c)); + if (null !== V) for (c = V.return; null !== c; ) { + var d = c; + switch (d.tag) { + case 1: + var e = d.type.childContextTypes; + null !== e && void 0 !== e && Ff(d); + break; + case 3: + nh(d); + Gf(d); + break; + case 5: + ph(d); + break; + case 4: + nh(d); + break; + case 13: + G(M, d); + break; + case 19: + G(M, d); + break; + case 10: + tg(d); + } + c = c.return; + } + U = a; + V = ah(a.current, null, b); + W = b; + X = qj; + wj = null; + yj = xj = 1073741823; + zj = null; + Aj = 0; + Bj = false; + } + function Wj(a, b) { + do { + try { + rg(); + Mh(); + if (null === V || null === V.return) return X = rj, wj = b, null; + a: { + var c = a, d = V.return, e = V, f = b; + b = W; + e.effectTag |= 2048; + e.firstEffect = e.lastEffect = null; + if (null !== f && "object" === typeof f && "function" === typeof f.then) { + var g = f, h = 0 !== (M.current & 1), k = d; + do { + var l; + if (l = 13 === k.tag) { + var m = k.memoizedState; + if (null !== m) l = null !== m.dehydrated ? true : false; + else { + var C = k.memoizedProps; + l = void 0 === C.fallback ? false : true !== C.unstable_avoidThisFallback ? true : h ? false : true; + } + } + if (l) { + var y = k.updateQueue; + if (null === y) { + var H = /* @__PURE__ */ new Set(); + H.add(g); + k.updateQueue = H; + } else y.add(g); + if (0 === (k.mode & 2)) { + k.effectTag |= 64; + e.effectTag &= -2981; + if (1 === e.tag) if (null === e.alternate) e.tag = 17; + else { + var z = Bg(1073741823, null); + z.tag = 2; + Dg(e, z); + } + e.expirationTime = 1073741823; + break a; + } + f = void 0; + e = b; + var ta = c.pingCache; + null === ta ? (ta = c.pingCache = new ej(), f = /* @__PURE__ */ new Set(), ta.set(g, f)) : (f = ta.get(g), void 0 === f && (f = /* @__PURE__ */ new Set(), ta.set(g, f))); + if (!f.has(e)) { + f.add(e); + var r = dk.bind(null, c, g, e); + g.then(r, r); + } + k.effectTag |= 4096; + k.expirationTime = b; + break a; + } + k = k.return; + } while (null !== k); + f = Error((Wa(e.type) || "A React component") + " suspended while rendering, but no fallback UI was specified.\n\nAdd a component higher in the tree to provide a loading indicator or placeholder to display." + Xa(e)); + } + X !== vj && (X = sj); + f = Ni(f, e); + k = d; + do { + switch (k.tag) { + case 3: + g = f; + k.effectTag |= 4096; + k.expirationTime = b; + var x = fj(k, g, b); + Eg(k, x); + break a; + case 1: + g = f; + var A = k.type, p = k.stateNode; + if (0 === (k.effectTag & 64) && ("function" === typeof A.getDerivedStateFromError || null !== p && "function" === typeof p.componentDidCatch && (null === jj || !jj.has(p)))) { + k.effectTag |= 4096; + k.expirationTime = b; + var t = ij(k, g, b); + Eg(k, t); + break a; + } + } + k = k.return; + } while (null !== k); + } + V = ek(V); + } catch (v) { + b = v; + continue; + } + break; + } while (1); + } + function Uj() { + var a = lj.current; + lj.current = Lh; + return null === a ? Lh : a; + } + function Ig(a, b) { + a < xj && 2 < a && (xj = a); + null !== b && a < yj && 2 < a && (yj = a, zj = b); + } + function Jg(a) { + a > Aj && (Aj = a); + } + function Zj() { + for (; null !== V; ) V = fk(V); + } + function Vj() { + for (; null !== V && !Of(); ) V = fk(V); + } + function fk(a) { + var b = gk(a.alternate, a, W); + a.memoizedProps = a.pendingProps; + null === b && (b = ek(a)); + mj.current = null; + return b; + } + function ek(a) { + V = a; + do { + var b = V.alternate; + a = V.return; + if (0 === (V.effectTag & 2048)) { + a: { + var c = b; + b = V; + var d = W; + var e = b.pendingProps; + switch (b.tag) { + case 2: + break; + case 16: + break; + case 15: + case 0: + break; + case 1: + L(b.type) && Ff(b); + break; + case 3: + nh(b); + Gf(b); + e = b.stateNode; + e.pendingContext && (e.context = e.pendingContext, e.pendingContext = null); + (null === c || null === c.child) && ki(b) && Ci(b); + Ii(b); + break; + case 5: + ph(b); + d = lh(kh.current); + var f = b.type; + if (null !== c && null != b.stateNode) Ji(c, b, f, e, d), c.ref !== b.ref && (b.effectTag |= 128); + else if (e) { + var g = lh(ih.current); + if (ki(b)) { + e = b; + var h = e.stateNode; + c = e.type; + var k = e.memoizedProps, l = d; + h[ue] = e; + h[ve] = k; + f = void 0; + d = h; + switch (c) { + case "iframe": + case "object": + case "embed": + F("load", d); + break; + case "video": + case "audio": + for (h = 0; h < dc.length; h++) F(dc[h], 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": + Bb(d, k); + F("invalid", d); + $d(l, "onChange"); + break; + case "select": + d._wrapperState = { wasMultiple: !!k.multiple }; + F("invalid", d); + $d(l, "onChange"); + break; + case "textarea": + Lb(d, k), F("invalid", d), $d(l, "onChange"); + } + Yd(c, k); + h = null; + for (f in k) k.hasOwnProperty(f) && (g = k[f], "children" === f ? "string" === typeof g ? d.textContent !== g && (h = ["children", g]) : "number" === typeof g && d.textContent !== "" + g && (h = ["children", "" + g]) : ia.hasOwnProperty(f) && null != g && $d(l, f)); + switch (c) { + case "input": + yb(d); + Gb(d, k, true); + break; + case "textarea": + yb(d); + Nb(d, k); + break; + case "select": + case "option": + break; + default: + "function" === typeof k.onClick && (d.onclick = ae); + } + f = h; + e.updateQueue = f; + e = null !== f ? true : false; + e && Ci(b); + } else { + c = b; + l = f; + k = e; + h = 9 === d.nodeType ? d : d.ownerDocument; + g === Ob.html && (g = Pb(l)); + g === Ob.html ? "script" === l ? (k = h.createElement("div"), k.innerHTML = " - - - - - - - - - - - - + +
diff --git a/outlib/helpers/migrate.js b/outlib/helpers/migrate.js deleted file mode 100644 index 76f22f0f..00000000 --- a/outlib/helpers/migrate.js +++ /dev/null @@ -1,136 +0,0 @@ -"use strict"; - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } - -var browser = browser || chrome; - -var stringkeys = ["layout"]; - -var jsonkeys = ["tabLimit", "tabWidth", "tabHeight", "windowAge", "windowNames", "windowColors"]; - -var boolkeys = ["openInOwnTab", "animations", "windowTitles", "compact", "dark", "tabactions", "badge", "sessionsFeature", "hideWindows", "filter-tabs"]; - -_asyncToGenerator(regeneratorRuntime.mark(function _callee() { - var hasLocalStorage, key, keyValue, values; - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - hasLocalStorage = false; - - - for (key in stringkeys) { - if (!!localStorage[key]) hasLocalStorage = true; - } - - for (key in boolkeys) { - if (!!localStorage[key]) hasLocalStorage = true; - } - - for (key in jsonkeys) { - if (!!localStorage[key]) hasLocalStorage = true; - } - - if (!hasLocalStorage) { - _context.next = 34; - break; - } - - keyValue = {}; - _context.next = 8; - return browser.storage.local.get(null); - - case 8: - values = _context.sent; - - values = values || {}; - _context.t0 = regeneratorRuntime.keys(values); - - case 11: - if ((_context.t1 = _context.t0()).done) { - _context.next = 21; - break; - } - - key = _context.t1.value; - - if (!values[key].tabs) { - _context.next = 18; - break; - } - - _context.next = 16; - return browser.storage.local.remove(key); - - case 16: - _context.next = 19; - break; - - case 18: - delete values[key]; - - case 19: - _context.next = 11; - break; - - case 21: - keyValue = {}; - - keyValue["sessions"] = values; - _context.next = 25; - return browser.storage.local.set(keyValue); - - case 25: - keyValue = {}; - - for (key in stringkeys) { - if (!!localStorage[key]) keyValue[key] = localStorage[key]; - } - - for (key in boolkeys) { - if (!!localStorage[key]) keyValue[key] = toBoolean(localStorage[key]); - } - - for (key in jsonkeys) { - if (!!localStorage[key]) keyValue[key] = JSON.parse(localStorage[key]); - } - - _context.next = 31; - return browser.storage.local.set(keyValue); - - case 31: - for (key in stringkeys) { - localStorage.removeItem(key); - }for (key in boolkeys) { - localStorage.removeItem(key); - }for (key in jsonkeys) { - localStorage.removeItem(key); - } - case 34: - case "end": - return _context.stop(); - } - } - }, _callee, this); -}))(); - -function toBoolean(str) { - if (typeof str === "undefined" || str === null) { - return false; - } else if (typeof str === "string") { - switch (str.toLowerCase()) { - case "false": - case "no": - case "0": - case "": - return false; - default: - return true; - } - } else if (typeof str === "number") { - return str !== 0; - } else { - return true; - } -} -//# sourceMappingURL=migrate.js.map \ No newline at end of file diff --git a/outlib/helpers/migrate.js.map b/outlib/helpers/migrate.js.map deleted file mode 100644 index 294b3b31..00000000 --- a/outlib/helpers/migrate.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../lib/helpers/migrate.js"],"names":["browser","chrome","stringkeys","jsonkeys","boolkeys","hasLocalStorage","key","localStorage","keyValue","storage","local","get","values","tabs","remove","set","toBoolean","JSON","parse","removeItem","str","toLowerCase"],"mappings":"AAAC;;;;AAED,IAAIA,UAAUA,WAAWC,MAAzB;;AAEA,IAAIC,aAAa,CAChB,QADgB,CAAjB;;AAIA,IAAIC,WAAW,CACd,UADc,EAEd,UAFc,EAGd,WAHc,EAId,WAJc,EAKd,aALc,EAMd,cANc,CAAf;;AASA,IAAIC,WAAW,CACd,cADc,EAEd,YAFc,EAGd,cAHc,EAId,SAJc,EAKd,MALc,EAMd,YANc,EAOd,OAPc,EAQd,iBARc,EASd,aATc,EAUd,aAVc,CAAf;;AAaA,0CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAEIC,oBAFJ,GAEsB,KAFtB;;;AAIA,UAASC,GAAT,IAAgBJ,UAAhB,EAA4B;AAC3B,UAAI,CAAC,CAACK,aAAaD,GAAb,CAAN,EAAyBD,kBAAkB,IAAlB;AACzB;;AAED,UAASC,GAAT,IAAgBF,QAAhB,EAA0B;AACzB,UAAI,CAAC,CAACG,aAAaD,GAAb,CAAN,EAAyBD,kBAAkB,IAAlB;AACzB;;AAED,UAASC,GAAT,IAAgBH,QAAhB,EAA0B;AACzB,UAAI,CAAC,CAACI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AAhB;AACzB;;AA5CF;AAAA,YA8CON,QAAQS,OAAR,CAAgBC,KAAhB,CAAsBK,GAAtB,CAA0BP,QAA1B,CA9CP;;AAAA;AAiDC,UAASF,GAAT,IAAgBJ,UAAhB;AAA4BK,mBAAaY,UAAb,CAAwBb,GAAxB;AAA5B,MACA,KAASA,GAAT,IAAgBF,QAAhB;AAA0BG,mBAAaY,UAAb,CAAwBb,GAAxB;AAA1B,MACA,KAASA,GAAT,IAAgBH,QAAhB;AAA0BI,mBAAaY,UAAb,CAAwBb,GAAxB;AAA1B;AAnDD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAD;;AAwDA,SAASU,SAAT,CAAmBI,GAAnB,EACA;AACC,KAAI,OAAOA,GAAP,KAAe,WAAf,IAA8BA,QAAQ,IAA1C,EAAgD;AAC/C,SAAO,KAAP;AACA,EAFD,MAEO,IAAI,OAAOA,GAAP,KAAe,QAAnB,EAA6B;AACnC,UAAQA,IAAIC,WAAJ,EAAR;AACC,QAAK,OAAL;AACA,QAAK,IAAL;AACA,QAAK,GAAL;AACA,QAAK,EAAL;AACC,WAAO,KAAP;AACD;AACC,WAAO,IAAP;AAPF;AASA,EAVM,MAUA,IAAI,OAAOD,GAAP,KAAe,QAAnB,EAA6B;AACnC,SAAOA,QAAQ,CAAf;AACA,EAFM,MAEA;AACN,SAAO,IAAP;AACA;AACD","file":"migrate.js","sourcesContent":["\"use strict\";\r\n\r\nvar browser = browser || chrome;\r\n\r\nvar stringkeys = [\r\n\t\"layout\"\r\n];\r\n\r\nvar jsonkeys = [\r\n\t\"tabLimit\",\r\n\t\"tabWidth\",\r\n\t\"tabHeight\",\r\n\t\"windowAge\",\r\n\t\"windowNames\",\r\n\t\"windowColors\"\r\n];\r\n\r\nvar boolkeys = [\r\n\t\"openInOwnTab\",\r\n\t\"animations\",\r\n\t\"windowTitles\",\r\n\t\"compact\",\r\n\t\"dark\",\r\n\t\"tabactions\",\r\n\t\"badge\",\r\n\t\"sessionsFeature\",\r\n\t\"hideWindows\",\r\n\t\"filter-tabs\"\r\n];\r\n\r\n(async function () {\r\n\r\n\tvar hasLocalStorage = false;\r\n\r\n\tfor (var key in stringkeys) {\r\n\t\tif (!!localStorage[key]) hasLocalStorage = true;\r\n\t}\r\n\r\n\tfor (var key in boolkeys) {\r\n\t\tif (!!localStorage[key]) hasLocalStorage = true;\r\n\t}\r\n\r\n\tfor (var key in jsonkeys) {\r\n\t\tif (!!localStorage[key]) hasLocalStorage = true;\r\n\t}\r\n\r\n\tif (hasLocalStorage) {\r\n\t\tvar keyValue = {};\r\n\r\n\t\tvar values = await browser.storage.local.get(null);\r\n\t\tvalues = values || {};\r\n\t\t// delete all values that don't have a tabs array\r\n\t\tfor (var key in values) {\r\n\t\t\tif (!!values[key].tabs) {\r\n\t\t\t\tawait browser.storage.local.remove(key);\r\n\t\t\t} else {\r\n\t\t\t\tdelete values[key];\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar keyValue = {};\r\n\t\tkeyValue[\"sessions\"] = values;\r\n\t\tawait browser.storage.local.set(keyValue);\r\n\r\n\t\tvar keyValue = {};\r\n\t\tfor (var key in stringkeys) {\r\n\t\t\tif (!!localStorage[key]) keyValue[key] = localStorage[key];\r\n\t\t}\r\n\r\n\t\tfor (var key in boolkeys) {\r\n\t\t\tif (!!localStorage[key]) keyValue[key] = toBoolean(localStorage[key]);\r\n\t\t}\r\n\r\n\t\tfor (var key in jsonkeys) {\r\n\t\t\tif (!!localStorage[key]) keyValue[key] = JSON.parse(localStorage[key]);\r\n\t\t}\r\n\r\n\t\tawait browser.storage.local.set(keyValue);\r\n\r\n\t\t// clear old localstorage\r\n\t\tfor (var key in stringkeys) localStorage.removeItem(key);\r\n\t\tfor (var key in boolkeys) localStorage.removeItem(key);\r\n\t\tfor (var key in jsonkeys) localStorage.removeItem(key);\r\n\r\n\t}\r\n})();\r\n\r\nfunction toBoolean(str)\r\n{\r\n\tif (typeof str === \"undefined\" || str === null) {\r\n\t\treturn false;\r\n\t} else if (typeof str === \"string\") {\r\n\t\tswitch (str.toLowerCase()) {\r\n\t\t\tcase \"false\":\r\n\t\t\tcase \"no\":\r\n\t\t\tcase \"0\":\r\n\t\t\tcase \"\":\r\n\t\t\t\treturn false;\r\n\t\t\tdefault:\r\n\t\t\t\treturn true;\r\n\t\t}\r\n\t} else if (typeof str === \"number\") {\r\n\t\treturn str !== 0;\r\n\t} else {\r\n\t\treturn true;\r\n\t}\r\n}"]} \ No newline at end of file diff --git a/outlib/helpers/storage.js b/outlib/helpers/storage.js deleted file mode 100644 index c16a6e9a..00000000 --- a/outlib/helpers/storage.js +++ /dev/null @@ -1,82 +0,0 @@ -"use strict"; - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } - -var browser = browser || chrome; - -var getLocalStorage = function () { - var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee(key) { - var default_value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - return _context.abrupt("return", new Promise(function (resolve, reject) { - browser.storage.local.get([key]).then(function (result) { - if (result[key] === undefined) { - resolve(default_value); - } else { - resolve(result[key]); - } - }); - })); - - case 1: - case "end": - return _context.stop(); - } - } - }, _callee, undefined); - })); - - return function getLocalStorage(_x) { - return _ref.apply(this, arguments); - }; -}(); - -var setLocalStorage = function () { - var _ref2 = _asyncToGenerator(regeneratorRuntime.mark(function _callee2(key, value) { - var obj; - return regeneratorRuntime.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - obj = {}; - - obj[key] = value; - return _context2.abrupt("return", browser.storage.local.set(obj)); - - case 3: - case "end": - return _context2.stop(); - } - } - }, _callee2, undefined); - })); - - return function setLocalStorage(_x3, _x4) { - return _ref2.apply(this, arguments); - }; -}(); - -var removeLocalStorage = function () { - var _ref3 = _asyncToGenerator(regeneratorRuntime.mark(function _callee3(key) { - return regeneratorRuntime.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - return _context3.abrupt("return", browser.storage.local.remove(key)); - - case 1: - case "end": - return _context3.stop(); - } - } - }, _callee3, undefined); - })); - - return function removeLocalStorage(_x5) { - return _ref3.apply(this, arguments); - }; -}(); -//# sourceMappingURL=storage.js.map \ No newline at end of file diff --git a/outlib/helpers/storage.js.map b/outlib/helpers/storage.js.map deleted file mode 100644 index 101b3527..00000000 --- a/outlib/helpers/storage.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../lib/helpers/storage.js"],"names":["browser","chrome","getLocalStorage","key","default_value","Promise","resolve","reject","storage","local","get","then","result","undefined","setLocalStorage","value","obj","set","removeLocalStorage","remove"],"mappings":";;;;AAAC,IAAIA,UAAUA,WAAWC,MAAzB;;AAED,IAAMC;AAAA,sDAAkB,iBAAOC,GAAP;AAAA,MAAYC,aAAZ,uEAA4B,IAA5B;AAAA;AAAA;AAAA;AAAA;AAAA,uCAChB,IAAIC,OAAJ,CAAY,UAACC,OAAD,EAAUC,MAAV,EAAqB;AACvCP,eAAQQ,OAAR,CAAgBC,KAAhB,CAAsBC,GAAtB,CAA0B,CAACP,GAAD,CAA1B,EAAiCQ,IAAjC,CAAsC,kBAAU;AAC/C,YAAIC,OAAOT,GAAP,MAAgBU,SAApB,EAA+B;AAC9BP,iBAAQF,aAAR;AACA,SAFD,MAEO;AACNE,iBAAQM,OAAOT,GAAP,CAAR;AACA;AACD,QAND;AAOA,OARM,CADgB;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;;AAAA;AAAA;AAAA;AAAA,GAAN;;AAYA,IAAMW;AAAA,uDAAkB,kBAAOX,GAAP,EAAYY,KAAZ;AAAA;AAAA;AAAA;AAAA;AAAA;AACnBC,SADmB,GACb,EADa;;AAEvBA,UAAIb,GAAJ,IAAWY,KAAX;AAFuB,wCAGhBf,QAAQQ,OAAR,CAAgBC,KAAhB,CAAsBQ,GAAtB,CAA0BD,GAA1B,CAHgB;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;;AAAA;AAAA;AAAA;AAAA,GAAN;;AAMA,IAAME;AAAA,uDAAqB,kBAAOf,GAAP;AAAA;AAAA;AAAA;AAAA;AAAA,wCACnBH,QAAQQ,OAAR,CAAgBC,KAAhB,CAAsBU,MAAtB,CAA6BhB,GAA7B,CADmB;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAArB;;AAAA;AAAA;AAAA;AAAA,GAAN","file":"storage.js","sourcesContent":["var browser = browser || chrome;\n\nconst getLocalStorage = async (key, default_value = null) => {\n\treturn new Promise((resolve, reject) => {\n\t\tbrowser.storage.local.get([key]).then(result => {\n\t\t\tif (result[key] === undefined) {\n\t\t\t\tresolve(default_value);\n\t\t\t} else {\n\t\t\t\tresolve(result[key]);\n\t\t\t}\n\t\t});\n\t});\n};\n\nconst setLocalStorage = async (key, value) => {\n\tvar obj = {};\n\tobj[key] = value;\n\treturn browser.storage.local.set(obj);\n};\n\nconst removeLocalStorage = async (key) => {\n\treturn browser.storage.local.remove(key);\n};"]} \ No newline at end of file diff --git a/outlib/helpers/utils.js b/outlib/helpers/utils.js deleted file mode 100644 index 57decf5c..00000000 --- a/outlib/helpers/utils.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; - -function debounce(func, wait, immediate) { - var timeout; - return function () { - var context = this, - args = arguments; - var later = function later() { - timeout = null; - if (!immediate) func.apply(context, args); - }; - var callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) func.apply(context, args); - }; -} - -function is_in_bounds(object, bounds) { - var C = object, - B = bounds; - if (C.left >= B.left && C.left <= B.left + B.width) { - if (C.top >= B.top && C.top <= B.top + B.height) { - return true; - } - } - return false; -} - -function stringHashcode(string) { - var hash = 0; - for (var i = 0; i < string.length; i++) { - var code = string.charCodeAt(i); - hash = (hash << 5) - hash + code; - hash = hash & hash; - } - return hash; -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/outlib/helpers/utils.js.map b/outlib/helpers/utils.js.map deleted file mode 100644 index 3a96e405..00000000 --- a/outlib/helpers/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../lib/helpers/utils.js"],"names":["debounce","func","wait","immediate","timeout","context","args","arguments","later","apply","callNow","clearTimeout","setTimeout","is_in_bounds","object","bounds","C","B","left","width","top","height","stringHashcode","string","hash","i","length","code","charCodeAt"],"mappings":";;AAIA,SAASA,QAAT,CAAkBC,IAAlB,EAAwBC,IAAxB,EAA8BC,SAA9B,EAAyC;AACxC,KAAIC,OAAJ;AACA,QAAO,YAAY;AAClB,MAAIC,UAAU,IAAd;AAAA,MAAoBC,OAAOC,SAA3B;AACA,MAAIC,QAAQ,SAASA,KAAT,GAAiB;AAC5BJ,aAAU,IAAV;AACA,OAAI,CAACD,SAAL,EAAgBF,KAAKQ,KAAL,CAAWJ,OAAX,EAAoBC,IAApB;AAChB,GAHD;AAIA,MAAII,UAAUP,aAAa,CAACC,OAA5B;AACAO,eAAaP,OAAb;AACAA,YAAUQ,WAAWJ,KAAX,EAAkBN,IAAlB,CAAV;AACA,MAAIQ,OAAJ,EAAaT,KAAKQ,KAAL,CAAWJ,OAAX,EAAoBC,IAApB;AACb,EAVD;AAWA;;AAED,SAASO,YAAT,CAAsBC,MAAtB,EAA8BC,MAA9B,EAAsC;AACrC,KAAIC,IAAIF,MAAR;AAAA,KAAgBG,IAAIF,MAApB;AACA,KAAIC,EAAEE,IAAF,IAAUD,EAAEC,IAAZ,IAAoBF,EAAEE,IAAF,IAAUD,EAAEC,IAAF,GAASD,EAAEE,KAA7C,EAAoD;AACnD,MAAIH,EAAEI,GAAF,IAASH,EAAEG,GAAX,IAAkBJ,EAAEI,GAAF,IAASH,EAAEG,GAAF,GAAQH,EAAEI,MAAzC,EAAiD;AAChD,UAAO,IAAP;AACA;AACD;AACD,QAAO,KAAP;AACA;;AAED,SAASC,cAAT,CAAwBC,MAAxB,EAAgC;AAC/B,KAAIC,OAAO,CAAX;AACA,MAAK,IAAIC,IAAI,CAAb,EAAgBA,IAAIF,OAAOG,MAA3B,EAAmCD,GAAnC,EAAwC;AACvC,MAAIE,OAAOJ,OAAOK,UAAP,CAAkBH,CAAlB,CAAX;AACAD,SAAQ,CAACA,QAAQ,CAAT,IAAcA,IAAf,GAAuBG,IAA9B;AACAH,SAAOA,OAAOA,IAAd;AACA;AACD,QAAOA,IAAP;AACA","file":"utils.js","sourcesContent":["// Returns a function, that, as long as it continues to be invoked, will not\r\n// be triggered. The function will be called after it stops being called for\r\n// N milliseconds. If `immediate` is passed, trigger the function on the\r\n// leading edge, instead of the trailing.\r\nfunction debounce(func, wait, immediate) {\r\n\tvar timeout;\r\n\treturn function () {\r\n\t\tvar context = this, args = arguments;\r\n\t\tvar later = function later() {\r\n\t\t\ttimeout = null;\r\n\t\t\tif (!immediate) func.apply(context, args);\r\n\t\t};\r\n\t\tvar callNow = immediate && !timeout;\r\n\t\tclearTimeout(timeout);\r\n\t\ttimeout = setTimeout(later, wait);\r\n\t\tif (callNow) func.apply(context, args);\r\n\t}\r\n}\r\n\r\nfunction is_in_bounds(object, bounds) {\r\n\tvar C = object, B = bounds;\r\n\tif (C.left >= B.left && C.left <= B.left + B.width) {\r\n\t\tif (C.top >= B.top && C.top <= B.top + B.height) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nfunction stringHashcode(string) {\r\n\tvar hash = 0;\r\n\tfor (var i = 0; i < string.length; i++) {\r\n\t\tvar code = string.charCodeAt(i);\r\n\t\thash = ((hash << 5) - hash) + code;\r\n\t\thash = hash & hash; // Convert to 32bit integer\r\n\t}\r\n\treturn hash;\r\n}"]} \ No newline at end of file diff --git a/outlib/popup/changelog.js b/outlib/popup/changelog.js deleted file mode 100644 index 837e48bb..00000000 --- a/outlib/popup/changelog.js +++ /dev/null @@ -1,4 +0,0 @@ -"use strict"; - -window.changelogPage = true; -//# sourceMappingURL=changelog.js.map \ No newline at end of file diff --git a/outlib/popup/changelog.js.map b/outlib/popup/changelog.js.map deleted file mode 100644 index 4d9ae789..00000000 --- a/outlib/popup/changelog.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../lib/popup/changelog.js"],"names":["window","changelogPage"],"mappings":"AAAA;;AACAA,OAAOC,aAAP,GAAuB,IAAvB","file":"changelog.js","sourcesContent":["\"use strict\";\nwindow.changelogPage = true;"]} \ No newline at end of file diff --git a/outlib/popup/options.js b/outlib/popup/options.js deleted file mode 100644 index 1f343405..00000000 --- a/outlib/popup/options.js +++ /dev/null @@ -1,4 +0,0 @@ -"use strict"; - -window.optionPage = true; -//# sourceMappingURL=options.js.map \ No newline at end of file diff --git a/outlib/popup/options.js.map b/outlib/popup/options.js.map deleted file mode 100644 index bb2b744a..00000000 --- a/outlib/popup/options.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../lib/popup/options.js"],"names":["window","optionPage"],"mappings":"AAAA;;AACAA,OAAOC,UAAP,GAAoB,IAApB","file":"options.js","sourcesContent":["\"use strict\";\nwindow.optionPage = true;"]} \ No newline at end of file diff --git a/outlib/popup/popup.js b/outlib/popup/popup.js deleted file mode 100644 index 2225b704..00000000 --- a/outlib/popup/popup.js +++ /dev/null @@ -1,123 +0,0 @@ -"use strict"; - -var loadApp = function () { - var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee() { - var height, width, root; - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - if (!window.loaded) { - _context.next = 2; - break; - } - - return _context.abrupt("return"); - - case 2: - _context.next = 4; - return getLocalStorage("tabHeight", 0); - - case 4: - height = _context.sent; - _context.next = 7; - return getLocalStorage("tabWidth", 0); - - case 7: - width = _context.sent; - - console.log(height, width); - if (window.inPopup) { - - if (height > 0 && width > 0) { - document.body.style.width = width + "px"; - document.body.style.height = height + "px"; - } - - root = document.getElementById("root"); - - if (root != null) { - height = document.body.style.height.split("px")[0]; - - height = parseInt(height) || 0; - if (height < 300) { - height = 400; - document.body.style.minHeight = height + "px"; - } else { - height++; - if (height > 600) height = 600; - document.body.style.minHeight = height + "px"; - } - } - } else { - if (window.inPanel) { - document.documentElement.style.maxHeight = "auto"; - document.documentElement.style.maxWidth = "auto"; - document.body.style.maxHeight = "auto"; - document.body.style.maxWidth = "auto"; - } - document.documentElement.style.maxHeight = "100%"; - document.documentElement.style.maxWidth = "100%"; - document.documentElement.style.height = "100%"; - document.documentElement.style.width = "100%"; - document.body.style.maxHeight = "100%"; - document.body.style.maxWidth = "100%"; - document.body.style.height = "100%"; - document.body.style.width = "100%"; - } - - if (!window.loaded) { - _context.next = 12; - break; - } - - return _context.abrupt("return"); - - case 12: - window.loaded = true; - ReactDOM.render(React.createElement(TabManager, { optionsActive: !!window.optionPage }), document.getElementById("TMP")); - - case 14: - case "end": - return _context.stop(); - } - } - }, _callee, this); - })); - - return function loadApp() { - return _ref.apply(this, arguments); - }; -}(); - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } - -window.loaded = false; -if (window.location.search.indexOf("?popup") > -1) { - window.inPopup = true; -} else { - window.inPopup = false; -} -if (window.location.search.indexOf("?panel") > -1) { - window.inPanel = true; -} else { - window.inPanel = false; -} -window.onload = function () { - window.requestAnimationFrame(loadApp); -}; -setTimeout(loadApp, 75); -setTimeout(loadApp, 125); -setTimeout(loadApp, 250); -setTimeout(loadApp, 375); -setTimeout(loadApp, 700); -setTimeout(loadApp, 1000); -setTimeout(loadApp, 2000); -setTimeout(loadApp, 3000); -setTimeout(loadApp, 5000); -setTimeout(loadApp, 15000); - -window.addEventListener("contextmenu", function (e) { - e.preventDefault(); -}); -//# sourceMappingURL=popup.js.map \ No newline at end of file diff --git a/outlib/popup/popup.js.map b/outlib/popup/popup.js.map deleted file mode 100644 index c8c97120..00000000 --- a/outlib/popup/popup.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../lib/popup/popup.jsx"],"names":["window","loaded","getLocalStorage","height","width","console","log","inPopup","document","body","style","root","getElementById","split","parseInt","minHeight","inPanel","documentElement","maxHeight","maxWidth","ReactDOM","render","optionPage","loadApp","location","search","indexOf","onload","requestAnimationFrame","setTimeout","addEventListener","e","preventDefault"],"mappings":"AAAA;;;sDA2BA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UACM,CAACA,OAAOC,MADd;AAAA;AAAA;AAAA;;AAAA;;AAAA;AAAA;AAAA,aAEoBC,gBAAgB,WAAhB,EAA6B,CAA7B,CAFpB;;AAAA;AAEKC,YAFL;AAAA;AAAA,aAGmBD,gBAAgB,UAAhB,EAA4B,CAA5B,CAHnB;;AAAA;AAGKE,WAHL;;AAICC,cAAQC,GAAR,CAAYH,MAAZ,EAAoBC,KAApB;AACA,UAAIJ,OAAOO,OAAX,EAAoB;;AAEnB,WAAIJ,SAAS,CAAT,IAAcC,QAAQ,CAA1B,EAA6B;AAC5BI,iBAASC,IAAT,CAAcC,KAAd,CAAoBN,KAApB,GAA4BA,QAAQ,IAApC;AACAI,iBAASC,IAAT,CAAcC,KAAd,CAAoBP,MAApB,GAA6BA,SAAS,IAAtC;AACA;;AAEGQ,WAPe,GAORH,SAASI,cAAT,CAAwB,MAAxB,CAPQ;;AAQnB,WAAID,QAAQ,IAAZ,EAAkB;AACbR,cADa,GACJK,SAASC,IAAT,CAAcC,KAAd,CAAoBP,MAApB,CAA2BU,KAA3B,CAAiC,IAAjC,EAA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,aAAOC,MAAP,GAAgB,IAAhB;AACAmB,eAASC,MAAT,CAAgB,oBAAC,UAAD,IAAY,eAAe,CAAC,CAACrB,OAAOsB,UAApC,GAAhB,EAAoEd,SAASI,cAAT,CAAwB,KAAxB,CAApE;;AA5CD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,E;;iBAAeW,O;;;;;;;AAzBfvB,OAAOC,MAAP,GAAgB,KAAhB;AACA,IAAID,OAAOwB,QAAP,CAAgBC,MAAhB,CAAuBC,OAAvB,CAA+B,QAA/B,IAA2C,CAAC,CAAhD,EAAmD;AAClD1B,QAAOO,OAAP,GAAiB,IAAjB;AACA,CAFD,MAEO;AACNP,QAAOO,OAAP,GAAiB,KAAjB;AACA;AACD,IAAIP,OAAOwB,QAAP,CAAgBC,MAAhB,CAAuBC,OAAvB,CAA+B,QAA/B,IAA2C,CAAC,CAAhD,EAAmD;AAClD1B,QAAOgB,OAAP,GAAiB,IAAjB;AACA,CAFD,MAEO;AACNhB,QAAOgB,OAAP,GAAiB,KAAjB;AACA;AACDhB,OAAO2B,MAAP,GAAgB,YAAW;AAC1B3B,QAAO4B,qBAAP,CAA6BL,OAA7B;AACA,CAFD;AAGAM,WAAWN,OAAX,EAAoB,EAApB;AACAM,WAAWN,OAAX,EAAoB,GAApB;AACAM,WAAWN,OAAX,EAAoB,GAApB;AACAM,WAAWN,OAAX,EAAoB,GAApB;AACAM,WAAWN,OAAX,EAAoB,GAApB;AACAM,WAAWN,OAAX,EAAoB,IAApB;AACAM,WAAWN,OAAX,EAAoB,IAApB;AACAM,WAAWN,OAAX,EAAoB,IAApB;AACAM,WAAWN,OAAX,EAAoB,IAApB;AACAM,WAAWN,OAAX,EAAoB,KAApB;;AAiDAvB,OAAO8B,gBAAP,CAAwB,aAAxB,EAAuC,UAAUC,CAAV,EAAa;AAACA,GAAEC,cAAF;AAAoB,CAAzE","file":"popup.js","sourcesContent":["\"use strict\";\n\nwindow.loaded = false;\nif (window.location.search.indexOf(\"?popup\") > -1) {\n\twindow.inPopup = true;\n} else {\n\twindow.inPopup = false;\n}\nif (window.location.search.indexOf(\"?panel\") > -1) {\n\twindow.inPanel = true;\n} else {\n\twindow.inPanel = false;\n}\nwindow.onload = function() {\n\twindow.requestAnimationFrame(loadApp);\n};\nsetTimeout(loadApp, 75);\nsetTimeout(loadApp, 125);\nsetTimeout(loadApp, 250);\nsetTimeout(loadApp, 375);\nsetTimeout(loadApp, 700);\nsetTimeout(loadApp, 1000);\nsetTimeout(loadApp, 2000);\nsetTimeout(loadApp, 3000);\nsetTimeout(loadApp, 5000);\nsetTimeout(loadApp, 15000);\n\nasync function loadApp() {\n\tif (!!window.loaded) return;\n\tvar height = await getLocalStorage(\"tabHeight\", 0);\n\tvar width = await getLocalStorage(\"tabWidth\", 0);\n\tconsole.log(height, width);\n\tif (window.inPopup) {\n\n\t\tif (height > 0 && width > 0) {\n\t\t\tdocument.body.style.width = width + \"px\";\n\t\t\tdocument.body.style.height = height + \"px\";\n\t\t}\n\n\t\tvar root = document.getElementById(\"root\");\n\t\tif (root != null) {\n\t\t\tvar height = document.body.style.height.split(\"px\")[0];\n\t\t\theight = parseInt(height) || 0;\n\t\t\tif (height < 300) {\n\t\t\t\theight = 400;\n\t\t\t\tdocument.body.style.minHeight = height + \"px\";\n\t\t\t} else {\n\t\t\t\theight++;\n\t\t\t\tif (height > 600) height = 600;\n\t\t\t\tdocument.body.style.minHeight = height + \"px\";\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif (window.inPanel) {\n\t\t\tdocument.documentElement.style.maxHeight = \"auto\";\n\t\t\tdocument.documentElement.style.maxWidth = \"auto\";\n\t\t\tdocument.body.style.maxHeight = \"auto\";\n\t\t\tdocument.body.style.maxWidth = \"auto\";\n\t\t}\n\t\tdocument.documentElement.style.maxHeight = \"100%\";\n\t\tdocument.documentElement.style.maxWidth = \"100%\";\n\t\tdocument.documentElement.style.height = \"100%\";\n\t\tdocument.documentElement.style.width = \"100%\";\n\t\tdocument.body.style.maxHeight = \"100%\";\n\t\tdocument.body.style.maxWidth = \"100%\";\n\t\tdocument.body.style.height = \"100%\";\n\t\tdocument.body.style.width = \"100%\";\n\t}\n\n\tif (!!window.loaded) return;\n\twindow.loaded = true;\n\tReactDOM.render(, document.getElementById(\"TMP\"));\n}\n\nwindow.addEventListener(\"contextmenu\", function (e) {e.preventDefault();});\n\n"]} \ No newline at end of file diff --git a/outlib/popup/views/Session.js b/outlib/popup/views/Session.js deleted file mode 100644 index c54ab437..00000000 --- a/outlib/popup/views/Session.js +++ /dev/null @@ -1,317 +0,0 @@ -"use strict"; - -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; }; }(); - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(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; } - -function _inherits(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 Session = function (_React$Component) { - _inherits(Session, _React$Component); - - function Session(props) { - _classCallCheck(this, Session); - - var _this3 = _possibleConstructorReturn(this, (Session.__proto__ || Object.getPrototypeOf(Session)).call(this, props)); - - var name = _this3.props.window.name; - var color = _this3.props.window.color || "default"; - _this3.state = { - windowTitles: [], - name: name, - color: color, - tabs: 0 - }; - - _this3.stop = _this3.stop.bind(_this3); - _this3.windowClick = _this3.windowClick.bind(_this3); - _this3.windowTabClick = _this3.windowTabClick.bind(_this3); - _this3.close = _this3.close.bind(_this3); - _this3.openTab = _this3.openTab.bind(_this3); - _this3.maximize = _this3.maximize.bind(_this3); - - return _this3; - } - - _createClass(Session, [{ - key: "render", - value: function render() { - var _this = this; - var name = this.state.name; - var color = this.state.color; - var hideWindow = true; - var titleAdded = false; - var tabsperrow = this.props.layout.indexOf("blocks") > -1 ? Math.ceil(Math.sqrt(this.props.tabs.length + 2)) : this.props.layout == "vertical" ? 1 : 15; - var tabs = this.props.tabs.map(function (tab) { - var tabId = tab.id * tab.id * tab.id * 100; - var isHidden = !!_this.props.hiddenTabs[tabId] && _this.props.filterTabs; - var isSelected = !!_this.props.selection[tabId]; - tab.id = tab.index; - hideWindow &= isHidden; - return React.createElement(Tab, { - id: "sessiontab_" + _this.props.window.id + "_" + tab.index, - key: "sessiontab_" + _this.props.window.id + "_" + tab.index, - window: _this.props.window, - layout: _this.props.layout, - tab: tab, - selected: isSelected, - hidden: isHidden, - draggable: false, - click: _this.openTab, - middleClick: _this.props.tabMiddleClick, - hoverHandler: _this.props.hoverHandler, - searchActive: _this.props.searchActive, - select: _this.props.select, - ref: "sessiontab" + tabId - }); - }); - if (!hideWindow) { - if (!!this.props.tabactions) { - tabs.push(React.createElement("div", { key: "sessionnl_" + _this.props.window.id, className: "newliner" }), React.createElement( - "div", - { key: "sessionwa_" + _this.props.window.id, className: "window-actions" }, - React.createElement("div", { - className: "icon tabaction restore " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Restore this saved window\nWill restore " + tabs.length + " tabs. Please note : The tabs will be restored without their history.", - onClick: this.windowClick, - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction delete " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Delete this saved window\nWill delete " + tabs.length + " tabs permanently", - onClick: this.close, - onMouseEnter: this.props.hoverIcon - }) - )); - } - - if (this.props.windowTitles) { - if (name) { - tabs.unshift(React.createElement( - "h3", - { key: "session-" + this.props.window.id + "-windowTitle", className: "center windowTitle" }, - name - )); - titleAdded = true; - } - } - if (tabsperrow < 3) { - tabsperrow = 3; - } - var children = []; - if (!!titleAdded) { - children.push(tabs.shift()); - } - for (var j = 0; j < tabs.length; j++) { - children.push(tabs[j]); - if ((j + 1) % tabsperrow == 0 && j && this.props.layout.indexOf("blocks") > -1) { - children.push(React.createElement("div", { key: "sessionnl_" + _this.props.window.id + "_" + j, className: "newliner" })); - } - } - var focused = false; - if (this.props.window.windowsInfo.focused || this.props.lastOpenWindow == this.props.window.windowsInfo.id) { - focused = true; - } - return React.createElement( - "div", - { - key: "session-" + this.props.window.id, - id: "session-" + this.props.window.id, - className: "window " + this.props.window.windowsInfo.state + " " + (focused ? "activeWindow" : "") + " session " + (this.props.layout.indexOf("blocks") > -1 ? "block" : "") + " " + this.props.layout + " " + this.state.color + " " + (this.props.window.windowsInfo.incognito ? " incognito" : "") + " " + (focused ? " focused" : ""), - onClick: this.windowClick - }, - React.createElement( - "div", - { className: "windowcontainer" }, - children - ) - ); - } else { - return null; - } - } - }, { - key: "shouldComponentUpdate", - value: function shouldComponentUpdate(nextProps, nextState) { - return true; - } - }, { - key: "stop", - value: function stop(e) { - e.stopPropagation(); - } - }, { - key: "windowTabClick", - value: function () { - var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee(e) { - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - e.stopPropagation(); - - case 1: - case "end": - return _context.stop(); - } - } - }, _callee, this); - })); - - function windowTabClick(_x) { - return _ref.apply(this, arguments); - } - - return windowTabClick; - }() - }, { - key: "windowClick", - value: function () { - var _ref2 = _asyncToGenerator(regeneratorRuntime.mark(function _callee2(e) { - return regeneratorRuntime.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - this.restoreSession(e, null); - - case 1: - case "end": - return _context2.stop(); - } - } - }, _callee2, this); - })); - - function windowClick(_x2) { - return _ref2.apply(this, arguments); - } - - return windowClick; - }() - }, { - key: "openTab", - value: function () { - var _ref3 = _asyncToGenerator(regeneratorRuntime.mark(function _callee3(e, index) { - return regeneratorRuntime.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - console.log(index); - this.restoreSession(e, index); - - case 2: - case "end": - return _context3.stop(); - } - } - }, _callee3, this); - })); - - function openTab(_x3, _x4) { - return _ref3.apply(this, arguments); - } - - return openTab; - }() - }, { - key: "restoreSession", - value: function () { - var _ref4 = _asyncToGenerator(regeneratorRuntime.mark(function _callee4(e, tabId) { - var _this2; - - return regeneratorRuntime.wrap(function _callee4$(_context4) { - while (1) { - switch (_context4.prev = _context4.next) { - case 0: - _this2 = this; - - e.stopPropagation(); - console.log("source window", this.props.window); - - - browser.runtime.sendMessage({ command: "create_window_with_session_tabs", window: this.props.window, tab_id: tabId }); - - this.props.parentUpdate(); - - if (!!window.inPopup) { - window.close(); - } else { - setTimeout(function () { - this.props.scrollTo("window", browser.windows.WINDOW_ID_CURRENT); - }.bind(this), 500); - } - - case 6: - case "end": - return _context4.stop(); - } - } - }, _callee4, this); - })); - - function restoreSession(_x5, _x6) { - return _ref4.apply(this, arguments); - } - - return restoreSession; - }() - }, { - key: "close", - value: function () { - var _ref5 = _asyncToGenerator(regeneratorRuntime.mark(function _callee5(e) { - var sessions, value; - return regeneratorRuntime.wrap(function _callee5$(_context5) { - while (1) { - switch (_context5.prev = _context5.next) { - case 0: - e.stopPropagation(); - - _context5.next = 3; - return getLocalStorage('sessions', {}); - - case 3: - sessions = _context5.sent; - - delete sessions[this.props.window.id]; - - _context5.next = 7; - return setLocalStorage('sessions', sessions).catch(function (err) { - console.log(err); - console.error(err.message); - }); - - case 7: - value = _context5.sent; - - - console.log(value); - this.props.parentUpdate(); - - case 10: - case "end": - return _context5.stop(); - } - } - }, _callee5, this); - })); - - function close(_x7) { - return _ref5.apply(this, arguments); - } - - return close; - }() - }, { - key: "maximize", - value: function maximize(e) { - e.stopPropagation(); - } - }]); - - return Session; -}(React.Component); -//# sourceMappingURL=Session.js.map \ No newline at end of file diff --git a/outlib/popup/views/Session.js.map b/outlib/popup/views/Session.js.map deleted file mode 100644 index c837bbd7..00000000 --- a/outlib/popup/views/Session.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../lib/popup/views/Session.jsx"],"names":["Session","props","name","window","color","state","windowTitles","tabs","stop","bind","windowClick","windowTabClick","close","openTab","maximize","_this","hideWindow","titleAdded","tabsperrow","layout","indexOf","Math","ceil","sqrt","length","map","tab","tabId","id","isHidden","hiddenTabs","filterTabs","isSelected","selection","index","tabMiddleClick","hoverHandler","searchActive","select","tabactions","push","hoverIcon","unshift","children","shift","j","focused","windowsInfo","lastOpenWindow","incognito","nextProps","nextState","e","stopPropagation","restoreSession","console","log","_this2","browser","runtime","sendMessage","command","tab_id","parentUpdate","inPopup","setTimeout","scrollTo","windows","WINDOW_ID_CURRENT","getLocalStorage","sessions","setLocalStorage","catch","err","error","message","value","React","Component"],"mappings":"AAAA;;;;;;;;;;;;IAEMA,O;;;AACL,kBAAYC,KAAZ,EAAmB;AAAA;;AAAA,iHACZA,KADY;;AAIlB,MAAIC,OAAO,OAAKD,KAAL,CAAWE,MAAX,CAAkBD,IAA7B;AACA,MAAIE,QAAQ,OAAKH,KAAL,CAAWE,MAAX,CAAkBC,KAAlB,IAA2B,SAAvC;AACA,SAAKC,KAAL,GAAa;AACZC,iBAAc,EADF;AAEZJ,SAAMA,IAFM;AAGZE,UAAOA,KAHK;AAIZG,SAAM;AAJ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,EAAG;AACXA,KAAEC,eAAF;AAIA;;;;EA3MoBwB,MAAMC,S","file":"Session.js","sourcesContent":["\"use strict\";\n\nclass Session extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\t//console.log(this.props.window);\n\t\t//console.log(this.props.window.name);\n\t\tvar name = this.props.window.name;\n\t\tvar color = this.props.window.color || \"default\";\n\t\tthis.state = {\n\t\t\twindowTitles: [],\n\t\t\tname: name,\n\t\t\tcolor: color,\n\t\t\ttabs: 0\n\t\t};\n\n\t\tthis.stop = this.stop.bind(this);\n\t\tthis.windowClick = this.windowClick.bind(this);\n\t\tthis.windowTabClick = this.windowTabClick.bind(this);\n\t\tthis.close = this.close.bind(this);\n\t\tthis.openTab = this.openTab.bind(this);\n\t\tthis.maximize = this.maximize.bind(this);\n\n\t}\n\trender() {\n\t\tvar _this = this;\n\t\tvar name = this.state.name;\n\t\tvar color = this.state.color;\n\t\tvar hideWindow = true;\n\t\tvar titleAdded = false;\n\t\tvar tabsperrow = this.props.layout.indexOf(\"blocks\") > -1 ? Math.ceil(Math.sqrt(this.props.tabs.length + 2)) : this.props.layout == \"vertical\" ? 1 : 15;\n\t\tvar tabs = this.props.tabs.map(function(tab) {\n\t\t\tvar tabId = tab.id * tab.id * tab.id * 100;\n\t\t\tvar isHidden = !!_this.props.hiddenTabs[tabId] && _this.props.filterTabs;\n\t\t\tvar isSelected = !!_this.props.selection[tabId];\n\t\t\ttab.id = tab.index;\n\t\t\thideWindow &= isHidden;\n\t\t\treturn (\n\t\t\t\t\n\t\t\t);\n\t\t});\n\t\tif (!hideWindow) {\n\t\t\tif (!!this.props.tabactions) {\n\t\t\t\ttabs.push(\n\t\t\t\t\t
,\n\t\t\t\t\t
\n\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\ttitle={\"Restore this saved window\\nWill restore \" + tabs.length + \" tabs. Please note : The tabs will be restored without their history.\"}\n\t\t\t\t\t\t\tonClick={this.windowClick}\n\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\ttitle={\"Delete this saved window\\nWill delete \" + tabs.length + \" tabs permanently\"}\n\t\t\t\t\t\t\tonClick={this.close}\n\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t/>\n\t\t\t\t\t
\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (this.props.windowTitles) {\n\t\t\t\tif (name) {\n\t\t\t\t\ttabs.unshift(\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\t{name}\n\t\t\t\t\t\t

\n\t\t\t\t\t);\n\t\t\t\t\ttitleAdded = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (tabsperrow < 3) {\n\t\t\t\ttabsperrow = 3;\n\t\t\t}\n\t\t\tvar children = [];\n\t\t\tif (!!titleAdded) {\n\t\t\t\tchildren.push(tabs.shift());\n\t\t\t}\n\t\t\tfor (var j = 0; j < tabs.length; j++) {\n\t\t\t\tchildren.push(tabs[j]);\n\t\t\t\tif ((j + 1) % tabsperrow == 0 && j && this.props.layout.indexOf(\"blocks\") > -1) {\n\t\t\t\t\tchildren.push(
);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar focused = false;\n\t\t\tif (this.props.window.windowsInfo.focused || this.props.lastOpenWindow == this.props.window.windowsInfo.id) {\n\t\t\t\tfocused = true;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t -1 ? \"block\" : \"\") +\n\t\t\t\t\t\t\" \" +\n\t\t\t\t\t\tthis.props.layout +\n\t\t\t\t\t\t\" \" +\n\t\t\t\t\t\tthis.state.color +\n\t\t\t\t\t\t\" \" +\n\t\t\t\t\t\t(this.props.window.windowsInfo.incognito ? \" incognito\" : \"\") +\n\t\t\t\t\t\t\" \" +\n\t\t\t\t\t\t(focused ? \" focused\" : \"\")\n\t\t\t\t\t}\n\t\t\t\t\tonClick={this.windowClick}\n\t\t\t\t>\n\t\t\t\t\t
{children}
\n\t\t\t\t
\n\t\t\t);\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\tshouldComponentUpdate(nextProps, nextState) {\n\t\t//console.log(\"should update?\", nextProps, nextState);\n\t\treturn true;\n\t}\n\tstop(e) {\n\t\te.stopPropagation();\n\t}\n\tasync windowTabClick(e) {\n\t\te.stopPropagation();\n\t}\n\tasync windowClick(e) {\n\t\tthis.restoreSession(e, null);\n\t}\n\tasync openTab(e, index) {\n\t\tconsole.log(index);\n\t\tthis.restoreSession(e, index);\n\t}\n\tasync restoreSession(e, tabId) {\n\t\tvar _this2 = this;\n\t\te.stopPropagation();\n\t\tconsole.log(\"source window\", this.props.window);\n\t\t// chrome.runtime.getBackgroundPage(function callback(tabs, backgroundPage) {\n\t\t// \tbackgroundPage.createWindowWithTabs(tabs);\n\t\t// }.bind(null, this.props.window.tabs));\n\n\t\tbrowser.runtime.sendMessage({command: \"create_window_with_session_tabs\", window: this.props.window, tab_id: tabId});\n\n\n\n\t\tthis.props.parentUpdate();\n\n\t\tif (!!window.inPopup) {\n\t\t\twindow.close();\n\t\t}else{\n\t\t\tsetTimeout(function() {\n\t\t\t\tthis.props.scrollTo(\"window\", browser.windows.WINDOW_ID_CURRENT);\n\t\t\t}.bind(this), 500);\n\t\t}\n\n\t\t// , function (tabs, w) {\n\t\t// \tbrowser.tabs.create(first.id, { pinned: first.pinned });\n\t\t// \tif (t.length > 0) {\n\t\t// \t\tbrowser.tabs.move(t, { windowId: w.id, index: -1 }, function (tab) {\n\t\t// \t\t\tbrowser.tabs.update(tab.id, { pinned: tab.pinned });\n\t\t// \t\t});\n\t\t// \t}\n\t\t// \tbrowser.windows.update(w.id, { focused: true });\n\t\t// }.bind(null, this.props.window.tabs));\n\t\t// browser.windows.update(this.props.window.windowsInfo.id, {\n\t\t// \t\"focused\": true },\n\t\t// function (a) {this.props.parentUpdate();}.bind(this));\n\t}\n\tasync close(e) {\n\t\te.stopPropagation();\n\n\t\tvar sessions = await getLocalStorage('sessions', {});\n\t\tdelete sessions[this.props.window.id];\n\n\t\tvar value = await setLocalStorage('sessions', sessions).catch(function (err) {\n\t\t\tconsole.log(err);\n\t\t\tconsole.error(err.message);\n\t\t});\n\n\t\tconsole.log(value);\n\t\tthis.props.parentUpdate();\n\t\t// browser.windows.remove(this.props.window.windowsInfo.id);\n\t}\n\tmaximize(e) {\n\t\te.stopPropagation();\n\t\t// browser.windows.update(this.props.window.windowsInfo.id, {\n\t\t// \t\"state\": \"normal\" },\n\t\t// function (a) {this.props.parentUpdate();}.bind(this));\n\t}\n}\n"]} \ No newline at end of file diff --git a/outlib/popup/views/Tab.js b/outlib/popup/views/Tab.js deleted file mode 100644 index 0dd5dffc..00000000 --- a/outlib/popup/views/Tab.js +++ /dev/null @@ -1,343 +0,0 @@ -"use strict"; - -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; }; }(); - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(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; } - -function _inherits(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 Tab = function (_React$Component) { - _inherits(Tab, _React$Component); - - function Tab(props) { - _classCallCheck(this, Tab); - - var _this = _possibleConstructorReturn(this, (Tab.__proto__ || Object.getPrototypeOf(Tab)).call(this, props)); - - _this.state = { - favIcon: "", - dragFavIcon: "", - hovered: false - }; - - _this.onHover = _this.onHover.bind(_this); - _this.onHoverOut = _this.onHoverOut.bind(_this); - _this.onMouseDown = _this.onMouseDown.bind(_this); - _this.click = _this.click.bind(_this); - _this.dragStart = _this.dragStart.bind(_this); - _this.dragOver = _this.dragOver.bind(_this); - _this.dragOut = _this.dragOut.bind(_this); - _this.drop = _this.drop.bind(_this); - _this.resolveFavIconUrl = _this.resolveFavIconUrl.bind(_this); - _this.checkSettings = _this.checkSettings.bind(_this); - - _this.tabRef = React.createRef(); - return _this; - } - - _createClass(Tab, [{ - key: "componentDidMount", - value: function () { - var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - _context.next = 2; - return this.checkSettings(); - - case 2: - case "end": - return _context.stop(); - } - } - }, _callee, this); - })); - - function componentDidMount() { - return _ref.apply(this, arguments); - } - - return componentDidMount; - }() - }, { - key: "checkSettings", - value: function () { - var _ref2 = _asyncToGenerator(regeneratorRuntime.mark(function _callee2() { - return regeneratorRuntime.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - _context2.next = 2; - return this.resolveFavIconUrl(); - - case 2: - case "end": - return _context2.stop(); - } - } - }, _callee2, this); - })); - - function checkSettings() { - return _ref2.apply(this, arguments); - } - - return checkSettings; - }() - }, { - key: "render", - value: function render() { - var children = []; - if (this.props.layout == "vertical") { - children.push(React.createElement( - "div", - { key: "tab-pinned-" + this.props.tab.id, className: "tab-pinned " + (!this.props.tab.pinned ? "hidden" : "") }, - "Pinned" - )); - children.push(React.createElement( - "div", - { key: "tab-highlighted-" + this.props.tab.id, className: "tab-highlighted " + (!this.props.tab.highlighted ? "hidden" : "") }, - "Active" - )); - children.push(React.createElement( - "div", - { key: "tab-selected-" + this.props.tab.id, className: "tab-selected " + (!this.props.selected ? "hidden" : "") }, - "Selected" - )); - children.push(React.createElement("div", { - key: "tab-icon-" + this.props.tab.id, - className: "iconoverlay ", - style: { - backgroundImage: "url(" + this.state.favIcon + ")" - } - })); - children.push(React.createElement( - "div", - { key: "tab-title-" + this.props.tab.id, className: "tabtitle" }, - this.props.tab.title || "" - )); - } - - var tabDom = { - className: "icon tab " + (this.props.selected ? "selected " : "") + (this.props.tab.pinned ? "pinned " : "") + (this.props.tab.highlighted ? "highlighted " : "") + (this.props.hidden ? "hidden " : "") + (this.props.tab.mutedInfo && this.props.tab.mutedInfo.muted ? "muted " : "") + (this.props.tab.audible ? "audible " : "") + (this.props.tab.discarded ? "discarded " : "") + (this.props.layout == "vertical" ? "full " : "") + (this.props.tab.incognito ? "incognito " : "") + (this.state.draggingOver || "") + (this.props.searchActive ? "search-active " : "") + " tab-" + this.props.tab.id + " " + (this.props.layout == "vertical" ? "vertical " : "blocks "), - style: this.props.layout == "vertical" ? {} : { backgroundImage: "url(" + this.state.favIcon + ")" }, - - id: this.props.id, - title: this.props.tab.title, - onClick: this.click, - onMouseDown: this.onMouseDown, - onMouseEnter: this.onHover, - onMouseOut: this.onHoverOut, - ref: this.tabRef - }; - - if (!!this.props.draggable) { - tabDom["onDragStart"] = this.dragStart; - tabDom["onDragOver"] = this.dragOver; - tabDom["onDragLeave"] = this.dragOut; - tabDom["onDrop"] = this.drop; - tabDom["draggable"] = "true"; - } - - return React.createElement( - "div", - tabDom, - children, - React.createElement("div", { className: "limiter" }) - ); - } - }, { - key: "onHover", - value: function onHover(e) { - this.setState({ hover: true }); - this.props.hoverHandler(this.props.tab); - } - }, { - key: "onHoverOut", - value: function onHoverOut(e) { - this.setState({ hover: false }); - } - }, { - key: "onMouseDown", - value: function onMouseDown(e) { - if (e.button === 0) return; - if (!this.props.draggable) return; - this.click(e); - } - }, { - key: "click", - value: function () { - var _ref3 = _asyncToGenerator(regeneratorRuntime.mark(function _callee3(e) { - var tabId, windowId; - return regeneratorRuntime.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - this.stopProp(e); - - tabId = this.props.tab.id; - windowId = this.props.window.id; - - - if (e.button === 1) { - this.props.middleClick(tabId); - } else if (e.button === 2 || e.nativeEvent.metaKey || e.nativeEvent.altKey || e.nativeEvent.shiftKey || e.nativeEvent.ctrlKey) { - e.preventDefault(); - if (e.button === 2 && (e.nativeEvent.metaKey || e.nativeEvent.altKey || e.nativeEvent.shiftKey || e.nativeEvent.ctrlKey)) { - this.props.selectTo(tabId); - } else { - this.props.select(tabId); - } - } else { - if (!!this.props.click) { - this.props.click(e, this.props.tab.id); - } else { - if (navigator.userAgent.search("Firefox") > -1) { - browser.runtime.sendMessage({ - command: "focus_on_tab_and_window_delayed", - tab: { id: tabId, windowId: windowId } - }); - } else { - browser.runtime.sendMessage({ - command: "focus_on_tab_and_window", - tab: { id: tabId, windowId: windowId } - }); - } - } - - if (!!window.inPopup) window.close(); - } - return _context3.abrupt("return", false); - - case 5: - case "end": - return _context3.stop(); - } - } - }, _callee3, this); - })); - - function click(_x) { - return _ref3.apply(this, arguments); - } - - return click; - }() - }, { - key: "dragStart", - value: function dragStart(e) { - if (!this.props.draggable) return false; - if (!this.props.drag) return false; - - this.state.dragFavIcon = ""; - this.props.dragFavicon(this.state.favIcon); - e.dataTransfer.setData("Text", this.props.tab.id); - e.dataTransfer.setData("text/uri-list", this.props.tab.url || ""); - this.props.drag(e, this.props.tab.id); - } - }, { - key: "dragOver", - value: function dragOver(e) { - if (!this.props.draggable) return false; - if (!this.props.drag) return false; - - this.state.dragFavIcon = this.props.dragFavicon(); - - var before = this.state.draggingOver; - if (this.props.layout == "vertical") { - this.state.draggingOver = e.nativeEvent.offsetY > ReactDOM.findDOMNode(this).clientHeight / 2 ? "bottom" : "top"; - } else { - this.state.draggingOver = e.nativeEvent.offsetX > ReactDOM.findDOMNode(this).clientWidth / 2 ? "right" : "left"; - } - if (before != this.state.draggingOver) { - this.forceUpdate(); - this.props.parentUpdate(); - } - } - }, { - key: "dragOut", - value: function dragOut() { - if (!this.props.draggable) return false; - if (!this.props.drag) return; - this.state.dragFavIcon = ""; - delete this.state.draggingOver; - this.forceUpdate(); - this.props.parentUpdate(); - } - }, { - key: "drop", - value: function drop(e) { - if (!this.props.draggable) return false; - if (!this.props.drag) return false; - if (!this.props.drop) return; - - this.state.dragFavIcon = ""; - this.stopProp(e); - var before = this.state.draggingOver == "top" || this.state.draggingOver == "left"; - delete this.state.draggingOver; - - this.props.drop(this.props.tab.id, before); - this.forceUpdate(); - this.props.parentUpdate(); - } - }, { - key: "resolveFavIconUrl", - value: function () { - var _ref4 = _asyncToGenerator(regeneratorRuntime.mark(function _callee4() { - var image, favIcons, iconUrl, iconName; - return regeneratorRuntime.wrap(function _callee4$(_context4) { - while (1) { - switch (_context4.prev = _context4.next) { - case 0: - if (!!this.props.tab.url && navigator.userAgent.search("Firefox") == -1) { - image = "chrome-extension://" + chrome.runtime.id + "/_favicon/?pageUrl=" + encodeURIComponent(this.props.tab.url) + "&size=64&" + Date.now(); - } else if (!!this.props.tab.url && this.props.tab.url.indexOf("chrome://") !== 0 && this.props.tab.url.indexOf("about:") !== 0) { - image = this.props.tab.favIconUrl ? "" + this.props.tab.favIconUrl + "" : ""; - } else { - favIcons = ["bookmarks", "chrome", "crashes", "downloads", "extensions", "flags", "history", "settings"]; - iconUrl = this.props.tab.url || ""; - iconName = ""; - - if (iconUrl.length > 9) iconName = iconUrl.slice(9).match(/^\w+/g); - image = !iconName || favIcons.indexOf(iconName[0]) < 0 ? "" : "../images/chrome/" + iconName[0] + ".png"; - } - this.setState({ - favIcon: image - }); - - case 2: - case "end": - return _context4.stop(); - } - } - }, _callee4, this); - })); - - function resolveFavIconUrl() { - return _ref4.apply(this, arguments); - } - - return resolveFavIconUrl; - }() - }, { - key: "stopProp", - value: function stopProp(e) { - if (e && e.nativeEvent) { - e.nativeEvent.preventDefault(); - e.nativeEvent.stopPropagation(); - } - if (e && e.preventDefault) { - e.preventDefault(); - e.stopPropagation(); - } - } - }]); - - return Tab; -}(React.Component); -//# sourceMappingURL=Tab.js.map \ No newline at end of file diff --git a/outlib/popup/views/Tab.js.map b/outlib/popup/views/Tab.js.map deleted file mode 100644 index e5f8b774..00000000 --- a/outlib/popup/views/Tab.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../lib/popup/views/Tab.jsx"],"names":["Tab","props","state","favIcon","dragFavIcon","hovered","onHover","bind","onHoverOut","onMouseDown","click","dragStart","dragOver","dragOut","drop","resolveFavIconUrl","checkSettings","tabRef","React","createRef","children","layout","push","tab","id","pinned","highlighted","selected","backgroundImage","title","tabDom","className","hidden","mutedInfo","muted","audible","discarded","incognito","draggingOver","searchActive","style","onClick","onMouseEnter","onMouseOut","ref","draggable","e","setState","hover","hoverHandler","button","stopProp","tabId","windowId","window","middleClick","nativeEvent","metaKey","altKey","shiftKey","ctrlKey","preventDefault","selectTo","select","navigator","userAgent","search","browser","runtime","sendMessage","command","inPopup","close","drag","dragFavicon","dataTransfer","setData","url","before","offsetY","ReactDOM","findDOMNode","clientHeight","offsetX","clientWidth","forceUpdate","parentUpdate","image","chrome","encodeURIComponent","Date","now","indexOf","favIconUrl","favIcons","iconUrl","iconName","length","slice","match","stopPropagation","Component"],"mappings":"AAAA;;;;;;;;;;;;IAEMA,G;;;AACL,cAAYC,KAAZ,EAAmB;AAAA;;AAAA,wGACZA,KADY;;AAElB,QAAKC,KAAL,GAAa;AACZC,YAAS,EADG;AAEZC,gBAAa,EAFD;AAGZC,YAAS;AAHG,GAAb;;AAMA,QAAKC,OAAL,GAA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AAwB,SAAxB,EAAmC,WAAnC,EAAgD,YAAhD,EAA8D,OAA9D,EAAuE,SAAvE,EAAkF,UAAlF,CADT;AAEFC,gBAFE,GAEQ,KAAK9F,KAAL,CAAWsB,GAAX,CAAesD,GAAf,IAAsB,EAF9B;AAGFmB,iBAHE,GAGS,EAHT;;AAIN,aAAID,QAAQE,MAAR,GAAiB,CAArB,EAAwBD,WAAWD,QAAQG,KAAR,CAAc,CAAd,EAAiBC,KAAjB,CAAuB,OAAvB,CAAX;AACxBZ,iBAAQ,CAACS,QAAD,IAAaF,SAASF,OAAT,CAAiBI,SAAS,CAAT,CAAjB,IAAgC,CAA7C,GAAiD,EAAjD,GAAsD,sBAAsBA,SAAS,CAAT,CAAtB,GAAoC,MAAlG;AACA;AACD,aAAKjD,QAAL,CAAc;AACb5C,kBAASoF;AADI,SAAd;;;;;;;;;;;;;;;;;;2BAIQzC,C,EAAG;AACX,OAAGA,KAAKA,EAAEU,WAAV,EAAuB;AACtBV,MAAEU,WAAF,CAAcK,cAAd;AACAf,MAAEU,WAAF,CAAc4C,eAAd;AACA;AACD,OAAGtD,KAAKA,EAAEe,cAAV,EAA0B;AACzBf,MAAEe,cAAF;AACAf,MAAEsD,eAAF;AACA;AACD;;;;EA9PgBlF,MAAMmF,S","file":"Tab.js","sourcesContent":["\"use strict\";\n\nclass Tab extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tfavIcon: \"\",\n\t\t\tdragFavIcon: \"\",\n\t\t\thovered: false\n\t\t};\n\n\t\tthis.onHover = this.onHover.bind(this);\n\t\tthis.onHoverOut = this.onHoverOut.bind(this);\n\t\tthis.onMouseDown = this.onMouseDown.bind(this);\n\t\tthis.click = this.click.bind(this);\n\t\tthis.dragStart = this.dragStart.bind(this);\n\t\tthis.dragOver = this.dragOver.bind(this);\n\t\tthis.dragOut = this.dragOut.bind(this);\n\t\tthis.drop = this.drop.bind(this);\n\t\tthis.resolveFavIconUrl = this.resolveFavIconUrl.bind(this);\n\t\tthis.checkSettings = this.checkSettings.bind(this);\n\n\t\tthis.tabRef = React.createRef();\n\t}\n\n\tasync componentDidMount() {\n\t\tawait this.checkSettings();\n\t}\n\n\tasync checkSettings() {\n\t\tawait this.resolveFavIconUrl();\n\t}\n\n\trender() {\n\t\tvar children = [];\n\t\tif (this.props.layout == \"vertical\") {\n\t\t\tchildren.push(\n\t\t\t\t
\n\t\t\t\t\tPinned\n\t\t\t\t
\n\t\t\t);\n\t\t\tchildren.push(\n\t\t\t\t
\n\t\t\t\t\tActive\n\t\t\t\t
\n\t\t\t);\n\t\t\tchildren.push(\n\t\t\t\t
\n\t\t\t\t\tSelected\n\t\t\t\t
\n\t\t\t);\n\t\t\tchildren.push(\n\t\t\t\t\n\t\t\t);\n\t\t\tchildren.push(\n\t\t\t\t
\n\t\t\t\t\t{this.props.tab.title || \"\"}\n\t\t\t\t
\n\t\t\t);\n\t\t}\n\n\t\tvar tabDom = {\n\t\t\tclassName:\n\t\t\t\t\"icon tab \" +\n\t\t\t\t(this.props.selected ? \"selected \" : \"\") +\n\t\t\t\t(this.props.tab.pinned ? \"pinned \" : \"\") +\n\t\t\t\t(this.props.tab.highlighted ? \"highlighted \" : \"\") +\n\t\t\t\t(this.props.hidden ? \"hidden \" : \"\") +\n\t\t\t\t((this.props.tab.mutedInfo && this.props.tab.mutedInfo.muted) ? \"muted \" : \"\") +\n\t\t\t\t(this.props.tab.audible ? \"audible \" : \"\") +\n\t\t\t\t(this.props.tab.discarded ? \"discarded \" : \"\") +\n\t\t\t\t(this.props.layout == \"vertical\" ? \"full \" : \"\") +\n\t\t\t\t(this.props.tab.incognito ? \"incognito \" : \"\") +\n\t\t\t\t(this.state.draggingOver || \"\") +\n\t\t\t\t(this.props.searchActive ? \"search-active \" : \"\") +\n\t\t\t\t\" tab-\" +\n\t\t\t\tthis.props.tab.id +\n\t\t\t\t\" \" +\n\t\t\t\t(this.props.layout == \"vertical\" ? \"vertical \" : \"blocks \"),\n\t\t\tstyle:\n\t\t\t\t(this.props.layout == \"vertical\"\n\t\t\t\t\t? { }\n\t\t\t\t\t: { backgroundImage: \"url(\" + this.state.favIcon + \")\" }\n\t\t\t\t)\n\t\t\t,\n\t\t\tid: this.props.id,\n\t\t\ttitle: this.props.tab.title,\n\t\t\tonClick: this.click,\n\t\t\tonMouseDown: this.onMouseDown,\n\t\t\tonMouseEnter: this.onHover,\n\t\t\tonMouseOut: this.onHoverOut,\n\t\t\tref: this.tabRef\n\t\t};\n\n\t\tif (!!this.props.draggable) {\n\t\t\ttabDom[\"onDragStart\"] = this.dragStart;\n\t\t\ttabDom[\"onDragOver\"] = this.dragOver;\n\t\t\ttabDom[\"onDragLeave\"] = this.dragOut;\n\t\t\ttabDom[\"onDrop\"] = this.drop;\n\t\t\ttabDom[\"draggable\"] = \"true\";\n\t\t}\n\n\t\treturn (\n\t\t\t
\n\t\t\t\t{children}\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\tonHover(e) {\n\t\tthis.setState({hover: true});\n\t\tthis.props.hoverHandler(this.props.tab);\n\t}\n\tonHoverOut(e) {\n\t\tthis.setState({hover: false});\n\t}\n\tonMouseDown(e) {\n\t\tif (e.button === 0) return;\n\t\tif (!this.props.draggable) return;\n\t\tthis.click(e);\n\t}\n\tasync click(e) {\n\t\tthis.stopProp(e);\n\n\t\tvar tabId = this.props.tab.id;\n\t\tvar windowId = this.props.window.id;\n\n\t\tif (e.button === 1) {\n\t\t\tthis.props.middleClick(tabId);\n\t\t} else if (e.button === 2 || e.nativeEvent.metaKey || e.nativeEvent.altKey || e.nativeEvent.shiftKey || e.nativeEvent.ctrlKey) {\n\t\t\te.preventDefault();\n\t\t\tif (e.button === 2 && (e.nativeEvent.metaKey || e.nativeEvent.altKey || e.nativeEvent.shiftKey || e.nativeEvent.ctrlKey)) {\n\t\t\t\tthis.props.selectTo(tabId);\n\t\t\t} else {\n\t\t\t\tthis.props.select(tabId);\n\t\t\t}\n\t\t} else {\n\t\t\tif (!!this.props.click) {\n\t\t\t\tthis.props.click(e, this.props.tab.id);\n\t\t\t} else {\n\t\t\t\tif (navigator.userAgent.search(\"Firefox\") > -1) {\n\t\t\t\t\tbrowser.runtime.sendMessage({\n\t\t\t\t\t\tcommand: \"focus_on_tab_and_window_delayed\",\n\t\t\t\t\t\ttab: {id: tabId, windowId: windowId}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tbrowser.runtime.sendMessage({\n\t\t\t\t\t\tcommand: \"focus_on_tab_and_window\",\n\t\t\t\t\t\ttab: {id: tabId, windowId: windowId}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!!window.inPopup) window.close();\n\t\t}\n\t\treturn false;\n\t}\n\tdragStart(e) {\n\t\tif (!this.props.draggable) return false;\n\t\tif (!this.props.drag) return false;\n\n\t\tthis.state.dragFavIcon = \"\";\n\t\tthis.props.dragFavicon(this.state.favIcon);\n\t\te.dataTransfer.setData(\"Text\", this.props.tab.id);\n\t\te.dataTransfer.setData(\"text/uri-list\", this.props.tab.url || \"\");\n\t\tthis.props.drag(e, this.props.tab.id);\n\t}\n\tdragOver(e) {\n\t\tif (!this.props.draggable) return false;\n\t\tif (!this.props.drag) return false;\n\n\t\tthis.state.dragFavIcon = this.props.dragFavicon();\n\n\t\tvar before = this.state.draggingOver;\n\t\tif (this.props.layout == \"vertical\") {\n\t\t\tthis.state.draggingOver = e.nativeEvent.offsetY > ReactDOM.findDOMNode(this).clientHeight / 2 ? \"bottom\" : \"top\";\n\t\t} else {\n\t\t\tthis.state.draggingOver = e.nativeEvent.offsetX > ReactDOM.findDOMNode(this).clientWidth / 2 ? \"right\" : \"left\";\n\t\t}\n\t\tif (before != this.state.draggingOver) {\n\t\t\tthis.forceUpdate();\n\t\t\tthis.props.parentUpdate();\n\t\t}\n\t}\n\tdragOut() {\n\t\tif (!this.props.draggable) return false;\n\t\tif (!this.props.drag) return;\n\t\tthis.state.dragFavIcon = \"\";\n\t\tdelete this.state.draggingOver;\n\t\tthis.forceUpdate();\n\t\tthis.props.parentUpdate();\n\t}\n\tdrop(e) {\n\t\tif (!this.props.draggable) return false;\n\t\tif (!this.props.drag) return false;\n\t\tif (!this.props.drop) return;\n\n\t\tthis.state.dragFavIcon = \"\";\n\t\tthis.stopProp(e);\n\t\tvar before = this.state.draggingOver == \"top\" || this.state.draggingOver == \"left\";\n\t\tdelete this.state.draggingOver;\n\n\t\tthis.props.drop(this.props.tab.id, before);\n\t\tthis.forceUpdate();\n\t\tthis.props.parentUpdate();\n\t}\n\tasync resolveFavIconUrl() {\n\t\tvar image;\n\t\t// firefox screenshots; needs \n\t\t// if(!!browser.tabs.captureTab) {\n\t\t// \tconsole.log(\"tabs captureTab\");\n\t\t// \timage = await browser.tabs.captureTab(this.props.tab.id);\n\t\t// \timage = \"url(\" + image + \")\";\n\t\t// }else\n\t\tif (!!this.props.tab.url && navigator.userAgent.search(\"Firefox\") == -1) {\n\t\t\timage = \"chrome-extension://\" + chrome.runtime.id + \"/_favicon/?pageUrl=\" + encodeURIComponent(this.props.tab.url) + \"&size=64&\" + Date.now();\n\t\t} else if (!!this.props.tab.url && this.props.tab.url.indexOf(\"chrome://\") !== 0 && this.props.tab.url.indexOf(\"about:\") !== 0) {\n\t\t\t// chrome screenshots / only for active tabs; needs \n\t\t\t// if(!!browser.tabs.captureVisibleTab && this.props.tab.highlighted) {\n\t\t\t// \tconsole.log(\"tabsCapture\");\n\t\t\t// \ttry {\n\t\t\t// \t\timage = await browser.tabs.captureVisibleTab( this.props.window.id, {} );\n\t\t\t// \t\t//console.log(image);\n\t\t\t// \t} catch ( e ) {\n\t\t\t// \t\tconsole.log(e.message);\n\t\t\t// \t}\n\t\t\t// \timage = \"url(\" + image + \")\";\n\t\t\t// }else{\n\t\t\timage = this.props.tab.favIconUrl ? \"\" + this.props.tab.favIconUrl + \"\" : \"\";\n\t\t\t//}\n\t\t} else {\n\t\t\tvar favIcons = [\"bookmarks\", \"chrome\", \"crashes\", \"downloads\", \"extensions\", \"flags\", \"history\", \"settings\"];\n\t\t\tvar iconUrl = this.props.tab.url || \"\";\n\t\t\tvar iconName = \"\";\n\t\t\tif (iconUrl.length > 9) iconName = iconUrl.slice(9).match(/^\\w+/g);\n\t\t\timage = !iconName || favIcons.indexOf(iconName[0]) < 0 ? \"\" : \"../images/chrome/\" + iconName[0] + \".png\";\n\t\t}\n\t\tthis.setState({\n\t\t\tfavIcon: image\n\t\t});\n\t}\n\tstopProp(e) {\n\t\tif(e && e.nativeEvent) {\n\t\t\te.nativeEvent.preventDefault();\n\t\t\te.nativeEvent.stopPropagation();\n\t\t}\n\t\tif(e && e.preventDefault) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t}\n\t}\n}\n"]} \ No newline at end of file diff --git a/outlib/popup/views/TabManager.js b/outlib/popup/views/TabManager.js deleted file mode 100644 index f376cccb..00000000 --- a/outlib/popup/views/TabManager.js +++ /dev/null @@ -1,2897 +0,0 @@ -"use strict"; - -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; }; }(); - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(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; } - -function _inherits(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 browser = browser || chrome; - -var TabManager = function (_React$Component) { - _inherits(TabManager, _React$Component); - - function TabManager(props) { - _classCallCheck(this, TabManager); - - var _this7 = _possibleConstructorReturn(this, (TabManager.__proto__ || Object.getPrototypeOf(TabManager)).call(this, props)); - - if (navigator.userAgent.search("Firefox") > -1) {} else { - var check = browser.permissions.contains({ permissions: ["system.display"] }); - check.then(function (result) { - if (result) {} else { - setLocalStorage("hideWindows", false); - this.state.hideWindows = false; - } - }.bind(_this7)); - } - - var layout = "blocks"; - var animations = true; - var windowTitles = true; - var compact = false; - var dark = false; - var tabactions = true; - var badge = true; - var sessionsFeature = false; - var hideWindows = false; - var filterTabs = false; - var tabLimit = 0; - var openInOwnTab = false; - var tabWidth = 800; - var tabHeight = 600; - - var closeTimeout; - var resetTimeout; - - _this7.state = { - layout: layout, - animations: animations, - windowTitles: windowTitles, - tabLimit: tabLimit, - openInOwnTab: openInOwnTab, - tabWidth: tabWidth, - tabHeight: tabHeight, - compact: compact, - dark: dark, - tabactions: tabactions, - badge: badge, - hideWindows: hideWindows, - sessionsFeature: sessionsFeature, - lastOpenWindow: -1, - windows: [], - sessions: [], - selection: {}, - lastSelect: false, - hiddenTabs: {}, - tabsbyid: {}, - windowsbyid: {}, - closeTimeout: closeTimeout, - resetTimeout: resetTimeout, - height: 600, - hasScrollBar: false, - focusUpdates: 0, - topText: "", - bottomText: "", - lastDirection: false, - optionsActive: !!_this7.props.optionsActive, - filterTabs: filterTabs, - dupTabs: false, - dragFavicon: "", - colorsActive: false - }; - - _this7.addWindow = _this7.addWindow.bind(_this7); - _this7.animationsText = _this7.animationsText.bind(_this7); - _this7.badgeText = _this7.badgeText.bind(_this7); - _this7.changelayout = _this7.changelayout.bind(_this7); - _this7.changeTabHeight = _this7.changeTabHeight.bind(_this7); - _this7.changeTabLimit = _this7.changeTabLimit.bind(_this7); - _this7.changeTabWidth = _this7.changeTabWidth.bind(_this7); - _this7.checkKey = _this7.checkKey.bind(_this7); - _this7.clearSelection = _this7.clearSelection.bind(_this7); - _this7.compactText = _this7.compactText.bind(_this7); - _this7.darkText = _this7.darkText.bind(_this7); - _this7.deleteTabs = _this7.deleteTabs.bind(_this7); - _this7.discardTabs = _this7.discardTabs.bind(_this7); - _this7.donate = _this7.donate.bind(_this7); - _this7.exportSessions = _this7.exportSessions.bind(_this7); - _this7.exportSessionsText = _this7.exportSessionsText.bind(_this7); - _this7.getTip = _this7.getTip.bind(_this7); - _this7.hideText = _this7.hideText.bind(_this7); - _this7.highlightDuplicates = _this7.highlightDuplicates.bind(_this7); - _this7.hoverIcon = _this7.hoverIcon.bind(_this7); - _this7.importSessions = _this7.importSessions.bind(_this7); - _this7.importSessionsText = _this7.importSessionsText.bind(_this7); - _this7.openInOwnTabText = _this7.openInOwnTabText.bind(_this7); - _this7.pinTabs = _this7.pinTabs.bind(_this7); - _this7.rateExtension = _this7.rateExtension.bind(_this7); - _this7.scrollTo = _this7.scrollTo.bind(_this7); - _this7.search = _this7.search.bind(_this7); - _this7.sessionsText = _this7.sessionsText.bind(_this7); - _this7.sessionSync = _this7.sessionSync.bind(_this7); - _this7.tabActionsText = _this7.tabActionsText.bind(_this7); - _this7.tabHeightText = _this7.tabHeightText.bind(_this7); - _this7.tabLimitText = _this7.tabLimitText.bind(_this7); - _this7.tabWidthText = _this7.tabWidthText.bind(_this7); - _this7.toggleAnimations = _this7.toggleAnimations.bind(_this7); - _this7.toggleBadge = _this7.toggleBadge.bind(_this7); - _this7.toggleCompact = _this7.toggleCompact.bind(_this7); - _this7.toggleDark = _this7.toggleDark.bind(_this7); - _this7.toggleFilterMismatchedTabs = _this7.toggleFilterMismatchedTabs.bind(_this7); - _this7.toggleHide = _this7.toggleHide.bind(_this7); - _this7.toggleOpenInOwnTab = _this7.toggleOpenInOwnTab.bind(_this7); - _this7.toggleOptions = _this7.toggleOptions.bind(_this7); - _this7.toggleSessions = _this7.toggleSessions.bind(_this7); - _this7.toggleTabActions = _this7.toggleTabActions.bind(_this7); - _this7.toggleWindowTitles = _this7.toggleWindowTitles.bind(_this7); - _this7.update = _this7.update.bind(_this7); - _this7.windowTitlesText = _this7.windowTitlesText.bind(_this7); - - return _this7; - } - - _createClass(TabManager, [{ - key: "UNSAFE_componentWillMount", - value: function UNSAFE_componentWillMount() { - this.update(); - } - }, { - key: "loadStorage", - value: function () { - var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee() { - var layout, animations, windowTitles, compact, dark, tabactions, badge, sessionsFeature, hideWindows, filterTabs, tabLimit, openInOwnTab, tabWidth, tabHeight, storage; - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - layout = "blocks"; - animations = true; - windowTitles = true; - compact = false; - dark = false; - tabactions = true; - badge = true; - sessionsFeature = false; - hideWindows = false; - filterTabs = false; - tabLimit = 0; - openInOwnTab = false; - tabWidth = 800; - tabHeight = 600; - _context.next = 16; - return browser.storage.local.get(null); - - case 16: - storage = _context.sent; - - - if (!storage["layout"]) storage["layout"] = "blocks"; - if (typeof storage["tabLimit"] === "undefined") storage["tabLimit"] = 0; - if (typeof storage["tabWidth"] === "undefined") storage["tabWidth"] = 800; - if (typeof storage["tabHeight"] === "undefined") storage["tabHeight"] = 600; - - if (typeof storage["animations"] === "undefined") storage["animations"] = true; - if (typeof storage["windowTitles"] === "undefined") storage["windowTitles"] = true; - if (typeof storage["tabactions"] === "undefined") storage["tabactions"] = true; - if (typeof storage["badge"] === "undefined") storage["badge"] = true; - - if (typeof storage["openInOwnTab"] === "undefined") storage["openInOwnTab"] = false; - if (typeof storage["compact"] === "undefined") storage["compact"] = false; - if (typeof storage["dark"] === "undefined") storage["dark"] = false; - if (typeof storage["sessionsFeature"] === "undefined") storage["sessionsFeature"] = false; - if (typeof storage["hideWindows"] === "undefined") storage["hideWindows"] = false; - if (typeof storage["filter-tabs"] === "undefined") storage["filter-tabs"] = false; - - if (typeof storage["version"] === "undefined") storage["version"] = "5.3.1"; - - layout = storage["layout"]; - tabLimit = storage["tabLimit"]; - tabWidth = storage["tabWidth"]; - tabHeight = storage["tabHeight"]; - openInOwnTab = storage["openInOwnTab"]; - animations = storage["animations"]; - windowTitles = storage["windowTitles"]; - compact = storage["compact"]; - dark = storage["dark"]; - tabactions = storage["tabactions"]; - badge = storage["badge"]; - sessionsFeature = storage["sessionsFeature"]; - hideWindows = storage["hideWindows"]; - filterTabs = storage["filter-tabs"]; - - if (dark) { - document.body.className = "dark"; - } else { - document.body.className = ""; - } - - this.setState({ - layout: layout, - animations: animations, - windowTitles: windowTitles, - tabLimit: tabLimit, - openInOwnTab: openInOwnTab, - tabWidth: tabWidth, - tabHeight: tabHeight, - compact: compact, - dark: dark, - tabactions: tabactions, - badge: badge, - hideWindows: hideWindows, - sessionsFeature: sessionsFeature, - filterTabs: filterTabs - }); - - case 48: - case "end": - return _context.stop(); - } - } - }, _callee, this); - })); - - function loadStorage() { - return _ref.apply(this, arguments); - } - - return loadStorage; - }() - }, { - key: "hoverHandler", - value: function hoverHandler(tab) { - this.setState({ topText: tab.title || "" }); - this.setState({ bottomText: tab.url || "" }); - - clearTimeout(this.state.resetTimeout); - this.state.resetTimeout = setTimeout(function () { - this.setState({ topText: "", bottomText: "" }); - this.update(); - }.bind(this), 15000); - } - }, { - key: "hoverIcon", - value: function hoverIcon(e) { - if (e && e.nativeEvent) { - e.nativeEvent.preventDefault(); - e.nativeEvent.stopPropagation(); - } - - var text = ""; - if (e && e.target && !!e.target.title) { - text = e.target.title; - } else if (typeof e == "string") { - text = e; - } - var bottom = " "; - if (text.indexOf("\n") > -1) { - var a = text.split("\n"); - text = a[0]; - bottom = a[1]; - } - this.setState({ topText: text }); - this.setState({ bottomText: bottom }); - - this.forceUpdate(); - } - }, { - key: "render", - value: function render() { - var _this = this; - - var hiddenCount = this.state.hiddenCount || 0; - var tabCount = this.state.tabCount || 0; - - var haveMin = false; - var haveSess = false; - - for (var i = this.state.windows.length - 1; i >= 0; i--) { - if (this.state.windows[i].state == "minimized") haveMin = true; - } - - if (this.state.sessionsFeature) { - if (this.state.sessions.length > 0) haveSess = true; - - if (haveSess && this.state.filterTabs) { - if (this.state.searchLen > 0 || Object.keys(this.state.hiddenTabs).length > 0) { - haveSess = false; - } - } - } - - return React.createElement( - "div", - { - id: "root", - className: (this.state.compact ? "compact" : "") + " " + (this.state.animations ? "animations" : "no-animations") + " " + (this.state.windowTitles ? "windowTitles" : "no-windowTitles"), - onKeyDown: this.checkKey, - ref: "root", - tabIndex: 0 - }, - !this.state.optionsActive && React.createElement( - "div", - { className: "window-container " + this.state.layout, ref: "windowcontainer", tabIndex: 2 }, - this.state.windows.map(function (window) { - if (window.state == "minimized") return; - if (!!this.state.colorsActive && this.state.colorsActive !== window.id) return; - return React.createElement(Window, { - key: "window" + window.id, - window: window, - tabs: window.tabs, - incognito: window.incognito, - layout: _this.state.layout, - selection: _this.state.selection, - searchActive: _this.state.searchLen > 0, - sessionsFeature: _this.state.sessionsFeature, - tabactions: _this.state.tabactions, - hiddenTabs: _this.state.hiddenTabs, - filterTabs: _this.state.filterTabs, - hoverHandler: _this.hoverHandler.bind(_this), - scrollTo: _this.scrollTo.bind(_this), - hoverIcon: _this.hoverIcon.bind(_this), - parentUpdate: _this.update.bind(_this), - toggleColors: _this.toggleColors.bind(_this), - tabMiddleClick: _this.deleteTab.bind(_this), - select: _this.select.bind(_this), - selectTo: _this.selectTo.bind(_this), - draggable: true, - drag: _this.drag.bind(_this), - drop: _this.drop.bind(_this), - dropWindow: _this.dropWindow.bind(_this), - windowTitles: _this.state.windowTitles, - lastOpenWindow: _this.state.lastOpenWindow, - dragFavicon: _this.dragFavicon.bind(_this), - ref: "window" + window.id - }); - }.bind(this)), - React.createElement( - "div", - { className: "hrCont " + (!haveMin ? "hidden" : "") }, - React.createElement( - "div", - { className: "hrDiv" }, - React.createElement( - "span", - { className: "hrSpan" }, - "Minimized windows" - ) - ) - ), - this.state.windows.map(function (window) { - if (window.state !== "minimized") return; - if (!!this.state.colorsActive && this.state.colorsActive !== window.id) return; - return React.createElement(Window, { - key: "window" + window.id, - window: window, - tabs: window.tabs, - incognito: window.incognito, - layout: _this.state.layout, - selection: _this.state.selection, - searchActive: _this.state.searchLen > 0, - sessionsFeature: _this.state.sessionsFeature, - tabactions: _this.state.tabactions, - hiddenTabs: _this.state.hiddenTabs, - filterTabs: _this.state.filterTabs, - hoverHandler: _this.hoverHandler.bind(_this), - scrollTo: _this.scrollTo.bind(_this), - hoverIcon: _this.hoverIcon.bind(_this), - parentUpdate: _this.update.bind(_this), - toggleColors: _this.toggleColors.bind(_this), - tabMiddleClick: _this.deleteTab.bind(_this), - select: _this.select.bind(_this), - selectTo: _this.selectTo.bind(_this), - draggable: true, - drag: _this.drag.bind(_this), - drop: _this.drop.bind(_this), - dropWindow: _this.dropWindow.bind(_this), - windowTitles: _this.state.windowTitles, - lastOpenWindow: _this.state.lastOpenWindow, - dragFavicon: _this.dragFavicon.bind(_this), - ref: "window" + window.id - }); - }.bind(this)), - React.createElement( - "div", - { className: "hrCont " + (!haveSess ? "hidden" : "") }, - React.createElement( - "div", - { className: "hrDiv" }, - React.createElement( - "span", - { className: "hrSpan" }, - "Saved windows" - ) - ) - ), - haveSess ? this.state.sessions.map(function (window) { - if (!!this.state.colorsActive && this.state.colorsActive !== window.id) return; - return React.createElement(Session, { - key: "session" + window.id, - window: window, - tabs: window.tabs, - incognito: window.incognito, - layout: _this.state.layout, - selection: _this.state.selection, - searchActive: _this.state.searchLen > 0, - tabactions: _this.state.tabactions, - hiddenTabs: _this.state.hiddenTabs, - filterTabs: _this.state.filterTabs, - hoverHandler: _this.hoverHandler.bind(_this), - scrollTo: _this.scrollTo.bind(_this), - hoverIcon: _this.hoverIcon.bind(_this), - parentUpdate: _this.update.bind(_this), - toggleColors: _this.toggleColors.bind(_this), - tabMiddleClick: _this.deleteTab.bind(_this), - select: _this.select.bind(_this), - windowTitles: _this.state.windowTitles, - lastOpenWindow: _this.state.lastOpenWindow, - ref: "session" + window.id - }); - }.bind(this)) : false - ), - this.state.optionsActive && React.createElement( - "div", - { className: "options-container", ref: "options-container" }, - React.createElement(TabOptions, { - compact: this.state.compact, - dark: this.state.dark, - animations: this.state.animations, - windowTitles: this.state.windowTitles, - tabLimit: this.state.tabLimit, - openInOwnTab: this.state.openInOwnTab, - tabWidth: this.state.tabWidth, - tabHeight: this.state.tabHeight, - tabactions: this.state.tabactions, - badge: this.state.badge, - hideWindows: this.state.hideWindows, - sessionsFeature: this.state.sessionsFeature, - exportSessions: this.exportSessions, - importSessions: this.importSessions, - toggleOpenInOwnTab: this.toggleOpenInOwnTab, - toggleBadge: this.toggleBadge, - toggleHide: this.toggleHide, - toggleSessions: this.toggleSessions, - toggleAnimations: this.toggleAnimations, - toggleWindowTitles: this.toggleWindowTitles, - toggleCompact: this.toggleCompact, - toggleDark: this.toggleDark, - toggleTabActions: this.toggleTabActions, - changeTabLimit: this.changeTabLimit, - changeTabWidth: this.changeTabWidth, - changeTabHeight: this.changeTabHeight, - openInOwnTabText: this.openInOwnTabText, - badgeText: this.badgeText, - hideText: this.hideText, - sessionsText: this.sessionsText, - exportSessionsText: this.exportSessionsText, - importSessionsText: this.importSessionsText, - animationsText: this.animationsText, - windowTitlesText: this.windowTitlesText, - tabLimitText: this.tabLimitText, - tabWidthText: this.tabWidthText, - tabHeightText: this.tabHeightText, - compactText: this.compactText, - darkText: this.darkText, - tabActionsText: this.tabActionsText, - getTip: this.getTip - }) - ), - React.createElement( - "div", - { className: "window top", ref: "tophover" }, - React.createElement("div", { className: "icon windowaction donate", title: "Donate a Coffee", onClick: this.donate, onMouseEnter: this.hoverIcon }), - React.createElement("div", { - className: "icon windowaction rate", - title: "Rate Tab Manager Plus", - onClick: this.rateExtension, - onMouseEnter: this.hoverIcon - }), - React.createElement("div", { className: "icon windowaction options", title: "Options", onClick: this.toggleOptions, onMouseEnter: this.hoverIcon }), - React.createElement("input", { - type: "text", - disabled: true, - className: "tabtitle", - ref: "topbox", - placeholder: maybePluralize(tabCount, 'tab') + " in " + this.state.windows.length + " windows", - value: this.state.topText - }), - React.createElement("input", { type: "text", disabled: true, className: "taburl", ref: "topboxurl", placeholder: this.getTip(), value: this.state.bottomText }) - ), - !this.state.optionsActive && !this.state.colorsActive && React.createElement( - "div", - { className: "window searchbox" }, - React.createElement( - "table", - null, - React.createElement( - "tbody", - null, - React.createElement( - "tr", - null, - React.createElement( - "td", - { className: "one" }, - React.createElement("input", { className: "searchBoxInput", type: "text", placeholder: "Start typing to search tabs...", tabIndex: "1", onChange: this.search, ref: "searchbox" }) - ), - React.createElement( - "td", - { className: "two" }, - React.createElement("div", { - className: "icon windowaction " + this.state.layout + "-view", - title: "Change to " + this.readablelayout(this.nextlayout()) + " View", - onClick: this.changelayout, - onMouseEnter: this.hoverIcon - }), - React.createElement("div", { - className: "icon windowaction trash", - title: Object.keys(this.state.selection).length > 0 ? "Close selected tabs\nWill close " + maybePluralize(Object.keys(this.state.selection).length, 'tab') : "Close current Tab", - onClick: this.deleteTabs, - onMouseEnter: this.hoverIcon - }), - React.createElement("div", { - className: "icon windowaction discard", - title: Object.keys(this.state.selection).length > 0 ? "Discard selected tabs\nWill discard " + maybePluralize(Object.keys(this.state.selection).length, 'tab') + " - freeing memory" : "Select tabs to discard them and free memory", - style: Object.keys(this.state.selection).length > 0 ? {} : { opacity: 0.25 }, - onClick: this.discardTabs, - onMouseEnter: this.hoverIcon - }), - React.createElement("div", { - className: "icon windowaction pin", - title: Object.keys(this.state.selection).length > 0 ? "Pin selected tabs\nWill pin " + maybePluralize(Object.keys(this.state.selection).length, 'tab') : "Pin current Tab", - onClick: this.pinTabs, - onMouseEnter: this.hoverIcon - }), - React.createElement("div", { - className: "icon windowaction filter" + (this.state.filterTabs ? " enabled" : ""), - title: (this.state.filterTabs ? "Turn off hiding of" : "Hide") + " tabs that do not match search" + (this.state.searchLen > 0 ? "\n" + (this.state.filterTabs ? "Will reveal " : "Will hide ") + maybePluralize(Object.keys(this.state.tabsbyid).length - Object.keys(this.state.selection).length, 'tab') : ""), - onClick: this.toggleFilterMismatchedTabs, - onMouseEnter: this.hoverIcon - }), - React.createElement("div", { - className: "icon windowaction new", - title: Object.keys(this.state.selection).length > 0 ? "Move tabs to new window\nWill move " + maybePluralize(Object.keys(this.state.selection).length, 'selected tab') + " to it" : "Open new empty window", - onClick: this.addWindow, - onMouseEnter: this.hoverIcon - }), - React.createElement("div", { - className: "icon windowaction duplicates" + (this.state.dupTabs ? " enabled" : ""), - title: "Highlight Duplicates", - onClick: this.highlightDuplicates, - onMouseEnter: this.hoverIcon - }) - ) - ) - ) - ) - ), - React.createElement("div", { className: "window placeholder" }) - ); - } - }, { - key: "componentDidMount", - value: function () { - var _ref2 = _asyncToGenerator(regeneratorRuntime.mark(function _callee3() { - var _this, runUpdate, runTabUpdate; - - return regeneratorRuntime.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - _context3.next = 2; - return this.loadStorage(); - - case 2: - _this = this; - runUpdate = debounce(this.update, 250); - - runUpdate = runUpdate.bind(this); - - runTabUpdate = function runTabUpdate(tabid, changeinfo, tab) { - if (!!_this.refs["window" + tab.windowId]) { - var window = _this.refs["window" + tab.windowId]; - if (!!window.refs["tab" + tabid]) { - var tab = window.refs["tab" + tabid]; - tab.checkSettings(); - } - } - }; - - browser.tabs.onCreated.addListener(runUpdate); - browser.tabs.onUpdated.addListener(runUpdate); - browser.tabs.onUpdated.addListener(runTabUpdate); - browser.tabs.onMoved.addListener(runUpdate); - browser.tabs.onRemoved.addListener(runUpdate); - browser.tabs.onReplaced.addListener(runUpdate); - browser.tabs.onDetached.addListener(runUpdate); - browser.tabs.onAttached.addListener(runUpdate); - browser.tabs.onActivated.addListener(runUpdate); - browser.windows.onFocusChanged.addListener(runUpdate); - browser.windows.onCreated.addListener(runUpdate); - browser.windows.onRemoved.addListener(runUpdate); - - browser.runtime.onMessage.addListener(function (request, sender, sendResponse) { - console.log(request.command); - switch (request.command) { - case "refresh_windows": - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = request.window_ids[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var window_id = _step.value; - - if (!_this.refs["window" + window_id]) continue; - _this.refs["window" + window_id].checkSettings(); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - break; - } - }); - - browser.storage.onChanged.addListener(this.sessionSync); - - this.sessionSync(); - - this.refs.root.focus(); - this.focusRoot(); - - _this = this; - - - setTimeout(_asyncToGenerator(regeneratorRuntime.mark(function _callee2() { - var scrollArea, activeWindow, activeTab, animations; - return regeneratorRuntime.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - scrollArea = document.getElementsByClassName("window-container")[0]; - activeWindow = document.getElementsByClassName("activeWindow"); - - if (!(!!activeWindow && activeWindow.length > 0)) { - _context2.next = 12; - break; - } - - activeTab = activeWindow[0].getElementsByClassName("highlighted"); - - if (!(!!activeTab && activeTab.length > 0)) { - _context2.next = 12; - break; - } - - if (!(!!scrollArea && scrollArea.scrollTop > 0)) { - _context2.next = 8; - break; - } - - _context2.next = 12; - break; - - case 8: - _context2.next = 10; - return getLocalStorage("animations", false); - - case 10: - animations = _context2.sent; - - activeTab[0].scrollIntoView({ behavior: animations ? "smooth" : "instant", block: "center", inline: "nearest" }); - - case 12: - case "end": - return _context2.stop(); - } - } - }, _callee2, this); - })), 250); - - case 25: - case "end": - return _context3.stop(); - } - } - }, _callee3, this); - })); - - function componentDidMount() { - return _ref2.apply(this, arguments); - } - - return componentDidMount; - }() - }, { - key: "sessionSync", - value: function () { - var _ref4 = _asyncToGenerator(regeneratorRuntime.mark(function _callee4() { - var values, sessions, key, sess; - return regeneratorRuntime.wrap(function _callee4$(_context4) { - while (1) { - switch (_context4.prev = _context4.next) { - case 0: - _context4.next = 2; - return getLocalStorage('sessions', {}); - - case 2: - values = _context4.sent; - sessions = []; - - for (key in values) { - sess = values[key]; - - if (sess.id && sess.tabs && sess.windowsInfo) { - sessions.push(values[key]); - } - } - this.state.sessions = sessions; - this.update(); - - case 7: - case "end": - return _context4.stop(); - } - } - }, _callee4, this); - })); - - function sessionSync() { - return _ref4.apply(this, arguments); - } - - return sessionSync; - }() - }, { - key: "focusRoot", - value: function focusRoot() { - this.state.focusUpdates++; - setTimeout(function () { - if (document.activeElement == document.body) { - this.refs.root.focus(); - this.forceUpdate(); - if (this.state.focusUpdates < 5) this.focusRoot(); - } - }.bind(this), 500); - } - }, { - key: "dragFavicon", - value: function dragFavicon(val) { - if (!val) { - return this.state.dragFavicon; - } else { - this.state.dragFavicon = val; - } - } - }, { - key: "rateExtension", - value: function rateExtension() { - if (navigator.userAgent.search("Firefox") > -1) { - browser.tabs.create({ url: "https://addons.mozilla.org/en-US/firefox/addon/tab-manager-plus-for-firefox/" }); - } else { - browser.tabs.create({ url: "https://chrome.google.com/webstore/detail/tab-manager-plus-for-chro/cnkdjjdmfiffagllbiiilooaoofcoeff" }); - } - this.forceUpdate(); - } - }, { - key: "donate", - value: function donate() { - browser.tabs.create({ url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=67TZLSEGYQFFW" }); - this.forceUpdate(); - } - }, { - key: "toggleOptions", - value: function toggleOptions() { - this.state.optionsActive = !this.state.optionsActive; - this.forceUpdate(); - } - }, { - key: "toggleColors", - value: function toggleColors(active, windowId) { - if (!!active) { - this.state.colorsActive = windowId; - } else { - this.state.colorsActive = false; - } - console.log("colorsActive", active, windowId, this.state.colorsActive); - this.forceUpdate(); - } - }, { - key: "update", - value: function () { - var _ref5 = _asyncToGenerator(regeneratorRuntime.mark(function _callee5() { - var windows, sort_windows, tabCount, i, window, j, tab, id; - return regeneratorRuntime.wrap(function _callee5$(_context5) { - while (1) { - switch (_context5.prev = _context5.next) { - case 0: - _context5.next = 2; - return browser.windows.getAll({ populate: true }); - - case 2: - windows = _context5.sent; - _context5.next = 5; - return getLocalStorage("windowAge", []); - - case 5: - sort_windows = _context5.sent; - - - windows.sort(function (a, b) { - var aSort = sort_windows.indexOf(a.id); - var bSort = sort_windows.indexOf(b.id); - if (a.state == "minimized" && b.state != "minimized") return 1; - if (b.state == "minimized" && a.state != "minimized") return -1; - if (aSort < bSort) return -1; - if (aSort > bSort) return 1; - return 0; - }); - - this.state.lastOpenWindow = windows[0].id; - this.state.windows = windows; - this.state.windowsbyid = {}; - this.state.tabsbyid = {}; - tabCount = 0; - - for (i = 0; i < windows.length; i++) { - window = windows[i]; - - this.state.windowsbyid[window.id] = window; - for (j = 0; j < window.tabs.length; j++) { - tab = window.tabs[j]; - - this.state.tabsbyid[tab.id] = tab; - tabCount++; - } - } - for (id in this.state.selection) { - if (!this.state.tabsbyid[id]) { - delete this.state.selection[id]; - this.state.lastSelect = id; - } - } - this.state.tabCount = tabCount; - this.setState({ - tabCount: tabCount - }); - - case 16: - case "end": - return _context5.stop(); - } - } - }, _callee5, this); - })); - - function update() { - return _ref5.apply(this, arguments); - } - - return update; - }() - }, { - key: "deleteTabs", - value: function () { - var _ref6 = _asyncToGenerator(regeneratorRuntime.mark(function _callee6() { - var _this2, tabs, t; - - return regeneratorRuntime.wrap(function _callee6$(_context6) { - while (1) { - switch (_context6.prev = _context6.next) { - case 0: - _this2 = this; - tabs = Object.keys(this.state.selection).map(function (id) { - return _this2.state.tabsbyid[id]; - }); - - if (!tabs.length) { - _context6.next = 6; - break; - } - - browser.runtime.sendMessage({ command: "close_tabs", tabs: tabs }); - _context6.next = 12; - break; - - case 6: - _context6.next = 8; - return browser.tabs.query({ currentWindow: true, active: true }); - - case 8: - t = _context6.sent; - - if (!(t && t.length > 0)) { - _context6.next = 12; - break; - } - - _context6.next = 12; - return browser.tabs.remove(t[0].id); - - case 12: - this.forceUpdate(); - - case 13: - case "end": - return _context6.stop(); - } - } - }, _callee6, this); - })); - - function deleteTabs() { - return _ref6.apply(this, arguments); - } - - return deleteTabs; - }() - }, { - key: "deleteTab", - value: function deleteTab(tabId) { - browser.tabs.remove(tabId); - } - }, { - key: "discardTabs", - value: function () { - var _ref7 = _asyncToGenerator(regeneratorRuntime.mark(function _callee7() { - var _this2, tabs; - - return regeneratorRuntime.wrap(function _callee7$(_context7) { - while (1) { - switch (_context7.prev = _context7.next) { - case 0: - _this2 = this; - tabs = Object.keys(this.state.selection).map(function (id) { - return _this2.state.tabsbyid[id]; - }); - - if (tabs.length) { - browser.runtime.sendMessage({ command: "discard_tabs", tabs: tabs }); - } - this.clearSelection(); - - case 4: - case "end": - return _context7.stop(); - } - } - }, _callee7, this); - })); - - function discardTabs() { - return _ref7.apply(this, arguments); - } - - return discardTabs; - }() - }, { - key: "discardTab", - value: function discardTab(tabId) { - browser.tabs.discard(tabId); - } - }, { - key: "addWindow", - value: function () { - var _ref8 = _asyncToGenerator(regeneratorRuntime.mark(function _callee8() { - var _this3, count, tabs; - - return regeneratorRuntime.wrap(function _callee8$(_context8) { - while (1) { - switch (_context8.prev = _context8.next) { - case 0: - _this3 = this; - count = Object.keys(this.state.selection).length; - tabs = Object.keys(this.state.selection).map(function (id) { - return _this3.state.tabsbyid[id]; - }); - - if (!(count == 0)) { - _context8.next = 8; - break; - } - - _context8.next = 6; - return browser.windows.create({}); - - case 6: - _context8.next = 9; - break; - - case 8: - if (count == 1) { - if (navigator.userAgent.search("Firefox") > -1) { - browser.runtime.sendMessage({ command: "focus_on_tab_and_window_delayed", tab: tabs[0] }); - } else { - browser.runtime.sendMessage({ command: "focus_on_tab_and_window", tab: tabs[0] }); - } - } else { - browser.runtime.sendMessage({ command: "create_window_with_tabs", tabs: tabs }); - } - - case 9: - if (!!window.inPopup) window.close(); - - case 10: - case "end": - return _context8.stop(); - } - } - }, _callee8, this); - })); - - function addWindow() { - return _ref8.apply(this, arguments); - } - - return addWindow; - }() - }, { - key: "pinTabs", - value: function () { - var _ref9 = _asyncToGenerator(regeneratorRuntime.mark(function _callee9() { - var _this4, tabs, i, t; - - return regeneratorRuntime.wrap(function _callee9$(_context9) { - while (1) { - switch (_context9.prev = _context9.next) { - case 0: - _this4 = this; - tabs = Object.keys(this.state.selection).map(function (id) { - return _this4.state.tabsbyid[id]; - }).sort(function (a, b) { - return a.index - b.index; - }); - - if (!tabs.length) { - _context9.next = 13; - break; - } - - if (tabs[0].pinned) tabs.reverse(); - i = 0; - - case 5: - if (!(i < tabs.length)) { - _context9.next = 11; - break; - } - - _context9.next = 8; - return browser.tabs.update(tabs[i].id, { pinned: !tabs[0].pinned }); - - case 8: - i++; - _context9.next = 5; - break; - - case 11: - _context9.next = 19; - break; - - case 13: - _context9.next = 15; - return browser.tabs.query({ currentWindow: true, active: true }); - - case 15: - t = _context9.sent; - - if (!(t && t.length > 0)) { - _context9.next = 19; - break; - } - - _context9.next = 19; - return browser.tabs.update(t[0].id, { pinned: !t[0].pinned }); - - case 19: - case "end": - return _context9.stop(); - } - } - }, _callee9, this); - })); - - function pinTabs() { - return _ref9.apply(this, arguments); - } - - return pinTabs; - }() - }, { - key: "highlightDuplicates", - value: function highlightDuplicates(e) { - this.state.selection = {}; - this.state.hiddenTabs = {}; - this.state.searchLen = 0; - this.state.dupTabs = !this.state.dupTabs; - this.refs.searchbox.value = ""; - if (!this.state.dupTabs) { - this.state.hiddenCount = 0; - this.forceUpdate(); - return; - } - var hiddenCount = this.state.hiddenCount || 0; - var idList = this.state.tabsbyid; - var dup = []; - for (var id in idList) { - var tab = this.state.tabsbyid[id]; - for (var id2 in idList) { - if (id == id2) continue; - var tab2 = this.state.tabsbyid[id2]; - if (tab.url == tab2.url) { - dup.push(id); - break; - } - } - } - for (var id in dup) { - this.state.searchLen++; - hiddenCount -= this.state.hiddenTabs[dup[id]] || 0; - this.state.selection[dup[id]] = true; - delete this.state.hiddenTabs[dup[id]]; - this.state.lastSelect = dup[id]; - } - for (var id in idList) { - var tab = this.state.tabsbyid[id]; - if (dup.indexOf(id) === -1) { - hiddenCount += 1 - (this.state.hiddenTabs[id] || 0); - this.state.hiddenTabs[id] = true; - delete this.state.selection[id]; - this.state.lastSelect = id; - } - } - if (dup.length == 0) { - this.setState({ - topText: "No duplicates found", - bottomText: " " - }); - } else { - this.setState({ - topText: "Highlighted " + dup.length + " duplicate tabs", - bottomText: "Press enter to move them to a new window" - }); - } - this.state.hiddenCount = hiddenCount; - this.forceUpdate(); - } - }, { - key: "search", - value: function search(e) { - var hiddenCount = this.state.hiddenCount || 0; - var searchQuery = e.target.value || ""; - var searchLen = searchQuery.length; - - var searchType = "normal"; - var searchTerms = []; - if (searchQuery.indexOf(" ") === -1) { - searchType = "normal"; - } else if (searchQuery.indexOf(" OR ") > -1) { - searchTerms = searchQuery.split(" OR "); - searchType = "OR"; - } else if (searchQuery.indexOf(" ") > -1) { - searchTerms = searchQuery.split(" "); - searchType = "AND"; - } - if (searchType != "normal") { - searchTerms = searchTerms.filter(function (entry) { - return entry.trim() != ''; - }); - } - - if (!searchLen) { - this.state.selection = {}; - this.state.hiddenTabs = {}; - hiddenCount = 0; - } else { - var idList; - var lastSearchLen = this.state.searchLen; - idList = this.state.tabsbyid; - if (searchType == "normal") { - if (!lastSearchLen) { - idList = this.state.tabsbyid; - } else if (lastSearchLen > searchLen) { - idList = this.state.hiddenTabs; - } else if (lastSearchLen < searchLen) { - idList = this.state.selection; - } - } - for (var id in idList) { - var tab = this.state.tabsbyid[id]; - var tabSearchTerm; - if (!!tab.title) tabSearchTerm = tab.title; - if (!!tab.url) tabSearchTerm += " " + tab.url; - tabSearchTerm = tabSearchTerm.toLowerCase(); - var match = false; - if (searchType == "normal") { - match = tabSearchTerm.indexOf(e.target.value.toLowerCase()) >= 0; - } else if (searchType == "OR") { - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - - try { - for (var _iterator2 = searchTerms[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var searchOR = _step2.value; - - searchOR = searchOR.trim().toLowerCase(); - if (tabSearchTerm.indexOf(searchOR) >= 0) { - match = true; - break; - } - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - } else if (searchType == "AND") { - var andMatch = true; - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; - - try { - for (var _iterator3 = searchTerms[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { - var searchAND = _step3.value; - - searchAND = searchAND.trim().toLowerCase(); - if (tabSearchTerm.indexOf(searchAND) >= 0) {} else { - andMatch = false; - break; - } - } - } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; - } finally { - try { - if (!_iteratorNormalCompletion3 && _iterator3.return) { - _iterator3.return(); - } - } finally { - if (_didIteratorError3) { - throw _iteratorError3; - } - } - } - - match = andMatch; - } - if (match) { - hiddenCount -= this.state.hiddenTabs[id] || 0; - this.state.selection[id] = true; - delete this.state.hiddenTabs[id]; - this.state.lastSelect = id; - } else { - hiddenCount += 1 - (this.state.hiddenTabs[id] || 0); - this.state.hiddenTabs[id] = true; - delete this.state.selection[id]; - this.state.lastSelect = id; - } - } - } - this.state.hiddenCount = hiddenCount; - this.state.searchLen = searchLen; - var matches = Object.keys(this.state.selection).length; - var matchtext = ""; - if (matches == 0 && searchLen > 0) { - this.setState({ - topText: "No matches for '" + searchQuery + "'", - bottomText: "" - }); - } else if (matches == 0) { - this.setState({ - topText: "", - bottomText: "" - }); - } else if (matches > 1) { - this.setState({ - topText: Object.keys(this.state.selection).length + " matches for '" + searchQuery + "'", - bottomText: "Press enter to move them to a new window" - }); - } else if (matches == 1) { - this.setState({ - topText: Object.keys(this.state.selection).length + " match for '" + searchQuery + "'", - bottomText: "Press enter to switch to the tab" - }); - } - this.forceUpdate(); - } - }, { - key: "clearSelection", - value: function clearSelection() { - this.state.selection = {}; - this.setState({ - lastSelect: false - }); - } - }, { - key: "checkKey", - value: function checkKey(e) { - if (e.keyCode == 13) this.addWindow(); - - if (e.keyCode == 27) { - if (this.state.searchLen > 0 || Object.keys(this.state.selection).length > 0) { - e.nativeEvent.preventDefault(); - e.nativeEvent.stopPropagation(); - } - this.state.hiddenTabs = {}; - this.state.searchLen = 0; - this.refs.searchbox.value = ""; - this.clearSelection(); - } - - if (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 65 && e.keyCode <= 90 || e.keyCode >= 186 && e.keyCode <= 192 || e.keyCode >= 219 && e.keyCode <= 22 || e.keyCode == 8 || e.keyCode == 46 || e.keyCode == 32) { - if (document.activeElement != this.refs.searchbox) { - if (document.activeElement.type != "text" && document.activeElement.type != "input") { - this.refs.searchbox.focus(); - } - } - } - - if (e.keyCode >= 37 && e.keyCode <= 40) { - if (document.activeElement != this.refs.windowcontainer && document.activeElement != this.refs.searchbox) { - this.refs.windowcontainer.focus(); - } - - if (document.activeElement != this.refs.searchbox || !this.refs.searchbox.value) { - var goLeft = e.keyCode == 37; - var goRight = e.keyCode == 39; - var goUp = e.keyCode == 38; - var goDown = e.keyCode == 40; - if (this.state.layout == "vertical") { - goLeft = e.keyCode == 38; - goRight = e.keyCode == 40; - goUp = e.keyCode == 37; - goDown = e.keyCode == 39; - } - if (goLeft || goRight || goUp || goDown) { - e.nativeEvent.preventDefault(); - e.nativeEvent.stopPropagation(); - } - var altKey = e.nativeEvent.metaKey || e.nativeEvent.altKey || e.nativeEvent.shiftKey || e.nativeEvent.ctrlKey; - if (goLeft || goRight) { - var selectedTabs = Object.keys(this.state.selection); - if (!altKey && selectedTabs.length > 1) {} else { - var found = false; - var selectedNext = false; - var selectedTab = false; - var first = false; - var prev = false; - var last = false; - if (selectedTabs.length == 1) { - selectedTab = selectedTabs[0]; - } else if (selectedTabs.length > 1) { - if (this.state.lastSelect) { - selectedTab = this.state.lastSelect; - } else { - selectedTab = selectedTabs[0]; - } - } else if (selectedTabs.length == 0 && this.state.lastSelect) { - selectedTab = this.state.lastSelect; - } - if (this.state.lastDirection) { - if (goRight && this.state.lastDirection == "goRight") {} else if (goLeft && this.state.lastDirection == "goLeft") {} else if (selectedTabs.length > 1) { - this.select(this.state.lastSelect); - this.state.lastDirection = false; - found = true; - } else { - this.state.lastDirection = false; - } - } - if (!this.state.lastDirection) { - if (goRight) this.state.lastDirection = "goRight"; - if (goLeft) this.state.lastDirection = "goLeft"; - } - var _iteratorNormalCompletion4 = true; - var _didIteratorError4 = false; - var _iteratorError4 = undefined; - - try { - for (var _iterator4 = this.state.windows[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { - var _w = _step4.value; - - if (found) break; - if (_w.state != "minimized") { - var _iteratorNormalCompletion6 = true; - var _didIteratorError6 = false; - var _iteratorError6 = undefined; - - try { - for (var _iterator6 = _w.tabs[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) { - var _t = _step6.value; - - last = _t.id; - if (!first) first = _t.id; - if (!selectedTab) { - if (!altKey) this.state.selection = {}; - this.select(_t.id); - found = true; - break; - } else if (selectedTab == _t.id) { - if (goRight) { - selectedNext = true; - } else if (prev) { - if (!altKey) this.state.selection = {}; - this.select(prev); - found = true; - break; - } - } else if (selectedNext) { - if (!altKey) this.state.selection = {}; - this.select(_t.id); - found = true; - break; - } - prev = _t.id; - } - } catch (err) { - _didIteratorError6 = true; - _iteratorError6 = err; - } finally { - try { - if (!_iteratorNormalCompletion6 && _iterator6.return) { - _iterator6.return(); - } - } finally { - if (_didIteratorError6) { - throw _iteratorError6; - } - } - } - } - } - } catch (err) { - _didIteratorError4 = true; - _iteratorError4 = err; - } finally { - try { - if (!_iteratorNormalCompletion4 && _iterator4.return) { - _iterator4.return(); - } - } finally { - if (_didIteratorError4) { - throw _iteratorError4; - } - } - } - - var _iteratorNormalCompletion5 = true; - var _didIteratorError5 = false; - var _iteratorError5 = undefined; - - try { - for (var _iterator5 = this.state.windows[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { - var _w = _step5.value; - - if (found) break; - if (_w.state == "minimized") { - var _iteratorNormalCompletion7 = true; - var _didIteratorError7 = false; - var _iteratorError7 = undefined; - - try { - for (var _iterator7 = _w.tabs[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) { - var _t = _step7.value; - - last = _t.id; - if (!first) first = _t.id; - if (!selectedTab) { - if (!altKey) this.state.selection = {}; - this.select(_t.id); - found = true; - break; - } else if (selectedTab == _t.id) { - if (goRight) { - selectedNext = true; - } else if (prev) { - if (!altKey) this.state.selection = {}; - this.select(prev); - found = true; - break; - } - } else if (selectedNext) { - if (!altKey) this.state.selection = {}; - this.select(_t.id); - found = true; - break; - } - prev = _t.id; - } - } catch (err) { - _didIteratorError7 = true; - _iteratorError7 = err; - } finally { - try { - if (!_iteratorNormalCompletion7 && _iterator7.return) { - _iterator7.return(); - } - } finally { - if (_didIteratorError7) { - throw _iteratorError7; - } - } - } - } - } - } catch (err) { - _didIteratorError5 = true; - _iteratorError5 = err; - } finally { - try { - if (!_iteratorNormalCompletion5 && _iterator5.return) { - _iterator5.return(); - } - } finally { - if (_didIteratorError5) { - throw _iteratorError5; - } - } - } - - if (!found && goRight && first) { - if (!altKey) this.state.selection = {}; - this.select(first); - found = true; - } - if (!found && goLeft && last) { - if (!altKey) this.state.selection = {}; - this.select(last); - found = true; - } - } - } - if (goUp || goDown) { - var selectedTabs = Object.keys(this.state.selection); - if (selectedTabs.length > 1) {} else { - var found = false; - var selectedNext = false; - var selectedTab = -1; - var first = false; - var prev = false; - var last = false; - var tabPosition = -1; - var i = -1; - if (selectedTabs.length == 1) { - selectedTab = selectedTabs[0]; - } - var _iteratorNormalCompletion8 = true; - var _didIteratorError8 = false; - var _iteratorError8 = undefined; - - try { - for (var _iterator8 = this.state.windows[Symbol.iterator](), _step8; !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done); _iteratorNormalCompletion8 = true) { - var _w = _step8.value; - - i = 0; - if (found) break; - if (_w.state != "minimized") { - if (!first) first = _w.id; - var _iteratorNormalCompletion10 = true; - var _didIteratorError10 = false; - var _iteratorError10 = undefined; - - try { - for (var _iterator10 = _w.tabs[Symbol.iterator](), _step10; !(_iteratorNormalCompletion10 = (_step10 = _iterator10.next()).done); _iteratorNormalCompletion10 = true) { - var _t = _step10.value; - - i++; - last = _w.id; - if (!selectedTab) { - this.selectWindowTab(_w.id, tabPosition); - found = true; - break; - } else if (selectedTab == _t.id) { - tabPosition = i; - - if (goDown) { - selectedNext = true; - break; - } else if (prev) { - this.selectWindowTab(prev, tabPosition); - found = true; - break; - } - } else if (selectedNext) { - this.selectWindowTab(_w.id, tabPosition); - found = true; - break; - } - } - } catch (err) { - _didIteratorError10 = true; - _iteratorError10 = err; - } finally { - try { - if (!_iteratorNormalCompletion10 && _iterator10.return) { - _iterator10.return(); - } - } finally { - if (_didIteratorError10) { - throw _iteratorError10; - } - } - } - - prev = _w.id; - } - } - } catch (err) { - _didIteratorError8 = true; - _iteratorError8 = err; - } finally { - try { - if (!_iteratorNormalCompletion8 && _iterator8.return) { - _iterator8.return(); - } - } finally { - if (_didIteratorError8) { - throw _iteratorError8; - } - } - } - - var _iteratorNormalCompletion9 = true; - var _didIteratorError9 = false; - var _iteratorError9 = undefined; - - try { - for (var _iterator9 = this.state.windows[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) { - var _w = _step9.value; - - i = 0; - if (found) break; - if (_w.state == "minimized") { - if (!first) first = _w.id; - var _iteratorNormalCompletion11 = true; - var _didIteratorError11 = false; - var _iteratorError11 = undefined; - - try { - for (var _iterator11 = _w.tabs[Symbol.iterator](), _step11; !(_iteratorNormalCompletion11 = (_step11 = _iterator11.next()).done); _iteratorNormalCompletion11 = true) { - var _t = _step11.value; - - i++; - last = _w.id; - if (!selectedTab) { - this.selectWindowTab(_w.id, tabPosition); - found = true; - break; - } else if (selectedTab == _t.id) { - tabPosition = i; - - if (goDown) { - selectedNext = true; - break; - } else if (prev) { - this.selectWindowTab(prev, tabPosition); - found = true; - break; - } - } else if (selectedNext) { - this.selectWindowTab(_w.id, tabPosition); - found = true; - break; - } - } - } catch (err) { - _didIteratorError11 = true; - _iteratorError11 = err; - } finally { - try { - if (!_iteratorNormalCompletion11 && _iterator11.return) { - _iterator11.return(); - } - } finally { - if (_didIteratorError11) { - throw _iteratorError11; - } - } - } - - prev = _w.id; - } - } - } catch (err) { - _didIteratorError9 = true; - _iteratorError9 = err; - } finally { - try { - if (!_iteratorNormalCompletion9 && _iterator9.return) { - _iterator9.return(); - } - } finally { - if (_didIteratorError9) { - throw _iteratorError9; - } - } - } - - if (!found && goDown && first) { - this.state.selection = {}; - this.selectWindowTab(first, tabPosition); - found = true; - } - - if (!found && goUp && last) { - this.state.selection = {}; - this.selectWindowTab(last, tabPosition); - found = true; - } - } - } - } - } - - if (e.keyCode == 33 || e.keyCode == 34) { - if (document.activeElement != this.refs.windowcontainer) { - this.refs.windowcontainer.focus(); - } - } - } - }, { - key: "selectWindowTab", - value: function selectWindowTab(windowId, tabPosition) { - if (!tabPosition || tabPosition < 1) tabPosition = 1; - var _iteratorNormalCompletion12 = true; - var _didIteratorError12 = false; - var _iteratorError12 = undefined; - - try { - for (var _iterator12 = this.state.windows[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) { - var _w = _step12.value; - - if (_w.id != windowId) continue; - var i = 0; - var _iteratorNormalCompletion13 = true; - var _didIteratorError13 = false; - var _iteratorError13 = undefined; - - try { - for (var _iterator13 = _w.tabs[Symbol.iterator](), _step13; !(_iteratorNormalCompletion13 = (_step13 = _iterator13.next()).done); _iteratorNormalCompletion13 = true) { - var _t = _step13.value; - - i++; - if (_w.tabs.length >= tabPosition && tabPosition == i || _w.tabs.length < tabPosition && _w.tabs.length == i) { - this.state.selection = {}; - this.select(_t.id); - } - } - } catch (err) { - _didIteratorError13 = true; - _iteratorError13 = err; - } finally { - try { - if (!_iteratorNormalCompletion13 && _iterator13.return) { - _iterator13.return(); - } - } finally { - if (_didIteratorError13) { - throw _iteratorError13; - } - } - } - } - } catch (err) { - _didIteratorError12 = true; - _iteratorError12 = err; - } finally { - try { - if (!_iteratorNormalCompletion12 && _iterator12.return) { - _iterator12.return(); - } - } finally { - if (_didIteratorError12) { - throw _iteratorError12; - } - } - } - } - }, { - key: "scrollTo", - value: function scrollTo(what, id) { - var els = document.getElementById(what + "-" + id); - if (!!els) { - if (!this.elVisible(els)) { - els.scrollIntoView({ behavior: this.state.animations ? "smooth" : "instant", block: "center", inline: "nearest" }); - } - } - } - }, { - key: "changelayout", - value: function () { - var _ref10 = _asyncToGenerator(regeneratorRuntime.mark(function _callee10(layout) { - var newLayout; - return regeneratorRuntime.wrap(function _callee10$(_context10) { - while (1) { - switch (_context10.prev = _context10.next) { - case 0: - if (layout && typeof layout == "string") { - newLayout = layout; - } else { - if (this.state.layout == "blocks") { - newLayout = this.state.layout = "blocks-big"; - } else if (this.state.layout == "blocks-big") { - newLayout = this.state.layout = "horizontal"; - } else if (this.state.layout == "horizontal") { - newLayout = this.state.layout = "vertical"; - } else { - newLayout = this.state.layout = "blocks"; - } - } - this.state.layout = newLayout; - _context10.next = 4; - return setLocalStorage("layout", newLayout); - - case 4: - - this.setState({ - layout: newLayout, - topText: "Switched to " + this.readablelayout(this.state.layout) + " view", - bottomText: " " - }); - - this.forceUpdate(); - - case 6: - case "end": - return _context10.stop(); - } - } - }, _callee10, this); - })); - - function changelayout(_x) { - return _ref10.apply(this, arguments); - } - - return changelayout; - }() - }, { - key: "nextlayout", - value: function nextlayout() { - if (this.state.layout == "blocks") { - return "blocks-big"; - } else if (this.state.layout == "blocks-big") { - return "horizontal"; - } else if (this.state.layout == "horizontal") { - return "vertical"; - } else { - return "blocks"; - } - } - }, { - key: "readablelayout", - value: function readablelayout(layout) { - if (layout == "blocks") { - return "Block"; - } else if (layout == "blocks-big") { - return "Big Block"; - } else if (layout == "horizontal") { - return "Horizontal"; - } else { - return "Vertical"; - } - } - }, { - key: "select", - value: function select(id) { - if (this.state.selection[id]) { - delete this.state.selection[id]; - this.setState({ - lastSelect: id - }); - } else { - this.state.selection[id] = true; - this.setState({ - lastSelect: id - }); - } - this.scrollTo('tab', id); - var tab = this.state.tabsbyid[id]; - if (this.refs['window' + tab.windowId] && this.refs['window' + tab.windowId].refs['tab' + id]) { - this.refs['window' + tab.windowId].refs['tab' + id].resolveFavIconUrl(); - } - - var selected = Object.keys(this.state.selection).length; - if (selected == 0) { - this.setState({ - topText: "No tabs selected", - bottomText: " " - }); - } else if (selected == 1) { - this.setState({ - topText: "Selected " + selected + " tab", - bottomText: "Press enter to switch to it" - }); - } else { - this.setState({ - topText: "Selected " + selected + " tabs", - bottomText: "Press enter to move them to a new window" - }); - } - } - }, { - key: "selectTo", - value: function selectTo(id, tabs) { - var activate = false; - var lastSelect = this.state.lastSelect; - if (id == lastSelect) { - this.select(id); - return; - } - if (!!lastSelect) { - if (this.state.selection[lastSelect]) { - activate = true; - } - } else { - if (this.state.selection[id]) { - activate = false; - } else { - activate = true; - } - } - - var rangeIndex1; - var rangeIndex2; - for (var i = 0; i < tabs.length; i++) { - if (tabs[i].id == id) { - rangeIndex1 = i; - } - if (!!lastSelect && tabs[i].id == lastSelect) { - rangeIndex2 = i; - } - } - if (!!lastSelect && !rangeIndex2) { - this.select(id); - return; - } - if (!rangeIndex2) { - var neighbours = []; - for (var i = 0; i < tabs.length; i++) { - var tabId = tabs[i].id; - if (tabId != id) { - if (this.state.selection[tabId]) { - neighbours.push(tabId); - } - } - } - - if (activate) { - var leftSibling = 0; - var rightSibling = tabs.length - 1; - for (var i = 0; i < rangeIndex1; i++) { - if (neighbours.indexOf(i) > -1) { - leftSibling = i; - } - } - for (var i = tabs.length - 1; i > rangeIndex1; i--) { - if (neighbours.indexOf(i) > -1) { - rightSibling = i; - } - } - var diff1 = rangeIndex1 - leftSibling; - var diff2 = rightSibling - rangeIndex1; - if (diff1 > diff2) { - rangeIndex2 = rightSibling; - } else { - rangeIndex2 = leftSibling; - } - } else { - var leftSibling = rangeIndex1; - var rightSibling = rangeIndex1; - for (var i = rangeIndex1; i > 0; i--) { - if (neighbours.indexOf(i) > -1) { - leftSibling = i; - } - } - for (var i = rangeIndex1; i < tabs.length; i++) { - if (neighbours.indexOf(i) > -1) { - rightSibling = i; - } - } - var diff1 = rangeIndex1 - leftSibling; - var diff2 = rightSibling - rangeIndex1; - if (diff1 > diff2) { - rangeIndex2 = leftSibling; - } else { - rangeIndex2 = rightSibling; - } - } - } - - this.setState({ - lastSelect: tabs[rangeIndex2].id - }); - if (rangeIndex2 < rangeIndex1) { - var r1 = rangeIndex2; - var r2 = rangeIndex1; - rangeIndex1 = r1; - rangeIndex2 = r2; - } - - for (var i = 0; i < tabs.length; i++) { - if (i >= rangeIndex1 && i <= rangeIndex2) { - var tabId = tabs[i].id; - if (activate) { - this.state.selection[tabId] = true; - } else { - delete this.state.selection[tabId]; - } - } - } - - this.scrollTo('tab', this.state.lastSelect); - - var selected = Object.keys(this.state.selection).length; - if (selected == 0) { - this.setState({ - topText: "No tabs selected", - bottomText: " " - }); - } else if (selected == 1) { - this.setState({ - topText: "Selected " + selected + " tab", - bottomText: "Press enter to switch to it" - }); - } else { - this.setState({ - topText: "Selected " + selected + " tabs", - bottomText: "Press enter to move them to a new window" - }); - } - this.forceUpdate(); - } - }, { - key: "drag", - value: function drag(e, id) { - if (!this.state.selection[id]) { - this.state.selection = {}; - this.state.selection[id] = true; - this.state.lastSelect = id; - } - this.forceUpdate(); - } - }, { - key: "drop", - value: function () { - var _ref11 = _asyncToGenerator(regeneratorRuntime.mark(function _callee11(id, before) { - var _this5, tab, tabs, index, i, t; - - return regeneratorRuntime.wrap(function _callee11$(_context11) { - while (1) { - switch (_context11.prev = _context11.next) { - case 0: - _this5 = this; - tab = this.state.tabsbyid[id]; - tabs = Object.keys(this.state.selection).map(function (id) { - return _this5.state.tabsbyid[id]; - }); - index = tab.index + (before ? 0 : 1); - i = 0; - - case 5: - if (!(i < tabs.length)) { - _context11.next = 14; - break; - } - - t = tabs[i]; - _context11.next = 9; - return browser.tabs.move(t.id, { windowId: tab.windowId, index: index }); - - case 9: - _context11.next = 11; - return browser.tabs.update(t.id, { pinned: t.pinned }); - - case 11: - i++; - _context11.next = 5; - break; - - case 14: - this.setState({ - selection: {} - }); - this.update(); - - case 16: - case "end": - return _context11.stop(); - } - } - }, _callee11, this); - })); - - function drop(_x2, _x3) { - return _ref11.apply(this, arguments); - } - - return drop; - }() - }, { - key: "dropWindow", - value: function () { - var _ref12 = _asyncToGenerator(regeneratorRuntime.mark(function _callee12(windowId) { - var _this6, tabs; - - return regeneratorRuntime.wrap(function _callee12$(_context12) { - while (1) { - switch (_context12.prev = _context12.next) { - case 0: - _this6 = this; - tabs = Object.keys(this.state.selection).map(function (id) { - return _this6.state.tabsbyid[id]; - }); - - - browser.runtime.sendMessage({ command: "move_tabs_to_window", window_id: windowId, tabs: tabs }); - - this.setState({ - selection: {} - }); - - case 4: - case "end": - return _context12.stop(); - } - } - }, _callee12, this); - })); - - function dropWindow(_x4) { - return _ref12.apply(this, arguments); - } - - return dropWindow; - }() - }, { - key: "changeTabLimit", - value: function () { - var _ref13 = _asyncToGenerator(regeneratorRuntime.mark(function _callee13(e) { - return regeneratorRuntime.wrap(function _callee13$(_context13) { - while (1) { - switch (_context13.prev = _context13.next) { - case 0: - this.state.tabLimit = e.target.value; - _context13.next = 3; - return setLocalStorage("tabLimit", this.state.tabLimit); - - case 3: - this.tabLimitText(); - this.forceUpdate(); - - case 5: - case "end": - return _context13.stop(); - } - } - }, _callee13, this); - })); - - function changeTabLimit(_x5) { - return _ref13.apply(this, arguments); - } - - return changeTabLimit; - }() - }, { - key: "tabLimitText", - value: function tabLimitText() { - this.setState({ - bottomText: "Limit the number of tabs per window. Will move new tabs into a new window instead. 0 to turn off" - }); - } - }, { - key: "changeTabWidth", - value: function () { - var _ref14 = _asyncToGenerator(regeneratorRuntime.mark(function _callee14(e) { - return regeneratorRuntime.wrap(function _callee14$(_context14) { - while (1) { - switch (_context14.prev = _context14.next) { - case 0: - this.state.tabWidth = e.target.value; - _context14.next = 3; - return setLocalStorage("tabWidth", this.state.tabWidth); - - case 3: - document.body.style.width = this.state.tabWidth + "px"; - this.tabWidthText(); - this.forceUpdate(); - - case 6: - case "end": - return _context14.stop(); - } - } - }, _callee14, this); - })); - - function changeTabWidth(_x6) { - return _ref14.apply(this, arguments); - } - - return changeTabWidth; - }() - }, { - key: "tabWidthText", - value: function tabWidthText() { - this.setState({ - bottomText: "Change the width of this window. 800 by default." - }); - } - }, { - key: "changeTabHeight", - value: function () { - var _ref15 = _asyncToGenerator(regeneratorRuntime.mark(function _callee15(e) { - return regeneratorRuntime.wrap(function _callee15$(_context15) { - while (1) { - switch (_context15.prev = _context15.next) { - case 0: - this.state.tabHeight = e.target.value; - _context15.next = 3; - return setLocalStorage("tabHeight", this.state.tabHeight); - - case 3: - document.body.style.height = this.state.tabHeight + "px"; - this.tabHeightText(); - this.forceUpdate(); - - case 6: - case "end": - return _context15.stop(); - } - } - }, _callee15, this); - })); - - function changeTabHeight(_x7) { - return _ref15.apply(this, arguments); - } - - return changeTabHeight; - }() - }, { - key: "tabHeightText", - value: function tabHeightText() { - this.setState({ - bottomText: "Change the height of this window. 600 by default." - }); - } - }, { - key: "toggleAnimations", - value: function () { - var _ref16 = _asyncToGenerator(regeneratorRuntime.mark(function _callee16() { - return regeneratorRuntime.wrap(function _callee16$(_context16) { - while (1) { - switch (_context16.prev = _context16.next) { - case 0: - this.state.animations = !this.state.animations; - _context16.next = 3; - return setLocalStorage("animations", this.state.animations); - - case 3: - this.animationsText(); - this.forceUpdate(); - - case 5: - case "end": - return _context16.stop(); - } - } - }, _callee16, this); - })); - - function toggleAnimations() { - return _ref16.apply(this, arguments); - } - - return toggleAnimations; - }() - }, { - key: "animationsText", - value: function animationsText() { - this.setState({ - bottomText: "Enables/disables animations. Default : on" - }); - } - }, { - key: "toggleWindowTitles", - value: function () { - var _ref17 = _asyncToGenerator(regeneratorRuntime.mark(function _callee17() { - return regeneratorRuntime.wrap(function _callee17$(_context17) { - while (1) { - switch (_context17.prev = _context17.next) { - case 0: - this.state.windowTitles = !this.state.windowTitles; - _context17.next = 3; - return setLocalStorage("windowTitles", this.state.windowTitles); - - case 3: - this.windowTitlesText(); - this.forceUpdate(); - - case 5: - case "end": - return _context17.stop(); - } - } - }, _callee17, this); - })); - - function toggleWindowTitles() { - return _ref17.apply(this, arguments); - } - - return toggleWindowTitles; - }() - }, { - key: "windowTitlesText", - value: function windowTitlesText() { - this.setState({ - bottomText: "Enables/disables window titles. Default : on" - }); - } - }, { - key: "toggleCompact", - value: function () { - var _ref18 = _asyncToGenerator(regeneratorRuntime.mark(function _callee18() { - return regeneratorRuntime.wrap(function _callee18$(_context18) { - while (1) { - switch (_context18.prev = _context18.next) { - case 0: - this.state.compact = !this.state.compact; - _context18.next = 3; - return setLocalStorage("compact", this.state.compact); - - case 3: - this.compactText(); - this.forceUpdate(); - - case 5: - case "end": - return _context18.stop(); - } - } - }, _callee18, this); - })); - - function toggleCompact() { - return _ref18.apply(this, arguments); - } - - return toggleCompact; - }() - }, { - key: "compactText", - value: function compactText() { - this.setState({ - bottomText: "Compact mode is a more compressed layout. Default : off" - }); - } - }, { - key: "toggleDark", - value: function () { - var _ref19 = _asyncToGenerator(regeneratorRuntime.mark(function _callee19() { - return regeneratorRuntime.wrap(function _callee19$(_context19) { - while (1) { - switch (_context19.prev = _context19.next) { - case 0: - this.state.dark = !this.state.dark; - _context19.next = 3; - return setLocalStorage("dark", this.state.dark); - - case 3: - this.darkText(); - if (this.state.dark) { - document.body.className = "dark"; - document.documentElement.className = "dark"; - } else { - document.body.className = ""; - document.documentElement.className = ""; - } - this.forceUpdate(); - - case 6: - case "end": - return _context19.stop(); - } - } - }, _callee19, this); - })); - - function toggleDark() { - return _ref19.apply(this, arguments); - } - - return toggleDark; - }() - }, { - key: "darkText", - value: function darkText() { - this.setState({ - bottomText: "Dark mode inverts the layout - better on the eyes. Default : off" - }); - } - }, { - key: "toggleTabActions", - value: function () { - var _ref20 = _asyncToGenerator(regeneratorRuntime.mark(function _callee20() { - return regeneratorRuntime.wrap(function _callee20$(_context20) { - while (1) { - switch (_context20.prev = _context20.next) { - case 0: - this.state.tabactions = !this.state.tabactions; - _context20.next = 3; - return setLocalStorage("tabactions", this.state.tabactions); - - case 3: - this.tabActionsText(); - this.forceUpdate(); - - case 5: - case "end": - return _context20.stop(); - } - } - }, _callee20, this); - })); - - function toggleTabActions() { - return _ref20.apply(this, arguments); - } - - return toggleTabActions; - }() - }, { - key: "tabActionsText", - value: function tabActionsText() { - this.setState({ - bottomText: "Adds 'Open a new tab' and 'Close this window' option to each window. Default : on" - }); - } - }, { - key: "toggleBadge", - value: function () { - var _ref21 = _asyncToGenerator(regeneratorRuntime.mark(function _callee21() { - return regeneratorRuntime.wrap(function _callee21$(_context21) { - while (1) { - switch (_context21.prev = _context21.next) { - case 0: - this.state.badge = !this.state.badge; - _context21.next = 3; - return setLocalStorage("badge", this.state.badge); - - case 3: - this.badgeText(); - browser.runtime.sendMessage({ command: "update_tab_count" }); - this.forceUpdate(); - - case 6: - case "end": - return _context21.stop(); - } - } - }, _callee21, this); - })); - - function toggleBadge() { - return _ref21.apply(this, arguments); - } - - return toggleBadge; - }() - }, { - key: "badgeText", - value: function badgeText() { - this.setState({ - bottomText: "Shows the number of open tabs on the Tab Manager icon. Default : on" - }); - } - }, { - key: "toggleOpenInOwnTab", - value: function () { - var _ref22 = _asyncToGenerator(regeneratorRuntime.mark(function _callee22() { - return regeneratorRuntime.wrap(function _callee22$(_context22) { - while (1) { - switch (_context22.prev = _context22.next) { - case 0: - this.state.openInOwnTab = !this.state.openInOwnTab; - _context22.next = 3; - return setLocalStorage("openInOwnTab", this.state.openInOwnTab); - - case 3: - this.openInOwnTabText(); - browser.runtime.sendMessage({ command: "reload_popup_controls" }); - this.forceUpdate(); - - case 6: - case "end": - return _context22.stop(); - } - } - }, _callee22, this); - })); - - function toggleOpenInOwnTab() { - return _ref22.apply(this, arguments); - } - - return toggleOpenInOwnTab; - }() - }, { - key: "openInOwnTabText", - value: function openInOwnTabText() { - this.setState({ - bottomText: "Open the Tab Manager by default in own tab, or as a popup?" - }); - } - }, { - key: "toggleSessions", - value: function () { - var _ref23 = _asyncToGenerator(regeneratorRuntime.mark(function _callee23() { - return regeneratorRuntime.wrap(function _callee23$(_context23) { - while (1) { - switch (_context23.prev = _context23.next) { - case 0: - this.state.sessionsFeature = !this.state.sessionsFeature; - _context23.next = 3; - return setLocalStorage("sessionsFeature", this.state.sessionsFeature); - - case 3: - this.sessionsText(); - this.forceUpdate(); - - case 5: - case "end": - return _context23.stop(); - } - } - }, _callee23, this); - })); - - function toggleSessions() { - return _ref23.apply(this, arguments); - } - - return toggleSessions; - }() - }, { - key: "sessionsText", - value: function sessionsText() { - this.setState({ - bottomText: "Allows you to save/restore windows into sessions. ( Tab History will be lost ) Default : off" - }); - } - }, { - key: "exportSessions", - value: function exportSessions() { - if (this.state.sessions.length == 0) { - window.alert("You have currently no windows saved for later. There is nothing to export."); - return; - } - var exportName = "tab-manager-plus-backup"; - var today = new Date(); - var y = today.getFullYear(); - - var m = ("0" + (today.getMonth() + 1)).slice(-2); - var d = ("0" + today.getDate()).slice(-2); - var h = ("0" + today.getHours()).slice(-2); - var mi = ("0" + today.getMinutes()).slice(-2); - var s = ("0" + today.getSeconds()).slice(-2); - exportName += "-" + y + m + d + "-" + h + mi + "-" + s; - var dataStr = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(this.state.sessions, null, 2)); - var downloadAnchorNode = document.createElement("a"); - downloadAnchorNode.setAttribute("href", dataStr); - downloadAnchorNode.setAttribute("download", exportName + ".json"); - document.body.appendChild(downloadAnchorNode); - downloadAnchorNode.click(); - downloadAnchorNode.remove(); - this.exportSessionsText(); - this.forceUpdate(); - } - }, { - key: "exportSessionsText", - value: function exportSessionsText() { - this.setState({ - bottomText: "Allows you to export your saved windows to an external backup" - }); - } - }, { - key: "importSessions", - value: function importSessions(evt) { - var _this8 = this; - - if (navigator.userAgent.search("Firefox") > -1) { - if (window.inPopup) { - window.alert("Due to a Firefox bug session import does not work in the popup. Please use the options screen or open Tab Manager Plus in its' own tab"); - return; - } - } - try { - var inputField = evt.target; - var files = evt.target.files; - if (!files.length) { - alert("No file selected!"); - this.setState({ bottomText: "Error: Could not read the backup file!" }); - return; - } - var file = files[0]; - var reader = new FileReader(); - var self = this; - reader.onload = function () { - var _ref24 = _asyncToGenerator(regeneratorRuntime.mark(function _callee24(event) { - var backupFile, success, i, newSession, sessions, value; - return regeneratorRuntime.wrap(function _callee24$(_context24) { - while (1) { - switch (_context24.prev = _context24.next) { - case 0: - try { - backupFile = JSON.parse(event.target.result); - } catch (err) { - console.error(err); - window.alert(err); - _this8.setState({ bottomText: "Error: Could not read the backup file!" }); - } - - if (!(!!backupFile && backupFile.length > 0)) { - _context24.next = 20; - break; - } - - success = backupFile.length; - i = 0; - - case 4: - if (!(i < backupFile.length)) { - _context24.next = 17; - break; - } - - newSession = backupFile[i]; - - if (!(newSession.windowsInfo && newSession.tabs && newSession.id)) { - _context24.next = 14; - break; - } - - _context24.next = 9; - return getLocalStorage('sessions', {}); - - case 9: - sessions = _context24.sent; - - sessions[newSession.id] = newSession; - _context24.next = 13; - return setLocalStorage('sessions', sessions).catch(function (err) { - console.log(err); - console.error(err.message); - success--; - }); - - case 13: - value = _context24.sent; - - case 14: - i++; - _context24.next = 4; - break; - - case 17: - _this8.setState({ bottomText: success + " windows successfully restored!" }); - _context24.next = 21; - break; - - case 20: - _this8.setState({ bottomText: "Error: Could not restore any windows from the backup file!" }); - - case 21: - inputField.value = ""; - _this8.sessionSync(); - - case 23: - case "end": - return _context24.stop(); - } - } - }, _callee24, _this8); - })); - - return function (_x8) { - return _ref24.apply(this, arguments); - }; - }(); - reader.readAsText(file); - } catch (err) { - console.error(err); - window.alert(err); - } - this.importSessionsText(); - this.forceUpdate(); - } - }, { - key: "importSessionsText", - value: function importSessionsText() { - this.setState({ - bottomText: "Allows you to restore your saved windows from an external backup" - }); - } - }, { - key: "toggleHide", - value: function () { - var _ref25 = _asyncToGenerator(regeneratorRuntime.mark(function _callee25() { - var granted; - return regeneratorRuntime.wrap(function _callee25$(_context25) { - while (1) { - switch (_context25.prev = _context25.next) { - case 0: - if (!(navigator.userAgent.search("Firefox") > -1)) { - _context25.next = 4; - break; - } - - this.state.hideWindows = false; - _context25.next = 8; - break; - - case 4: - _context25.next = 6; - return browser.permissions.request({ permissions: ["system.display"] }); - - case 6: - granted = _context25.sent; - - if (granted) { - this.state.hideWindows = !this.state.hideWindows; - } else { - this.state.hideWindows = false; - } - - case 8: - _context25.next = 10; - return setLocalStorage("hideWindows", this.state.hideWindows); - - case 10: - this.hideText(); - this.forceUpdate(); - - case 12: - case "end": - return _context25.stop(); - } - } - }, _callee25, this); - })); - - function toggleHide() { - return _ref25.apply(this, arguments); - } - - return toggleHide; - }() - }, { - key: "hideText", - value: function hideText() { - this.setState({ - bottomText: "Automatically minimizes inactive chrome windows. Default : off" - }); - } - }, { - key: "toggleFilterMismatchedTabs", - value: function () { - var _ref26 = _asyncToGenerator(regeneratorRuntime.mark(function _callee26() { - return regeneratorRuntime.wrap(function _callee26$(_context26) { - while (1) { - switch (_context26.prev = _context26.next) { - case 0: - this.state.filterTabs = !this.state.filterTabs; - _context26.next = 3; - return setLocalStorage("filter-tabs", this.state.filterTabs); - - case 3: - this.forceUpdate(); - - case 4: - case "end": - return _context26.stop(); - } - } - }, _callee26, this); - })); - - function toggleFilterMismatchedTabs() { - return _ref26.apply(this, arguments); - } - - return toggleFilterMismatchedTabs; - }() - }, { - key: "getTip", - value: function getTip() { - var tips = ["You can right click on a tab to select it", "Press enter to move all selected tabs to a new window", "Middle click to close a tab", "Tab Manager Plus loves saving time", "To see incognito tabs, enable incognito access in the extension settings", "You can drag and drop tabs to other windows", "You can type to search right away", "You can search for different tabs : google OR yahoo"]; - - return "Tip: " + tips[Math.floor(Math.random() * tips.length)]; - } - }, { - key: "isInViewport", - value: function isInViewport(element, ofElement) { - var rect = element.getBoundingClientRect(); - return rect.top >= 0 && rect.left >= 0 && rect.bottom <= ofElement.height && rect.right <= ofElement.width; - } - }, { - key: "elVisible", - value: function elVisible(elem) { - if (!(elem instanceof Element)) throw Error("DomUtil: elem is not an element."); - var style = getComputedStyle(elem); - if (style.display === "none") return false; - if (style.visibility !== "visible") return false; - if (style.opacity < 0.1) return false; - if (elem.offsetWidth + elem.offsetHeight + elem.getBoundingClientRect().height + elem.getBoundingClientRect().width === 0) { - return false; - } - var elemCenter = { - x: elem.getBoundingClientRect().left + elem.offsetWidth / 2, - y: elem.getBoundingClientRect().top + elem.offsetHeight / 2 - }; - - if (elemCenter.x < 0) return false; - if (elemCenter.x > (document.documentElement.clientWidth || window.innerWidth)) return false; - if (elemCenter.y < 0) return false; - if (elemCenter.y > (document.documentElement.clientHeight || window.innerHeight)) return false; - var pointContainer = document.elementFromPoint(elemCenter.x, elemCenter.y); - do { - if (pointContainer === elem) return true; - } while (pointContainer = pointContainer.parentNode); - return false; - } - }]); - - return TabManager; -}(React.Component); - -function debounce(func, wait, immediate) { - var timeout; - return function () { - var context = this, - args = arguments; - var later = function later() { - timeout = null; - if (!immediate) func.apply(context, args); - }; - var callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) func.apply(context, args); - }; -} - -var maybePluralize = function maybePluralize(count, noun) { - var suffix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 's'; - return count + " " + noun + (count !== 1 ? suffix : ''); -}; -//# sourceMappingURL=TabManager.js.map \ No newline at end of file diff --git a/outlib/popup/views/TabManager.js.map b/outlib/popup/views/TabManager.js.map deleted file mode 100644 index a7beafd1..00000000 --- a/outlib/popup/views/TabManager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../lib/popup/views/TabManager.jsx"],"names":["browser","chrome","TabManager","props","navigator","userAgent","search","check","permissions","contains","then","result","setLocalStorage","state","hideWindows","bind","layout","animations","windowTitles","compact","dark","tabactions","badge","sessionsFeature","filterTabs","tabLimit","openInOwnTab","tabWidth","tabHeight","closeTimeout","resetTimeout","lastOpenWindow","windows","sessions","selection","lastSelect","hiddenTabs","tabsbyid","windowsbyid","height","hasScrollBar","focusUpdates","topText","bottomText","lastDirection","optionsActive","dupTabs","dragFavicon","colorsActive","addWindow","animationsText","badgeText","changelayout","changeTabHeight","changeTabLimit","changeTabWidth","checkKey","clearSelection","compactText","darkText","deleteTabs","discardTabs","donate","exportSessions","exportSessionsText","getTip","hideText","highlightDuplicates","hoverIcon","importSessions","importSessionsText","openInOwnTabText","pinTabs","rateExtension","scrollTo","sessionsText","sessionSync","tabActionsText","tabHeightText","tabLimitText","tabWidthText","toggleAnimations","toggleBadge","toggleCompact","toggleDark","toggleFilterMismatchedTabs","toggleHide","toggleOpenInOwnTab","toggleOptions","toggleSessions","toggleTabActions","toggleWindowTitles","update","windowTitlesText","storage","local","get","document","body","className","setState","tab","title","url","clearTimeout","setTimeout","e","nativeEvent","preventDefault","stopPropagation","text","target","bottom","indexOf","a","split","forceUpdate","_this","hiddenCount","tabCount","haveMin","haveSess","i","length","searchLen","Object","keys","map","window","id","tabs","incognito","hoverHandler","toggleColors","deleteTab","select","selectTo","drag","drop","dropWindow","maybePluralize","readablelayout","nextlayout","opacity","loadStorage","runUpdate","debounce","runTabUpdate","tabid","changeinfo","refs","windowId","checkSettings","onCreated","addListener","onUpdated","onMoved","onRemoved","onReplaced","onDetached","onAttached","onActivated","onFocusChanged","runtime","onMessage","request","sender","sendResponse","console","log","command","window_ids","window_id","onChanged","root","focus","focusRoot","scrollArea","getElementsByClassName","activeWindow","activeTab","scrollTop","getLocalStorage","scrollIntoView","behavior","block","inline","values","key","sess","windowsInfo","push","activeElement","val","create","active","getAll","populate","sort_windows","sort","b","aSort","bSort","j","_this2","sendMessage","query","currentWindow","t","remove","tabId","discard","_this3","count","inPopup","close","_this4","index","pinned","reverse","searchbox","value","idList","dup","id2","tab2","searchQuery","searchType","searchTerms","filter","entry","trim","lastSearchLen","tabSearchTerm","toLowerCase","match","searchOR","andMatch","searchAND","matches","matchtext","keyCode","type","windowcontainer","goLeft","goRight","goUp","goDown","altKey","metaKey","shiftKey","ctrlKey","selectedTabs","found","selectedNext","selectedTab","first","prev","last","_w","_t","tabPosition","selectWindowTab","what","els","getElementById","elVisible","newLayout","resolveFavIconUrl","selected","activate","rangeIndex1","rangeIndex2","neighbours","leftSibling","rightSibling","diff1","diff2","r1","r2","before","_this5","move","_this6","style","width","documentElement","alert","exportName","today","Date","y","getFullYear","m","getMonth","slice","d","getDate","h","getHours","mi","getMinutes","s","getSeconds","dataStr","encodeURIComponent","JSON","stringify","downloadAnchorNode","createElement","setAttribute","appendChild","click","evt","inputField","files","file","reader","FileReader","self","onload","event","backupFile","parse","err","error","success","newSession","catch","message","readAsText","granted","tips","Math","floor","random","element","ofElement","rect","getBoundingClientRect","top","left","right","elem","Element","Error","getComputedStyle","display","visibility","offsetWidth","offsetHeight","elemCenter","x","clientWidth","innerWidth","clientHeight","innerHeight","pointContainer","elementFromPoint","parentNode","React","Component","func","wait","immediate","timeout","context","args","arguments","later","apply","callNow","noun","suffix"],"mappings":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AoBC,IAApB;AACb,EAXD;AAYA;;AAED,IAAMnO,iBAAiB,SAAjBA,cAAiB,CAACyE,KAAD,EAAQ+J,IAAR;AAAA,KAAcC,MAAd,uEAAuB,GAAvB;AAAA,QAClBhK,KADkB,SACT+J,IADS,IACF/J,UAAU,CAAV,GAAcgK,MAAd,GAAuB,EADrB;AAAA,CAAvB","file":"TabManager.js","sourcesContent":["\"use strict\";\n\nvar browser = browser || chrome;\n\nclass TabManager extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\t//this.update();\n\n\t\tif (navigator.userAgent.search(\"Firefox\") > -1) {\n\t\t} else {\n\t\t\tvar check = browser.permissions.contains({ permissions: [\"system.display\"] });\n\t\t\tcheck.then(\n\t\t\t\tfunction(result) {\n\t\t\t\t\tif (result) {\n\t\t\t\t\t\t// The extension has the permissions.\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetLocalStorage(\"hideWindows\", false);\n\t\t\t\t\t\tthis.state.hideWindows = false;\n\t\t\t\t\t}\n\t\t\t\t}.bind(this)\n\t\t\t);\n\t\t}\n\n\t\tvar layout = \"blocks\";\n\t\tvar animations = true;\n\t\tvar windowTitles = true;\n\t\tvar compact = false;\n\t\tvar dark = false;\n\t\tvar tabactions = true;\n\t\tvar badge = true;\n\t\tvar sessionsFeature = false;\n\t\tvar hideWindows = false;\n\t\tvar filterTabs = false;\n\t\tvar tabLimit = 0;\n\t\tvar openInOwnTab = false;\n\t\tvar tabWidth = 800;\n\t\tvar tabHeight = 600;\n\n\t\tvar closeTimeout;\n\t\tvar resetTimeout;\n\n\t\tthis.state = {\n\t\t\tlayout: layout,\n\t\t\tanimations: animations,\n\t\t\twindowTitles: windowTitles,\n\t\t\ttabLimit: tabLimit,\n\t\t\topenInOwnTab: openInOwnTab,\n\t\t\ttabWidth: tabWidth,\n\t\t\ttabHeight: tabHeight,\n\t\t\tcompact: compact,\n\t\t\tdark: dark,\n\t\t\ttabactions: tabactions,\n\t\t\tbadge: badge,\n\t\t\thideWindows: hideWindows,\n\t\t\tsessionsFeature: sessionsFeature,\n\t\t\tlastOpenWindow: -1,\n\t\t\twindows: [],\n\t\t\tsessions: [],\n\t\t\tselection: {},\n\t\t\tlastSelect: false,\n\t\t\thiddenTabs: {},\n\t\t\ttabsbyid: {},\n\t\t\twindowsbyid: {},\n\t\t\tcloseTimeout: closeTimeout,\n\t\t\tresetTimeout: resetTimeout,\n\t\t\theight: 600,\n\t\t\thasScrollBar: false,\n\t\t\tfocusUpdates: 0,\n\t\t\ttopText: \"\",\n\t\t\tbottomText: \"\",\n\t\t\tlastDirection: false,\n\t\t\toptionsActive: !!this.props.optionsActive,\n\t\t\tfilterTabs: filterTabs,\n\t\t\tdupTabs: false,\n\t\t\tdragFavicon: \"\",\n\t\t\tcolorsActive: false\n\t\t};\n\n\t\tthis.addWindow = this.addWindow.bind(this);\n\t\tthis.animationsText = this.animationsText.bind(this);\n\t\tthis.badgeText = this.badgeText.bind(this);\n\t\tthis.changelayout = this.changelayout.bind(this);\n\t\tthis.changeTabHeight = this.changeTabHeight.bind(this);\n\t\tthis.changeTabLimit = this.changeTabLimit.bind(this);\n\t\tthis.changeTabWidth = this.changeTabWidth.bind(this);\n\t\tthis.checkKey = this.checkKey.bind(this);\n\t\tthis.clearSelection = this.clearSelection.bind(this);\n\t\tthis.compactText = this.compactText.bind(this);\n\t\tthis.darkText = this.darkText.bind(this);\n\t\tthis.deleteTabs = this.deleteTabs.bind(this);\n\t\tthis.discardTabs = this.discardTabs.bind(this);\n\t\tthis.donate = this.donate.bind(this);\n\t\tthis.exportSessions = this.exportSessions.bind(this);\n\t\tthis.exportSessionsText = this.exportSessionsText.bind(this);\n\t\tthis.getTip = this.getTip.bind(this);\n\t\tthis.hideText = this.hideText.bind(this);\n\t\tthis.highlightDuplicates = this.highlightDuplicates.bind(this);\n\t\tthis.hoverIcon = this.hoverIcon.bind(this);\n\t\tthis.importSessions = this.importSessions.bind(this);\n\t\tthis.importSessionsText = this.importSessionsText.bind(this);\n\t\tthis.openInOwnTabText = this.openInOwnTabText.bind(this);\n\t\tthis.pinTabs = this.pinTabs.bind(this);\n\t\tthis.rateExtension = this.rateExtension.bind(this);\n\t\tthis.scrollTo = this.scrollTo.bind(this);\n\t\tthis.search = this.search.bind(this);\n\t\tthis.sessionsText = this.sessionsText.bind(this);\n\t\tthis.sessionSync = this.sessionSync.bind(this);\n\t\tthis.tabActionsText = this.tabActionsText.bind(this);\n\t\tthis.tabHeightText = this.tabHeightText.bind(this);\n\t\tthis.tabLimitText = this.tabLimitText.bind(this);\n\t\tthis.tabWidthText = this.tabWidthText.bind(this);\n\t\tthis.toggleAnimations = this.toggleAnimations.bind(this);\n\t\tthis.toggleBadge = this.toggleBadge.bind(this);\n\t\tthis.toggleCompact = this.toggleCompact.bind(this);\n\t\tthis.toggleDark = this.toggleDark.bind(this);\n\t\tthis.toggleFilterMismatchedTabs = this.toggleFilterMismatchedTabs.bind(this);\n\t\tthis.toggleHide = this.toggleHide.bind(this);\n\t\tthis.toggleOpenInOwnTab = this.toggleOpenInOwnTab.bind(this);\n\t\tthis.toggleOptions = this.toggleOptions.bind(this);\n\t\tthis.toggleSessions = this.toggleSessions.bind(this);\n\t\tthis.toggleTabActions = this.toggleTabActions.bind(this);\n\t\tthis.toggleWindowTitles = this.toggleWindowTitles.bind(this);\n\t\tthis.update = this.update.bind(this);\n\t\tthis.windowTitlesText = this.windowTitlesText.bind(this);\n\n\t}\n\tUNSAFE_componentWillMount() {\n\t\tthis.update();\n\t}\n\n\tasync loadStorage() {\n\t\tvar layout = \"blocks\";\n\t\tvar animations = true;\n\t\tvar windowTitles = true;\n\t\tvar compact = false;\n\t\tvar dark = false;\n\t\tvar tabactions = true;\n\t\tvar badge = true;\n\t\tvar sessionsFeature = false;\n\t\tvar hideWindows = false;\n\t\tvar filterTabs = false;\n\t\tvar tabLimit = 0;\n\t\tvar openInOwnTab = false;\n\t\tvar tabWidth = 800;\n\t\tvar tabHeight = 600;\n\n\t\tvar storage = await browser.storage.local.get(null);\n\n\t\tif (!storage[\"layout\"]) storage[\"layout\"] = \"blocks\";\n\t\tif (typeof storage[\"tabLimit\"] === \"undefined\") storage[\"tabLimit\"] = 0;\n\t\tif (typeof storage[\"tabWidth\"] === \"undefined\") storage[\"tabWidth\"] = 800;\n\t\tif (typeof storage[\"tabHeight\"] === \"undefined\") storage[\"tabHeight\"] = 600;\n\n\t\tif (typeof storage[\"animations\"] === \"undefined\") storage[\"animations\"] = true;\n\t\tif (typeof storage[\"windowTitles\"] === \"undefined\") storage[\"windowTitles\"] = true;\n\t\tif (typeof storage[\"tabactions\"] === \"undefined\") storage[\"tabactions\"] = true;\n\t\tif (typeof storage[\"badge\"] === \"undefined\") storage[\"badge\"] = true;\n\n\t\tif (typeof storage[\"openInOwnTab\"] === \"undefined\") storage[\"openInOwnTab\"] = false;\n\t\tif (typeof storage[\"compact\"] === \"undefined\") storage[\"compact\"] = false;\n\t\tif (typeof storage[\"dark\"] === \"undefined\") storage[\"dark\"] = false;\n\t\tif (typeof storage[\"sessionsFeature\"] === \"undefined\") storage[\"sessionsFeature\"] = false;\n\t\tif (typeof storage[\"hideWindows\"] === \"undefined\") storage[\"hideWindows\"] = false;\n\t\tif (typeof storage[\"filter-tabs\"] === \"undefined\") storage[\"filter-tabs\"] = false;\n\n\t\tif (typeof storage[\"version\"] === \"undefined\") storage[\"version\"] = __VERSION__;\n\n\t\tlayout = storage[\"layout\"];\n\t\ttabLimit = storage[\"tabLimit\"];\n\t\ttabWidth = storage[\"tabWidth\"];\n\t\ttabHeight = storage[\"tabHeight\"];\n\t\topenInOwnTab = storage[\"openInOwnTab\"];\n\t\tanimations = storage[\"animations\"];\n\t\twindowTitles = storage[\"windowTitles\"];\n\t\tcompact = storage[\"compact\"];\n\t\tdark = storage[\"dark\"];\n\t\ttabactions = storage[\"tabactions\"];\n\t\tbadge = storage[\"badge\"];\n\t\tsessionsFeature = storage[\"sessionsFeature\"];\n\t\thideWindows = storage[\"hideWindows\"];\n\t\tfilterTabs = storage[\"filter-tabs\"];\n\n\t\tif (dark) {\n\t\t\tdocument.body.className = \"dark\";\n\t\t} else {\n\t\t\tdocument.body.className = \"\";\n\t\t}\n\n\t\tthis.setState({\n\t\t\tlayout: layout,\n\t\t\tanimations: animations,\n\t\t\twindowTitles: windowTitles,\n\t\t\ttabLimit: tabLimit,\n\t\t\topenInOwnTab: openInOwnTab,\n\t\t\ttabWidth: tabWidth,\n\t\t\ttabHeight: tabHeight,\n\t\t\tcompact: compact,\n\t\t\tdark: dark,\n\t\t\ttabactions: tabactions,\n\t\t\tbadge: badge,\n\t\t\thideWindows: hideWindows,\n\t\t\tsessionsFeature: sessionsFeature,\n\t\t\tfilterTabs: filterTabs\n\t\t});\n\t}\n\n\thoverHandler(tab) {\n\t\tthis.setState({ topText: tab.title || \"\" });\n\t\tthis.setState({ bottomText: tab.url || \"\" });\n\t\t// clearTimeout(this.state.closeTimeout);\n\t\t// this.state.closeTimeout = setTimeout(function () {\n\t\t// window.close();\n\t\t// }, 100000);\n\t\tclearTimeout(this.state.resetTimeout);\n\t\tthis.state.resetTimeout = setTimeout(\n\t\t\tfunction() {\n\t\t\t\tthis.setState({ topText: \"\", bottomText: \"\" });\n\t\t\t\tthis.update();\n\t\t\t}.bind(this),\n\t\t\t15000\n\t\t);\n\t\t//this.update();\n\t}\n\thoverIcon(e) {\n\t\tif (e && e.nativeEvent) {\n\t\t\te.nativeEvent.preventDefault();\n\t\t\te.nativeEvent.stopPropagation();\n\t\t}\n\n\t\tvar text = \"\";\n\t\tif(e && e.target && !!e.target.title) {\n\t\t\ttext = e.target.title;\n\t\t} else if (typeof (e) == \"string\") {\n\t\t\ttext = e;\n\t\t}\n\t\tvar bottom = \" \";\n\t\tif (text.indexOf(\"\\n\") > -1) {\n\t\t\tvar a = text.split(\"\\n\");\n\t\t\ttext = a[0];\n\t\t\tbottom = a[1];\n\t\t}\n\t\tthis.setState({ topText: text });\n\t\tthis.setState({ bottomText: bottom });\n\t\t//this.update();\n\t\tthis.forceUpdate();\n\t}\n\trender() {\n\t\tvar _this = this;\n\n\t\tvar hiddenCount = this.state.hiddenCount || 0;\n\t\tvar tabCount = this.state.tabCount || 0;\n\n\t\tvar haveMin = false;\n\t\tvar haveSess = false;\n\n\t\tfor (var i = this.state.windows.length - 1; i >= 0; i--) {\n\t\t\tif (this.state.windows[i].state == \"minimized\") haveMin = true;\n\t\t}\n\n\t\tif (this.state.sessionsFeature) {\n\t\t\tif (this.state.sessions.length > 0) haveSess = true;\n\t\t\t// disable session window if we have filtering enabled\n\t\t\t// and filter active\n\t\t\tif (haveSess && this.state.filterTabs) {\n\t\t\t\tif (this.state.searchLen > 0 || Object.keys(this.state.hiddenTabs).length > 0) {\n\t\t\t\t\thaveSess = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn (\n\t\t\t\n\t\t\t\t{!this.state.optionsActive &&
\n\t\t\t\t\t{this.state.windows.map(function(window) {\n\t\t\t\t\t\tif (window.state == \"minimized\") return;\n\t\t\t\t\t\tif (!!this.state.colorsActive && this.state.colorsActive !== window.id) return;\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t 0}\n\t\t\t\t\t\t\t\tsessionsFeature={_this.state.sessionsFeature}\n\t\t\t\t\t\t\t\ttabactions={_this.state.tabactions}\n\t\t\t\t\t\t\t\thiddenTabs={_this.state.hiddenTabs}\n\t\t\t\t\t\t\t\tfilterTabs={_this.state.filterTabs}\n\t\t\t\t\t\t\t\thoverHandler={_this.hoverHandler.bind(_this)}\n\t\t\t\t\t\t\t\tscrollTo={_this.scrollTo.bind(_this)}\n\t\t\t\t\t\t\t\thoverIcon={_this.hoverIcon.bind(_this)}\n\t\t\t\t\t\t\t\tparentUpdate={_this.update.bind(_this)}\n\t\t\t\t\t\t\t\ttoggleColors={_this.toggleColors.bind(_this)}\n\t\t\t\t\t\t\t\ttabMiddleClick={_this.deleteTab.bind(_this)}\n\t\t\t\t\t\t\t\tselect={_this.select.bind(_this)}\n\t\t\t\t\t\t\t\tselectTo={_this.selectTo.bind(_this)}\n\t\t\t\t\t\t\t\tdraggable={true}\n\t\t\t\t\t\t\t\tdrag={_this.drag.bind(_this)}\n\t\t\t\t\t\t\t\tdrop={_this.drop.bind(_this)}\n\t\t\t\t\t\t\t\tdropWindow={_this.dropWindow.bind(_this)}\n\t\t\t\t\t\t\t\twindowTitles={_this.state.windowTitles}\n\t\t\t\t\t\t\t\tlastOpenWindow={_this.state.lastOpenWindow}\n\t\t\t\t\t\t\t\tdragFavicon={_this.dragFavicon.bind(_this)}\n\t\t\t\t\t\t\t\tref={\"window\" + window.id}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t}.bind(this))}\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\tMinimized windows\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t{this.state.windows.map(function(window) {\n\t\t\t\t\t\tif (window.state !== \"minimized\") return;\n\t\t\t\t\t\tif (!!this.state.colorsActive && this.state.colorsActive !== window.id) return;\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t 0}\n\t\t\t\t\t\t\t\tsessionsFeature={_this.state.sessionsFeature}\n\t\t\t\t\t\t\t\ttabactions={_this.state.tabactions}\n\t\t\t\t\t\t\t\thiddenTabs={_this.state.hiddenTabs}\n\t\t\t\t\t\t\t\tfilterTabs={_this.state.filterTabs}\n\t\t\t\t\t\t\t\thoverHandler={_this.hoverHandler.bind(_this)}\n\t\t\t\t\t\t\t\tscrollTo={_this.scrollTo.bind(_this)}\n\t\t\t\t\t\t\t\thoverIcon={_this.hoverIcon.bind(_this)}\n\t\t\t\t\t\t\t\tparentUpdate={_this.update.bind(_this)}\n\t\t\t\t\t\t\t\ttoggleColors={_this.toggleColors.bind(_this)}\n\t\t\t\t\t\t\t\ttabMiddleClick={_this.deleteTab.bind(_this)}\n\t\t\t\t\t\t\t\tselect={_this.select.bind(_this)}\n\t\t\t\t\t\t\t\tselectTo={_this.selectTo.bind(_this)}\n\t\t\t\t\t\t\t\tdraggable={true}\n\t\t\t\t\t\t\t\tdrag={_this.drag.bind(_this)}\n\t\t\t\t\t\t\t\tdrop={_this.drop.bind(_this)}\n\t\t\t\t\t\t\t\tdropWindow={_this.dropWindow.bind(_this)}\n\t\t\t\t\t\t\t\twindowTitles={_this.state.windowTitles}\n\t\t\t\t\t\t\t\tlastOpenWindow={_this.state.lastOpenWindow}\n\t\t\t\t\t\t\t\tdragFavicon={_this.dragFavicon.bind(_this)}\n\t\t\t\t\t\t\t\tref={\"window\" + window.id}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t}.bind(this))}\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\tSaved windows\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t{haveSess\n\t\t\t\t\t\t? this.state.sessions.map(function(window) {\n\t\t\t\t\t\t\t\tif (!!this.state.colorsActive && this.state.colorsActive !== window.id) return;\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t 0}\n\t\t\t\t\t\t\t\t\t\ttabactions={_this.state.tabactions}\n\t\t\t\t\t\t\t\t\t\thiddenTabs={_this.state.hiddenTabs}\n\t\t\t\t\t\t\t\t\t\tfilterTabs={_this.state.filterTabs}\n\t\t\t\t\t\t\t\t\t\thoverHandler={_this.hoverHandler.bind(_this)}\n\t\t\t\t\t\t\t\t\t\tscrollTo={_this.scrollTo.bind(_this)}\n\t\t\t\t\t\t\t\t\t\thoverIcon={_this.hoverIcon.bind(_this)}\n\t\t\t\t\t\t\t\t\t\tparentUpdate={_this.update.bind(_this)}\n\t\t\t\t\t\t\t\t\t\ttoggleColors={_this.toggleColors.bind(_this)}\n\t\t\t\t\t\t\t\t\t\ttabMiddleClick={_this.deleteTab.bind(_this)}\n\t\t\t\t\t\t\t\t\t\tselect={_this.select.bind(_this)}\n\t\t\t\t\t\t\t\t\t\twindowTitles={_this.state.windowTitles}\n\t\t\t\t\t\t\t\t\t\tlastOpenWindow={_this.state.lastOpenWindow}\n\t\t\t\t\t\t\t\t\t\tref={\"session\" + window.id}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}.bind(this))\n\t\t\t\t\t\t: false}\n\t\t\t\t
}\n\t\t\t\t{this.state.optionsActive &&
\n\t\t\t\t\t\n\t\t\t\t
}\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t{!this.state.optionsActive && !this.state.colorsActive &&
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t 0\n\t\t\t\t\t\t\t\t\t\t\t\t? \"Close selected tabs\\nWill close \" + maybePluralize(Object.keys(this.state.selection).length, 'tab')\n\t\t\t\t\t\t\t\t\t\t\t\t: \"Close current Tab\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonClick={this.deleteTabs}\n\t\t\t\t\t\t\t\t\t\tonMouseEnter={this.hoverIcon}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t 0\n\t\t\t\t\t\t\t\t\t\t\t\t? \"Discard selected tabs\\nWill discard \" + maybePluralize(Object.keys(this.state.selection).length, 'tab') + \" - freeing memory\"\n\t\t\t\t\t\t\t\t\t\t\t\t: \"Select tabs to discard them and free memory\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\t\t\tObject.keys(this.state.selection).length > 0\n\t\t\t\t\t\t\t\t\t\t\t\t? {}\n\t\t\t\t\t\t\t\t\t\t\t\t: { opacity: 0.25 }\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonClick={this.discardTabs}\n\t\t\t\t\t\t\t\t\t\tonMouseEnter={this.hoverIcon}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t 0\n\t\t\t\t\t\t\t\t\t\t\t\t? \"Pin selected tabs\\nWill pin \" + maybePluralize(Object.keys(this.state.selection).length, 'tab')\n\t\t\t\t\t\t\t\t\t\t\t\t: \"Pin current Tab\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonClick={this.pinTabs}\n\t\t\t\t\t\t\t\t\t\tonMouseEnter={this.hoverIcon}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t 0\n\t\t\t\t\t\t\t\t\t\t\t\t? \"\\n\" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t(this.state.filterTabs ? \"Will reveal \" : \"Will hide \") +\n\t\t\t\t\t\t\t\t\t\t\t\t\tmaybePluralize((Object.keys(this.state.tabsbyid).length - Object.keys(this.state.selection).length), 'tab')\n\t\t\t\t\t\t\t\t\t\t\t\t: \"\")\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonClick={this.toggleFilterMismatchedTabs}\n\t\t\t\t\t\t\t\t\t\tonMouseEnter={this.hoverIcon}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t 0\n\t\t\t\t\t\t\t\t\t\t\t\t? \"Move tabs to new window\\nWill move \" + maybePluralize(Object.keys(this.state.selection).length, 'selected tab') + \" to it\"\n\t\t\t\t\t\t\t\t\t\t\t\t: \"Open new empty window\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonClick={this.addWindow}\n\t\t\t\t\t\t\t\t\t\tonMouseEnter={this.hoverIcon}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t
}\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\tasync componentDidMount()\n\t{\n\t\tawait this.loadStorage();\n\n\t\tvar _this = this;\n\n\t\tvar runUpdate = debounce(this.update, 250);\n\t\trunUpdate = runUpdate.bind(this);\n\n\t\tvar runTabUpdate = (tabid, changeinfo, tab) => {\n\t\t\tif (!!_this.refs[\"window\" + tab.windowId]) {\n\t\t\t\tvar window = _this.refs[\"window\" + tab.windowId];\n\t\t\t\tif (!!window.refs[\"tab\" + tabid]) {\n\t\t\t\t\tvar tab = window.refs[\"tab\" + tabid];\n\t\t\t\t\ttab.checkSettings();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbrowser.tabs.onCreated.addListener(runUpdate);\n\t\tbrowser.tabs.onUpdated.addListener(runUpdate);\n\t\tbrowser.tabs.onUpdated.addListener(runTabUpdate);\n\t\tbrowser.tabs.onMoved.addListener(runUpdate);\n\t\tbrowser.tabs.onRemoved.addListener(runUpdate);\n\t\tbrowser.tabs.onReplaced.addListener(runUpdate);\n\t\tbrowser.tabs.onDetached.addListener(runUpdate);\n\t\tbrowser.tabs.onAttached.addListener(runUpdate);\n\t\tbrowser.tabs.onActivated.addListener(runUpdate);\n\t\tbrowser.windows.onFocusChanged.addListener(runUpdate);\n\t\tbrowser.windows.onCreated.addListener(runUpdate);\n\t\tbrowser.windows.onRemoved.addListener(runUpdate);\n\n\t\tbrowser.runtime.onMessage.addListener(function (request, sender, sendResponse) {\n\t\t\tconsole.log(request.command);\n\t\t\tswitch (request.command) {\n\t\t\t\tcase \"refresh_windows\":\n\t\t\t\t\tfor (var window_id of request.window_ids) {\n\t\t\t\t\t\tif (!_this.refs[\"window\" + window_id]) continue;\n\t\t\t\t\t\t_this.refs[\"window\" + window_id].checkSettings();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t});\n\n\n\t\tbrowser.storage.onChanged.addListener(this.sessionSync);\n\n\t\tthis.sessionSync();\n\n\t\tthis.refs.root.focus();\n\t\tthis.focusRoot();\n\n\t\tvar _this = this;\n\n\t\tsetTimeout(async function() {\n\t\t\tvar scrollArea = document.getElementsByClassName(\"window-container\")[0];\n\t\t\tvar activeWindow = document.getElementsByClassName(\"activeWindow\");\n\t\t\tif (!!activeWindow && activeWindow.length > 0) {\n\t\t\t\tvar activeTab = activeWindow[0].getElementsByClassName(\"highlighted\");\n\t\t\t\tif (!!activeTab && activeTab.length > 0) {\n\t\t\t\t\tif (!!scrollArea && scrollArea.scrollTop > 0) {\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar animations = await getLocalStorage(\"animations\", false);\n\t\t\t\t\t\tactiveTab[0].scrollIntoView({ behavior: animations ? \"smooth\" : \"instant\", block: \"center\", inline: \"nearest\" });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}, 250);\n\n\t\t// box.select();\n\t\t// box.focus();\n\t}\n\tasync sessionSync() {\n\t\tvar values = await getLocalStorage('sessions', {});\n\t\t// console.log(values);\n\t\tvar sessions = [];\n\t\tfor (var key in values) {\n\t\t\tvar sess = values[key];\n\t\t\tif (sess.id && sess.tabs && sess.windowsInfo) {\n\t\t\t\tsessions.push(values[key]);\n\t\t\t}\n\t\t}\n\t\tthis.state.sessions = sessions;\n\t\tthis.update();\n\t}\n\tfocusRoot() {\n\t\tthis.state.focusUpdates++;\n\t\tsetTimeout(\n\t\t\tfunction() {\n\t\t\t\tif (document.activeElement == document.body) {\n\t\t\t\t\tthis.refs.root.focus();\n\t\t\t\t\tthis.forceUpdate();\n\t\t\t\t\tif (this.state.focusUpdates < 5) this.focusRoot();\n\t\t\t\t}\n\t\t\t}.bind(this),\n\t\t\t500\n\t\t);\n\t}\n\tdragFavicon(val) {\n\t\tif (!val) {\n\t\t\treturn this.state.dragFavicon;\n\t\t} else {\n\t\t\tthis.state.dragFavicon = val;\n\t\t}\n\t}\n\trateExtension() {\n\t\tif (navigator.userAgent.search(\"Firefox\") > -1) {\n\t\t\tbrowser.tabs.create({ url: \"https://addons.mozilla.org/en-US/firefox/addon/tab-manager-plus-for-firefox/\" });\n\t\t} else {\n\t\t\tbrowser.tabs.create({ url: \"https://chrome.google.com/webstore/detail/tab-manager-plus-for-chro/cnkdjjdmfiffagllbiiilooaoofcoeff\" });\n\t\t}\n\t\tthis.forceUpdate();\n\t}\n\tdonate() {\n\t\tbrowser.tabs.create({ url: \"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=67TZLSEGYQFFW\" });\n\t\tthis.forceUpdate();\n\t}\n\ttoggleOptions() {\n\t\tthis.state.optionsActive = !this.state.optionsActive;\n\t\tthis.forceUpdate();\n\t}\n\ttoggleColors(active, windowId) {\n\t\tif(!!active) {\n\t\t\tthis.state.colorsActive = windowId;\n\t\t}else{\n\t\t\tthis.state.colorsActive = false;\n\t\t}\n\t\tconsole.log(\"colorsActive\", active, windowId, this.state.colorsActive);\n\t\tthis.forceUpdate();\n\t}\n\n\tasync update() {\n\t\tvar windows = await browser.windows.getAll({ populate: true });\n\t\tvar sort_windows = await getLocalStorage(\"windowAge\", []);\n\n\t\twindows.sort(function(a, b) {\n\t\t\tvar aSort = sort_windows.indexOf(a.id);\n\t\t\tvar bSort = sort_windows.indexOf(b.id);\n\t\t\tif (a.state == \"minimized\" && b.state != \"minimized\") return 1;\n\t\t\tif (b.state == \"minimized\" && a.state != \"minimized\") return -1;\n\t\t\tif (aSort < bSort) return -1;\n\t\t\tif (aSort > bSort) return 1;\n\t\t\treturn 0;\n\t\t});\n\n\t\tthis.state.lastOpenWindow = windows[0].id;\n\t\tthis.state.windows = windows;\n\t\tthis.state.windowsbyid = {};\n\t\tthis.state.tabsbyid = {};\n\t\tvar tabCount = 0;\n\t\tfor (var i = 0; i < windows.length; i++) {\n\t\t\tvar window = windows[i];\n\t\t\tthis.state.windowsbyid[window.id] = window;\n\t\t\tfor (var j = 0; j < window.tabs.length; j++) {\n\t\t\t\tvar tab = window.tabs[j];\n\t\t\t\tthis.state.tabsbyid[tab.id] = tab;\n\t\t\t\ttabCount++;\n\t\t\t}\n\t\t}\n\t\tfor (var id in this.state.selection) {\n\t\t\tif (!this.state.tabsbyid[id]) {\n\t\t\t\tdelete this.state.selection[id];\n\t\t\t\tthis.state.lastSelect = id;\n\t\t\t}\n\t\t}\n\t\tthis.state.tabCount = tabCount;\n\t\tthis.setState({\n\t\t\ttabCount: tabCount\n\t\t});\n\t\t//this.state.searchLen = 0;\n\t\t// this.forceUpdate();\n\t}\n\tasync deleteTabs() {\n\t\tvar _this2 = this;\n\t\tvar tabs = Object.keys(this.state.selection).map(function(id) {\n\t\t\treturn _this2.state.tabsbyid[id];\n\t\t});\n\t\tif (tabs.length) {\n\t\t\tbrowser.runtime.sendMessage({command: \"close_tabs\", tabs: tabs});\n\t\t} else {\n\t\t\tvar t = await browser.tabs.query({ currentWindow: true, active: true });\n\t\t\tif (t && t.length > 0) {\n\t\t\t\tawait browser.tabs.remove(t[0].id);\n\t\t\t}\n\t\t}\n\t\tthis.forceUpdate();\n\t}\n\tdeleteTab(tabId) {\n\t\tbrowser.tabs.remove(tabId);\n\t}\n\tasync discardTabs() {\n\t\tvar _this2 = this;\n\t\tvar tabs = Object.keys(this.state.selection).map(function(id) {\n\t\t\treturn _this2.state.tabsbyid[id];\n\t\t});\n\t\tif (tabs.length) {\n\t\t\tbrowser.runtime.sendMessage({command: \"discard_tabs\", tabs: tabs});\n\t\t}\n\t\tthis.clearSelection();\n\t}\n\tdiscardTab(tabId) {\n\t\tbrowser.tabs.discard(tabId);\n\t}\n\tasync addWindow() {\n\t\tvar _this3 = this;\n\t\tvar count = Object.keys(this.state.selection).length;\n\t\tvar tabs = Object.keys(this.state.selection).map(function(id) {\n\t\t\treturn _this3.state.tabsbyid[id];\n\t\t});\n\n\t\tif (count == 0) {\n\t\t\tawait browser.windows.create({});\n\t\t} else if (count == 1) {\n\t\t\tif (navigator.userAgent.search(\"Firefox\") > -1) {\n\t\t\t\tbrowser.runtime.sendMessage({command: \"focus_on_tab_and_window_delayed\", tab: tabs[0]});\n\t\t\t}else{\n\t\t\t\tbrowser.runtime.sendMessage({command: \"focus_on_tab_and_window\", tab: tabs[0]});\n\t\t\t}\n\t\t} else {\n\t\t\tbrowser.runtime.sendMessage({command: \"create_window_with_tabs\", tabs: tabs});\n\t\t}\n\t\tif (!!window.inPopup) window.close();\n\t}\n\tasync pinTabs() {\n\t\tvar _this4 = this;\n\t\tvar tabs = Object.keys(this.state.selection)\n\t\t\t.map(function(id) {\n\t\t\t\treturn _this4.state.tabsbyid[id];\n\t\t\t})\n\t\t\t.sort(function(a, b) {\n\t\t\t\treturn a.index - b.index;\n\t\t\t});\n\t\tif (tabs.length) {\n\t\t\tif (tabs[0].pinned) tabs.reverse();\n\t\t\tfor (var i = 0; i < tabs.length; i++) {\n\t\t\t\tawait browser.tabs.update(tabs[i].id, { pinned: !tabs[0].pinned });\n\t\t\t}\n\t\t} else {\n\t\t\tvar t = await browser.tabs.query({ currentWindow: true, active: true });\n\t\t\tif (t && t.length > 0) {\n\t\t\t\tawait browser.tabs.update(t[0].id, { pinned: !t[0].pinned });\n\t\t\t}\n\t\t}\n\t}\n\thighlightDuplicates(e) {\n\t\tthis.state.selection = {};\n\t\tthis.state.hiddenTabs = {};\n\t\tthis.state.searchLen = 0;\n\t\tthis.state.dupTabs = !this.state.dupTabs;\n\t\tthis.refs.searchbox.value = \"\";\n\t\tif (!this.state.dupTabs) {\n\t\t\tthis.state.hiddenCount = 0;\n\t\t\tthis.forceUpdate();\n\t\t\treturn;\n\t\t}\n\t\tvar hiddenCount = this.state.hiddenCount || 0;\n\t\tvar idList = this.state.tabsbyid;\n\t\tvar dup = [];\n\t\tfor (var id in idList) {\n\t\t\tvar tab = this.state.tabsbyid[id];\n\t\t\tfor (var id2 in idList) {\n\t\t\t\tif (id == id2) continue;\n\t\t\t\tvar tab2 = this.state.tabsbyid[id2];\n\t\t\t\tif (tab.url == tab2.url) {\n\t\t\t\t\tdup.push(id);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (var id in dup) {\n\t\t\tthis.state.searchLen++;\n\t\t\thiddenCount -= this.state.hiddenTabs[dup[id]] || 0;\n\t\t\tthis.state.selection[dup[id]] = true;\n\t\t\tdelete this.state.hiddenTabs[dup[id]];\n\t\t\tthis.state.lastSelect = dup[id];\n\t\t}\n\t\tfor (var id in idList) {\n\t\t\tvar tab = this.state.tabsbyid[id];\n\t\t\tif (dup.indexOf(id) === -1) {\n\t\t\t\thiddenCount += 1 - (this.state.hiddenTabs[id] || 0);\n\t\t\t\tthis.state.hiddenTabs[id] = true;\n\t\t\t\tdelete this.state.selection[id];\n\t\t\t\tthis.state.lastSelect = id;\n\t\t\t}\n\t\t}\n\t\tif (dup.length == 0) {\n\t\t\tthis.setState({\n\t\t\t\ttopText: \"No duplicates found\",\n\t\t\t\tbottomText: \" \"\n\t\t\t});\n\t\t} else {\n\t\t\tthis.setState({\n\t\t\t\ttopText: \"Highlighted \" + dup.length + \" duplicate tabs\",\n\t\t\t\tbottomText: \"Press enter to move them to a new window\"\n\t\t\t});\n\t\t}\n\t\tthis.state.hiddenCount = hiddenCount;\n\t\tthis.forceUpdate();\n\t}\n\tsearch(e) {\n\t\tvar hiddenCount = this.state.hiddenCount || 0;\n\t\tvar searchQuery = e.target.value || \"\";\n\t\tvar searchLen = searchQuery.length;\n\n\t\tvar searchType = \"normal\";\n\t\tvar searchTerms = [];\n\t\tif(searchQuery.indexOf(\" \") === -1) {\n\t\t\tsearchType = \"normal\";\n\t\t}else if(searchQuery.indexOf(\" OR \") > -1) {\n\t\t\tsearchTerms = searchQuery.split(\" OR \");\n\t\t\tsearchType = \"OR\";\n\t\t}else if(searchQuery.indexOf(\" \") > -1) {\n\t\t\tsearchTerms = searchQuery.split(\" \");\n\t\t\tsearchType = \"AND\";\n\t\t}\n\t\tif(searchType != \"normal\") {\n\t\t\tsearchTerms = searchTerms.filter(function(entry) { return entry.trim() != ''; });\n\t\t}\n\n\t\tif (!searchLen) {\n\t\t\tthis.state.selection = {};\n\t\t\tthis.state.hiddenTabs = {};\n\t\t\thiddenCount = 0;\n\t\t} else {\n\t\t\tvar idList;\n\t\t\tvar lastSearchLen = this.state.searchLen;\n\t\t\tidList = this.state.tabsbyid;\n\t\t\tif(searchType == \"normal\") {\n\t\t\t\tif (!lastSearchLen) {\n\t\t\t\t\tidList = this.state.tabsbyid;\n\t\t\t\t} else if (lastSearchLen > searchLen) {\n\t\t\t\t\tidList = this.state.hiddenTabs;\n\t\t\t\t} else if (lastSearchLen < searchLen) {\n\t\t\t\t\tidList = this.state.selection;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var id in idList) {\n\t\t\t\tvar tab = this.state.tabsbyid[id];\n\t\t\t\tvar tabSearchTerm;\n\t\t\t\tif (!!tab.title) tabSearchTerm = tab.title;\n\t\t\t\tif (!!tab.url) tabSearchTerm += \" \" + tab.url;\n\t\t\t\ttabSearchTerm = tabSearchTerm.toLowerCase();\n\t\t\t\tvar match = false;\n\t\t\t\tif(searchType == \"normal\") {\n\t\t\t\t\tmatch = (tabSearchTerm.indexOf(e.target.value.toLowerCase()) >= 0);\n\t\t\t\t}else if(searchType == \"OR\") {\n\t\t\t\t\tfor (var searchOR of searchTerms) {\n\t\t\t\t\t\tsearchOR = searchOR.trim().toLowerCase();\n\t\t\t\t\t\tif(tabSearchTerm.indexOf(searchOR) >= 0) {\n\t\t\t\t\t\t\tmatch = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else if(searchType == \"AND\") {\n\t\t\t\t\tvar andMatch = true;\n\t\t\t\t\tfor (var searchAND of searchTerms) {\n\t\t\t\t\t\tsearchAND = searchAND.trim().toLowerCase();\n\t\t\t\t\t\tif(tabSearchTerm.indexOf(searchAND) >= 0) {\n\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tandMatch = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tmatch = andMatch;\n\t\t\t\t}\n\t\t\t\tif (match) {\n\t\t\t\t\thiddenCount -= this.state.hiddenTabs[id] || 0;\n\t\t\t\t\tthis.state.selection[id] = true;\n\t\t\t\t\tdelete this.state.hiddenTabs[id];\n\t\t\t\t\tthis.state.lastSelect = id;\n\t\t\t\t} else {\n\t\t\t\t\thiddenCount += 1 - (this.state.hiddenTabs[id] || 0);\n\t\t\t\t\tthis.state.hiddenTabs[id] = true;\n\t\t\t\t\tdelete this.state.selection[id];\n\t\t\t\t\tthis.state.lastSelect = id;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.state.hiddenCount = hiddenCount;\n\t\tthis.state.searchLen = searchLen;\n\t\tvar matches = Object.keys(this.state.selection).length;\n\t\tvar matchtext = \"\";\n\t\tif (matches == 0 && searchLen > 0) {\n\t\t\tthis.setState({\n\t\t\t\ttopText: \"No matches for '\" + searchQuery + \"'\",\n\t\t\t\tbottomText: \"\"\n\t\t\t});\n\t\t} else if (matches == 0) {\n\t\t\tthis.setState({\n\t\t\t\ttopText: \"\",\n\t\t\t\tbottomText: \"\"\n\t\t\t});\n\t\t} else if (matches > 1) {\n\t\t\tthis.setState({\n\t\t\t\ttopText: Object.keys(this.state.selection).length + \" matches for '\" + searchQuery + \"'\",\n\t\t\t\tbottomText: \"Press enter to move them to a new window\"\n\t\t\t});\n\t\t} else if (matches == 1) {\n\t\t\tthis.setState({\n\t\t\t\ttopText: Object.keys(this.state.selection).length + \" match for '\" + searchQuery + \"'\",\n\t\t\t\tbottomText: \"Press enter to switch to the tab\"\n\t\t\t});\n\t\t}\n\t\tthis.forceUpdate();\n\t}\n\tclearSelection() {\n\t\tthis.state.selection = {};\n\t\tthis.setState({\n\t\t\tlastSelect: false\n\t\t});\n\t}\n\tcheckKey(e) {\n\t\t// enter\n\t\tif (e.keyCode == 13) this.addWindow();\n\t\t// escape key\n\t\tif (e.keyCode == 27) {\n\t\t\tif(this.state.searchLen > 0 || Object.keys(this.state.selection).length > 0) {\n\t\t\t\t// stop popup from closing if we have search text or selection active\n\t\t\t\te.nativeEvent.preventDefault();\n\t\t\t\te.nativeEvent.stopPropagation();\n\t\t\t}\n\t\t\tthis.state.hiddenTabs = {};\n\t\t\tthis.state.searchLen = 0;\n\t\t\tthis.refs.searchbox.value = \"\";\n\t\t\tthis.clearSelection();\n\t\t}\n\t\t// any typed keys\n\t\tif (\n\t\t\t(e.keyCode >= 48 && e.keyCode <= 57) ||\n\t\t\t(e.keyCode >= 65 && e.keyCode <= 90) ||\n\t\t\t(e.keyCode >= 186 && e.keyCode <= 192) ||\n\t\t\t(e.keyCode >= 219 && e.keyCode <= 22) ||\n\t\t\te.keyCode == 8 ||\n\t\t\te.keyCode == 46 ||\n\t\t\te.keyCode == 32\n\t\t) {\n\t\t\tif (document.activeElement != this.refs.searchbox) {\n\t\t\t\tif (document.activeElement.type != \"text\" && document.activeElement.type != \"input\") {\n\t\t\t\t\tthis.refs.searchbox.focus();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// arrow keys\n\t\t/*\n\t\t\tleft arrow 37\n\t\t\tup arrow 38\n\t\t\tright arrow 39\n\t\t\tdown arrow 40\n\t\t*/\n\t\tif (e.keyCode >= 37 && e.keyCode <= 40) {\n\t\t\tif (document.activeElement != this.refs.windowcontainer && document.activeElement != this.refs.searchbox) {\n\t\t\t\tthis.refs.windowcontainer.focus();\n\t\t\t}\n\n\t\t\tif (document.activeElement != this.refs.searchbox || !this.refs.searchbox.value) {\n\t\t\t\tvar goLeft = e.keyCode == 37;\n\t\t\t\tvar goRight = e.keyCode == 39;\n\t\t\t\tvar goUp = e.keyCode == 38;\n\t\t\t\tvar goDown = e.keyCode == 40;\n\t\t\t\tif (this.state.layout == \"vertical\") {\n\t\t\t\t\tgoLeft = e.keyCode == 38;\n\t\t\t\t\tgoRight = e.keyCode == 40;\n\t\t\t\t\tgoUp = e.keyCode == 37;\n\t\t\t\t\tgoDown = e.keyCode == 39;\n\t\t\t\t}\n\t\t\t\tif (goLeft || goRight || goUp || goDown) {\n\t\t\t\t\te.nativeEvent.preventDefault();\n\t\t\t\t\te.nativeEvent.stopPropagation();\n\t\t\t\t}\n\t\t\t\tvar altKey = e.nativeEvent.metaKey || e.nativeEvent.altKey || e.nativeEvent.shiftKey || e.nativeEvent.ctrlKey;\n\t\t\t\tif (goLeft || goRight) {\n\t\t\t\t\tvar selectedTabs = Object.keys(this.state.selection);\n\t\t\t\t\tif (!altKey && selectedTabs.length > 1) {\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar found = false;\n\t\t\t\t\t\tvar selectedNext = false;\n\t\t\t\t\t\tvar selectedTab = false;\n\t\t\t\t\t\tvar first = false;\n\t\t\t\t\t\tvar prev = false;\n\t\t\t\t\t\tvar last = false;\n\t\t\t\t\t\tif (selectedTabs.length == 1) {\n\t\t\t\t\t\t\tselectedTab = selectedTabs[0];\n\t\t\t\t\t\t\t// console.log(\"one tab\", selectedTab);\n\t\t\t\t\t\t} else if (selectedTabs.length > 1) {\n\t\t\t\t\t\t\tif (this.state.lastSelect) {\n\t\t\t\t\t\t\t\tselectedTab = this.state.lastSelect;\n\t\t\t\t\t\t\t\t// console.log(\"more tabs, last\", selectedTab);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tselectedTab = selectedTabs[0];\n\t\t\t\t\t\t\t\t// console.log(\"more tabs, first\", selectedTab);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (selectedTabs.length == 0 && this.state.lastSelect) {\n\t\t\t\t\t\t\tselectedTab = this.state.lastSelect;\n\t\t\t\t\t\t\t// console.log(\"no tabs, last\", selectedTab);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (this.state.lastDirection) {\n\t\t\t\t\t\t\tif (goRight && this.state.lastDirection == \"goRight\") {\n\t\t\t\t\t\t\t} else if (goLeft && this.state.lastDirection == \"goLeft\") {\n\t\t\t\t\t\t\t} else if (selectedTabs.length > 1) {\n\t\t\t\t\t\t\t\t// console.log(\"turned back, last\", this.state.lastSelect, selectedTab);\n\t\t\t\t\t\t\t\tthis.select(this.state.lastSelect);\n\t\t\t\t\t\t\t\tthis.state.lastDirection = false;\n\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.state.lastDirection = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!this.state.lastDirection) {\n\t\t\t\t\t\t\tif (goRight) this.state.lastDirection = \"goRight\";\n\t\t\t\t\t\t\tif (goLeft) this.state.lastDirection = \"goLeft\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (var _w of this.state.windows) {\n\t\t\t\t\t\t\tif (found) break;\n\t\t\t\t\t\t\tif (_w.state != \"minimized\") {\n\t\t\t\t\t\t\t\tfor (var _t of _w.tabs) {\n\t\t\t\t\t\t\t\t\tlast = _t.id;\n\t\t\t\t\t\t\t\t\tif (!first) first = _t.id;\n\t\t\t\t\t\t\t\t\tif (!selectedTab) {\n\t\t\t\t\t\t\t\t\t\tif (!altKey) this.state.selection = {};\n\t\t\t\t\t\t\t\t\t\tthis.select(_t.id);\n\t\t\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t} else if (selectedTab == _t.id) {\n\t\t\t\t\t\t\t\t\t\t// console.log(\"select next one\", selectedNext);\n\t\t\t\t\t\t\t\t\t\tif (goRight) {\n\t\t\t\t\t\t\t\t\t\t\tselectedNext = true;\n\t\t\t\t\t\t\t\t\t\t} else if (prev) {\n\t\t\t\t\t\t\t\t\t\t\tif (!altKey) this.state.selection = {};\n\t\t\t\t\t\t\t\t\t\t\tthis.select(prev);\n\t\t\t\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else if (selectedNext) {\n\t\t\t\t\t\t\t\t\t\tif (!altKey) this.state.selection = {};\n\t\t\t\t\t\t\t\t\t\tthis.select(_t.id);\n\t\t\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tprev = _t.id;\n\t\t\t\t\t\t\t\t\t// console.log(_t, _t.id == selectedTab);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (var _w of this.state.windows) {\n\t\t\t\t\t\t\tif (found) break;\n\t\t\t\t\t\t\tif (_w.state == \"minimized\") {\n\t\t\t\t\t\t\t\tfor (var _t of _w.tabs) {\n\t\t\t\t\t\t\t\t\tlast = _t.id;\n\t\t\t\t\t\t\t\t\tif (!first) first = _t.id;\n\t\t\t\t\t\t\t\t\tif (!selectedTab) {\n\t\t\t\t\t\t\t\t\t\tif (!altKey) this.state.selection = {};\n\t\t\t\t\t\t\t\t\t\tthis.select(_t.id);\n\t\t\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t} else if (selectedTab == _t.id) {\n\t\t\t\t\t\t\t\t\t\tif (goRight) {\n\t\t\t\t\t\t\t\t\t\t\tselectedNext = true;\n\t\t\t\t\t\t\t\t\t\t} else if (prev) {\n\t\t\t\t\t\t\t\t\t\t\tif (!altKey) this.state.selection = {};\n\t\t\t\t\t\t\t\t\t\t\tthis.select(prev);\n\t\t\t\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else if (selectedNext) {\n\t\t\t\t\t\t\t\t\t\tif (!altKey) this.state.selection = {};\n\t\t\t\t\t\t\t\t\t\tthis.select(_t.id);\n\t\t\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tprev = _t.id;\n\t\t\t\t\t\t\t\t\t// console.log(_t, _t.id == selectedTab);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!found && goRight && first) {\n\t\t\t\t\t\t\tif (!altKey) this.state.selection = {};\n\t\t\t\t\t\t\tthis.select(first);\n\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!found && goLeft && last) {\n\t\t\t\t\t\t\tif (!altKey) this.state.selection = {};\n\t\t\t\t\t\t\tthis.select(last);\n\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (goUp || goDown) {\n\t\t\t\t\tvar selectedTabs = Object.keys(this.state.selection);\n\t\t\t\t\tif (selectedTabs.length > 1) {\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar found = false;\n\t\t\t\t\t\tvar selectedNext = false;\n\t\t\t\t\t\tvar selectedTab = -1;\n\t\t\t\t\t\tvar first = false;\n\t\t\t\t\t\tvar prev = false;\n\t\t\t\t\t\tvar last = false;\n\t\t\t\t\t\tvar tabPosition = -1;\n\t\t\t\t\t\tvar i = -1;\n\t\t\t\t\t\tif (selectedTabs.length == 1) {\n\t\t\t\t\t\t\tselectedTab = selectedTabs[0];\n\t\t\t\t\t\t\t// console.log(selectedTab);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (var _w of this.state.windows) {\n\t\t\t\t\t\t\ti = 0;\n\t\t\t\t\t\t\tif (found) break;\n\t\t\t\t\t\t\tif (_w.state != \"minimized\") {\n\t\t\t\t\t\t\t\tif (!first) first = _w.id;\n\t\t\t\t\t\t\t\tfor (var _t of _w.tabs) {\n\t\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\t\tlast = _w.id;\n\t\t\t\t\t\t\t\t\tif (!selectedTab) {\n\t\t\t\t\t\t\t\t\t\tthis.selectWindowTab(_w.id, tabPosition);\n\t\t\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t} else if (selectedTab == _t.id) {\n\t\t\t\t\t\t\t\t\t\ttabPosition = i;\n\t\t\t\t\t\t\t\t\t\t// console.log(\"found tab\", _w.id, _t.id, selectedTab, i);\n\t\t\t\t\t\t\t\t\t\tif (goDown) {\n\t\t\t\t\t\t\t\t\t\t\t// console.log(\"select next window \", selectedNext, tabPosition);\n\t\t\t\t\t\t\t\t\t\t\tselectedNext = true;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t} else if (prev) {\n\t\t\t\t\t\t\t\t\t\t\t// console.log(\"select prev window \", prev, tabPosition);\n\t\t\t\t\t\t\t\t\t\t\tthis.selectWindowTab(prev, tabPosition);\n\t\t\t\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else if (selectedNext) {\n\t\t\t\t\t\t\t\t\t\t// console.log(\"selecting next window \", _w.id, tabPosition);\n\t\t\t\t\t\t\t\t\t\tthis.selectWindowTab(_w.id, tabPosition);\n\t\t\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// console.log(_t, _t.id == selectedTab);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tprev = _w.id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (var _w of this.state.windows) {\n\t\t\t\t\t\t\ti = 0;\n\t\t\t\t\t\t\tif (found) break;\n\t\t\t\t\t\t\tif (_w.state == \"minimized\") {\n\t\t\t\t\t\t\t\tif (!first) first = _w.id;\n\t\t\t\t\t\t\t\tfor (var _t of _w.tabs) {\n\t\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\t\tlast = _w.id;\n\t\t\t\t\t\t\t\t\tif (!selectedTab) {\n\t\t\t\t\t\t\t\t\t\tthis.selectWindowTab(_w.id, tabPosition);\n\t\t\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t} else if (selectedTab == _t.id) {\n\t\t\t\t\t\t\t\t\t\ttabPosition = i;\n\t\t\t\t\t\t\t\t\t\t// console.log(\"found tab\", _w.id, _t.id, selectedTab, i);\n\t\t\t\t\t\t\t\t\t\tif (goDown) {\n\t\t\t\t\t\t\t\t\t\t\t// console.log(\"select next window \", selectedNext, tabPosition);\n\t\t\t\t\t\t\t\t\t\t\tselectedNext = true;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t} else if (prev) {\n\t\t\t\t\t\t\t\t\t\t\t// console.log(\"select prev window \", prev, tabPosition);\n\t\t\t\t\t\t\t\t\t\t\tthis.selectWindowTab(prev, tabPosition);\n\t\t\t\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else if (selectedNext) {\n\t\t\t\t\t\t\t\t\t\t// console.log(\"selecting next window \", _w.id, tabPosition);\n\t\t\t\t\t\t\t\t\t\tthis.selectWindowTab(_w.id, tabPosition);\n\t\t\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// console.log(_t, _t.id == selectedTab);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tprev = _w.id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// console.log(found, goDown, first);\n\t\t\t\t\t\tif (!found && goDown && first) {\n\t\t\t\t\t\t\t// console.log(\"go first\", first);\n\t\t\t\t\t\t\tthis.state.selection = {};\n\t\t\t\t\t\t\tthis.selectWindowTab(first, tabPosition);\n\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// console.log(found, goUp, last);\n\t\t\t\t\t\tif (!found && goUp && last) {\n\t\t\t\t\t\t\t// console.log(\"go last\", last);\n\t\t\t\t\t\t\tthis.state.selection = {};\n\t\t\t\t\t\t\tthis.selectWindowTab(last, tabPosition);\n\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// page up / page down\n\t\tif (e.keyCode == 33 || e.keyCode == 34) {\n\t\t\tif (document.activeElement != this.refs.windowcontainer) {\n\t\t\t\tthis.refs.windowcontainer.focus();\n\t\t\t}\n\t\t}\n\t}\n\tselectWindowTab(windowId, tabPosition) {\n\t\tif (!tabPosition || tabPosition < 1) tabPosition = 1;\n\t\tfor (var _w of this.state.windows) {\n\t\t\tif (_w.id != windowId) continue;\n\t\t\tvar i = 0;\n\t\t\tfor (var _t of _w.tabs) {\n\t\t\t\ti++;\n\t\t\t\tif ((_w.tabs.length >= tabPosition && tabPosition == i) || (_w.tabs.length < tabPosition && _w.tabs.length == i)) {\n\t\t\t\t\tthis.state.selection = {};\n\t\t\t\t\tthis.select(_t.id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tscrollTo(what, id) {\n\t\tvar els = document.getElementById(what + \"-\" + id);\n\t\tif (!!els) {\n\t\t\tif (!this.elVisible(els)) {\n\t\t\t\tels.scrollIntoView({ behavior: this.state.animations ? \"smooth\" : \"instant\", block: \"center\", inline: \"nearest\" });\n\t\t\t}\n\t\t}\n\t}\n\tasync changelayout(layout) {\n\t\tvar newLayout;\n\t\tif (layout && typeof (layout) == \"string\") {\n\t\t\tnewLayout = layout;\n\t\t} else {\n\t\t\tif (this.state.layout == \"blocks\") {\n\t\t\t\tnewLayout = this.state.layout = \"blocks-big\";\n\t\t\t} else if (this.state.layout == \"blocks-big\") {\n\t\t\t\tnewLayout = this.state.layout = \"horizontal\";\n\t\t\t} else if (this.state.layout == \"horizontal\") {\n\t\t\t\tnewLayout = this.state.layout = \"vertical\";\n\t\t\t} else {\n\t\t\t\tnewLayout = this.state.layout = \"blocks\";\n\t\t\t}\n\t\t}\n\t\tthis.state.layout = newLayout;\n\t\tawait setLocalStorage(\"layout\", newLayout);\n\n\t\tthis.setState({\n\t\t\tlayout: newLayout,\n\t\t\ttopText: \"Switched to \" + this.readablelayout(this.state.layout) + \" view\",\n\t\t\tbottomText: \" \"\n\t\t});\n\n\t\tthis.forceUpdate();\n\t}\n\tnextlayout() {\n\t\tif (this.state.layout == \"blocks\") {\n\t\t\treturn \"blocks-big\";\n\t\t} else if (this.state.layout == \"blocks-big\") {\n\t\t\treturn \"horizontal\";\n\t\t} else if (this.state.layout == \"horizontal\") {\n\t\t\treturn \"vertical\";\n\t\t} else {\n\t\t\treturn \"blocks\";\n\t\t}\n\t}\n\treadablelayout(layout) {\n\t\tif (layout == \"blocks\") {\n\t\t\treturn \"Block\";\n\t\t} else if (layout == \"blocks-big\") {\n\t\t\treturn \"Big Block\";\n\t\t} else if (layout == \"horizontal\") {\n\t\t\treturn \"Horizontal\";\n\t\t} else {\n\t\t\treturn \"Vertical\";\n\t\t}\n\t}\n\tselect(id) {\n\t\tif (this.state.selection[id]) {\n\t\t\tdelete this.state.selection[id];\n\t\t\tthis.setState({\n\t\t\t\tlastSelect: id\n\t\t\t});\n\t\t} else {\n\t\t\tthis.state.selection[id] = true;\n\t\t\tthis.setState({\n\t\t\t\tlastSelect: id\n\t\t\t});\n\t\t}\n\t\tthis.scrollTo('tab', id);\n\t\tvar tab = this.state.tabsbyid[id];\n\t\tif(this.refs['window' + tab.windowId] && this.refs['window' + tab.windowId].refs['tab' + id]) {\n\t\t\tthis.refs['window' + tab.windowId].refs['tab' + id].resolveFavIconUrl();\n\t\t}\n\n\t\tvar selected = Object.keys(this.state.selection).length;\n\t\tif (selected == 0) {\n\t\t\tthis.setState({\n\t\t\t\ttopText: \"No tabs selected\",\n\t\t\t\tbottomText: \" \"\n\t\t\t});\n\t\t} else if (selected == 1) {\n\t\t\tthis.setState({\n\t\t\t\ttopText: \"Selected \" + selected + \" tab\",\n\t\t\t\tbottomText: \"Press enter to switch to it\"\n\t\t\t});\n\t\t} else {\n\t\t\tthis.setState({\n\t\t\t\ttopText: \"Selected \" + selected + \" tabs\",\n\t\t\t\tbottomText: \"Press enter to move them to a new window\"\n\t\t\t});\n\t\t}\n\t}\n\tselectTo(id, tabs) {\n\t\tvar activate = false;\n\t\tvar lastSelect = this.state.lastSelect;\n\t\tif (id == lastSelect) {\n\t\t\tthis.select(id);\n\t\t\treturn;\n\t\t}\n\t\tif (!!lastSelect) {\n\t\t\tif (this.state.selection[lastSelect]) {\n\t\t\t\tactivate = true;\n\t\t\t}\n\t\t} else {\n\t\t\tif (this.state.selection[id]) {\n\t\t\t\tactivate = false;\n\t\t\t} else {\n\t\t\t\tactivate = true;\n\t\t\t}\n\t\t}\n\n\t\tvar rangeIndex1;\n\t\tvar rangeIndex2;\n\t\tfor (var i = 0; i < tabs.length; i++) {\n\t\t\tif (tabs[i].id == id) {\n\t\t\t\trangeIndex1 = i;\n\t\t\t}\n\t\t\tif (!!lastSelect && tabs[i].id == lastSelect) {\n\t\t\t\trangeIndex2 = i;\n\t\t\t}\n\t\t}\n\t\tif (!!lastSelect && !rangeIndex2) {\n\t\t\tthis.select(id);\n\t\t\treturn;\n\t\t}\n\t\tif (!rangeIndex2) {\n\t\t\tvar neighbours = [];\n\t\t\tfor (var i = 0; i < tabs.length; i++) {\n\t\t\t\tvar tabId = tabs[i].id;\n\t\t\t\tif (tabId != id) {\n\t\t\t\t\tif (this.state.selection[tabId]) {\n\t\t\t\t\t\tneighbours.push(tabId);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (activate) {\n\t\t\t\t// find closest selected item that's not connected\n\t\t\t\tvar leftSibling = 0;\n\t\t\t\tvar rightSibling = tabs.length - 1;\n\t\t\t\tfor (var i = 0; i < rangeIndex1; i++) {\n\t\t\t\t\tif (neighbours.indexOf(i) > -1) {\n\t\t\t\t\t\tleftSibling = i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (var i = tabs.length - 1; i > rangeIndex1; i--) {\n\t\t\t\t\tif (neighbours.indexOf(i) > -1) {\n\t\t\t\t\t\trightSibling = i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar diff1 = rangeIndex1 - leftSibling;\n\t\t\t\tvar diff2 = rightSibling - rangeIndex1;\n\t\t\t\tif (diff1 > diff2) {\n\t\t\t\t\trangeIndex2 = rightSibling;\n\t\t\t\t} else {\n\t\t\t\t\trangeIndex2 = leftSibling;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// find furthest selected item that's connected\n\t\t\t\tvar leftSibling = rangeIndex1;\n\t\t\t\tvar rightSibling = rangeIndex1;\n\t\t\t\tfor (var i = rangeIndex1; i > 0; i--) {\n\t\t\t\t\tif (neighbours.indexOf(i) > -1) {\n\t\t\t\t\t\tleftSibling = i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (var i = rangeIndex1; i < tabs.length; i++) {\n\t\t\t\t\tif (neighbours.indexOf(i) > -1) {\n\t\t\t\t\t\trightSibling = i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar diff1 = rangeIndex1 - leftSibling;\n\t\t\t\tvar diff2 = rightSibling - rangeIndex1;\n\t\t\t\tif (diff1 > diff2) {\n\t\t\t\t\trangeIndex2 = leftSibling;\n\t\t\t\t} else {\n\t\t\t\t\trangeIndex2 = rightSibling;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.setState({\n\t\t\tlastSelect: tabs[rangeIndex2].id\n\t\t});\n\t\tif (rangeIndex2 < rangeIndex1) {\n\t\t\tvar r1 = rangeIndex2;\n\t\t\tvar r2 = rangeIndex1;\n\t\t\trangeIndex1 = r1;\n\t\t\trangeIndex2 = r2;\n\t\t}\n\n\t\tfor (var i = 0; i < tabs.length; i++) {\n\t\t\tif (i >= rangeIndex1 && i <= rangeIndex2) {\n\t\t\t\tvar tabId = tabs[i].id;\n\t\t\t\tif (activate) {\n\t\t\t\t\tthis.state.selection[tabId] = true;\n\t\t\t\t} else {\n\t\t\t\t\tdelete this.state.selection[tabId];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.scrollTo('tab', this.state.lastSelect);\n\n\t\tvar selected = Object.keys(this.state.selection).length;\n\t\tif (selected == 0) {\n\t\t\tthis.setState({\n\t\t\t\ttopText: \"No tabs selected\",\n\t\t\t\tbottomText: \" \"\n\t\t\t});\n\t\t} else if (selected == 1) {\n\t\t\tthis.setState({\n\t\t\t\ttopText: \"Selected \" + selected + \" tab\",\n\t\t\t\tbottomText: \"Press enter to switch to it\"\n\t\t\t});\n\t\t} else {\n\t\t\tthis.setState({\n\t\t\t\ttopText: \"Selected \" + selected + \" tabs\",\n\t\t\t\tbottomText: \"Press enter to move them to a new window\"\n\t\t\t});\n\t\t}\n\t\tthis.forceUpdate();\n\t}\n\tdrag(e, id) {\n\t\tif (!this.state.selection[id]) {\n\t\t\tthis.state.selection = {};\n\t\t\tthis.state.selection[id] = true;\n\t\t\tthis.state.lastSelect = id;\n\t\t}\n\t\tthis.forceUpdate();\n\t}\n\tasync drop(id, before) {\n\t\tvar _this5 = this;\n\t\tvar tab = this.state.tabsbyid[id];\n\t\tvar tabs = Object.keys(this.state.selection).map(function(id) {\n\t\t\treturn _this5.state.tabsbyid[id];\n\t\t});\n\t\tvar index = tab.index + (before ? 0 : 1);\n\n\t\tfor (var i = 0; i < tabs.length; i++) {\n\t\t\tvar t = tabs[i];\n\t\t\tawait browser.tabs.move(t.id, { windowId: tab.windowId, index: index });\n\t\t\tawait browser.tabs.update(t.id, { pinned: t.pinned });\n\t\t}\n\t\tthis.setState({\n\t\t\tselection: {}\n\t\t});\n\t\tthis.update();\n\t}\n\tasync dropWindow(windowId) {\n\t\tvar _this6 = this;\n\t\tvar tabs = Object.keys(this.state.selection).map(function(id) {\n\t\t\treturn _this6.state.tabsbyid[id];\n\t\t});\n\n\t\tbrowser.runtime.sendMessage({command: \"move_tabs_to_window\", window_id: windowId, tabs: tabs});\n\n\t\tthis.setState({\n\t\t\tselection: {}\n\t\t});\n\t}\n\tasync changeTabLimit(e) {\n\t\tthis.state.tabLimit = e.target.value;\n\t\tawait setLocalStorage(\"tabLimit\", this.state.tabLimit);\n\t\tthis.tabLimitText();\n\t\tthis.forceUpdate();\n\t}\n\ttabLimitText() {\n\t\tthis.setState({\n\t\t\tbottomText: \"Limit the number of tabs per window. Will move new tabs into a new window instead. 0 to turn off\"\n\t\t});\n\t}\n\tasync changeTabWidth(e) {\n\t\tthis.state.tabWidth = e.target.value;\n\t\tawait setLocalStorage(\"tabWidth\", this.state.tabWidth);\n\t\tdocument.body.style.width = this.state.tabWidth + \"px\";\n\t\tthis.tabWidthText();\n\t\tthis.forceUpdate();\n\t}\n\ttabWidthText() {\n\t\tthis.setState({\n\t\t\tbottomText: \"Change the width of this window. 800 by default.\"\n\t\t});\n\t}\n\tasync changeTabHeight(e) {\n\t\tthis.state.tabHeight = e.target.value;\n\t\tawait setLocalStorage(\"tabHeight\", this.state.tabHeight);\n\t\tdocument.body.style.height = this.state.tabHeight + \"px\";\n\t\tthis.tabHeightText();\n\t\tthis.forceUpdate();\n\t}\n\ttabHeightText() {\n\t\tthis.setState({\n\t\t\tbottomText: \"Change the height of this window. 600 by default.\"\n\t\t});\n\t}\n\tasync toggleAnimations() {\n\t\tthis.state.animations = !this.state.animations;\n\t\tawait setLocalStorage(\"animations\", this.state.animations);\n\t\tthis.animationsText();\n\t\tthis.forceUpdate();\n\t}\n\tanimationsText() {\n\t\tthis.setState({\n\t\t\tbottomText: \"Enables/disables animations. Default : on\"\n\t\t});\n\t}\n\tasync toggleWindowTitles() {\n\t\tthis.state.windowTitles = !this.state.windowTitles;\n\t\tawait setLocalStorage(\"windowTitles\", this.state.windowTitles);\n\t\tthis.windowTitlesText();\n\t\tthis.forceUpdate();\n\t}\n\twindowTitlesText() {\n\t\tthis.setState({\n\t\t\tbottomText: \"Enables/disables window titles. Default : on\"\n\t\t});\n\t}\n\tasync toggleCompact() {\n\t\tthis.state.compact = !this.state.compact;\n\t\tawait setLocalStorage(\"compact\", this.state.compact);\n\t\tthis.compactText();\n\t\tthis.forceUpdate();\n\t}\n\tcompactText() {\n\t\tthis.setState({\n\t\t\tbottomText: \"Compact mode is a more compressed layout. Default : off\"\n\t\t});\n\t}\n\tasync toggleDark() {\n\t\tthis.state.dark = !this.state.dark;\n\t\tawait setLocalStorage(\"dark\", this.state.dark);\n\t\tthis.darkText();\n\t\tif (this.state.dark) {\n\t\t\tdocument.body.className = \"dark\";\n\t\t\tdocument.documentElement.className = \"dark\";\n\t\t} else {\n\t\t\tdocument.body.className = \"\";\n\t\t\tdocument.documentElement.className = \"\";\n\t\t}\n\t\tthis.forceUpdate();\n\t}\n\tdarkText() {\n\t\tthis.setState({\n\t\t\tbottomText: \"Dark mode inverts the layout - better on the eyes. Default : off\"\n\t\t});\n\t}\n\tasync toggleTabActions() {\n\t\tthis.state.tabactions = !this.state.tabactions;\n\t\tawait setLocalStorage(\"tabactions\", this.state.tabactions);\n\t\tthis.tabActionsText();\n\t\tthis.forceUpdate();\n\t}\n\ttabActionsText() {\n\t\tthis.setState({\n\t\t\tbottomText: \"Adds 'Open a new tab' and 'Close this window' option to each window. Default : on\"\n\t\t});\n\t}\n\tasync toggleBadge() {\n\t\tthis.state.badge = !this.state.badge;\n\t\tawait setLocalStorage(\"badge\", this.state.badge);\n\t\tthis.badgeText();\n\t\tbrowser.runtime.sendMessage({command: \"update_tab_count\"});\n\t\tthis.forceUpdate();\n\t}\n\tbadgeText() {\n\t\tthis.setState({\n\t\t\tbottomText: \"Shows the number of open tabs on the Tab Manager icon. Default : on\"\n\t\t});\n\t}\n\tasync toggleOpenInOwnTab() {\n\t\tthis.state.openInOwnTab = !this.state.openInOwnTab;\n\t\tawait setLocalStorage(\"openInOwnTab\", this.state.openInOwnTab);\n\t\tthis.openInOwnTabText();\n\t\tbrowser.runtime.sendMessage({ command: \"reload_popup_controls\" });\n\t\tthis.forceUpdate();\n\t}\n\topenInOwnTabText() {\n\t\tthis.setState({\n\t\t\tbottomText: \"Open the Tab Manager by default in own tab, or as a popup?\"\n\t\t});\n\t}\n\tasync toggleSessions() {\n\t\tthis.state.sessionsFeature = !this.state.sessionsFeature;\n\t\tawait setLocalStorage(\"sessionsFeature\", this.state.sessionsFeature);\n\t\tthis.sessionsText();\n\t\tthis.forceUpdate();\n\t}\n\tsessionsText() {\n\t\tthis.setState({\n\t\t\tbottomText: \"Allows you to save/restore windows into sessions. ( Tab History will be lost ) Default : off\"\n\t\t});\n\t}\n\texportSessions() {\n\t\tif (this.state.sessions.length == 0) {\n\t\t\twindow.alert(\"You have currently no windows saved for later. There is nothing to export.\");\n\t\t\treturn;\n\t\t}\n\t\tvar exportName = \"tab-manager-plus-backup\";\n\t\tvar today = new Date();\n\t\tvar y = today.getFullYear();\n\t\t// JavaScript months are 0-based.\n\t\tvar m = (\"0\" + (today.getMonth() + 1)).slice(-2);\n\t\tvar d = (\"0\" + today.getDate()).slice(-2);\n\t\tvar h = (\"0\" + today.getHours()).slice(-2);\n\t\tvar mi = (\"0\" + today.getMinutes()).slice(-2);\n\t\tvar s = (\"0\" + today.getSeconds()).slice(-2);\n\t\texportName += \"-\" + y + m + d + \"-\" + h + mi + \"-\" + s;\n\t\tvar dataStr = \"data:text/json;charset=utf-8,\" + encodeURIComponent(JSON.stringify(this.state.sessions, null, 2));\n\t\tvar downloadAnchorNode = document.createElement(\"a\");\n\t\tdownloadAnchorNode.setAttribute(\"href\", dataStr);\n\t\tdownloadAnchorNode.setAttribute(\"download\", exportName + \".json\");\n\t\tdocument.body.appendChild(downloadAnchorNode); // required for firefox\n\t\tdownloadAnchorNode.click();\n\t\tdownloadAnchorNode.remove();\n\t\tthis.exportSessionsText();\n\t\tthis.forceUpdate();\n\t}\n\texportSessionsText() {\n\t\tthis.setState({\n\t\t\tbottomText: \"Allows you to export your saved windows to an external backup\"\n\t\t});\n\t}\n\timportSessions(evt) {\n\t\tif (navigator.userAgent.search(\"Firefox\") > -1) {\n\t\t\tif(window.inPopup) {\n\t\t\t\twindow.alert(\"Due to a Firefox bug session import does not work in the popup. Please use the options screen or open Tab Manager Plus in its' own tab\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\tlet inputField = evt.target; // #session_import\n\t\t\tlet files = evt.target.files;\n\t\t\tif (!files.length) {\n\t\t\t\talert(\"No file selected!\");\n\t\t\t\tthis.setState({ bottomText: \"Error: Could not read the backup file!\" });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet file = files[0];\n\t\t\tlet reader = new FileReader();\n\t\t\tconst self = this;\n\t\t\treader.onload = async event => {\n\t\t\t\t//console.log('FILE CONTENT', event.target.result);\n\t\t\t\tvar backupFile;\n\t\t\t\ttry {\n\t\t\t\t\tbackupFile = JSON.parse(event.target.result);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tconsole.error(err);\n\t\t\t\t\twindow.alert(err);\n\t\t\t\t\tthis.setState({ bottomText: \"Error: Could not read the backup file!\" });\n\t\t\t\t}\n\t\t\t\tif (!!backupFile && backupFile.length > 0) {\n\t\t\t\t\tvar success = backupFile.length;\n\t\t\t\t\tfor (var i = 0; i < backupFile.length; i++) {\n\t\t\t\t\t\tvar newSession = backupFile[i];\n\t\t\t\t\t\tif (newSession.windowsInfo && newSession.tabs && newSession.id) {\n\t\t\t\t\t\t\tvar sessions = await getLocalStorage('sessions', {});\n\t\t\t\t\t\t\tsessions[newSession.id] = newSession;\n\t\t\t\t\t\t\t//this.state.sessions.push(obj);\n\n\t\t\t\t\t\t\tvar value = await setLocalStorage('sessions', sessions).catch(function(err) {\n\t\t\t\t\t\t\t\tconsole.log(err);\n\t\t\t\t\t\t\t\tconsole.error(err.message);\n\t\t\t\t\t\t\t\tsuccess--;\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t//console.log(value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.setState({ bottomText: success + \" windows successfully restored!\" });\n\t\t\t\t} else {\n\t\t\t\t\tthis.setState({ bottomText: \"Error: Could not restore any windows from the backup file!\" });\n\t\t\t\t}\n\t\t\t\tinputField.value = \"\";\n\t\t\t\tthis.sessionSync();\n\t\t\t};\n\t\t\treader.readAsText(file);\n\t\t} catch (err) {\n\t\t\tconsole.error(err);\n\t\t\twindow.alert(err);\n\t\t}\n\t\tthis.importSessionsText();\n\t\tthis.forceUpdate();\n\t}\n\timportSessionsText() {\n\t\tthis.setState({\n\t\t\tbottomText: \"Allows you to restore your saved windows from an external backup\"\n\t\t});\n\t}\n\tasync toggleHide() {\n\n\t\tif (navigator.userAgent.search(\"Firefox\") > -1) {\n\t\t\tthis.state.hideWindows = false;\n\t\t} else {\n\t\t\tvar granted = await browser.permissions.request({ permissions: [\"system.display\"] });\n\t\t\tif (granted) {\n\t\t\t\tthis.state.hideWindows = !this.state.hideWindows;\n\t\t\t} else {\n\t\t\t\tthis.state.hideWindows = false;\n\t\t\t}\n\t\t}\n\n\t\tawait setLocalStorage(\"hideWindows\", this.state.hideWindows);\n\t\tthis.hideText();\n\t\tthis.forceUpdate();\n\t}\n\thideText() {\n\t\tthis.setState({\n\t\t\tbottomText: \"Automatically minimizes inactive chrome windows. Default : off\"\n\t\t});\n\t}\n\tasync toggleFilterMismatchedTabs() {\n\t\tthis.state.filterTabs = !this.state.filterTabs;\n\t\tawait setLocalStorage(\"filter-tabs\", this.state.filterTabs);\n\t\tthis.forceUpdate();\n\t}\n\tgetTip() {\n\t\tvar tips = [\n\t\t\t\"You can right click on a tab to select it\",\n\t\t\t\"Press enter to move all selected tabs to a new window\",\n\t\t\t\"Middle click to close a tab\",\n\t\t\t\"Tab Manager Plus loves saving time\",\n\t\t\t\"To see incognito tabs, enable incognito access in the extension settings\",\n\t\t\t\"You can drag and drop tabs to other windows\",\n\t\t\t\"You can type to search right away\",\n\t\t\t\"You can search for different tabs : google OR yahoo\"\n\t\t];\n\n\t\treturn \"Tip: \" + tips[Math.floor(Math.random() * tips.length)];\n\t}\n\tisInViewport(element, ofElement) {\n\t\tvar rect = element.getBoundingClientRect();\n\t\treturn rect.top >= 0 && rect.left >= 0 && rect.bottom <= ofElement.height && rect.right <= ofElement.width;\n\t}\n\telVisible(elem) {\n\t\tif (!(elem instanceof Element)) throw Error(\"DomUtil: elem is not an element.\");\n\t\tvar style = getComputedStyle(elem);\n\t\tif (style.display === \"none\") return false;\n\t\tif (style.visibility !== \"visible\") return false;\n\t\tif (style.opacity < 0.1) return false;\n\t\tif (elem.offsetWidth + elem.offsetHeight + elem.getBoundingClientRect().height + elem.getBoundingClientRect().width === 0) {\n\t\t\treturn false;\n\t\t}\n\t\tvar elemCenter = {\n\t\t\tx: elem.getBoundingClientRect().left + elem.offsetWidth / 2,\n\t\t\ty: elem.getBoundingClientRect().top + elem.offsetHeight / 2\n\t\t};\n\n\t\tif (elemCenter.x < 0) return false;\n\t\tif (elemCenter.x > (document.documentElement.clientWidth || window.innerWidth)) return false;\n\t\tif (elemCenter.y < 0) return false;\n\t\tif (elemCenter.y > (document.documentElement.clientHeight || window.innerHeight)) return false;\n\t\tvar pointContainer = document.elementFromPoint(elemCenter.x, elemCenter.y);\n\t\tdo {\n\t\t\tif (pointContainer === elem) return true;\n\t\t} while ((pointContainer = pointContainer.parentNode));\n\t\treturn false;\n\t}\n}\n\nfunction debounce(func, wait, immediate) {\n\tvar timeout;\n\treturn function() {\n\t\tvar context = this,\n\t\t\targs = arguments;\n\t\tvar later = function later() {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t};\n\t\tvar callNow = immediate && !timeout;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(later, wait);\n\t\tif (callNow) func.apply(context, args);\n\t};\n}\n\nconst maybePluralize = (count, noun, suffix = 's') =>\n `${count} ${noun}${count !== 1 ? suffix : ''}`;"]} \ No newline at end of file diff --git a/outlib/popup/views/TabOptions.js b/outlib/popup/views/TabOptions.js deleted file mode 100644 index d8e0d0b2..00000000 --- a/outlib/popup/views/TabOptions.js +++ /dev/null @@ -1,734 +0,0 @@ -"use strict"; - -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; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(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; } - -function _inherits(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 TabOptions = function (_React$Component) { - _inherits(TabOptions, _React$Component); - - function TabOptions(props) { - _classCallCheck(this, TabOptions); - - var _this = _possibleConstructorReturn(this, (TabOptions.__proto__ || Object.getPrototypeOf(TabOptions)).call(this, props)); - - _this.state = {}; - return _this; - } - - _createClass(TabOptions, [{ - key: "logo", - value: function logo() { - var logo = [React.createElement("img", { src: "images/browsers.svg", style: { maxWidth: "3rem" } }), React.createElement( - "h2", - null, - "Tab Manager Plus ", - "5.3.1" - )]; - - return React.createElement( - "div", - { className: "logo-options" }, - React.createElement( - "div", - { className: "logo-box" }, - logo - ) - ); - } - }, { - key: "optionsSection", - value: function optionsSection() { - var opts = [React.createElement( - "div", - { className: "optionsBox" }, - React.createElement( - "h4", - null, - "Tab options" - ), - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement("input", { - type: "number", - onMouseEnter: this.props.tabLimitText, - onChange: this.props.changeTabLimit, - value: this.props.tabLimit, - id: "enable_tabLimit", - name: "enable_tabLimit" - }), - React.createElement("label", { onMouseEnter: this.props.tabLimitText, htmlFor: "enable_tabLimit", style: { whiteSpace: "pre", lineHeight: "2rem" } }), - React.createElement( - "label", - { className: "textlabel", htmlFor: "enable_tabLimit", style: { textAlign: "", whiteSpace: "pre", lineHeight: "2rem" } }, - "Limit Tabs Per Window" - ), - React.createElement( - "div", - { className: "option-description" }, - "Once you reach this number of tabs, Tab Manager will move new tabs to a new window instead. No more windows with 60 tabs open!", - React.createElement("br", null), - React.createElement( - "i", - null, - "By default: 0 ( disabled )" - ), - React.createElement("br", null), - React.createElement( - "i", - null, - "Suggested value: 15" - ) - ) - ) - ), React.createElement( - "div", - { className: "optionsBox" }, - React.createElement( - "h4", - null, - "Popup size" - ), - React.createElement( - "div", - { className: "option-description" }, - "You can resize the popup here up to a maximum size of 800x600. This limitation is a browser limitation, and we cannot display a bigger popup due to this. If you want to have a better overview, instead you can right click on the Tab Manager Plus icon, and `open in own tab`. This will open the Tab Manager in a new tab." - ), - React.createElement( - "div", - { className: "toggle-box half-size float-right" }, - React.createElement( - "label", - { className: "textlabel", htmlFor: "enable_tabWidth", style: { textAlign: "", whiteSpace: "pre", lineHeight: "2rem" } }, - "Popup Width" - ), - React.createElement("input", { - type: "number", - min: "450", - max: "800", - step: "25", - onMouseEnter: this.props.tabWidthText, - onChange: this.props.changeTabWidth, - value: this.props.tabWidth, - id: "enable_tabWidth", - name: "enable_tabWidth" - }), - React.createElement("label", { onMouseEnter: this.props.tabWidthText, htmlFor: "enable_tabWidth", style: { whiteSpace: "pre", lineHeight: "2rem" } }) - ), - React.createElement( - "div", - { className: "toggle-box half-size" }, - React.createElement( - "label", - { className: "textlabel", htmlFor: "enable_tabHeight", style: { textAlign: "", whiteSpace: "pre", lineHeight: "2rem" } }, - "Popup Height" - ), - React.createElement("input", { - type: "number", - min: "400", - max: "600", - step: "25", - onMouseEnter: this.props.tabHeightText, - onChange: this.props.changeTabHeight, - value: this.props.tabHeight, - id: "enable_tabHeight", - name: "enable_tabHeight" - }), - React.createElement("label", { onMouseEnter: this.props.tabHeightText, htmlFor: "enable_tabHeight", style: { whiteSpace: "pre", lineHeight: "2rem" } }) - ) - ), React.createElement( - "div", - { className: "optionsBox" }, - React.createElement( - "h4", - null, - "Window style" - ), - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "div", - { className: "toggle" }, - React.createElement("input", { - type: "checkbox", - onMouseEnter: this.props.darkText, - onChange: this.props.toggleDark, - checked: this.props.dark, - id: "dark_mode", - name: "dark_mode" - }), - React.createElement("label", { onMouseEnter: this.props.darkText, htmlFor: "dark_mode", style: { whiteSpace: "pre", lineHeight: "2rem" } }) - ), - React.createElement( - "label", - { className: "textlabel", htmlFor: "dark_mode", style: { whiteSpace: "pre", lineHeight: "2rem" } }, - "Dark mode" - ), - React.createElement( - "div", - { className: "option-description" }, - "Dark mode, for working at night time. ", - React.createElement("br", null), - React.createElement( - "i", - null, - "By default: disabled" - ) - ) - ), - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "div", - { className: "toggle" }, - React.createElement("input", { - type: "checkbox", - onMouseEnter: this.props.compactText, - onChange: this.props.toggleCompact, - checked: this.props.compact, - id: "compact_mode", - name: "compact_mode" - }), - React.createElement("label", { onMouseEnter: this.props.compactText, htmlFor: "compact_mode", style: { whiteSpace: "pre", lineHeight: "2rem" } }) - ), - React.createElement( - "label", - { className: "textlabel", htmlFor: "compact_mode", style: { whiteSpace: "pre", lineHeight: "2rem" } }, - "Compact mode" - ), - React.createElement( - "div", - { className: "option-description" }, - "Saves a little bit of space around the icons. Makes it less beautiful, but more space efficient. ", - React.createElement("br", null), - React.createElement( - "i", - null, - "By default: disabled" - ) - ) - ), - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "div", - { className: "toggle" }, - React.createElement("input", { - type: "checkbox", - onMouseEnter: this.props.animationsText, - onChange: this.props.toggleAnimations, - checked: this.props.animations, - id: "enable_animations", - name: "enable_animations" - }), - React.createElement("label", { onMouseEnter: this.props.animationsText, htmlFor: "enable_animations", style: { whiteSpace: "pre", lineHeight: "2rem" } }) - ), - React.createElement( - "label", - { className: "textlabel", htmlFor: "enable_animations", style: { whiteSpace: "pre", lineHeight: "2rem" } }, - "Animations" - ), - React.createElement( - "div", - { className: "option-description" }, - "Disables/enables animations and transitions in the popup. ", - React.createElement("br", null), - React.createElement( - "i", - null, - "By default: enabled" - ) - ) - ), - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "div", - { className: "toggle" }, - React.createElement("input", { - type: "checkbox", - onMouseEnter: this.props.windowTitlesText, - onChange: this.props.toggleWindowTitles, - checked: this.props.windowTitles, - id: "enable_windowTitles", - name: "enable_windowTitles" - }), - React.createElement("label", { onMouseEnter: this.props.windowTitlesText, htmlFor: "enable_windowTitles", style: { whiteSpace: "pre", lineHeight: "2rem" } }) - ), - React.createElement( - "label", - { className: "textlabel", htmlFor: "enable_windowTitles", style: { whiteSpace: "pre", lineHeight: "2rem" } }, - "Window titles" - ), - React.createElement( - "div", - { className: "option-description" }, - "Disables/enables window titles. ", - React.createElement("br", null), - React.createElement( - "i", - null, - "By default: enabled" - ) - ) - ) - ), React.createElement( - "div", - { className: "optionsBox" }, - React.createElement( - "h4", - null, - "Session Management" - ), - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "div", - { className: "toggle" }, - React.createElement("input", { - type: "checkbox", - onMouseEnter: this.props.sessionsText, - onChange: this.props.toggleSessions, - checked: this.props.sessionsFeature, - id: "session_mode", - name: "session_mode" - }), - React.createElement("label", { onMouseEnter: this.props.sessionsText, htmlFor: "session_mode", style: { whiteSpace: "pre", lineHeight: "2rem" } }) - ), - React.createElement( - "label", - { className: "textlabel", htmlFor: "session_mode", style: { whiteSpace: "pre", lineHeight: "2rem" } }, - "Save Windows for Later" - ), - React.createElement( - "div", - { className: "option-description" }, - "Allows you to save windows as sessions ( saved windows ). You can restore these saved windows later on. The restored windows won't have the history restored. This feature is currently in beta.", - React.createElement("br", null), - React.createElement( - "i", - null, - "By default: disabled ( experimental feature )" - ) - ) - ), - this.props.sessionsFeature && React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "label", - { className: "textlabel", htmlFor: "session_export", style: { whiteSpace: "pre", lineHeight: "2rem" } }, - React.createElement( - "h4", - null, - "Export/Backup Sessions" - ) - ), - React.createElement( - "button", - { type: "button", onMouseEnter: this.props.exportSessionsText, onClick: this.props.exportSessions, id: "session_export", name: "session_export" }, - "Export/Backup Sessions" - ), - React.createElement("label", { onMouseEnter: this.props.exportSessionsText, htmlFor: "session_export", style: { whiteSpace: "pre", lineHeight: "2rem" } }) - ), - React.createElement( - "div", - { className: "option-description" }, - "Allows you to backup your saved windows to an external file." - ) - ), - this.props.sessionsFeature && React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "label", - { className: "textlabel", htmlFor: "session_import", style: { whiteSpace: "pre", lineHeight: "2rem" } }, - React.createElement( - "h4", - null, - "Import/Restore Sessions" - ) - ), - React.createElement("input", { - type: "file", - accept: "application/json", - onMouseEnter: this.props.importSessionsText, - onChange: this.props.importSessions, - id: "session_import", - name: "session_import", - placeholder: "Import/Restore Sessions" - }), - React.createElement("label", { onMouseEnter: this.props.importSessionsText, htmlFor: "session_import", style: { whiteSpace: "pre", lineHeight: "2rem" } }) - ), - React.createElement( - "div", - { className: "option-description" }, - "Allows you to restore your backup from an external file. The restored windows will be added to your current saved windows." - ) - ) - ), React.createElement( - "div", - { className: "optionsBox" }, - React.createElement( - "h4", - null, - "Popup icon" - ), - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "div", - { className: "toggle" }, - React.createElement("input", { - type: "checkbox", - onMouseEnter: this.props.badgeText, - onChange: this.props.toggleBadge, - checked: this.props.badge, - id: "badge_mode", - name: "badge_mode" - }), - React.createElement("label", { onMouseEnter: this.props.badgeText, htmlFor: "badge_mode", style: { whiteSpace: "pre", lineHeight: "2rem" } }) - ), - React.createElement( - "label", - { className: "textlabel", htmlFor: "badge_mode", style: { whiteSpace: "pre", lineHeight: "2rem" } }, - "Count Tabs" - ), - React.createElement( - "div", - { className: "option-description" }, - "Shows you the number of open tabs over the Tab Manager icon in the top right of your browser.", - React.createElement("br", null), - React.createElement( - "i", - null, - "By default: enabled" - ) - ) - ), - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "div", - { className: "toggle" }, - React.createElement("input", { - type: "checkbox", - onMouseEnter: this.props.openInOwnTabText, - onChange: this.props.toggleOpenInOwnTab, - checked: this.props.openInOwnTab, - id: "openinowntab_mode", - name: "openinowntab_mode" - }), - React.createElement("label", { onMouseEnter: this.props.openInOwnTabText, htmlFor: "openinowntab_mode", style: { whiteSpace: "pre", lineHeight: "2rem" } }) - ), - React.createElement( - "label", - { className: "textlabel", htmlFor: "openinowntab_mode", style: { whiteSpace: "pre", lineHeight: "2rem" } }, - "Open in own Tab by default" - ), - React.createElement( - "div", - { className: "option-description" }, - "Opens the Tab Manager in own tab by default, instead of the popup.", - React.createElement("br", null), - React.createElement( - "i", - null, - "By default: disabled" - ) - ) - ) - ), React.createElement( - "div", - { className: "optionsBox" }, - React.createElement( - "h4", - null, - "Window settings" - ), - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "div", - { className: "toggle" }, - React.createElement("input", { - type: "checkbox", - onMouseEnter: this.props.hideText, - onChange: this.props.toggleHide, - checked: this.props.hideWindows, - id: "auto_hide", - name: "auto_hide" - }), - React.createElement("label", { onMouseEnter: this.props.hideText, htmlFor: "auto_hide", style: { whiteSpace: "pre", lineHeight: "2rem" } }) - ), - React.createElement( - "label", - { className: "textlabel", htmlFor: "auto_hide", style: { whiteSpace: "pre", lineHeight: "2rem" } }, - "Minimize inactive windows" - ), - React.createElement( - "div", - { className: "option-description" }, - "With this option enabled, you will only have 1 open window per monitor at all times. When you switch to another window, the other windows will be minimized to the tray automatically.", - React.createElement("br", null), - React.createElement( - "i", - null, - "By default: disabled" - ) - ) - ), - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "div", - { className: "toggle" }, - React.createElement("input", { - type: "checkbox", - onMouseEnter: this.props.tabActionsText, - onChange: this.props.toggleTabActions, - checked: this.props.tabactions, - id: "tabactions_mode", - name: "tabactions_mode" - }), - React.createElement("label", { onMouseEnter: this.props.tabActionsText, htmlFor: "tabactions_mode", style: { whiteSpace: "pre", lineHeight: "2rem" } }) - ), - React.createElement( - "label", - { className: "textlabel", htmlFor: "tabactions_mode", style: { whiteSpace: "pre", lineHeight: "2rem" } }, - "Show action buttons" - ), - React.createElement( - "div", - { className: "option-description" }, - "Displays buttons in every window for : opening a new tab, minimizing the window, assigning a color to the window and closing the window.", - React.createElement("br", null), - React.createElement( - "i", - null, - "By default: enabled" - ) - ) - ) - ), React.createElement( - "div", - { className: "optionsBox" }, - React.createElement( - "h4", - null, - "Advanced settings" - ), - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "a", - { href: "#", onClick: this.openIncognitoOptions }, - "Allow in Incognito" - ) - ), - React.createElement( - "div", - { className: "option-description" }, - "If you also want to see your incognito tabs in the Tab Manager overview, then enable incognito access for this extension." - ) - ), - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "a", - { href: "#", onClick: this.openShortcuts }, - "Change shortcut key" - ), - React.createElement( - "div", - { className: "option-description" }, - "If you want to disable or change the shortcut key with which to open Tab Manager Plus, you can do so here." - ) - ) - ), React.createElement( - "div", - { className: "optionsBox" }, - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "h4", - null, - "Right mouse button" - ), - React.createElement( - "div", - { className: "option-description" }, - "With the right mouse button you can select tabs" - ), - React.createElement( - "h4", - null, - "Shift+Right mouse button" - ), - React.createElement( - "div", - { className: "option-description" }, - "While holding shift, and pressing the right mouse button you can select all tabs between the last selected tab and the current one" - ), - React.createElement( - "h4", - null, - "Middle mouse button" - ), - React.createElement( - "div", - { className: "option-description" }, - "With the middle mouse button you can close a tab" - ), - React.createElement( - "h4", - null, - "[Enter / Return] button" - ), - React.createElement( - "div", - { className: "option-description" }, - "With the return button you can switch to the currently selected tab, or move multiple selected tabs to a new window" - ) - ) - )]; - - return React.createElement( - "div", - { className: "toggle-options" }, - opts - ); - } - }, { - key: "openIncognitoOptions", - value: function openIncognitoOptions() { - browser.tabs.create({ - url: "chrome://extensions/?id=cnkdjjdmfiffagllbiiilooaoofcoeff" - }); - } - }, { - key: "openShortcuts", - value: function openShortcuts() { - browser.tabs.create({ url: "chrome://extensions/shortcuts" }); - } - }, { - key: "licenses", - value: function licenses() { - var licenses = []; - licenses.push(React.createElement( - "div", - { className: "license" }, - "Tab Manager Plus is based on", - " ", - React.createElement( - "a", - { href: "https://github.com/dsc/Tab-Manager", target: "_blank", title: "Tab-Manager" }, - "dsc/Tab-Manager" - ), - ",", - " ", - React.createElement( - "a", - { href: "https://github.com/joshperry/Tab-Manager", target: "_blank", title: "Tab-Manager" }, - "joshperry/Tab-Manager" - ), - " ", - "and", - " ", - React.createElement( - "a", - { href: "https://github.com/JonasNo/Tab-Manager", target: "_blank", title: "Tab-Manager" }, - "JonasNo/Tab-Manager" - ), - ".", - React.createElement("br", null), - "Licensed by", - " ", - React.createElement( - "a", - { href: "http://creativecommons.org/licenses/by/3.0/", target: "_blank", title: " Mozilla Public License (MPL)" }, - "MPLv2" - ), - ". Icons made by", - " ", - React.createElement( - "a", - { href: "http://www.freepik.com", title: "Freepik" }, - "Freepik" - ), - " ", - "from", - " ", - React.createElement( - "a", - { href: "http://www.flaticon.com", title: "Flaticon" }, - "www.flaticon.com" - ), - ". Licensed by", - " ", - React.createElement( - "a", - { href: "http://creativecommons.org/licenses/by/3.0/", target: "_blank", title: "Creative Commons BY 3.0" }, - "CC 3.0 BY" - ), - "." - )); - - return React.createElement( - "div", - { className: "licenses" }, - licenses - ); - } - }, { - key: "render", - value: function render() { - var children = []; - - children.push(this.logo()); - children.push(this.optionsSection()); - children.push(React.createElement("div", { className: "clearfix" })); - - children.push(this.licenses()); - - return React.createElement( - "div", - { className: "options-window" }, - React.createElement( - "div", - null, - children - ) - ); - } - }]); - - return TabOptions; -}(React.Component); -//# sourceMappingURL=TabOptions.js.map \ No newline at end of file diff --git a/outlib/popup/views/TabOptions.js.map b/outlib/popup/views/TabOptions.js.map deleted file mode 100644 index bfd989f9..00000000 --- a/outlib/popup/views/TabOptions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../lib/popup/views/TabOptions.jsx"],"names":["TabOptions","props","state","logo","maxWidth","opts","tabLimitText","changeTabLimit","tabLimit","whiteSpace","lineHeight","textAlign","tabWidthText","changeTabWidth","tabWidth","tabHeightText","changeTabHeight","tabHeight","darkText","toggleDark","dark","compactText","toggleCompact","compact","animationsText","toggleAnimations","animations","windowTitlesText","toggleWindowTitles","windowTitles","sessionsText","toggleSessions","sessionsFeature","exportSessionsText","exportSessions","importSessionsText","importSessions","badgeText","toggleBadge","badge","openInOwnTabText","toggleOpenInOwnTab","openInOwnTab","hideText","toggleHide","hideWindows","tabActionsText","toggleTabActions","tabactions","openIncognitoOptions","openShortcuts","browser","tabs","create","url","licenses","push","children","optionsSection","React","Component"],"mappings":"AAAA;;;;;;;;;;IAEMA,U;;;AACL,qBAAYC,KAAZ,EAAmB;AAAA;;AAAA,sHACZA,KADY;;AAElB,QAAKC,KAAL,GAAa,EAAb;AAFkB;AAGlB;;;;yBACM;AACN,OAAIC,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\t\tthis.state = {};\n\t}\n\tlogo() {\n\t\tvar logo = [,

Tab Manager Plus {__VERSION__}

];\n\n\t\treturn (\n\t\t\t
\n\t\t\t\t
{logo}
\n\t\t\t
\n\t\t);\n\t}\n\toptionsSection() {\n\t\tvar opts = [\n\t\t\t
\n\t\t\t\t

Tab options

\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t
,\n\t\t\t
\n\t\t\t\t

Popup size

\n\t\t\t\t
\n\t\t\t\t\tYou can resize the popup here up to a maximum size of 800x600. This limitation is a browser limitation, and we cannot display a bigger popup due to\n\t\t\t\t\tthis. If you want to have a better overview, instead you can right click on the Tab Manager Plus icon, and `open in own tab`. This will open the Tab\n\t\t\t\t\tManager in a new tab.\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t
,\n\t\t\t
\n\t\t\t\t

Window style

\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\tDark mode, for working at night time.
\n\t\t\t\t\t\tBy default: disabled\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\tSaves a little bit of space around the icons. Makes it less beautiful, but more space efficient.
\n\t\t\t\t\t\tBy default: disabled\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\tDisables/enables animations and transitions in the popup.
\n\t\t\t\t\t\tBy default: enabled\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\tDisables/enables window titles.
\n\t\t\t\t\t\tBy default: enabled\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
,\n\t\t\t
\n\t\t\t\t

Session Management

\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\tAllows you to save windows as sessions ( saved windows ). You can restore these saved windows later on. The restored windows won't have the history\n\t\t\t\t\t\trestored. This feature is currently in beta.\n\t\t\t\t\t\t
\n\t\t\t\t\t\tBy default: disabled ( experimental feature )\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t{this.props.sessionsFeature &&
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
Allows you to backup your saved windows to an external file.
\n\t\t\t\t
}\n\t\t\t\t{this.props.sessionsFeature &&
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\tAllows you to restore your backup from an external file. The restored windows will be added to your current saved windows.\n\t\t\t\t\t
\n\t\t\t\t
}\n\t\t\t
,\n\t\t\t
\n\t\t\t\t

Popup icon

\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\tShows you the number of open tabs over the Tab Manager icon in the top right of your browser.\n\t\t\t\t\t\t
\n\t\t\t\t\t\tBy default: enabled\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\tOpens the Tab Manager in own tab by default, instead of the popup.\n\t\t\t\t\t\t
\n\t\t\t\t\t\tBy default: disabled\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
,\n\t\t\t
\n\t\t\t\t

Window settings

\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\tWith this option enabled, you will only have 1 open window per monitor at all times. When you switch to another window, the other windows will be\n\t\t\t\t\t\tminimized to the tray automatically.\n\t\t\t\t\t\t
\n\t\t\t\t\t\tBy default: disabled\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\tDisplays buttons in every window for : opening a new tab, minimizing the window, assigning a color to the window and closing the window.\n\t\t\t\t\t\t
\n\t\t\t\t\t\tBy default: enabled\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
,\n\t\t\t
\n\t\t\t\t

Advanced settings

\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\tIf you also want to see your incognito tabs in the Tab Manager overview, then enable incognito access for this extension.\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\tChange shortcut key\n\t\t\t\t\t\n\t\t\t\t\t
If you want to disable or change the shortcut key with which to open Tab Manager Plus, you can do so here.
\n\t\t\t\t
\n\t\t\t
,\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t

Right mouse button

\n\t\t\t\t\t
With the right mouse button you can select tabs
\n\t\t\t\t\t

Shift+Right mouse button

\n\t\t\t\t\t
\n\t\t\t\t\t\tWhile holding shift, and pressing the right mouse button you can select all tabs between the last selected tab and the current one\n\t\t\t\t\t
\n\t\t\t\t\t

Middle mouse button

\n\t\t\t\t\t
With the middle mouse button you can close a tab
\n\t\t\t\t\t

[Enter / Return] button

\n\t\t\t\t\t
\n\t\t\t\t\t\tWith the return button you can switch to the currently selected tab, or move multiple selected tabs to a new window\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t];\n\n\t\treturn
{opts}
;\n\t}\n\topenIncognitoOptions() {\n\t\tbrowser.tabs.create({\n\t\t\turl: \"chrome://extensions/?id=cnkdjjdmfiffagllbiiilooaoofcoeff\"\n\t\t});\n\t}\n\topenShortcuts() {\n\t\tbrowser.tabs.create({ url: \"chrome://extensions/shortcuts\" });\n\t}\n\tlicenses() {\n\t\tvar licenses = [];\n\t\tlicenses.push(\n\t\t\t
\n\t\t\t\tTab Manager Plus is based on{\" \"}\n\t\t\t\t\n\t\t\t\t\tdsc/Tab-Manager\n\t\t\t\t\n\t\t\t\t,{\" \"}\n\t\t\t\t\n\t\t\t\t\tjoshperry/Tab-Manager\n\t\t\t\t{\" \"}\n\t\t\t\tand{\" \"}\n\t\t\t\t\n\t\t\t\t\tJonasNo/Tab-Manager\n\t\t\t\t\n\t\t\t\t.
\n\t\t\t\tLicensed by{\" \"}\n\t\t\t\t\n\t\t\t\t\tMPLv2\n\t\t\t\t\n\t\t\t\t. Icons made by{\" \"}\n\t\t\t\t\n\t\t\t\t\tFreepik\n\t\t\t\t{\" \"}\n\t\t\t\tfrom{\" \"}\n\t\t\t\t\n\t\t\t\t\twww.flaticon.com\n\t\t\t\t\n\t\t\t\t. Licensed by{\" \"}\n\t\t\t\t\n\t\t\t\t\tCC 3.0 BY\n\t\t\t\t\n\t\t\t\t.\n\t\t\t
\n\t\t);\n\n\t\treturn
{licenses}
;\n\t}\n\trender() {\n\t\tvar children = [];\n\n\t\tchildren.push(this.logo());\n\t\tchildren.push(this.optionsSection());\n\t\tchildren.push(
);\n\t\t//children.push(React.createElement('h4', {}, this.props.getTip()));\n\t\tchildren.push(this.licenses());\n\n\t\treturn (\n\t\t\t
\n\t\t\t\t
{children}
\n\t\t\t
\n\t\t);\n\t}\n}"]} \ No newline at end of file diff --git a/outlib/popup/views/TabOptionsFirefox.js b/outlib/popup/views/TabOptionsFirefox.js deleted file mode 100644 index 70a78c25..00000000 --- a/outlib/popup/views/TabOptionsFirefox.js +++ /dev/null @@ -1,699 +0,0 @@ -"use strict"; - -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; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(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; } - -function _inherits(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 TabOptions = function (_React$Component) { - _inherits(TabOptions, _React$Component); - - function TabOptions(props) { - _classCallCheck(this, TabOptions); - - var _this = _possibleConstructorReturn(this, (TabOptions.__proto__ || Object.getPrototypeOf(TabOptions)).call(this, props)); - - _this.state = {}; - return _this; - } - - _createClass(TabOptions, [{ - key: "logo", - value: function logo() { - var logo = [React.createElement("img", { src: "images/browsers.svg", style: { maxWidth: "3rem" } }), React.createElement( - "h2", - null, - "Tab Manager Plus ", - "5.3.1" - )]; - - return React.createElement( - "div", - { className: "logo-options" }, - React.createElement( - "div", - { className: "logo-box" }, - logo - ) - ); - } - }, { - key: "optionsSection", - value: function optionsSection() { - var opts = [React.createElement( - "div", - { className: "optionsBox" }, - React.createElement( - "h4", - null, - "Tab options" - ), - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement("input", { - type: "number", - onMouseEnter: this.props.tabLimitText, - onChange: this.props.changeTabLimit, - value: this.props.tabLimit, - id: "enable_tabLimit", - name: "enable_tabLimit" - }), - React.createElement("label", { onMouseEnter: this.props.tabLimitText, htmlFor: "enable_tabLimit", style: { whiteSpace: "pre", lineHeight: "2rem" } }), - React.createElement( - "label", - { className: "textlabel", htmlFor: "enable_tabLimit", style: { textAlign: "", whiteSpace: "pre", lineHeight: "2rem" } }, - "Limit Tabs Per Window" - ), - React.createElement( - "div", - { className: "option-description" }, - "Once you reach this number of tabs, Tab Manager will move new tabs to a new window instead. No more windows with 60 tabs open!", - React.createElement("br", null), - React.createElement( - "i", - null, - "By default: 0 ( disabled )" - ), - React.createElement("br", null), - React.createElement( - "i", - null, - "Suggested value: 15" - ) - ) - ) - ), React.createElement( - "div", - { className: "optionsBox" }, - React.createElement( - "h4", - null, - "Popup size" - ), - React.createElement( - "div", - { className: "option-description" }, - "You can resize the popup here up to a maximum size of 800x600. This limitation is a browser limitation, and we cannot display a bigger popup due to this. If you want to have a better overview, instead you can right click on the Tab Manager Plus icon, and `open in own tab`. This will open the Tab Manager in a new tab." - ), - React.createElement( - "div", - { className: "toggle-box half-size float-right" }, - React.createElement( - "label", - { className: "textlabel", htmlFor: "enable_tabWidth", style: { textAlign: "", whiteSpace: "pre", lineHeight: "2rem" } }, - "Popup Width" - ), - React.createElement("input", { - type: "number", - min: "450", - max: "800", - step: "25", - onMouseEnter: this.props.tabWidthText, - onChange: this.props.changeTabWidth, - value: this.props.tabWidth, - id: "enable_tabWidth", - name: "enable_tabWidth" - }), - React.createElement("label", { onMouseEnter: this.props.tabWidthText, htmlFor: "enable_tabWidth", style: { whiteSpace: "pre", lineHeight: "2rem" } }) - ), - React.createElement( - "div", - { className: "toggle-box half-size" }, - React.createElement( - "label", - { className: "textlabel", htmlFor: "enable_tabHeight", style: { textAlign: "", whiteSpace: "pre", lineHeight: "2rem" } }, - "Popup Height" - ), - React.createElement("input", { - type: "number", - min: "400", - max: "600", - step: "25", - onMouseEnter: this.props.tabHeightText, - onChange: this.props.changeTabHeight, - value: this.props.tabHeight, - id: "enable_tabHeight", - name: "enable_tabHeight" - }), - React.createElement("label", { onMouseEnter: this.props.tabHeightText, htmlFor: "enable_tabHeight", style: { whiteSpace: "pre", lineHeight: "2rem" } }) - ) - ), React.createElement( - "div", - { className: "optionsBox" }, - React.createElement( - "h4", - null, - "Window style" - ), - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "div", - { className: "toggle" }, - React.createElement("input", { - type: "checkbox", - onMouseEnter: this.props.darkText, - onChange: this.props.toggleDark, - checked: this.props.dark, - id: "dark_mode", - name: "dark_mode" - }), - React.createElement("label", { onMouseEnter: this.props.darkText, htmlFor: "dark_mode", style: { whiteSpace: "pre", lineHeight: "2rem" } }) - ), - React.createElement( - "label", - { className: "textlabel", htmlFor: "dark_mode", style: { whiteSpace: "pre", lineHeight: "2rem" } }, - "Dark mode" - ), - React.createElement( - "div", - { className: "option-description" }, - "Dark mode, for working at night time. ", - React.createElement("br", null), - React.createElement( - "i", - null, - "By default: disabled" - ) - ) - ), - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "div", - { className: "toggle" }, - React.createElement("input", { - type: "checkbox", - onMouseEnter: this.props.compactText, - onChange: this.props.toggleCompact, - checked: this.props.compact, - id: "compact_mode", - name: "compact_mode" - }), - React.createElement("label", { onMouseEnter: this.props.compactText, htmlFor: "compact_mode", style: { whiteSpace: "pre", lineHeight: "2rem" } }) - ), - React.createElement( - "label", - { className: "textlabel", htmlFor: "compact_mode", style: { whiteSpace: "pre", lineHeight: "2rem" } }, - "Compact mode" - ), - React.createElement( - "div", - { className: "option-description" }, - "Saves a little bit of space around the icons. Makes it less beautiful, but more space efficient. ", - React.createElement("br", null), - React.createElement( - "i", - null, - "By default: disabled" - ) - ) - ), - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "div", - { className: "toggle" }, - React.createElement("input", { - type: "checkbox", - onMouseEnter: this.props.animationsText, - onChange: this.props.toggleAnimations, - checked: this.props.animations, - id: "enable_animations", - name: "enable_animations" - }), - React.createElement("label", { onMouseEnter: this.props.animationsText, htmlFor: "enable_animations", style: { whiteSpace: "pre", lineHeight: "2rem" } }) - ), - React.createElement( - "label", - { className: "textlabel", htmlFor: "enable_animations", style: { whiteSpace: "pre", lineHeight: "2rem" } }, - "Animations" - ), - React.createElement( - "div", - { className: "option-description" }, - "Disables/enables animations and transitions in the popup. ", - React.createElement("br", null), - React.createElement( - "i", - null, - "By default: enabled" - ) - ) - ), - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "div", - { className: "toggle" }, - React.createElement("input", { - type: "checkbox", - onMouseEnter: this.props.windowTitlesText, - onChange: this.props.toggleWindowTitles, - checked: this.props.windowTitles, - id: "enable_windowTitles", - name: "enable_windowTitles" - }), - React.createElement("label", { onMouseEnter: this.props.windowTitlesText, htmlFor: "enable_windowTitles", style: { whiteSpace: "pre", lineHeight: "2rem" } }) - ), - React.createElement( - "label", - { className: "textlabel", htmlFor: "enable_windowTitles", style: { whiteSpace: "pre", lineHeight: "2rem" } }, - "Window titles" - ), - React.createElement( - "div", - { className: "option-description" }, - "Disables/enables window titles. ", - React.createElement("br", null), - React.createElement( - "i", - null, - "By default: enabled" - ) - ) - ) - ), React.createElement( - "div", - { className: "optionsBox" }, - React.createElement( - "h4", - null, - "Session Management" - ), - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "div", - { className: "toggle" }, - React.createElement("input", { - type: "checkbox", - onMouseEnter: this.props.sessionsText, - onChange: this.props.toggleSessions, - checked: this.props.sessionsFeature, - id: "session_mode", - name: "session_mode" - }), - React.createElement("label", { onMouseEnter: this.props.sessionsText, htmlFor: "session_mode", style: { whiteSpace: "pre", lineHeight: "2rem" } }) - ), - React.createElement( - "label", - { className: "textlabel", htmlFor: "session_mode", style: { whiteSpace: "pre", lineHeight: "2rem" } }, - "Save Windows for Later" - ), - React.createElement( - "div", - { className: "option-description" }, - "Allows you to save windows as sessions ( saved windows ). You can restore these saved windows later on. The restored windows won't have the history restored. This feature is currently in beta.", - React.createElement("br", null), - React.createElement( - "i", - null, - "By default: disabled ( experimental feature )" - ) - ) - ), - this.props.sessionsFeature && React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "label", - { className: "textlabel", htmlFor: "session_export", style: { whiteSpace: "pre", lineHeight: "2rem" } }, - React.createElement( - "h4", - null, - "Export/Backup Sessions" - ) - ), - React.createElement( - "button", - { type: "button", onMouseEnter: this.props.exportSessionsText, onClick: this.props.exportSessions, id: "session_export", name: "session_export" }, - "Export/Backup Sessions" - ), - React.createElement("label", { onMouseEnter: this.props.exportSessionsText, htmlFor: "session_export", style: { whiteSpace: "pre", lineHeight: "2rem" } }) - ), - React.createElement( - "div", - { className: "option-description" }, - "Allows you to backup your saved windows to an external file." - ) - ), - this.props.sessionsFeature && React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "label", - { className: "textlabel", htmlFor: "session_import", style: { whiteSpace: "pre", lineHeight: "2rem" } }, - React.createElement( - "h4", - null, - "Import/Restore Sessions" - ) - ), - React.createElement("input", { - type: "file", - accept: "application/json", - onMouseEnter: this.props.importSessionsText, - onChange: this.props.importSessions, - id: "session_import", - name: "session_import", - placeholder: "Import/Restore Sessions" - }), - React.createElement("label", { onMouseEnter: this.props.importSessionsText, htmlFor: "session_import", style: { whiteSpace: "pre", lineHeight: "2rem" } }) - ), - React.createElement( - "div", - { className: "option-description" }, - "Allows you to restore your backup from an external file. The restored windows will be added to your current saved windows." - ) - ) - ), React.createElement( - "div", - { className: "optionsBox" }, - React.createElement( - "h4", - null, - "Popup icon" - ), - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "div", - { className: "toggle" }, - React.createElement("input", { - type: "checkbox", - onMouseEnter: this.props.badgeText, - onChange: this.props.toggleBadge, - checked: this.props.badge, - id: "badge_mode", - name: "badge_mode" - }), - React.createElement("label", { onMouseEnter: this.props.badgeText, htmlFor: "badge_mode", style: { whiteSpace: "pre", lineHeight: "2rem" } }) - ), - React.createElement( - "label", - { className: "textlabel", htmlFor: "badge_mode", style: { whiteSpace: "pre", lineHeight: "2rem" } }, - "Count Tabs" - ), - React.createElement( - "div", - { className: "option-description" }, - "Shows you the number of open tabs over the Tab Manager icon in the top right of your browser.", - React.createElement("br", null), - React.createElement( - "i", - null, - "By default: enabled" - ) - ) - ), - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "div", - { className: "toggle" }, - React.createElement("input", { - type: "checkbox", - onMouseEnter: this.props.openInOwnTabText, - onChange: this.props.toggleOpenInOwnTab, - checked: this.props.openInOwnTab, - id: "openinowntab_mode", - name: "openinowntab_mode" - }), - React.createElement("label", { onMouseEnter: this.props.openInOwnTabText, htmlFor: "openinowntab_mode", style: { whiteSpace: "pre", lineHeight: "2rem" } }) - ), - React.createElement( - "label", - { className: "textlabel", htmlFor: "openinowntab_mode", style: { whiteSpace: "pre", lineHeight: "2rem" } }, - "Open in own Tab by default" - ), - React.createElement( - "div", - { className: "option-description" }, - "Opens the Tab Manager in own tab by default, instead of the popup.", - React.createElement("br", null), - React.createElement( - "i", - null, - "By default: disabled" - ) - ) - ) - ), React.createElement( - "div", - { className: "optionsBox" }, - React.createElement( - "h4", - null, - "Window settings" - ), - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "div", - { className: "toggle" }, - React.createElement("input", { - type: "checkbox", - onMouseEnter: this.props.tabActionsText, - onChange: this.props.toggleTabActions, - checked: this.props.tabactions, - id: "tabactions_mode", - name: "tabactions_mode" - }), - React.createElement("label", { onMouseEnter: this.props.tabActionsText, htmlFor: "tabactions_mode", style: { whiteSpace: "pre", lineHeight: "2rem" } }) - ), - React.createElement( - "label", - { className: "textlabel", htmlFor: "tabactions_mode", style: { whiteSpace: "pre", lineHeight: "2rem" } }, - "Show action buttons" - ), - React.createElement( - "div", - { className: "option-description" }, - "Displays buttons in every window for : opening a new tab, minimizing the window, assigning a color to the window and closing the window.", - React.createElement("br", null), - React.createElement( - "i", - null, - "By default: enabled" - ) - ) - ) - ), React.createElement( - "div", - { className: "optionsBox" }, - React.createElement( - "h4", - null, - "Advanced settings" - ), - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "a", - { href: "#", onClick: this.openIncognitoOptions }, - "Allow in Private Windows" - ) - ), - React.createElement( - "div", - { className: "option-description" }, - "If you also want to see your private tabs in the Tab Manager overview, then enable private windows access for this extension." - ) - ), - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "a", - { href: "#", onClick: this.openShortcuts }, - "Change shortcut key" - ), - React.createElement( - "div", - { className: "option-description" }, - "If you want to disable or change the shortcut key with which to open Tab Manager Plus, you can do so in the add-ons settings. Click on the settings cog on the next page, and then 'Manage Extension Shortcuts'." - ) - ) - ), React.createElement( - "div", - { className: "optionsBox" }, - React.createElement( - "div", - { className: "toggle-box" }, - React.createElement( - "h4", - null, - "Right mouse button" - ), - React.createElement( - "div", - { className: "option-description" }, - "With the right mouse button you can select tabs" - ), - React.createElement( - "h4", - null, - "Shift+Right mouse button" - ), - React.createElement( - "div", - { className: "option-description" }, - "While holding shift, and pressing the right mouse button you can select all tabs between the last selected tab and the current one" - ), - React.createElement( - "h4", - null, - "Middle mouse button" - ), - React.createElement( - "div", - { className: "option-description" }, - "With the middle mouse button you can close a tab" - ), - React.createElement( - "h4", - null, - "[Enter / Return] button" - ), - React.createElement( - "div", - { className: "option-description" }, - "With the return button you can switch to the currently selected tab, or move multiple selected tabs to a new window" - ) - ) - )]; - - return React.createElement( - "div", - { className: "toggle-options" }, - opts - ); - } - }, { - key: "openIncognitoOptions", - value: function openIncognitoOptions() { - browser.runtime.openOptionsPage(); - } - }, { - key: "openShortcuts", - value: function openShortcuts() { - browser.runtime.openOptionsPage(); - } - }, { - key: "licenses", - value: function licenses() { - var licenses = []; - licenses.push(React.createElement( - "div", - { className: "license" }, - "Tab Manager Plus is based on", - " ", - React.createElement( - "a", - { href: "https://github.com/dsc/Tab-Manager", target: "_blank", title: "Tab-Manager" }, - "dsc/Tab-Manager" - ), - ",", - " ", - React.createElement( - "a", - { href: "https://github.com/joshperry/Tab-Manager", target: "_blank", title: "Tab-Manager" }, - "joshperry/Tab-Manager" - ), - " ", - "and", - " ", - React.createElement( - "a", - { href: "https://github.com/JonasNo/Tab-Manager", target: "_blank", title: "Tab-Manager" }, - "JonasNo/Tab-Manager" - ), - ".", - React.createElement("br", null), - "Licensed by", - " ", - React.createElement( - "a", - { href: "http://creativecommons.org/licenses/by/3.0/", target: "_blank", title: " Mozilla Public License (MPL)" }, - "MPLv2" - ), - ". Icons made by", - " ", - React.createElement( - "a", - { href: "http://www.freepik.com", title: "Freepik" }, - "Freepik" - ), - " ", - "from", - " ", - React.createElement( - "a", - { href: "http://www.flaticon.com", title: "Flaticon" }, - "www.flaticon.com" - ), - ". Licensed by", - " ", - React.createElement( - "a", - { href: "http://creativecommons.org/licenses/by/3.0/", target: "_blank", title: "Creative Commons BY 3.0" }, - "CC 3.0 BY" - ), - "." - )); - - return React.createElement( - "div", - { className: "licenses" }, - licenses - ); - } - }, { - key: "render", - value: function render() { - var children = []; - - children.push(this.logo()); - children.push(this.optionsSection()); - children.push(React.createElement("div", { className: "clearfix" })); - - children.push(this.licenses()); - - return React.createElement( - "div", - { className: "options-window" }, - React.createElement( - "div", - null, - children - ) - ); - } - }]); - - return TabOptions; -}(React.Component); -//# sourceMappingURL=TabOptionsFirefox.js.map \ No newline at end of file diff --git a/outlib/popup/views/TabOptionsFirefox.js.map b/outlib/popup/views/TabOptionsFirefox.js.map deleted file mode 100644 index cac4abdb..00000000 --- a/outlib/popup/views/TabOptionsFirefox.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../lib/popup/views/TabOptionsFirefox.jsx"],"names":["TabOptions","props","state","logo","maxWidth","opts","tabLimitText","changeTabLimit","tabLimit","whiteSpace","lineHeight","textAlign","tabWidthText","changeTabWidth","tabWidth","tabHeightText","changeTabHeight","tabHeight","darkText","toggleDark","dark","compactText","toggleCompact","compact","animationsText","toggleAnimations","animations","windowTitlesText","toggleWindowTitles","windowTitles","sessionsText","toggleSessions","sessionsFeature","exportSessionsText","exportSessions","importSessionsText","importSessions","badgeText","toggleBadge","badge","openInOwnTabText","toggleOpenInOwnTab","openInOwnTab","tabActionsText","toggleTabActions","tabactions","openIncognitoOptions","openShortcuts","browser","runtime","openOptionsPage","licenses","push","children","optionsSection","React","Component"],"mappings":"AAAA;;;;;;;;;;IAEMA,U;;;AACL,qBAAYC,KAAZ,EAAmB;AAAA;;AAAA,sHACZA,KADY;;AAElB,QAAKC,KAAL,GAAa,EAAb;AAFkB;AAGlB;;;;yBACM;AACN,OAAIC,OAAO,CAAC,6BAAK,KAAI,qBAAT,EAA+B,OAAO,EAAEC,UAAU,MAAZ,EAAtC,GAAD,EAAiE;AAAA;AAAA;AAAA;AAAA;AAAA,IAAjE,CAAX;;AAEA,UACC;AAAA;AAAA,MAAK,WAAU,cAAf;AACC;AAAA;AAAA,OAAK,WAAU,UAAf;AAA2BD;AAA3B;AADD,IADD;AAKA;;;mCACgB;AAChB,OAAIE,OAAO,CACV;AAAA;AAAA,MAAK,WAAU,YAAf;AACC;AAAA;AAAA;AAAA;AAAA,KADD;AAEC;AAAA;AAAA,OAAK,WAAU,YAAf;AACC;AACC,YAAK,QADN;AAEC,oBAAc,KAAKJ,KAAL,CAAWK,YAF1B;AAGC,gBAAU,KAAKL,KAAL,CAAWM,cAHtB;AAIC,aAAO,KAAKN,KAAL,CAAWO,QAJnB;AAKC,UAAG,iBALJ;AAMC,YAAK;AANN,OADD;AASC,oCAAO,cAAc,KAAKP,KAAL,CAAWK,YAAhC,EAA8C,SAAQ,iBAAtD,EAAwE,OAAO,EAAEG,YAAY,KAAd,EAAqBC,YAAY,MAAjC,EAA/E,GATD;A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;AAUC;AAAA;AAAA,OAAG,MAAK,wCAAR,EAAiD,QAAO,QAAxD,EAAiE,OAAM,aAAvE;AAAA;AAAA,KAVD;AAAA;AAaE,mCAbF;AAAA;AAca,OAdb;AAeC;AAAA;AAAA,OAAG,MAAK,6CAAR,EAAsD,QAAO,QAA7D,EAAsE,OAAM,+BAA5E;AAAA;AAAA,KAfD;AAAA;AAkBiB,OAlBjB;AAmBC;AAAA;AAAA,OAAG,MAAK,wBAAR,EAAiC,OAAM,SAAvC;AAAA;AAAA,KAnBD;AAqBM,OArBN;AAAA;AAsBM,OAtBN;AAuBC;AAAA;AAAA,OAAG,MAAK,yBAAR,EAAkC,OAAM,UAAxC;AAAA;AAAA,KAvBD;AAAA;AA0Be,OA1Bf;AA2BC;AAAA;AAAA,OAAG,MAAK,6CAAR,EAAsD,QAAO,QAA7D,EAAsE,OAAM,yBAA5E;AAAA;AAAA,KA3BD;AAAA;AAAA,IADD;;AAmCA,UAAO;AAAA;AAAA,MAAK,WAAU,UAAf;AAA2BD;AAA3B,IAAP;AACA;;;2BACQ;AACR,OAAIE,WAAW,EAAf;;AAEAA,YAASD,IAAT,CAAc,KAAKjD,IAAL,EAAd;AACAkD,YAASD,IAAT,CAAc,KAAKE,cAAL,EAAd;AACAD,YAASD,IAAT,CAAc,6BAAK,WAAU,UAAf,GAAd;;AAEAC,YAASD,IAAT,CAAc,KAAKD,QAAL,EAAd;;AAEA,UACC;AAAA;AAAA,MAAK,WAAU,gBAAf;AACC;AAAA;AAAA;AAAME;AAAN;AADD,IADD;AAKA;;;;EA1YuBE,MAAMC,S","file":"TabOptionsFirefox.js","sourcesContent":["\"use strict\";\n\nclass TabOptions extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = {};\n\t}\n\tlogo() {\n\t\tvar logo = [,

Tab Manager Plus {__VERSION__}

];\n\n\t\treturn (\n\t\t\t
\n\t\t\t\t
{logo}
\n\t\t\t
\n\t\t);\n\t}\n\toptionsSection() {\n\t\tvar opts = [\n\t\t\t
\n\t\t\t\t

Tab options

\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t
,\n\t\t\t
\n\t\t\t\t

Popup size

\n\t\t\t\t
\n\t\t\t\t\tYou can resize the popup here up to a maximum size of 800x600. This limitation is a browser limitation, and we cannot display a bigger popup due to\n\t\t\t\t\tthis. If you want to have a better overview, instead you can right click on the Tab Manager Plus icon, and `open in own tab`. This will open the Tab\n\t\t\t\t\tManager in a new tab.\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t
,\n\t\t\t
\n\t\t\t\t

Window style

\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\tDark mode, for working at night time.
\n\t\t\t\t\t\tBy default: disabled\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\tSaves a little bit of space around the icons. Makes it less beautiful, but more space efficient.
\n\t\t\t\t\t\tBy default: disabled\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\tDisables/enables animations and transitions in the popup.
\n\t\t\t\t\t\tBy default: enabled\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\tDisables/enables window titles.
\n\t\t\t\t\t\tBy default: enabled\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
,\n\t\t\t
\n\t\t\t\t

Session Management

\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\tAllows you to save windows as sessions ( saved windows ). You can restore these saved windows later on. The restored windows won't have the history\n\t\t\t\t\t\trestored. This feature is currently in beta.\n\t\t\t\t\t\t
\n\t\t\t\t\t\tBy default: disabled ( experimental feature )\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t{this.props.sessionsFeature &&
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
Allows you to backup your saved windows to an external file.
\n\t\t\t\t
}\n\t\t\t\t{this.props.sessionsFeature &&
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\tAllows you to restore your backup from an external file. The restored windows will be added to your current saved windows.\n\t\t\t\t\t
\n\t\t\t\t
}\n\t\t\t
,\n\t\t\t
\n\t\t\t\t

Popup icon

\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\tShows you the number of open tabs over the Tab Manager icon in the top right of your browser.\n\t\t\t\t\t\t
\n\t\t\t\t\t\tBy default: enabled\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\tOpens the Tab Manager in own tab by default, instead of the popup.\n\t\t\t\t\t\t
\n\t\t\t\t\t\tBy default: disabled\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
,\n\t\t\t
\n\t\t\t\t

Window settings

\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\tDisplays buttons in every window for : opening a new tab, minimizing the window, assigning a color to the window and closing the window.\n\t\t\t\t\t\t
\n\t\t\t\t\t\tBy default: enabled\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
,\n\t\t\t
\n\t\t\t\t

Advanced settings

\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\tIf you also want to see your private tabs in the Tab Manager overview, then enable private windows access for this extension.\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\tChange shortcut key\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\tIf you want to disable or change the shortcut key with which to open Tab Manager Plus, you can do so in the add-ons settings. Click on the settings\n\t\t\t\t\t\tcog on the next page, and then 'Manage Extension Shortcuts'.\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
,\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t

Right mouse button

\n\t\t\t\t\t
With the right mouse button you can select tabs
\n\t\t\t\t\t

Shift+Right mouse button

\n\t\t\t\t\t
\n\t\t\t\t\t\tWhile holding shift, and pressing the right mouse button you can select all tabs between the last selected tab and the current one\n\t\t\t\t\t
\n\t\t\t\t\t

Middle mouse button

\n\t\t\t\t\t
With the middle mouse button you can close a tab
\n\t\t\t\t\t

[Enter / Return] button

\n\t\t\t\t\t
\n\t\t\t\t\t\tWith the return button you can switch to the currently selected tab, or move multiple selected tabs to a new window\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t];\n\n\t\treturn
{opts}
;\n\t}\n\topenIncognitoOptions() {\n\t\tbrowser.runtime.openOptionsPage();\n\t\t// browser.tabs.create({ url: 'about:addons' });\n\t}\n\topenShortcuts() {\n\t\tbrowser.runtime.openOptionsPage();\n\t\t//browser.tabs.create({ url: 'about:addons' });\n\t}\n\tlicenses() {\n\t\tvar licenses = [];\n\t\tlicenses.push(\n\t\t\t
\n\t\t\t\tTab Manager Plus is based on{\" \"}\n\t\t\t\t\n\t\t\t\t\tdsc/Tab-Manager\n\t\t\t\t\n\t\t\t\t,{\" \"}\n\t\t\t\t\n\t\t\t\t\tjoshperry/Tab-Manager\n\t\t\t\t{\" \"}\n\t\t\t\tand{\" \"}\n\t\t\t\t\n\t\t\t\t\tJonasNo/Tab-Manager\n\t\t\t\t\n\t\t\t\t.
\n\t\t\t\tLicensed by{\" \"}\n\t\t\t\t\n\t\t\t\t\tMPLv2\n\t\t\t\t\n\t\t\t\t. Icons made by{\" \"}\n\t\t\t\t\n\t\t\t\t\tFreepik\n\t\t\t\t{\" \"}\n\t\t\t\tfrom{\" \"}\n\t\t\t\t\n\t\t\t\t\twww.flaticon.com\n\t\t\t\t\n\t\t\t\t. Licensed by{\" \"}\n\t\t\t\t\n\t\t\t\t\tCC 3.0 BY\n\t\t\t\t\n\t\t\t\t.\n\t\t\t
\n\t\t);\n\n\t\treturn
{licenses}
;\n\t}\n\trender() {\n\t\tvar children = [];\n\n\t\tchildren.push(this.logo());\n\t\tchildren.push(this.optionsSection());\n\t\tchildren.push(
);\n\t\t//children.push(React.createElement('h4', {}, this.props.getTip()));\n\t\tchildren.push(this.licenses());\n\n\t\treturn (\n\t\t\t
\n\t\t\t\t
{children}
\n\t\t\t
\n\t\t);\n\t}\n}\n"]} \ No newline at end of file diff --git a/outlib/popup/views/Window.js b/outlib/popup/views/Window.js deleted file mode 100644 index 7331b71d..00000000 --- a/outlib/popup/views/Window.js +++ /dev/null @@ -1,1063 +0,0 @@ -"use strict"; - -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 _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; }; }(); - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(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; } - -function _inherits(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 Window = function (_React$Component) { - _inherits(Window, _React$Component); - - function Window(props) { - _classCallCheck(this, Window); - - var _this2 = _possibleConstructorReturn(this, (Window.__proto__ || Object.getPrototypeOf(Window)).call(this, props)); - - _this2.state = { - colorActive: false, - windowTitles: [], - color: "default", - name: "", - tabs: 0, - hover: false - }; - - _this2.addTab = _this2.addTab.bind(_this2); - _this2.changeColors = _this2.changeColors.bind(_this2); - _this2.changeName = _this2.changeName.bind(_this2); - _this2.checkKey = _this2.checkKey.bind(_this2); - _this2.closePopup = _this2.closePopup.bind(_this2); - _this2.close = _this2.close.bind(_this2); - _this2.colors = _this2.colors.bind(_this2); - _this2.dragOver = _this2.dragOver.bind(_this2); - _this2.dragLeave = _this2.dragLeave.bind(_this2); - _this2.drop = _this2.drop.bind(_this2); - _this2.maximize = _this2.maximize.bind(_this2); - _this2.minimize = _this2.minimize.bind(_this2); - _this2.save = _this2.save.bind(_this2); - _this2.stop = _this2.stop.bind(_this2); - _this2.windowClick = _this2.windowClick.bind(_this2); - _this2.selectToFromTab = _this2.selectToFromTab.bind(_this2); - _this2.hoverWindow = _this2.hoverWindow.bind(_this2); - _this2.hoverWindowOut = _this2.hoverWindowOut.bind(_this2); - _this2.checkSettings = _this2.checkSettings.bind(_this2); - return _this2; - } - - _createClass(Window, [{ - key: "componentDidMount", - value: function () { - var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - _context.next = 2; - return this.checkSettings(); - - case 2: - case "end": - return _context.stop(); - } - } - }, _callee, this); - })); - - function componentDidMount() { - return _ref.apply(this, arguments); - } - - return componentDidMount; - }() - }, { - key: "checkSettings", - value: function () { - var _ref2 = _asyncToGenerator(regeneratorRuntime.mark(function _callee2() { - var colors, color, name, names; - return regeneratorRuntime.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - _context2.next = 2; - return getLocalStorage("windowColors", {}); - - case 2: - colors = _context2.sent; - color = colors[this.props.window.id] || "default"; - name = ""; - - if (!this.props.window.titlePreface) { - _context2.next = 9; - break; - } - - name = this.props.window.titlePreface; - _context2.next = 17; - break; - - case 9: - _context2.next = 11; - return getLocalStorage("windowNames", {}); - - case 11: - names = _context2.sent; - - if (!((typeof names === "undefined" ? "undefined" : _typeof(names)) !== 'object')) { - _context2.next = 16; - break; - } - - _context2.next = 15; - return setLocalStorage("windowNames", {}); - - case 15: - names = {}; - - case 16: - name = names[this.props.window.id] || ""; - - case 17: - - this.setState({ - color: color, - name: name - }); - - case 18: - case "end": - return _context2.stop(); - } - } - }, _callee2, this); - })); - - function checkSettings() { - return _ref2.apply(this, arguments); - } - - return checkSettings; - }() - }, { - key: "render", - value: function render() { - var _this = this; - - var color = this.state.color; - var name = this.state.name; - - var hideWindow = true; - var titleAdded = false; - var tabsperrow = this.props.layout.indexOf("blocks") > -1 ? Math.ceil(Math.sqrt(this.props.tabs.length + 2)) : this.props.layout == "vertical" ? 1 : 15; - var tabs = this.props.tabs.map(function (tab) { - var isHidden = !!_this.props.hiddenTabs[tab.id] && _this.props.filterTabs; - var isSelected = !!_this.props.selection[tab.id]; - hideWindow &= isHidden; - return React.createElement(Tab, { - key: "windowtab_" + _this.props.window.id + "_" + tab.id, - window: _this.props.window, - layout: _this.props.layout, - tab: tab, - selected: isSelected, - hidden: isHidden, - middleClick: _this.props.tabMiddleClick, - hoverHandler: _this.props.hoverHandler, - searchActive: _this.props.searchActive, - select: _this.props.select, - selectTo: _this.selectToFromTab, - draggable: true, - drag: _this.props.drag, - drop: _this.props.drop, - dropWindow: _this.props.dropWindow, - dragFavicon: _this.props.dragFavicon, - parentUpdate: _this.forceUpdate.bind(_this), - ref: "tab" + tab.id, - id: "tab-" + tab.id - }); - }); - if (!hideWindow) { - if (!!this.props.tabactions) { - tabs.push(React.createElement("div", { key: "windownl_" + _this.props.window.id, className: "newliner" }), React.createElement( - "div", - { key: "windowactions_" + this.props.window.id, className: "window-actions" }, - this.props.sessionsFeature ? React.createElement("div", { - className: "icon tabaction save " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Save this window for later\nWill save " + tabs.length + " tabs with this window for later. Please note : The saved tabs will lose their history.", - onClick: this.save, - onMouseEnter: this.props.hoverIcon - }) : false, - React.createElement("div", { - className: "icon tabaction add " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Open a new tab", - onClick: this.addTab, - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction colors " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Change window name or color", - onClick: this.colors, - onMouseEnter: this.props.hoverIcon - }), - this.props.window.state == "minimized" ? React.createElement("div", { - className: "icon tabaction maximize " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Maximize this window\nWill maximize " + tabs.length + " tabs", - onClick: this.maximize, - onMouseEnter: this.props.hoverIcon - }) : React.createElement("div", { - className: "icon tabaction minimize " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Minimize this window\nWill minimize " + tabs.length + " tabs", - onClick: this.minimize, - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction close " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Close this window\nWill close " + tabs.length + " tabs", - onClick: this.close, - onMouseEnter: this.props.hoverIcon - }) - )); - } - if (this.state.colorActive) { - tabs.push(React.createElement( - "div", - { key: "windowcolors_" + _this.props.window.id, className: "window-colors " + (this.state.colorActive ? "" : "hidden"), onClick: this.stop, onKeyDown: this.checkKey }, - React.createElement( - "h2", - { className: "window-x", onClick: this.closePopup }, - "x" - ), - React.createElement( - "h3", - { className: "center" }, - "Name the window" - ), - React.createElement("input", { - className: "window-name-input", - type: "text", - onChange: this.changeName, - value: this.state.name, - placeholder: this.state.windowTitles ? this.topEntries(this.state.windowTitles).join("") : "Name window...", - tabIndex: "1", - ref: "namebox", - onKeyDown: this.checkKey - }), - React.createElement( - "h3", - { className: "center" }, - "Pick a color" - ), - React.createElement( - "div", - { className: "colors-box" }, - React.createElement("div", { - className: "icon tabaction default " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Change background color", - onClick: this.changeColors.bind(this, { colorActive: false, color: "default" }), - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction color1 " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Change background color", - onClick: this.changeColors.bind(this, { colorActive: false, color: "color1" }), - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction color2 " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Change background color", - onClick: this.changeColors.bind(this, { colorActive: false, color: "color2" }), - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction color3 " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Change background color", - onClick: this.changeColors.bind(this, { colorActive: false, color: "color3" }), - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction color4 " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Change background color", - onClick: this.changeColors.bind(this, { colorActive: false, color: "color4" }), - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction color5 " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Change background color", - onClick: this.changeColors.bind(this, { colorActive: false, color: "color5" }), - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction color6 " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Change background color", - onClick: this.changeColors.bind(this, { colorActive: false, color: "color6" }), - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction color7 " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Change background color", - onClick: this.changeColors.bind(this, { colorActive: false, color: "color7" }), - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction color8 " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Change background color", - onClick: this.changeColors.bind(this, { colorActive: false, color: "color8" }), - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction color9 " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Change background color", - onClick: this.changeColors.bind(this, { colorActive: false, color: "color9" }), - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction color10 " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Change background color", - onClick: this.changeColors.bind(this, { colorActive: false, color: "color10" }), - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction color11 " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Change background color", - onClick: this.changeColors.bind(this, { colorActive: false, color: "color11" }), - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction color12 " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Change background color", - onClick: this.changeColors.bind(this, { colorActive: false, color: "color12" }), - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction color13 " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Change background color", - onClick: this.changeColors.bind(this, { colorActive: false, color: "color13" }), - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction color14 " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Change background color", - onClick: this.changeColors.bind(this, { colorActive: false, color: "color14" }), - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction color15 " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Change background color", - onClick: this.changeColors.bind(this, { colorActive: false, color: "color15" }), - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction color16 " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Change background color", - onClick: this.changeColors.bind(this, { colorActive: false, color: "color16" }), - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction color17 " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Change background color", - onClick: this.changeColors.bind(this, { colorActive: false, color: "color17" }), - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction color18 " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Change background color", - onClick: this.changeColors.bind(this, { colorActive: false, color: "color18" }), - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction color19 " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Change background color", - onClick: this.changeColors.bind(this, { colorActive: false, color: "color19" }), - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction color20 " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Change background color", - onClick: this.changeColors.bind(this, { colorActive: false, color: "color20" }), - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction color21 " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Change background color", - onClick: this.changeColors.bind(this, { colorActive: false, color: "color21" }), - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction color22 " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Change background color", - onClick: this.changeColors.bind(this, { colorActive: false, color: "color22" }), - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction color23 " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Change background color", - onClick: this.changeColors.bind(this, { colorActive: false, color: "color23" }), - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction color24 " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Change background color", - onClick: this.changeColors.bind(this, { colorActive: false, color: "color24" }), - onMouseEnter: this.props.hoverIcon - }), - React.createElement("div", { - className: "icon tabaction color25 " + (this.props.layout.indexOf("blocks") > -1 ? "" : "windowaction"), - title: "Change background color", - onClick: this.changeColors.bind(this, { colorActive: false, color: "color25" }), - onMouseEnter: this.props.hoverIcon - }) - ) - )); - } - - if (this.props.windowTitles) { - if (!!name) { - tabs.unshift(React.createElement( - "h3", - { - key: "window-" + this.props.window.id + "-windowTitle", - className: "editName center windowTitle", - onClick: this.colors, - title: "Change the name of this window", - onMouseEnter: this.props.hoverIcon - }, - name - )); - titleAdded = true; - } else { - if (this.state.windowTitles.length == 0 || this.state.tabs != tabs.length + this.props.window.id * 99) { - this.state.windowTitles = []; - this.state.tabs = tabs.length + this.props.window.id * 99; - for (var i = 0; i < tabs.length; i++) { - - if (!!tabs[i].props && !!tabs[i].props.tab && !!tabs[i].props.tab.url) { - var url = new URL(tabs[i].props.tab.url); - var protocol = url.protocol || ""; - var hostname = url.hostname || ""; - if (protocol.indexOf("view-source") > -1 && !!url.pathname) { - url = new URL(url.pathname); - hostname = url.hostname || "source"; - } else if (protocol.indexOf("chrome-extension") > -1) { - hostname = tabs[i].props.tab.title || "extension"; - } else if (protocol.indexOf("about") > -1) { - hostname = tabs[i].props.tab.title || "about"; - } else if (hostname.indexOf("mail.google") > -1) { - hostname = "gmail"; - } else { - if (!hostname) hostname = ""; - hostname = hostname.replace("www.", ""); - var regex_var = new RegExp(/(\.[^\.]{0,2})(\.[^\.]{0,2})(\.*$)|(\.[^\.]*)(\.*$)/); - hostname = hostname.replace(regex_var, "").split(".").pop(); - } - - if (!!hostname && hostname.length > 18) { - hostname = tabs[i].props.tab.title || ""; - - while (hostname.length > 18 && hostname.indexOf("—") > -1) { - hostname = hostname.split("—"); - hostname.pop(); - hostname = hostname.join("—"); - } - - while (hostname.length > 18 && hostname.indexOf("-") > -1) { - hostname = hostname.split("-"); - hostname.pop(); - hostname = hostname.join("-"); - } - - while (hostname.length > 18 && hostname.indexOf(" ") > -1) { - hostname = hostname.split(" "); - hostname.pop(); - hostname = hostname.join(" "); - } - } - this.state.windowTitles.push(hostname); - } - } - } - - if (this.state.windowTitles.length > 0) { - tabs.unshift(React.createElement( - "h3", - { - key: "window-" + this.props.window.id + "-windowTitle", - className: "editName center windowTitle", - onClick: this.colors, - title: "Change the name of this window", - onMouseEnter: this.props.hoverIcon - }, - this.topEntries(this.state.windowTitles).join("") - )); - titleAdded = true; - } - } - } - - if (tabsperrow < 5) { - tabsperrow = 5; - } - var children = []; - if (!!titleAdded) { - children.push(tabs.shift()); - } - var z = -1; - for (var j = 0; j < tabs.length; j++) { - var tab = tabs[j].props.tab; - var isHidden = !!tab && !!tab.id && !!this.props.hiddenTabs[tab.id] && this.props.filterTabs; - if (!isHidden) { - z++; - children.push(tabs[j]); - } - if ((z + 1) % tabsperrow == 0 && z && this.props.layout.indexOf("blocks") > -1) { - children.push(React.createElement("div", { className: "newliner", key: "windownlz_" + _this.props.window.id + "_" + z })); - } - } - var focused = false; - if (this.props.window.focused || this.props.lastOpenWindow == this.props.window.id) { - focused = true; - } - return React.createElement( - "div", - { - key: "window-" + this.props.window.id, - id: "window-" + this.props.window.id, - className: "window " + this.props.window.state + " window-" + this.props.window.id + " " + (focused ? "activeWindow" : "") + " " + this.state.color + " " + (this.props.layout.indexOf("blocks") > -1 ? "block" : "") + " " + this.props.layout + " " + (this.props.window.incognito ? " incognito" : "") + " " + (focused ? " focused" : ""), - onDragEnter: this.dragOver, - onDragOver: this.dragOver, - onDragLeave: this.dragLeave, - onClick: this.windowClick, - title: "", - onMouseEnter: this.hoverWindow.bind(null, tabs), - onMouseLeave: this.hoverWindowOut, - onDrop: this.drop - }, - React.createElement( - "div", - { key: "windowcontainer_" + this.props.window.id, className: "windowcontainer", title: "Focus this window\nWill select this window with " + tabs.length + " tabs" }, - children - ) - ); - } else { - return null; - } - } - }, { - key: "stop", - value: function stop(e) { - this.stopProp(e); - } - }, { - key: "addTab", - value: function addTab(e) { - this.stopProp(e); - browser.tabs.create({ windowId: this.props.window.id }); - } - }, { - key: "dragOver", - value: function dragOver(e) { - this.state.hover = true; - this.stopProp(e); - } - }, { - key: "dragLeave", - value: function dragLeave(e) { - this.state.hover = false; - e.nativeEvent.preventDefault(); - } - }, { - key: "drop", - value: function drop(e) { - var distance = 1000000; - var closestTab = null; - var closestRef = null; - - for (var i = 0; i < this.props.tabs.length; i++) { - var tab = this.props.tabs[i]; - var tabRef = this.refs["tab" + tab.id].tabRef.current; - var tabRect = tabRef.getBoundingClientRect(); - var x = e.nativeEvent.clientX; - var y = e.nativeEvent.clientY; - var dx = tabRect.x - x; - var dy = tabRect.y - y; - var d = Math.sqrt(dx * dx + dy * dy); - if (d < distance) { - distance = d; - closestTab = tab.id; - closestRef = tabRef; - } - } - - this.stopProp(e); - - if (closestTab != null) { - var before = null; - var boundingRect = closestRef.getBoundingClientRect(); - if (this.props.layout == "vertical") { - before = e.nativeEvent.clientY < boundingRect.top ? true : false; - } else { - before = e.nativeEvent.clientX < boundingRect.left ? true : false; - } - this.props.drop(closestTab, before); - } else { - this.props.dropWindow(this.props.window.id); - } - } - }, { - key: "hoverWindow", - value: function hoverWindow(tabs, e) { - this.state.hover = true; - this.props.hoverIcon("Focus this window\nWill select this window with " + tabs.length + " tabs"); - } - }, { - key: "hoverWindowOut", - value: function hoverWindowOut(e) { - this.state.hover = false; - } - }, { - key: "checkKey", - value: function checkKey(e) { - if (e.keyCode == 13 || e.keyCode == 27) { - this.stopProp(e); - this.closePopup(); - } - } - }, { - key: "windowClick", - value: function () { - var _ref3 = _asyncToGenerator(regeneratorRuntime.mark(function _callee3(e) { - var windowId; - return regeneratorRuntime.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - this.stopProp(e); - - windowId = this.props.window.id; - - - if (navigator.userAgent.search("Firefox") > -1) { - browser.runtime.sendMessage({ command: "focus_on_window_delayed", window_id: windowId }); - } else { - browser.runtime.sendMessage({ command: "focus_on_window", window_id: windowId }); - } - - this.props.parentUpdate(); - if (!!window.inPopup) window.close(); - return _context3.abrupt("return", false); - - case 6: - case "end": - return _context3.stop(); - } - } - }, _callee3, this); - })); - - function windowClick(_x) { - return _ref3.apply(this, arguments); - } - - return windowClick; - }() - }, { - key: "selectToFromTab", - value: function selectToFromTab(tabId) { - if (tabId) this.props.selectTo(tabId, this.props.tabs); - } - }, { - key: "close", - value: function () { - var _ref4 = _asyncToGenerator(regeneratorRuntime.mark(function _callee4(e) { - return regeneratorRuntime.wrap(function _callee4$(_context4) { - while (1) { - switch (_context4.prev = _context4.next) { - case 0: - this.stopProp(e); - _context4.next = 3; - return browser.windows.remove(this.props.window.id); - - case 3: - case "end": - return _context4.stop(); - } - } - }, _callee4, this); - })); - - function close(_x2) { - return _ref4.apply(this, arguments); - } - - return close; - }() - }, { - key: "uuidv4", - value: function uuidv4() { - return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) { - var r = Math.random() * 16 | 0, - v = c == "x" ? r : r & 0x3 | 0x8; - return v.toString(16); - }); - } - }, { - key: "save", - value: function () { - var _ref5 = _asyncToGenerator(regeneratorRuntime.mark(function _callee5(e) { - var sessionName, sessionColor, session, queryInfo, tabs, tabkey, newTab, sessions, value; - return regeneratorRuntime.wrap(function _callee5$(_context5) { - while (1) { - switch (_context5.prev = _context5.next) { - case 0: - this.stopProp(e); - - console.log("session name", this.state.name); - sessionName = this.state.name || this.topEntries(this.state.windowTitles).join(""); - sessionColor = this.state.color || "default"; - - - console.log("session name", sessionName); - - session = { - tabs: [], - windowsInfo: {}, - name: sessionName, - color: sessionColor, - date: Date.now(), - sessionStartTime: Date.now(), - id: this.uuidv4() - }; - - - if (this.state.name) { - session.customName = true; - } - - queryInfo = {}; - - queryInfo.windowId = this.props.window.id; - console.log(queryInfo); - - _context5.next = 12; - return browser.tabs.query(queryInfo); - - case 12: - tabs = _context5.sent; - - console.log(tabs); - _context5.t0 = regeneratorRuntime.keys(tabs); - - case 15: - if ((_context5.t1 = _context5.t0()).done) { - _context5.next = 24; - break; - } - - tabkey = _context5.t1.value; - - if (!(navigator.userAgent.search("Firefox") > -1)) { - _context5.next = 21; - break; - } - - newTab = tabs[tabkey]; - - if (!(!!newTab.url && newTab.url.search("about:") > -1)) { - _context5.next = 21; - break; - } - - return _context5.abrupt("continue", 15); - - case 21: - session.tabs.push(tabs[tabkey]); - _context5.next = 15; - break; - - case 24: - console.log(session.tabs); - _context5.next = 27; - return browser.windows.get(this.props.window.id); - - case 27: - session.windowsInfo = _context5.sent; - - - console.log(session); - - _context5.next = 31; - return getLocalStorage('sessions', {}); - - case 31: - sessions = _context5.sent; - - sessions[session.id] = session; - - _context5.next = 35; - return setLocalStorage('sessions', sessions).catch(function (err) { - console.log(err); - console.error(err.message); - }); - - case 35: - value = _context5.sent; - - this.props.parentUpdate(); - console.log("Value is set to " + value); - - setTimeout(function () { - this.props.scrollTo("session", session.id); - }.bind(this), 150); - - case 39: - case "end": - return _context5.stop(); - } - } - }, _callee5, this); - })); - - function save(_x3) { - return _ref5.apply(this, arguments); - } - - return save; - }() - }, { - key: "minimize", - value: function () { - var _ref6 = _asyncToGenerator(regeneratorRuntime.mark(function _callee6(e) { - return regeneratorRuntime.wrap(function _callee6$(_context6) { - while (1) { - switch (_context6.prev = _context6.next) { - case 0: - this.stopProp(e); - _context6.next = 3; - return browser.windows.update(this.props.window.id, { - state: "minimized" - }); - - case 3: - this.props.parentUpdate(); - - case 4: - case "end": - return _context6.stop(); - } - } - }, _callee6, this); - })); - - function minimize(_x4) { - return _ref6.apply(this, arguments); - } - - return minimize; - }() - }, { - key: "maximize", - value: function () { - var _ref7 = _asyncToGenerator(regeneratorRuntime.mark(function _callee7(e) { - return regeneratorRuntime.wrap(function _callee7$(_context7) { - while (1) { - switch (_context7.prev = _context7.next) { - case 0: - this.stopProp(e); - _context7.next = 3; - return browser.windows.update(this.props.window.id, { - state: "normal" - }); - - case 3: - this.props.parentUpdate(); - - case 4: - case "end": - return _context7.stop(); - } - } - }, _callee7, this); - })); - - function maximize(_x5) { - return _ref7.apply(this, arguments); - } - - return maximize; - }() - }, { - key: "colors", - value: function colors(e) { - this.stopProp(e); - this.props.toggleColors(!this.state.colorActive, this.props.window.id); - this.setState({ - colorActive: !this.state.colorActive - }); - setTimeout(function () { - if (this.state.colorActive) { - this.refs.namebox.focus(); - } - }.bind(this), 150); - } - }, { - key: "changeColors", - value: function () { - var _ref8 = _asyncToGenerator(regeneratorRuntime.mark(function _callee8(a) { - var color; - return regeneratorRuntime.wrap(function _callee8$(_context8) { - while (1) { - switch (_context8.prev = _context8.next) { - case 0: - this.setState(a); - this.props.toggleColors(!this.state.colorActive, this.props.window.id); - - color = a.color || "default"; - - - browser.runtime.sendMessage({ - command: "set_window_color", - window_id: this.props.window.id, - color: color - }); - - this.state.color = color; - this.setState({ - color: color - }); - this.closePopup(); - - case 7: - case "end": - return _context8.stop(); - } - } - }, _callee8, this); - })); - - function changeColors(_x6) { - return _ref8.apply(this, arguments); - } - - return changeColors; - }() - }, { - key: "closePopup", - value: function closePopup() { - this.props.toggleColors(!this.state.colorActive, this.props.window.id); - this.setState({ - colorActive: !this.state.colorActive - }); - this.props.parentUpdate(); - } - }, { - key: "changeName", - value: function () { - var _ref9 = _asyncToGenerator(regeneratorRuntime.mark(function _callee9(e) { - var name; - return regeneratorRuntime.wrap(function _callee9$(_context9) { - while (1) { - switch (_context9.prev = _context9.next) { - case 0: - name = ""; - - if (e && e.target && e.target.value) name = e.target.value; - - browser.runtime.sendMessage({ - command: "set_window_name", - window_id: this.props.window.id, - name: name - }); - - this.state.name = name; - this.setState({ - name: name - }); - - if (!(navigator.userAgent.search("Firefox") > -1)) { - _context9.next = 13; - break; - } - - if (!name) { - _context9.next = 11; - break; - } - - _context9.next = 9; - return browser.windows.update(this.props.window.id, { - titlePreface: name + " - " - }); - - case 9: - _context9.next = 13; - break; - - case 11: - _context9.next = 13; - return browser.windows.update(this.props.window.id, { - titlePreface: name - }); - - case 13: - case "end": - return _context9.stop(); - } - } - }, _callee9, this); - })); - - function changeName(_x7) { - return _ref9.apply(this, arguments); - } - - return changeName; - }() - }, { - key: "topEntries", - value: function topEntries(arr) { - var cnts = arr.reduce(function (obj, val) { - obj[val] = (obj[val] || 0) + 1; - return obj; - }, {}); - var sorted = Object.keys(cnts).sort(function (a, b) { - return cnts[b] - cnts[a]; - }); - - var more = 0; - if (sorted.length == 3) {} else { - while (sorted.length > 2) { - sorted.pop(); - more++; - } - } - for (var i = 0; i < sorted.length; i++) { - if (i > 0) { - sorted[i] = ", " + sorted[i]; - } - } - if (more > 0) { - sorted.push(" & " + more + " more"); - } - return sorted; - } - }, { - key: "stopProp", - value: function stopProp(e) { - if (e && e.nativeEvent) { - e.nativeEvent.preventDefault(); - e.nativeEvent.stopPropagation(); - } - if (e && e.preventDefault) { - e.preventDefault(); - e.stopPropagation(); - } - } - }]); - - return Window; -}(React.Component); -//# sourceMappingURL=Window.js.map \ No newline at end of file diff --git a/outlib/popup/views/Window.js.map b/outlib/popup/views/Window.js.map deleted file mode 100644 index 568e6682..00000000 --- a/outlib/popup/views/Window.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../lib/popup/views/Window.jsx"],"names":["Window","props","state","colorActive","windowTitles","color","name","tabs","hover","addTab","bind","changeColors","changeName","checkKey","closePopup","close","colors","dragOver","dragLeave","drop","maximize","minimize","save","stop","windowClick","selectToFromTab","hoverWindow","hoverWindowOut","checkSettings","getLocalStorage","window","id","titlePreface","names","setLocalStorage","setState","_this","hideWindow","titleAdded","tabsperrow","layout","indexOf","Math","ceil","sqrt","length","map","tab","isHidden","hiddenTabs","filterTabs","isSelected","selection","tabMiddleClick","hoverHandler","searchActive","select","drag","dropWindow","dragFavicon","forceUpdate","tabactions","push","sessionsFeature","hoverIcon","topEntries","join","unshift","i","url","URL","protocol","hostname","pathname","title","replace","regex_var","RegExp","split","pop","children","shift","z","j","focused","lastOpenWindow","incognito","e","stopProp","browser","create","windowId","nativeEvent","preventDefault","distance","closestTab","closestRef","tabRef","refs","current","tabRect","getBoundingClientRect","x","clientX","y","clientY","dx","dy","d","before","boundingRect","top","left","keyCode","navigator","userAgent","search","runtime","sendMessage","command","window_id","parentUpdate","inPopup","tabId","selectTo","windows","remove","c","r","random","v","toString","console","log","sessionName","sessionColor","session","windowsInfo","date","Date","now","sessionStartTime","uuidv4","customName","queryInfo","query","tabkey","newTab","get","sessions","catch","err","error","message","value","setTimeout","scrollTo","update","toggleColors","namebox","focus","a","target","arr","cnts","reduce","obj","val","sorted","Object","keys","sort","b","more","stopPropagation","React","Component"],"mappings":"AAAA;;;;;;;;;;;;;;IAEMA,M;;;AACL,iBAAYC,KAAZ,EAAmB;AAAA;;AAAA,+GACZA,KADY;;AAGlB,SAAKC,K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AX,EAAc;AACbL,WAAO1G,IAAP,CAAY,QAAQ+G,IAAR,GAAe,OAA3B;AACA;AACD,UAAOL,MAAP;AACA;;;2BACQjF,C,EAAG;AACX,OAAGA,KAAKA,EAAEK,WAAV,EAAuB;AACtBL,MAAEK,WAAF,CAAcC,cAAd;AACAN,MAAEK,WAAF,CAAckF,eAAd;AACA;AACD,OAAGvF,KAAKA,EAAEM,cAAV,EAA0B;AACzBN,MAAEM,cAAF;AACAN,MAAEuF,eAAF;AACA;AACD;;;;EA3uBmBC,MAAMC,S","file":"Window.js","sourcesContent":["\"use strict\";\n\nclass Window extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\tthis.state = {\n\t\t\tcolorActive: false,\n\t\t\twindowTitles: [],\n\t\t\tcolor: \"default\",\n\t\t\tname: \"\",\n\t\t\ttabs: 0,\n\t\t\thover: false\n\t\t};\n\n\t\tthis.addTab = this.addTab.bind(this);\n\t\tthis.changeColors = this.changeColors.bind(this);\n\t\tthis.changeName = this.changeName.bind(this);\n\t\tthis.checkKey = this.checkKey.bind(this);\n\t\tthis.closePopup = this.closePopup.bind(this);\n\t\tthis.close = this.close.bind(this);\n\t\tthis.colors = this.colors.bind(this);\n\t\tthis.dragOver = this.dragOver.bind(this);\n\t\tthis.dragLeave = this.dragLeave.bind(this);\n\t\tthis.drop = this.drop.bind(this);\n\t\tthis.maximize = this.maximize.bind(this);\n\t\tthis.minimize = this.minimize.bind(this);\n\t\tthis.save = this.save.bind(this);\n\t\tthis.stop = this.stop.bind(this);\n\t\tthis.windowClick = this.windowClick.bind(this);\n\t\tthis.selectToFromTab = this.selectToFromTab.bind(this);\n\t\tthis.hoverWindow = this.hoverWindow.bind(this);\n\t\tthis.hoverWindowOut = this.hoverWindowOut.bind(this);\n\t\tthis.checkSettings = this.checkSettings.bind(this);\n\t}\n\n\tasync componentDidMount() {\n\t\tawait this.checkSettings();\n\t}\n\n\tasync checkSettings() {\n\t\tvar colors = await getLocalStorage(\"windowColors\", {});\n\t\tvar color = colors[this.props.window.id] || \"default\";\n\n\t\tvar name = \"\";\n\t\tif (!!this.props.window.titlePreface) {\n\t\t\tname = this.props.window.titlePreface;\n\t\t} else {\n\t\t\tvar names = await getLocalStorage(\"windowNames\", {});\n\t\t\tif (typeof names !== 'object') {\n\t\t\t\tawait setLocalStorage(\"windowNames\", {});\n\t\t\t\tnames = {};\n\t\t\t}\n\t\t\tname = names[this.props.window.id] || \"\";\n\t\t}\n\n\t\tthis.setState({\n\t\t\tcolor: color,\n\t\t\tname: name\n\t\t});\n\t}\n\n\trender() {\n\t\tvar _this = this;\n\n\t\tvar color = this.state.color;\n\t\tvar name = this.state.name;\n\n\t\tvar hideWindow = true;\n\t\tvar titleAdded = false;\n\t\tvar tabsperrow = this.props.layout.indexOf(\"blocks\") > -1 ? Math.ceil(Math.sqrt(this.props.tabs.length + 2)) : this.props.layout == \"vertical\" ? 1 : 15;\n\t\tvar tabs = this.props.tabs.map(function(tab) {\n\t\t\tvar isHidden = !!_this.props.hiddenTabs[tab.id] && _this.props.filterTabs;\n\t\t\tvar isSelected = !!_this.props.selection[tab.id];\n\t\t\thideWindow &= isHidden;\n\t\t\treturn (\n\t\t\t\t\n\t\t\t);\n\t\t});\n\t\tif (!hideWindow) {\n\t\t\tif (!!this.props.tabactions) {\n\t\t\t\ttabs.push(\n\t\t\t\t\t
,\n\t\t\t\t\t
\n\t\t\t\t\t\t{this.props.sessionsFeature ? (\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\t\t\t\"Save this window for later\\nWill save \" +\n\t\t\t\t\t\t\t\t\ttabs.length +\n\t\t\t\t\t\t\t\t\t\" tabs with this window for later. Please note : The saved tabs will lose their history.\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonClick={this.save}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\ttitle=\"Open a new tab\"\n\t\t\t\t\t\t\tonClick={this.addTab}\n\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\ttitle=\"Change window name or color\"\n\t\t\t\t\t\t\tonClick={this.colors}\n\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{this.props.window.state == \"minimized\" ? (\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle={\"Maximize this window\\nWill maximize \" + tabs.length + \" tabs\"}\n\t\t\t\t\t\t\t\tonClick={this.maximize}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle={\"Minimize this window\\nWill minimize \" + tabs.length + \" tabs\"}\n\t\t\t\t\t\t\t\tonClick={this.minimize}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\ttitle={\"Close this window\\nWill close \" + tabs.length + \" tabs\"}\n\t\t\t\t\t\t\tonClick={this.close}\n\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t/>\n\t\t\t\t\t
\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (this.state.colorActive) {\n\t\t\t\ttabs.push(\n\t\t\t\t\t
\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\tx\n\t\t\t\t\t\t

\n\t\t\t\t\t\t

Name the window

\n\t\t\t\t\t\t\n\t\t\t\t\t\t

Pick a color

\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle=\"Change background color\"\n\t\t\t\t\t\t\t\tonClick={this.changeColors.bind(this, { colorActive: false, color: \"default\" })}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle=\"Change background color\"\n\t\t\t\t\t\t\t\tonClick={this.changeColors.bind(this, { colorActive: false, color: \"color1\" })}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle=\"Change background color\"\n\t\t\t\t\t\t\t\tonClick={this.changeColors.bind(this, { colorActive: false, color: \"color2\" })}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle=\"Change background color\"\n\t\t\t\t\t\t\t\tonClick={this.changeColors.bind(this, { colorActive: false, color: \"color3\" })}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle=\"Change background color\"\n\t\t\t\t\t\t\t\tonClick={this.changeColors.bind(this, { colorActive: false, color: \"color4\" })}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle=\"Change background color\"\n\t\t\t\t\t\t\t\tonClick={this.changeColors.bind(this, { colorActive: false, color: \"color5\" })}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle=\"Change background color\"\n\t\t\t\t\t\t\t\tonClick={this.changeColors.bind(this, { colorActive: false, color: \"color6\" })}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle=\"Change background color\"\n\t\t\t\t\t\t\t\tonClick={this.changeColors.bind(this, { colorActive: false, color: \"color7\" })}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle=\"Change background color\"\n\t\t\t\t\t\t\t\tonClick={this.changeColors.bind(this, { colorActive: false, color: \"color8\" })}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle=\"Change background color\"\n\t\t\t\t\t\t\t\tonClick={this.changeColors.bind(this, { colorActive: false, color: \"color9\" })}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle=\"Change background color\"\n\t\t\t\t\t\t\t\tonClick={this.changeColors.bind(this, { colorActive: false, color: \"color10\" })}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle=\"Change background color\"\n\t\t\t\t\t\t\t\tonClick={this.changeColors.bind(this, { colorActive: false, color: \"color11\" })}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle=\"Change background color\"\n\t\t\t\t\t\t\t\tonClick={this.changeColors.bind(this, { colorActive: false, color: \"color12\" })}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle=\"Change background color\"\n\t\t\t\t\t\t\t\tonClick={this.changeColors.bind(this, { colorActive: false, color: \"color13\" })}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle=\"Change background color\"\n\t\t\t\t\t\t\t\tonClick={this.changeColors.bind(this, { colorActive: false, color: \"color14\" })}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle=\"Change background color\"\n\t\t\t\t\t\t\t\tonClick={this.changeColors.bind(this, { colorActive: false, color: \"color15\" })}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle=\"Change background color\"\n\t\t\t\t\t\t\t\tonClick={this.changeColors.bind(this, { colorActive: false, color: \"color16\" })}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle=\"Change background color\"\n\t\t\t\t\t\t\t\tonClick={this.changeColors.bind(this, { colorActive: false, color: \"color17\" })}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle=\"Change background color\"\n\t\t\t\t\t\t\t\tonClick={this.changeColors.bind(this, { colorActive: false, color: \"color18\" })}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle=\"Change background color\"\n\t\t\t\t\t\t\t\tonClick={this.changeColors.bind(this, { colorActive: false, color: \"color19\" })}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle=\"Change background color\"\n\t\t\t\t\t\t\t\tonClick={this.changeColors.bind(this, { colorActive: false, color: \"color20\" })}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle=\"Change background color\"\n\t\t\t\t\t\t\t\tonClick={this.changeColors.bind(this, { colorActive: false, color: \"color21\" })}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle=\"Change background color\"\n\t\t\t\t\t\t\t\tonClick={this.changeColors.bind(this, { colorActive: false, color: \"color22\" })}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle=\"Change background color\"\n\t\t\t\t\t\t\t\tonClick={this.changeColors.bind(this, { colorActive: false, color: \"color23\" })}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle=\"Change background color\"\n\t\t\t\t\t\t\t\tonClick={this.changeColors.bind(this, { colorActive: false, color: \"color24\" })}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t -1 ? \"\" : \"windowaction\")}\n\t\t\t\t\t\t\t\ttitle=\"Change background color\"\n\t\t\t\t\t\t\t\tonClick={this.changeColors.bind(this, { colorActive: false, color: \"color25\" })}\n\t\t\t\t\t\t\t\tonMouseEnter={this.props.hoverIcon}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (this.props.windowTitles) {\n\t\t\t\tif (!!name) {\n\t\t\t\t\ttabs.unshift(\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{name}\n\t\t\t\t\t\t\n\t\t\t\t\t);\n\t\t\t\t\ttitleAdded = true;\n\t\t\t\t} else {\n\t\t\t\t\tif (this.state.windowTitles.length == 0 || this.state.tabs != tabs.length + this.props.window.id * 99) {\n\t\t\t\t\t\tthis.state.windowTitles = [];\n\t\t\t\t\t\tthis.state.tabs = tabs.length + this.props.window.id * 99;\n\t\t\t\t\t\tfor (var i = 0; i < tabs.length; i++) {\n\n\t\t\t\t\t\t\tif (!!tabs[i].props && !!tabs[i].props.tab && !!tabs[i].props.tab.url) {\n\t\t\t\t\t\t\t\tvar url = new URL(tabs[i].props.tab.url);\n\t\t\t\t\t\t\t\tvar protocol = url.protocol || \"\";\n\t\t\t\t\t\t\t\tvar hostname = url.hostname || \"\";\n\t\t\t\t\t\t\t\tif (protocol.indexOf(\"view-source\") > -1 && !!url.pathname) {\n\t\t\t\t\t\t\t\t\turl = new URL(url.pathname);\n\t\t\t\t\t\t\t\t\thostname = url.hostname || \"source\";\n\t\t\t\t\t\t\t\t} else if (protocol.indexOf(\"chrome-extension\") > -1) {\n\t\t\t\t\t\t\t\t\thostname = tabs[i].props.tab.title || \"extension\";\n\t\t\t\t\t\t\t\t} else if (protocol.indexOf(\"about\") > -1) {\n\t\t\t\t\t\t\t\t\thostname = tabs[i].props.tab.title || \"about\";\n\t\t\t\t\t\t\t\t} else if (hostname.indexOf(\"mail.google\") > -1) {\n\t\t\t\t\t\t\t\t\thostname = \"gmail\";\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif (!hostname) hostname = \"\";\n\t\t\t\t\t\t\t\t\thostname = hostname.replace(\"www.\", \"\");\n\t\t\t\t\t\t\t\t\tvar regex_var = new RegExp(/(\\.[^\\.]{0,2})(\\.[^\\.]{0,2})(\\.*$)|(\\.[^\\.]*)(\\.*$)/);\n\t\t\t\t\t\t\t\t\thostname = hostname\n\t\t\t\t\t\t\t\t\t\t.replace(regex_var, \"\")\n\t\t\t\t\t\t\t\t\t\t.split(\".\")\n\t\t\t\t\t\t\t\t\t\t.pop();\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (!!hostname && hostname.length > 18) {\n\t\t\t\t\t\t\t\t\thostname = tabs[i].props.tab.title || \"\";\n\n\t\t\t\t\t\t\t\t\twhile (hostname.length > 18 && hostname.indexOf(\"—\") > -1) {\n\t\t\t\t\t\t\t\t\t\thostname = hostname.split(\"—\");\n\t\t\t\t\t\t\t\t\t\thostname.pop();\n\t\t\t\t\t\t\t\t\t\thostname = hostname.join(\"—\");\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\twhile (hostname.length > 18 && hostname.indexOf(\"-\") > -1) {\n\t\t\t\t\t\t\t\t\t\thostname = hostname.split(\"-\");\n\t\t\t\t\t\t\t\t\t\thostname.pop();\n\t\t\t\t\t\t\t\t\t\thostname = hostname.join(\"-\");\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\twhile (hostname.length > 18 && hostname.indexOf(\" \") > -1) {\n\t\t\t\t\t\t\t\t\t\thostname = hostname.split(\" \");\n\t\t\t\t\t\t\t\t\t\thostname.pop();\n\t\t\t\t\t\t\t\t\t\thostname = hostname.join(\" \");\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis.state.windowTitles.push(hostname);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.state.windowTitles.length > 0) {\n\t\t\t\t\t\ttabs.unshift(\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{this.topEntries(this.state.windowTitles).join(\"\")}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t);\n\t\t\t\t\t\ttitleAdded = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (tabsperrow < 5) {\n\t\t\t\ttabsperrow = 5;\n\t\t\t}\n\t\t\tvar children = [];\n\t\t\tif (!!titleAdded) {\n\t\t\t\tchildren.push(tabs.shift());\n\t\t\t}\n\t\t\tvar z = -1;\n\t\t\tfor (var j = 0; j < tabs.length; j++) {\n\t\t\t\tvar tab = tabs[j].props.tab;\n\t\t\t\tvar isHidden = !!tab && !!tab.id && !!this.props.hiddenTabs[tab.id] && this.props.filterTabs;\n\t\t\t\tif(!isHidden) {\n\t\t\t\t\tz++;\n\t\t\t\t\tchildren.push(tabs[j]);\n\t\t\t\t}\n\t\t\t\tif ((z + 1) % tabsperrow == 0 && z && this.props.layout.indexOf(\"blocks\") > -1) {\n\t\t\t\t\tchildren.push(
);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar focused = false;\n\t\t\tif (this.props.window.focused || this.props.lastOpenWindow == this.props.window.id) {\n\t\t\t\tfocused = true;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t -1 ? \"block\" : \"\") +\n\t\t\t\t\t\t\" \" +\n\t\t\t\t\t\tthis.props.layout +\n\t\t\t\t\t\t\" \" +\n\t\t\t\t\t\t(this.props.window.incognito ? \" incognito\" : \"\") +\n\t\t\t\t\t\t\" \" +\n\t\t\t\t\t\t(focused ? \" focused\" : \"\")\n\t\t\t\t\t}\n\t\t\t\t\tonDragEnter={this.dragOver}\n\t\t\t\t\tonDragOver={this.dragOver}\n\t\t\t\t\tonDragLeave={this.dragLeave}\n\t\t\t\t\tonClick={this.windowClick}\n\t\t\t\t\ttitle={\"\"}\n\t\t\t\t\tonMouseEnter={this.hoverWindow.bind(null, tabs)}\n\t\t\t\t\tonMouseLeave={this.hoverWindowOut}\n\t\t\t\t\tonDrop={this.drop}\n\t\t\t\t>\n\t\t\t\t\t
{children}
\n\t\t\t\t
\n\t\t\t);\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\tstop(e) {\n\t\tthis.stopProp(e);\n\t}\n\taddTab(e) {\n\t\tthis.stopProp(e);\n\t\tbrowser.tabs.create({ windowId: this.props.window.id });\n\t}\n\tdragOver(e) {\n\t\tthis.state.hover = true;\n\t\tthis.stopProp(e);\n\t}\n\tdragLeave(e) {\n\t\tthis.state.hover = false;\n\t\te.nativeEvent.preventDefault();\n\t}\n\tdrop(e) {\n\t\tvar distance = 1000000;\n\t\tvar closestTab = null;\n\t\tvar closestRef = null;\n\n\t\tfor (var i = 0; i < this.props.tabs.length; i++) {\n\t\t\tvar tab = this.props.tabs[i];\n\t\t\tvar tabRef = this.refs[\"tab\" + tab.id].tabRef.current;\n\t\t\tvar tabRect = tabRef.getBoundingClientRect();\n\t\t\tvar x = e.nativeEvent.clientX;\n\t\t\tvar y = e.nativeEvent.clientY;\n\t\t\tvar dx = tabRect.x - x;\n\t\t\tvar dy = tabRect.y - y;\n\t\t\tvar d = Math.sqrt(dx * dx + dy * dy);\n\t\t\tif (d < distance) {\n\t\t\t\tdistance = d;\n\t\t\t\tclosestTab = tab.id;\n\t\t\t\tclosestRef = tabRef;\n\t\t\t}\n\t\t}\n\n\t\tthis.stopProp(e);\n\n\t\tif (closestTab != null) {\n\t\t\tvar before = null;\n\t\t\tvar boundingRect = closestRef.getBoundingClientRect();\n\t\t\tif (this.props.layout == \"vertical\") {\n\t\t\t\tbefore = e.nativeEvent.clientY < boundingRect.top ? true : false;\n\t\t\t} else {\n\t\t\t\tbefore = e.nativeEvent.clientX < boundingRect.left ? true : false;\n\t\t\t}\n\t\t\tthis.props.drop(closestTab, before);\n\t\t} else {\n\t\t\tthis.props.dropWindow(this.props.window.id);\n\t\t}\n\t}\n\thoverWindow(tabs, e) {\n\t\tthis.state.hover = true;\n\t\tthis.props.hoverIcon(\"Focus this window\\nWill select this window with \" + tabs.length + \" tabs\");\n\t\t// this.props.hoverIcon(e);\n\t}\n\thoverWindowOut(e) {\n\t\tthis.state.hover = false;\n\t}\n\tcheckKey(e) {\n\t\t// close popup when enter or escape have been pressed\n\t\tif (e.keyCode == 13 || e.keyCode == 27) {\n\t\t\tthis.stopProp(e);\n\t\t\tthis.closePopup();\n\t\t}\n\t}\n\tasync windowClick(e) {\n\t\tthis.stopProp(e);\n\n\t\tvar windowId = this.props.window.id;\n\n\t\tif (navigator.userAgent.search(\"Firefox\") > -1) {\n\t\t\tbrowser.runtime.sendMessage({command: \"focus_on_window_delayed\", window_id: windowId});\n\t\t} else {\n\t\t\tbrowser.runtime.sendMessage({command: \"focus_on_window\", window_id: windowId});\n\t\t}\n\n\t\tthis.props.parentUpdate();\n\t\tif (!!window.inPopup) window.close();\n\t\treturn false;\n\t}\n\tselectToFromTab(tabId) {\n\t\tif(tabId) this.props.selectTo(tabId, this.props.tabs);\n\t}\n\tasync close(e) {\n\t\tthis.stopProp(e);\n\t\tawait browser.windows.remove(this.props.window.id);\n\t}\n\tuuidv4() {\n\t\treturn \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function(c) {\n\t\t\tvar r = (Math.random() * 16) | 0,\n\t\t\t\tv = c == \"x\" ? r : (r & 0x3) | 0x8;\n\t\t\treturn v.toString(16);\n\t\t});\n\t}\n\tasync save(e) {\n\t\tthis.stopProp(e);\n\n\t\tconsole.log(\"session name\", this.state.name);\n\t\tvar sessionName = this.state.name || this.topEntries(this.state.windowTitles).join(\"\");\n\t\tvar sessionColor = this.state.color || \"default\";\n\n\t\tconsole.log(\"session name\", sessionName);\n\n\t\tvar session = {\n\t\t\ttabs: [],\n\t\t\twindowsInfo: {},\n\t\t\tname: sessionName,\n\t\t\tcolor: sessionColor,\n\t\t\tdate: Date.now(),\n\t\t\tsessionStartTime: Date.now(),\n\t\t\tid: this.uuidv4()\n\t\t};\n\n\t\tif (this.state.name) {\n\t\t\tsession.customName = true;\n\t\t}\n\n\t\tvar queryInfo = {};\n\t\t//queryInfo.currentWindow = true;\n\t\tqueryInfo.windowId = this.props.window.id;\n\t\tconsole.log(queryInfo);\n\n\t\tvar tabs = await browser.tabs.query(queryInfo);\n\t\tconsole.log(tabs);\n\t\tfor (var tabkey in tabs) {\n\t\t\tif (navigator.userAgent.search(\"Firefox\") > -1) {\n\t\t\t\tvar newTab = tabs[tabkey];\n\t\t\t\tif (!!newTab.url && newTab.url.search(\"about:\") > -1) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tsession.tabs.push(tabs[tabkey]);\n\t\t}\n\t\tconsole.log(session.tabs);\n\t\tsession.windowsInfo = await browser.windows.get(this.props.window.id);\n\n\t\tconsole.log(session);\n\n\t\tvar sessions = await getLocalStorage('sessions', {});\n\t\tsessions[session.id] = session;\n\n\t\tvar value = await setLocalStorage('sessions', sessions).catch(function(err) {\n\t\t\tconsole.log(err);\n\t\t\tconsole.error(err.message);\n\t\t});\n\t\tthis.props.parentUpdate();\n\t\tconsole.log(\"Value is set to \" + value);\n\n\t\tsetTimeout(function() {\n\t\t\tthis.props.scrollTo(\"session\", session.id);\n\t\t}.bind(this), 150);\n\t}\n\tasync minimize(e) {\n\t\tthis.stopProp(e);\n\t\tawait browser.windows.update(this.props.window.id, {\n\t\t\tstate: \"minimized\"\n\t\t});\n\t\tthis.props.parentUpdate();\n\t}\n\tasync maximize(e) {\n\t\tthis.stopProp(e);\n\t\tawait browser.windows.update(this.props.window.id, {\n\t\t\tstate: \"normal\"\n\t\t});\n\t\tthis.props.parentUpdate();\n\t}\n\tcolors(e) {\n\t\tthis.stopProp(e);\n\t\tthis.props.toggleColors(!this.state.colorActive, this.props.window.id);\n\t\tthis.setState({\n\t\t\tcolorActive: !this.state.colorActive\n\t\t});\n\t\tsetTimeout(function() {\n\t\t\tif(this.state.colorActive) {\n\t\t\t\tthis.refs.namebox.focus();\n\t\t\t}\n\t\t}.bind(this), 150);\n\t}\n\tasync changeColors(a) {\n\t\tthis.setState(a);\n\t\tthis.props.toggleColors(!this.state.colorActive, this.props.window.id);\n\n\t\tvar color = a.color || \"default\";\n\n\t\tbrowser.runtime.sendMessage({\n\t\t\tcommand: \"set_window_color\",\n\t\t\twindow_id: this.props.window.id,\n\t\t\tcolor: color\n\t\t});\n\n\t\tthis.state.color = color;\n\t\tthis.setState({\n\t\t\tcolor: color\n\t\t});\n\t\tthis.closePopup();\n\t}\n\tclosePopup() {\n\t\tthis.props.toggleColors(!this.state.colorActive, this.props.window.id);\n\t\tthis.setState({\n\t\t\tcolorActive: !this.state.colorActive\n\t\t});\n\t\tthis.props.parentUpdate();\n\t}\n\tasync changeName(e) {\n\t\t// this.setState(a);\n\t\tvar name = \"\";\n\t\tif(e && e.target && e.target.value) name = e.target.value;\n\n\t\tbrowser.runtime.sendMessage({\n\t\t\tcommand: \"set_window_name\",\n\t\t\twindow_id: this.props.window.id,\n\t\t\tname: name\n\t\t});\n\n\t\tthis.state.name = name;\n\t\tthis.setState({\n\t\t\tname: name\n\t\t});\n\t\tif (navigator.userAgent.search(\"Firefox\") > -1) {\n\t\t\tif(!!name) {\n\t\t\t\tawait browser.windows.update(this.props.window.id, {\n\t\t\t\t\ttitlePreface: name + \" - \"\n\t\t\t\t});\n\t\t\t}else{\n\t\t\t\tawait browser.windows.update(this.props.window.id, {\n\t\t\t\t\ttitlePreface: name\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\ttopEntries(arr) {\n\t\tvar cnts = arr.reduce(function(obj, val) {\n\t\t\tobj[val] = (obj[val] || 0) + 1;\n\t\t\treturn obj;\n\t\t}, {});\n\t\tvar sorted = Object.keys(cnts).sort(function(a, b) {\n\t\t\treturn cnts[b] - cnts[a];\n\t\t});\n\n\t\tvar more = 0;\n\t\tif (sorted.length == 3) {\n\t\t} else {\n\t\t\twhile (sorted.length > 2) {\n\t\t\t\tsorted.pop();\n\t\t\t\tmore++;\n\t\t\t}\n\t\t}\n\t\tfor (var i = 0; i < sorted.length; i++) {\n\t\t\tif (i > 0) {\n\t\t\t\tsorted[i] = \", \" + sorted[i];\n\t\t\t}\n\t\t}\n\t\tif (more > 0) {\n\t\t\tsorted.push(\" & \" + more + \" more\");\n\t\t}\n\t\treturn sorted;\n\t}\n\tstopProp(e) {\n\t\tif(e && e.nativeEvent) {\n\t\t\te.nativeEvent.preventDefault();\n\t\t\te.nativeEvent.stopPropagation();\n\t\t}\n\t\tif(e && e.preventDefault) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t}\n\t}\n}\n"]} \ No newline at end of file diff --git a/outlib/service_worker/background/actions.js b/outlib/service_worker/background/actions.js deleted file mode 100644 index 977c9fa7..00000000 --- a/outlib/service_worker/background/actions.js +++ /dev/null @@ -1,178 +0,0 @@ -"use strict"; - -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 setWindowColor = function () { - var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee(windowId, color) { - var colors; - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - _context.next = 2; - return getLocalStorage("windowColors", {}); - - case 2: - colors = _context.sent; - - if ((typeof colors === "undefined" ? "undefined" : _typeof(colors)) !== 'object') colors = {}; - colors[windowId] = color; - _context.next = 7; - return setLocalStorage("windowColors", colors); - - case 7: - _context.next = 9; - return updateWindowHash(windowId); - - case 9: - browser.runtime.sendMessage({ - command: "refresh_windows", - window_ids: [windowId] - }); - - case 10: - case "end": - return _context.stop(); - } - } - }, _callee, this); - })); - - return function setWindowColor(_x, _x2) { - return _ref.apply(this, arguments); - }; -}(); - -var setWindowName = function () { - var _ref2 = _asyncToGenerator(regeneratorRuntime.mark(function _callee2(windowId, name) { - var names; - return regeneratorRuntime.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - _context2.next = 2; - return getLocalStorage("windowNames", {}); - - case 2: - names = _context2.sent; - - if ((typeof names === "undefined" ? "undefined" : _typeof(names)) !== 'object') names = {}; - names[windowId] = name; - _context2.next = 7; - return setLocalStorage("windowNames", names); - - case 7: - _context2.next = 9; - return updateWindowHash(windowId); - - case 9: - browser.runtime.sendMessage({ - command: "refresh_windows", - window_ids: [windowId] - }); - - case 10: - case "end": - return _context2.stop(); - } - } - }, _callee2, this); - })); - - return function setWindowName(_x3, _x4) { - return _ref2.apply(this, arguments); - }; -}(); - -var updateWindowHash = function () { - var _ref3 = _asyncToGenerator(regeneratorRuntime.mark(function _callee3(windowId) { - var window, hash, hashes; - return regeneratorRuntime.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - _context3.next = 2; - return browser.windows.get(windowId, { populate: true }); - - case 2: - window = _context3.sent; - hash = hashcode(window); - _context3.next = 6; - return getLocalStorage("windowHashes", {}); - - case 6: - hashes = _context3.sent; - - hashes[windowId] = hash; - _context3.next = 10; - return setLocalStorage("windowHashes", hashes); - - case 10: - case "end": - return _context3.stop(); - } - } - }, _callee3, this); - })); - - return function updateWindowHash(_x5) { - return _ref3.apply(this, arguments); - }; -}(); - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } - -var browser = browser || chrome; - -function handleMessages(request, sender, sendResponse) { - switch (request.command) { - case "reload_popup_controls": - setupPopup(); - break; - case "update_tab_count": - updateTabCount(); - break; - case "discard_tabs": - discardTabs(request.tabs); - break; - case "move_tabs_to_window": - moveTabsToWindow(request.window_id, request.tabs); - break; - case "focus_on_tab_and_window": - focusOnTabAndWindow(request.tab); - break; - case "focus_on_tab_and_window_delayed": - focusOnTabAndWindowDelayed(request.tab); - break; - case "focus_on_window": - focusOnWindow(request.window_id); - break; - case "focus_on_window_delayed": - focusOnWindowDelayed(request.window_id); - break; - case "set_window_color": - setWindowColor(request.window_id, request.color); - break; - case "set_window_name": - setWindowName(request.window_id, request.name); - break; - case "create_window_with_tabs": - createWindowWithTabs(request.tabs); - break; - case "create_window_with_session_tabs": - createWindowWithSessionTabs(request.window, request.tab_id); - break; - case "close_tabs": - closeTabs(request.tabs); - break; - } -} - -function handleCommands(command) { - if (command == "switch_to_previous_active_tab") { - if (!!globalTabsActive && globalTabsActive.length > 1) { - focusOnTabAndWindow(globalTabsActive[globalTabsActive.length - 2]); - } - } -} -//# sourceMappingURL=actions.js.map \ No newline at end of file diff --git a/outlib/service_worker/background/actions.js.map b/outlib/service_worker/background/actions.js.map deleted file mode 100644 index 7e15299a..00000000 --- a/outlib/service_worker/background/actions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../lib/service_worker/background/actions.js"],"names":["windowId","color","getLocalStorage","colors","setLocalStorage","updateWindowHash","browser","runtime","sendMessage","command","window_ids","setWindowColor","name","names","setWindowName","windows","get","populate","window","hash","hashcode","hashes","chrome","handleMessages","request","sender","sendResponse","setupPopup","updateTabCount","discardTabs","tabs","moveTabsToWindow","window_id","focusOnTabAndWindow","tab","focusOnTabAndWindowDelayed","focusOnWindow","focusOnWindowDelayed","createWindowWithTabs","createWindowWithSessionTabs","tab_id","closeTabs","handleCommands","globalTabsActive","length"],"mappings":";;;;;sDAsDA,iBAA8BA,QAA9B,EAAwCC,KAAxC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aACoBC,gBAAgB,cAAhB,EAAgC,EAAhC,CADpB;;AAAA;AACKC,YADL;;AAEC,UAAI,QAAOA,MAAP,yCAAOA,MAAP,OAAkB,QAAtB,EAAgCA,SAAS,EAAT;AAChCA,aAAOH,QAAP,IAAmBC,KAAnB;AAHD;AAAA,aAIOG,gBAAgB,cAAhB,EAAgCD,MAAhC,CAJP;;AAAA;AAAA;AAAA,aAKOE,iBAAiBL,QAAjB,CALP;;AAAA;AAMCM,cAAQC,OAAR,CAAgBC,WAAhB,CAA4B;AAC3BC,gBAAS,iBADkB;AAE3BC,mBAAY,CAACV,QAAD;AAFe,OAA5B;;AAND;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,E;;iBAAeW,c;;;;;;uDAYf,kBAA6BX,QAA7B,EAAuCY,IAAvC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aACmBV,gBAAgB,aAAhB,EAA+B,EAA/B,CADnB;;AAAA;AACKW,WADL;;AAEC,UAAI,QAAOA,KAAP,yCAAOA,KAAP,OAAiB,QAArB,EAA+BA,QAAQ,EAAR;AAC/BA,YAAMb,QAAN,IAAkBY,IAAlB;AAHD;AAAA,aAIOR,gBAAgB,aAAhB,EAA+BS,KAA/B,CAJP;;AAAA;AAAA;AAAA,aAKOR,iBAAiBL,QAAjB,CALP;;AAAA;AAMCM,cAAQC,OAAR,CAAgBC,WAAhB,CAA4B;AAC3BC,gBAAS,iBADkB;AAE3BC,mBAAY,CAACV,QAAD;AAFe,OAA5B;;AAND;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,E;;iBAAec,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S,+BAA4Bf,QAAQN,MAApC,EAA4CM,QAAQgB,MAApD;AACA;AACD,OAAK,YAAL;AACCC,aAAUjB,QAAQM,IAAlB;AACA;AAvCF;AAyCA;;AAED,SAASY,cAAT,CAAwBjC,OAAxB,EAAiC;AAChC,KAAIA,WAAW,+BAAf,EAAgD;AAC/C,MAAI,CAAC,CAACkC,gBAAF,IAAsBA,iBAAiBC,MAAjB,GAA0B,CAApD,EAAuD;AACtDX,uBAAoBU,iBAAiBA,iBAAiBC,MAAjB,GAA0B,CAA3C,CAApB;AACA;AACD;AACD","file":"actions.js","sourcesContent":["var browser = browser || chrome;\r\n\r\nfunction handleMessages(request, sender, sendResponse) {\r\n\tswitch (request.command) {\r\n\t\tcase \"reload_popup_controls\":\r\n\t\t\tsetupPopup();\r\n\t\t\tbreak;\r\n\t\tcase \"update_tab_count\":\r\n\t\t\tupdateTabCount();\r\n\t\t\tbreak;\r\n\t\tcase \"discard_tabs\":\r\n\t\t\tdiscardTabs(request.tabs);\r\n\t\t\tbreak;\r\n\t\tcase \"move_tabs_to_window\":\r\n\t\t\tmoveTabsToWindow(request.window_id, request.tabs);\r\n\t\t\tbreak;\r\n\t\tcase \"focus_on_tab_and_window\":\r\n\t\t\tfocusOnTabAndWindow(request.tab);\r\n\t\t\tbreak;\r\n\t\tcase \"focus_on_tab_and_window_delayed\":\r\n\t\t\tfocusOnTabAndWindowDelayed(request.tab);\r\n\t\t\tbreak;\r\n\t\tcase \"focus_on_window\":\r\n\t\t\tfocusOnWindow(request.window_id);\r\n\t\t\tbreak;\r\n\t\tcase \"focus_on_window_delayed\":\r\n\t\t\tfocusOnWindowDelayed(request.window_id);\r\n\t\t\tbreak;\r\n\t\tcase \"set_window_color\":\r\n\t\t\tsetWindowColor(request.window_id, request.color);\r\n\t\t\tbreak;\r\n\t\tcase \"set_window_name\":\r\n\t\t\tsetWindowName(request.window_id, request.name);\r\n\t\t\tbreak;\r\n\t\tcase \"create_window_with_tabs\":\r\n\t\t\tcreateWindowWithTabs(request.tabs);\r\n\t\t\tbreak;\r\n\t\tcase \"create_window_with_session_tabs\":\r\n\t\t\tcreateWindowWithSessionTabs(request.window, request.tab_id);\r\n\t\t\tbreak;\r\n\t\tcase \"close_tabs\":\r\n\t\t\tcloseTabs(request.tabs);\r\n\t\t\tbreak;\r\n\t}\r\n}\r\n\r\nfunction handleCommands(command) {\r\n\tif (command == \"switch_to_previous_active_tab\") {\r\n\t\tif (!!globalTabsActive && globalTabsActive.length > 1) {\r\n\t\t\tfocusOnTabAndWindow(globalTabsActive[globalTabsActive.length - 2]);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nasync function setWindowColor(windowId, color) {\r\n\tvar colors = await getLocalStorage(\"windowColors\", {});\r\n\tif (typeof colors !== 'object') colors = {};\r\n\tcolors[windowId] = color;\r\n\tawait setLocalStorage(\"windowColors\", colors);\r\n\tawait updateWindowHash(windowId);\r\n\tbrowser.runtime.sendMessage({\r\n\t\tcommand: \"refresh_windows\",\r\n\t\twindow_ids: [windowId]\r\n\t});\r\n}\r\n\r\nasync function setWindowName(windowId, name) {\r\n\tvar names = await getLocalStorage(\"windowNames\", {});\r\n\tif (typeof names !== 'object') names = {};\r\n\tnames[windowId] = name;\r\n\tawait setLocalStorage(\"windowNames\", names);\r\n\tawait updateWindowHash(windowId);\r\n\tbrowser.runtime.sendMessage({\r\n\t\tcommand: \"refresh_windows\",\r\n\t\twindow_ids: [windowId]\r\n\t});\r\n}\r\n\r\nasync function updateWindowHash(windowId) {\r\n\tvar window = await browser.windows.get(windowId, {populate: true});\r\n\tvar hash = hashcode(window);\r\n\tvar hashes = await getLocalStorage(\"windowHashes\", {});\r\n\thashes[windowId] = hash;\r\n\tawait setLocalStorage(\"windowHashes\", hashes);\r\n}"]} \ No newline at end of file diff --git a/outlib/service_worker/background/tabs.js b/outlib/service_worker/background/tabs.js deleted file mode 100644 index 7458e0f4..00000000 --- a/outlib/service_worker/background/tabs.js +++ /dev/null @@ -1,503 +0,0 @@ -"use strict"; - -var setupTabListeners = function () { - var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - browser.tabs.onCreated.removeListener(tabAdded); - browser.tabs.onUpdated.removeListener(tabCountChanged); - browser.tabs.onRemoved.removeListener(tabCountChanged); - browser.tabs.onReplaced.removeListener(tabCountChanged); - browser.tabs.onDetached.removeListener(tabCountChanged); - browser.tabs.onAttached.removeListener(tabCountChanged); - browser.tabs.onActivated.removeListener(tabActiveChanged); - browser.tabs.onMoved.removeListener(tabCountChanged); - - browser.tabs.onCreated.removeListener(checkTabCreate); - browser.tabs.onUpdated.removeListener(checkTabUpdate); - browser.tabs.onRemoved.removeListener(checkTabRemove); - browser.tabs.onDetached.removeListener(checkTabDetached); - browser.tabs.onAttached.removeListener(checkTabAttached); - browser.tabs.onMoved.removeListener(checkTabMoved); - - browser.tabs.onCreated.addListener(tabAdded); - browser.tabs.onUpdated.addListener(tabCountChanged); - browser.tabs.onRemoved.addListener(tabCountChanged); - browser.tabs.onReplaced.addListener(tabCountChanged); - browser.tabs.onDetached.addListener(tabCountChanged); - browser.tabs.onAttached.addListener(tabCountChanged); - browser.tabs.onActivated.addListener(tabActiveChanged); - browser.tabs.onMoved.addListener(tabCountChanged); - - browser.tabs.onCreated.addListener(checkTabCreate); - browser.tabs.onUpdated.addListener(checkTabUpdate); - browser.tabs.onRemoved.addListener(checkTabRemove); - browser.tabs.onDetached.addListener(checkTabDetached); - browser.tabs.onAttached.addListener(checkTabAttached); - browser.tabs.onMoved.addListener(checkTabMoved); - case 28: - case "end": - return _context.stop(); - } - } - }, _callee, this); - })); - - return function setupTabListeners() { - return _ref.apply(this, arguments); - }; -}(); - -var discardTabs = function () { - var _ref2 = _asyncToGenerator(regeneratorRuntime.mark(function _callee2(tabs) { - var i; - return regeneratorRuntime.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - for (i = 0; i < tabs.length; i++) { - if (!tabs[i].discarded) { - browser.tabs.discard(tabs[i].id).catch(function (e) { - console.error(e); - console.log(e.message); - }); - } - } - - case 1: - case "end": - return _context2.stop(); - } - } - }, _callee2, this); - })); - - return function discardTabs(_x) { - return _ref2.apply(this, arguments); - }; -}(); - -var closeTabs = function () { - var _ref3 = _asyncToGenerator(regeneratorRuntime.mark(function _callee3(tabs) { - var i; - return regeneratorRuntime.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - i = 0; - - case 1: - if (!(i < tabs.length)) { - _context3.next = 7; - break; - } - - _context3.next = 4; - return browser.tabs.remove(tabs[i].id); - - case 4: - i++; - _context3.next = 1; - break; - - case 7: - case "end": - return _context3.stop(); - } - } - }, _callee3, this); - })); - - return function closeTabs(_x2) { - return _ref3.apply(this, arguments); - }; -}(); - -var moveTabsToWindow = function () { - var _ref4 = _asyncToGenerator(regeneratorRuntime.mark(function _callee4(windowId, tabs) { - var i, t; - return regeneratorRuntime.wrap(function _callee4$(_context4) { - while (1) { - switch (_context4.prev = _context4.next) { - case 0: - i = 0; - - case 1: - if (!(i < tabs.length)) { - _context4.next = 10; - break; - } - - t = tabs[i]; - _context4.next = 5; - return browser.tabs.move(t.id, { windowId: windowId, index: -1 }); - - case 5: - _context4.next = 7; - return browser.tabs.update(t.id, { pinned: t.pinned }); - - case 7: - i++; - _context4.next = 1; - break; - - case 10: - case "end": - return _context4.stop(); - } - } - }, _callee4, this); - })); - - return function moveTabsToWindow(_x3, _x4) { - return _ref4.apply(this, arguments); - }; -}(); - -var focusOnTabAndWindow = function () { - var _ref5 = _asyncToGenerator(regeneratorRuntime.mark(function _callee5(tab) { - var windowId, tabId; - return regeneratorRuntime.wrap(function _callee5$(_context5) { - while (1) { - switch (_context5.prev = _context5.next) { - case 0: - windowId = tab.windowId; - - if (!!tab.tabId) { - tabId = tab.tabId; - } else { - tabId = tab.id; - } - - browser.windows.update(windowId, { focused: true }).then(function (tabId, windowId) { - browser.tabs.update(tabId, { active: true }).then(function (tabId, windowId) { - tabActiveChanged({ tabId: tabId, windowId: windowId }); - }.bind(this, tabId, windowId)); - }.bind(this, tabId, windowId)); - - case 3: - case "end": - return _context5.stop(); - } - } - }, _callee5, this); - })); - - return function focusOnTabAndWindow(_x5) { - return _ref5.apply(this, arguments); - }; -}(); - -var updateTabCount = function () { - var _ref6 = _asyncToGenerator(regeneratorRuntime.mark(function _callee6() { - var run, badge, result, count, toRemove, i, t, found, j; - return regeneratorRuntime.wrap(function _callee6$(_context6) { - while (1) { - switch (_context6.prev = _context6.next) { - case 0: - run = true; - _context6.next = 3; - return getLocalStorage("badge", true); - - case 3: - badge = _context6.sent; - - if (!badge) run = false; - - if (!run) { - _context6.next = 21; - break; - } - - _context6.next = 8; - return browser.tabs.query({}); - - case 8: - result = _context6.sent; - count = 0; - - if (!!result && !!result.length) { - count = result.length; - } - _context6.next = 13; - return browser.action.setBadgeText({ text: count + "" }); - - case 13: - _context6.next = 15; - return browser.action.setBadgeBackgroundColor({ color: "purple" }); - - case 15: - toRemove = []; - - if (!!globalTabsActive) { - for (i = 0; i < globalTabsActive.length; i++) { - t = globalTabsActive[i]; - found = false; - - if (!!result && !!result.length) { - for (j = 0; j < result.length; j++) { - if (result[j].id == t.tabId) found = true; - } - ; - } - if (!found) toRemove.push(i); - } - ; - } - - for (i = toRemove.length - 1; i >= 0; i--) { - if (!!globalTabsActive && globalTabsActive.length > 0) { - if (!!globalTabsActive[toRemove[i]]) globalTabsActive.splice(toRemove[i], 1); - } - } - ; - _context6.next = 23; - break; - - case 21: - _context6.next = 23; - return browser.action.setBadgeText({ text: "" }); - - case 23: - case "end": - return _context6.stop(); - } - } - }, _callee6, this); - })); - - return function updateTabCount() { - return _ref6.apply(this, arguments); - }; -}(); - -var tabAdded = function () { - var _ref7 = _asyncToGenerator(regeneratorRuntime.mark(function _callee7(tab) { - var tabLimit, tabCount; - return regeneratorRuntime.wrap(function _callee7$(_context7) { - while (1) { - switch (_context7.prev = _context7.next) { - case 0: - _context7.next = 2; - return getLocalStorage("tabLimit", 0); - - case 2: - tabLimit = _context7.sent; - - if (!(tabLimit > 0)) { - _context7.next = 11; - break; - } - - if (!(tab.id != browser.tabs.TAB_ID_NONE)) { - _context7.next = 11; - break; - } - - _context7.next = 7; - return browser.tabs.query({ currentWindow: true }); - - case 7: - tabCount = _context7.sent; - - if (!(tabCount.length > tabLimit)) { - _context7.next = 11; - break; - } - - _context7.next = 11; - return createWindowWithTabs([tab], tab.incognito); - - case 11: - updateTabCountDebounce(); - - case 12: - case "end": - return _context7.stop(); - } - } - }, _callee7, this); - })); - - return function tabAdded(_x6) { - return _ref7.apply(this, arguments); - }; -}(); - -var checkTabCreate = function () { - var _ref8 = _asyncToGenerator(regeneratorRuntime.mark(function _callee8(tab) { - return regeneratorRuntime.wrap(function _callee8$(_context8) { - while (1) { - switch (_context8.prev = _context8.next) { - case 0: - _context8.next = 2; - return checkWindow(tab.windowId); - - case 2: - case "end": - return _context8.stop(); - } - } - }, _callee8, this); - })); - - return function checkTabCreate(_x7) { - return _ref8.apply(this, arguments); - }; -}(); - -var checkTabUpdate = function () { - var _ref9 = _asyncToGenerator(regeneratorRuntime.mark(function _callee9(tabid, changeinfo, tab) { - return regeneratorRuntime.wrap(function _callee9$(_context9) { - while (1) { - switch (_context9.prev = _context9.next) { - case 0: - _context9.next = 2; - return checkWindow(tab.windowId); - - case 2: - case "end": - return _context9.stop(); - } - } - }, _callee9, this); - })); - - return function checkTabUpdate(_x8, _x9, _x10) { - return _ref9.apply(this, arguments); - }; -}(); - -var checkTabRemove = function () { - var _ref10 = _asyncToGenerator(regeneratorRuntime.mark(function _callee10(tabid, removeinfo) { - return regeneratorRuntime.wrap(function _callee10$(_context10) { - while (1) { - switch (_context10.prev = _context10.next) { - case 0: - if (!removeinfo.isWindowClosing) { - _context10.next = 2; - break; - } - - return _context10.abrupt("return"); - - case 2: - _context10.next = 4; - return checkWindow(removeinfo.windowId); - - case 4: - case "end": - return _context10.stop(); - } - } - }, _callee10, this); - })); - - return function checkTabRemove(_x11, _x12) { - return _ref10.apply(this, arguments); - }; -}(); - -var checkTabDetached = function () { - var _ref11 = _asyncToGenerator(regeneratorRuntime.mark(function _callee11(tabid, detachinfo) { - return regeneratorRuntime.wrap(function _callee11$(_context11) { - while (1) { - switch (_context11.prev = _context11.next) { - case 0: - _context11.next = 2; - return checkWindow(detachinfo.oldWindowId); - - case 2: - case "end": - return _context11.stop(); - } - } - }, _callee11, this); - })); - - return function checkTabDetached(_x13, _x14) { - return _ref11.apply(this, arguments); - }; -}(); - -var checkTabAttached = function () { - var _ref12 = _asyncToGenerator(regeneratorRuntime.mark(function _callee12(tabid, attachinfo) { - return regeneratorRuntime.wrap(function _callee12$(_context12) { - while (1) { - switch (_context12.prev = _context12.next) { - case 0: - _context12.next = 2; - return checkWindow(attachinfo.newWindowId); - - case 2: - case "end": - return _context12.stop(); - } - } - }, _callee12, this); - })); - - return function checkTabAttached(_x15, _x16) { - return _ref12.apply(this, arguments); - }; -}(); - -var checkTabMoved = function () { - var _ref13 = _asyncToGenerator(regeneratorRuntime.mark(function _callee13(tabid, moveinfo) { - return regeneratorRuntime.wrap(function _callee13$(_context13) { - while (1) { - switch (_context13.prev = _context13.next) { - case 0: - _context13.next = 2; - return checkWindow(moveinfo.windowId); - - case 2: - case "end": - return _context13.stop(); - } - } - }, _callee13, this); - })); - - return function checkTabMoved(_x17, _x18) { - return _ref13.apply(this, arguments); - }; -}(); - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } - -var browser = browser || chrome; - -function focusOnTabAndWindowDelayed(tab) { - var tab = JSON.parse(JSON.stringify(tab)); - setTimeout(focusOnTabAndWindow.bind(this, tab), 125); -} - -function tabCountChanged() { - updateTabCountDebounce(); -} - -function tabActiveChanged(tab) { - if (!!tab && !!tab.tabId) { - if (!globalTabsActive) globalTabsActive = []; - if (!!globalTabsActive && globalTabsActive.length > 0) { - var lastActive = globalTabsActive[globalTabsActive.length - 1]; - if (!!lastActive && lastActive.tabId == tab.tabId && lastActive.windowId == tab.windowId) { - return; - } - } - while (globalTabsActive.length > 20) { - globalTabsActive.shift(); - } - for (var i = globalTabsActive.length - 1; i >= 0; i--) { - if (globalTabsActive[i].tabId == tab.tabId) { - globalTabsActive.splice(i, 1); - } - } - globalTabsActive.push(tab); - } - updateTabCountDebounce(); -} -//# sourceMappingURL=tabs.js.map \ No newline at end of file diff --git a/outlib/service_worker/background/tabs.js.map b/outlib/service_worker/background/tabs.js.map deleted file mode 100644 index 4dde4e0d..00000000 --- a/outlib/service_worker/background/tabs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../lib/service_worker/background/tabs.js"],"names":["browser","tabs","onCreated","removeListener","tabAdded","onUpdated","tabCountChanged","onRemoved","onReplaced","onDetached","onAttached","onActivated","tabActiveChanged","onMoved","checkTabCreate","checkTabUpdate","checkTabRemove","checkTabDetached","checkTabAttached","checkTabMoved","addListener","setupTabListeners","i","length","discarded","discard","id","catch","e","console","error","log","message","discardTabs","remove","closeTabs","windowId","t","move","index","update","pinned","moveTabsToWindow","tab","tabId","windows","focused","then","active","bind","focusOnTabAndWindow","run","getLocalStorage","badge","query","result","count","action","setBadgeText","text","setBadgeBackgroundColor","color","toRemove","globalTabsActive","found","j","push","splice","updateTabCount","tabLimit","TAB_ID_NONE","currentWindow","tabCount","createWindowWithTabs","incognito","updateTabCountDebounce","checkWindow","tabid","changeinfo","removeinfo","isWindowClosing","detachinfo","oldWindowId","attachinfo","newWindowId","moveinfo","chrome","focusOnTabAndWindowDelayed","JSON","parse","stringify","setTimeout","lastActive","shift"],"mappings":";;;sDAEA;AAAA;AAAA;AAAA;AAAA;AACCA,cAAQC,IAAR,CAAaC,S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\n\tbrowser.tabs.onCreated.removeListener(tabAdded);\r\n\tbrowser.tabs.onUpdated.removeListener(tabCountChanged);\r\n\tbrowser.tabs.onRemoved.removeListener(tabCountChanged);\r\n\tbrowser.tabs.onReplaced.removeListener(tabCountChanged);\r\n\tbrowser.tabs.onDetached.removeListener(tabCountChanged);\r\n\tbrowser.tabs.onAttached.removeListener(tabCountChanged);\r\n\tbrowser.tabs.onActivated.removeListener(tabActiveChanged);\r\n\tbrowser.tabs.onMoved.removeListener(tabCountChanged);\r\n\r\n\tbrowser.tabs.onCreated.removeListener(checkTabCreate);\r\n\tbrowser.tabs.onUpdated.removeListener(checkTabUpdate);\r\n\tbrowser.tabs.onRemoved.removeListener(checkTabRemove);\r\n\tbrowser.tabs.onDetached.removeListener(checkTabDetached);\r\n\tbrowser.tabs.onAttached.removeListener(checkTabAttached);\r\n\tbrowser.tabs.onMoved.removeListener(checkTabMoved);\r\n\r\n\tbrowser.tabs.onCreated.addListener(tabAdded);\r\n\tbrowser.tabs.onUpdated.addListener(tabCountChanged);\r\n\tbrowser.tabs.onRemoved.addListener(tabCountChanged);\r\n\tbrowser.tabs.onReplaced.addListener(tabCountChanged);\r\n\tbrowser.tabs.onDetached.addListener(tabCountChanged);\r\n\tbrowser.tabs.onAttached.addListener(tabCountChanged);\r\n\tbrowser.tabs.onActivated.addListener(tabActiveChanged);\r\n\tbrowser.tabs.onMoved.addListener(tabCountChanged);\r\n\r\n\tbrowser.tabs.onCreated.addListener(checkTabCreate); // 1, tab\r\n\tbrowser.tabs.onUpdated.addListener(checkTabUpdate); // 3, tabid, changeinfo, tab\r\n\tbrowser.tabs.onRemoved.addListener(checkTabRemove); // 2, tabid, removeinfo\r\n\tbrowser.tabs.onDetached.addListener(checkTabDetached); // 2, tabid, detachinfo\r\n\tbrowser.tabs.onAttached.addListener(checkTabAttached); // 2, tabid, attachinfo\r\n\tbrowser.tabs.onMoved.addListener(checkTabMoved); // 2, tabid, moveinfo\r\n}\r\n\r\nasync function discardTabs(tabs) {\r\n\tfor (var i = 0; i < tabs.length; i++) {\r\n\t\tif (!tabs[i].discarded) {\r\n\t\t\tbrowser.tabs.discard(tabs[i].id).catch(function (e) {\r\n\t\t\t\tconsole.error(e);\r\n\t\t\t\tconsole.log(e.message);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}\r\n\r\nasync function closeTabs(tabs) {\r\n\tfor (var i = 0; i < tabs.length; i++) {\r\n\t\tawait browser.tabs.remove(tabs[i].id);\r\n\t}\r\n}\r\n\r\nasync function moveTabsToWindow(windowId, tabs) {\r\n\tfor (var i = 0; i < tabs.length; i++) {\r\n\t\tvar t = tabs[i];\r\n\t\tawait browser.tabs.move(t.id, {windowId: windowId, index: -1});\r\n\t\tawait browser.tabs.update(t.id, {pinned: t.pinned});\r\n\t}\r\n}\r\n\r\nfunction focusOnTabAndWindowDelayed(tab) {\r\n\tvar tab = JSON.parse(JSON.stringify(tab));\r\n\tsetTimeout(focusOnTabAndWindow.bind(this, tab), 125);\r\n}\r\n\r\nasync function focusOnTabAndWindow(tab) {\r\n\tvar windowId = tab.windowId;\r\n\tvar tabId;\r\n\tif (!!tab.tabId) {\r\n\t\ttabId = tab.tabId;\r\n\t} else {\r\n\t\ttabId = tab.id;\r\n\t}\r\n\r\n\tbrowser.windows.update(windowId, {focused: true}).then(function (tabId, windowId) {\r\n\t\tbrowser.tabs.update(tabId, {active: true}).then(function (tabId, windowId) {\r\n\t\t\ttabActiveChanged({tabId: tabId, windowId: windowId});\r\n\t\t}.bind(this, tabId, windowId));\r\n\t}.bind(this, tabId, windowId));\r\n}\r\n\r\nasync function updateTabCount() {\r\n\tvar run = true;\r\n\r\n\tvar badge = await getLocalStorage(\"badge\", true);\r\n\tif (!badge) run = false;\r\n\r\n\tif (run) {\r\n\t\tvar result = await browser.tabs.query({});\r\n\t\tvar count = 0;\r\n\t\tif (!!result && !!result.length) {\r\n\t\t\tcount = result.length;\r\n\t\t}\r\n\t\tawait browser.action.setBadgeText({text: count + \"\"});\r\n\t\tawait browser.action.setBadgeBackgroundColor({color: \"purple\"});\r\n\t\tvar toRemove = [];\r\n\t\tif (!!globalTabsActive) {\r\n\t\t\tfor (var i = 0; i < globalTabsActive.length; i++) {\r\n\t\t\t\tvar t = globalTabsActive[i];\r\n\t\t\t\tvar found = false;\r\n\t\t\t\tif (!!result && !!result.length) {\r\n\t\t\t\t\tfor (var j = 0; j < result.length; j++) {\r\n\t\t\t\t\t\tif (result[j].id == t.tabId) found = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t;\r\n\t\t\t\t}\r\n\t\t\t\tif (!found) toRemove.push(i);\r\n\t\t\t}\r\n\t\t\t;\r\n\t\t}\r\n\t\t// console.log(\"to remove\", toRemove);\r\n\t\tfor (var i = toRemove.length - 1; i >= 0; i--) {\r\n\t\t\t// console.log(\"removing\", toRemove[i]);\r\n\t\t\tif (!!globalTabsActive && globalTabsActive.length > 0) {\r\n\t\t\t\tif (!!globalTabsActive[toRemove[i]]) globalTabsActive.splice(toRemove[i], 1);\r\n\t\t\t}\r\n\t\t}\r\n\t\t;\r\n\t} else {\r\n\t\tawait browser.action.setBadgeText({text: \"\"});\r\n\t}\r\n}\r\n\r\nfunction tabCountChanged() {\r\n\tupdateTabCountDebounce();\r\n}\r\n\r\nasync function tabAdded(tab) {\r\n\tvar tabLimit = await getLocalStorage(\"tabLimit\", 0);\r\n\tif (tabLimit > 0) {\r\n\t\tif (tab.id != browser.tabs.TAB_ID_NONE) {\r\n\t\t\tvar tabCount = await browser.tabs.query({currentWindow: true});\r\n\t\t\tif (tabCount.length > tabLimit) {\r\n\t\t\t\tawait createWindowWithTabs([tab], tab.incognito);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tupdateTabCountDebounce();\r\n}\r\n\r\nfunction tabActiveChanged(tab) {\r\n\tif (!!tab && !!tab.tabId) {\r\n\t\tif (!globalTabsActive) globalTabsActive = [];\r\n\t\tif (!!globalTabsActive && globalTabsActive.length > 0) {\r\n\t\t\tvar lastActive = globalTabsActive[globalTabsActive.length - 1];\r\n\t\t\tif (!!lastActive && lastActive.tabId == tab.tabId && lastActive.windowId == tab.windowId) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\twhile (globalTabsActive.length > 20) {\r\n\t\t\tglobalTabsActive.shift();\r\n\t\t}\r\n\t\tfor (var i = globalTabsActive.length - 1; i >= 0; i--) {\r\n\t\t\tif (globalTabsActive[i].tabId == tab.tabId) {\r\n\t\t\t\tglobalTabsActive.splice(i, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t\tglobalTabsActive.push(tab);\r\n\t}\r\n\tupdateTabCountDebounce();\r\n}\r\n\r\nasync function checkTabCreate(tab) {\r\n\tawait checkWindow(tab.windowId);\r\n}\r\n\r\nasync function checkTabUpdate(tabid, changeinfo, tab) {\r\n\tawait checkWindow(tab.windowId);\r\n}\r\n\r\nasync function checkTabRemove(tabid, removeinfo) {\r\n\tif (removeinfo.isWindowClosing) return;\r\n\tawait checkWindow(removeinfo.windowId);\r\n}\r\n\r\nasync function checkTabDetached(tabid, detachinfo) {\r\n\tawait checkWindow(detachinfo.oldWindowId);\r\n}\r\n\r\nasync function checkTabAttached(tabid, attachinfo) {\r\n\tawait checkWindow(attachinfo.newWindowId);\r\n}\r\n\r\nasync function checkTabMoved(tabid, moveinfo) {\r\n\tawait checkWindow(moveinfo.windowId);\r\n}"]} \ No newline at end of file diff --git a/outlib/service_worker/background/tracking.js b/outlib/service_worker/background/tracking.js deleted file mode 100644 index eedb67f6..00000000 --- a/outlib/service_worker/background/tracking.js +++ /dev/null @@ -1,293 +0,0 @@ -"use strict"; - -var cleanUp = function () { - var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee() { - var activewindows, windowids, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, w, windows, i, names, colors, tocheck, exists, to_refresh, id, hashes, found, _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, windowhash; - - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - _context.next = 2; - return browser.windows.getAll({ populate: true }); - - case 2: - activewindows = _context.sent; - windowids = []; - _iteratorNormalCompletion = true; - _didIteratorError = false; - _iteratorError = undefined; - _context.prev = 7; - - for (_iterator = activewindows[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - w = _step.value; - - windowids.push(w.id); - } - _context.next = 15; - break; - - case 11: - _context.prev = 11; - _context.t0 = _context["catch"](7); - _didIteratorError = true; - _iteratorError = _context.t0; - - case 15: - _context.prev = 15; - _context.prev = 16; - - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - - case 18: - _context.prev = 18; - - if (!_didIteratorError) { - _context.next = 21; - break; - } - - throw _iteratorError; - - case 21: - return _context.finish(18); - - case 22: - return _context.finish(15); - - case 23: - _context.next = 25; - return getLocalStorage("windowAge", []); - - case 25: - windows = _context.sent; - - if (!(windows instanceof Array)) windows = []; - - for (i = windows.length - 1; i >= 0; i--) { - if (windowids.indexOf(windows[i]) < 0) { - windows.splice(i, 1); - } - } - ; - _context.next = 31; - return setLocalStorage("windowAge", windows); - - case 31: - _context.next = 33; - return getLocalStorage("windowNames", {}); - - case 33: - names = _context.sent; - _context.next = 36; - return getLocalStorage("windowColors", {}); - - case 36: - colors = _context.sent; - tocheck = new Set(); - exists = new Set(); - to_refresh = []; - - for (id in names) { - if (windowids.indexOf(parseInt(id)) < 0) { - tocheck.add(id); - } else { - exists.add(id); - } - } - - for (id in colors) { - if (windowids.indexOf(parseInt(id)) < 0) { - tocheck.add(id); - } else { - exists.add(id); - } - } - - if (!(tocheck.size > 0)) { - _context.next = 112; - break; - } - - _context.next = 45; - return getLocalStorage("windowHashes", {}); - - case 45: - hashes = _context.sent; - - console.log(hashes); - console.log(names); - console.log(colors); - - for (id in hashes) { - if (!hashes[id]) delete hashes[id]; - }for (id in colors) { - if (!colors[id]) delete colors[id]; - }found = false; - _iteratorNormalCompletion2 = true; - _didIteratorError2 = false; - _iteratorError2 = undefined; - _context.prev = 55; - _iterator2 = activewindows[Symbol.iterator](); - - case 57: - if (_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done) { - _context.next = 84; - break; - } - - w = _step2.value; - windowhash = hashcode(w); - _context.t1 = regeneratorRuntime.keys(hashes); - - case 61: - if ((_context.t2 = _context.t1()).done) { - _context.next = 81; - break; - } - - id = _context.t2.value; - - if (tocheck.has(id)) { - _context.next = 65; - break; - } - - return _context.abrupt("continue", 61); - - case 65: - if (!exists.has(id)) { - _context.next = 67; - break; - } - - return _context.abrupt("continue", 61); - - case 67: - if (!(w.id == id)) { - _context.next = 69; - break; - } - - return _context.abrupt("break", 81); - - case 69: - if (!(hashes[id] == windowhash)) { - _context.next = 79; - break; - } - - console.log("found by hash, old id " + id + " new id " + w.id); - to_refresh.push(w.id); - if (!!names[id]) { - names[w.id] = names[id]; - delete names[id]; - } - if (!!colors[id]) { - colors[w.id] = colors[id]; - delete colors[id]; - } - hashes[w.id] = names[id]; - delete hashes[id]; - found = true; - tocheck.delete(id); - return _context.abrupt("break", 81); - - case 79: - _context.next = 61; - break; - - case 81: - _iteratorNormalCompletion2 = true; - _context.next = 57; - break; - - case 84: - _context.next = 90; - break; - - case 86: - _context.prev = 86; - _context.t3 = _context["catch"](55); - _didIteratorError2 = true; - _iteratorError2 = _context.t3; - - case 90: - _context.prev = 90; - _context.prev = 91; - - if (!_iteratorNormalCompletion2 && _iterator2.return) { - _iterator2.return(); - } - - case 93: - _context.prev = 93; - - if (!_didIteratorError2) { - _context.next = 96; - break; - } - - throw _iteratorError2; - - case 96: - return _context.finish(93); - - case 97: - return _context.finish(90); - - case 98: - - for (id in tocheck) { - console.log("did not find by hash", id); - } - - if (!found) { - _context.next = 107; - break; - } - - _context.next = 102; - return setLocalStorage("windowNames", names); - - case 102: - _context.next = 104; - return setLocalStorage("windowColors", colors); - - case 104: - _context.next = 106; - return setLocalStorage("windowHashes", hashes); - - case 106: - browser.runtime.sendMessage({ - command: "refresh_windows", - window_ids: to_refresh - }); - - case 107: - - console.log(tocheck); - console.log(exists); - console.log(hashes); - console.log(names); - console.log(colors); - - case 112: - case "end": - return _context.stop(); - } - } - }, _callee, this, [[7, 11, 15, 23], [16,, 18, 22], [55, 86, 90, 98], [91,, 93, 97]]); - })); - - return function cleanUp() { - return _ref.apply(this, arguments); - }; -}(); - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } - -var browser = browser || chrome; -//# sourceMappingURL=tracking.js.map \ No newline at end of file diff --git a/outlib/service_worker/background/tracking.js.map b/outlib/service_worker/background/tracking.js.map deleted file mode 100644 index 479e899b..00000000 --- a/outlib/service_worker/background/tracking.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../lib/service_worker/background/tracking.js"],"names":["browser","windows","getAll","populate","activewindows","windowids","w","push","id","getLocalStorage","Array","i","length","indexOf","splice","setLocalStorage","names","colors","tocheck","Set","exists","to_refresh","parseInt","add","size","hashes","console","log","found","windowhash","hashcode","has","delete","runtime","sendMessage","command","window_ids","cleanUp","chrome"],"mappings":";;;sDAEA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAC2BA,QAAQC,OAAR,CAAgBC,MAAhB,CAAuB,EAACC,UAAU,IAAX,EAAvB,CAD3B;;AAAA;AACKC,mBADL;AAEKC,eAFL,GAEiB,EAFjB;AAAA;AAAA;AAAA;AAAA;;AAGC,uBAAcD,aAAd,uHAA6B;AAApBE,QAAoB;;AAC5BD,iBAAUE,IAAV,CAAeD,EAAEE,EAAjB;AACA;AALF;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;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F;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,E;;iBAAeoB,O;;;;;;;AAFd,IAAIrC,UAAUA,WAAWsC,MAAzB","file":"tracking.js","sourcesContent":["var browser = browser || chrome;\r\n\r\nasync function cleanUp() {\r\n\tvar activewindows = await browser.windows.getAll({populate: true});\r\n\tvar windowids = [];\r\n\tfor (var w of activewindows) {\r\n\t\twindowids.push(w.id);\r\n\t}\r\n\t// console.log(\"window ids...\", windowids);\r\n\r\n\tvar windows = await getLocalStorage(\"windowAge\", []);\r\n\tif (!(windows instanceof Array)) windows = [];\r\n\r\n\t// console.log(\"before\", JSON.parse(JSON.stringify(windows)));\r\n\tfor (var i = windows.length - 1; i >= 0; i--) {\r\n\t\tif (windowids.indexOf(windows[i]) < 0) {\r\n\t\t\t// console.log(\"did not find\", windows[i], i);\r\n\t\t\twindows.splice(i, 1);\r\n\t\t}\r\n\t}\r\n\t;\r\n\t// console.log(\"after\", JSON.parse(JSON.stringify(windows)));\r\n\tawait setLocalStorage(\"windowAge\", windows);\r\n\r\n\tvar names = await getLocalStorage(\"windowNames\", {});\r\n\tvar colors = await getLocalStorage(\"windowColors\", {});\r\n\tvar tocheck = new Set();\r\n\tvar exists = new Set();\r\n\tvar to_refresh = [];\r\n\r\n\t// console.log(\"before\", JSON.parse(JSON.stringify(names)));\r\n\tfor (var id in names) {\r\n\t\tif (windowids.indexOf(parseInt(id)) < 0) {\r\n\t\t\t// console.log(\"did not find\", id);\r\n\t\t\ttocheck.add(id);\r\n\t\t} else {\r\n\t\t\texists.add(id);\r\n\t\t}\r\n\t}\r\n\r\n\tfor (var id in colors) {\r\n\t\tif (windowids.indexOf(parseInt(id)) < 0) {\r\n\t\t\t// console.log(\"did not find\", id);\r\n\t\t\ttocheck.add(id);\r\n\t\t} else {\r\n\t\t\texists.add(id);\r\n\t\t}\r\n\t}\r\n\r\n\tif (tocheck.size > 0) {\r\n\t\tvar hashes = await getLocalStorage(\"windowHashes\", {});\r\n\t\tconsole.log(hashes);\r\n\t\tconsole.log(names);\r\n\t\tconsole.log(colors);\r\n\r\n\t\t// delete hashes with empty values\r\n\t\tfor (var id in hashes) if (!hashes[id]) delete hashes[id];\r\n\t\tfor (var id in colors) if (!colors[id]) delete colors[id];\r\n\r\n\t\tvar found = false;\r\n\r\n\t\tfor (var w of activewindows) {\r\n\t\t\tvar windowhash = hashcode(w);\r\n\t\t\tfor (var id in hashes) {\r\n\t\t\t\tif (!tocheck.has(id)) continue;\r\n\t\t\t\tif (exists.has(id)) continue;\r\n\t\t\t\tif (w.id == id) break;\r\n\t\t\t\tif (hashes[id] == windowhash) {\r\n\t\t\t\t\tconsole.log(\"found by hash, old id \" + id + \" new id \" + w.id);\r\n\t\t\t\t\tto_refresh.push(w.id);\r\n\t\t\t\t\tif (!!names[id]) {\r\n\t\t\t\t\t\tnames[w.id] = names[id];\r\n\t\t\t\t\t\tdelete names[id];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!!colors[id]) {\r\n\t\t\t\t\t\tcolors[w.id] = colors[id];\r\n\t\t\t\t\t\tdelete colors[id];\r\n\t\t\t\t\t}\r\n\t\t\t\t\thashes[w.id] = names[id];\r\n\t\t\t\t\tdelete hashes[id];\r\n\t\t\t\t\tfound = true;\r\n\t\t\t\t\ttocheck.delete(id);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (var id in tocheck) {\r\n\t\t\tconsole.log(\"did not find by hash\", id);\r\n\t\t\t//delete colors[id];\r\n\t\t\t//delete names[id];\r\n\t\t\t//delete hashes[id];\r\n\t\t}\r\n\r\n\t\tif (found) {\r\n\t\t\tawait setLocalStorage(\"windowNames\", names);\r\n\t\t\tawait setLocalStorage(\"windowColors\", colors);\r\n\t\t\tawait setLocalStorage(\"windowHashes\", hashes);\r\n\t\t\tbrowser.runtime.sendMessage({\r\n\t\t\t\tcommand: \"refresh_windows\",\r\n\t\t\t\twindow_ids: to_refresh\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tconsole.log(tocheck)\r\n\t\tconsole.log(exists)\r\n\t\tconsole.log(hashes);\r\n\t\tconsole.log(names);\r\n\t\tconsole.log(colors);\r\n\t}\r\n}"]} \ No newline at end of file diff --git a/outlib/service_worker/background/windows.js b/outlib/service_worker/background/windows.js deleted file mode 100644 index 6518d692..00000000 --- a/outlib/service_worker/background/windows.js +++ /dev/null @@ -1,786 +0,0 @@ -"use strict"; - -var setupWindowListeners = function () { - var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - browser.windows.onFocusChanged.removeListener(windowFocus); - browser.windows.onCreated.removeListener(windowCreated); - browser.windows.onRemoved.removeListener(windowRemoved); - - browser.windows.onFocusChanged.addListener(windowFocus); - browser.windows.onCreated.addListener(windowCreated); - browser.windows.onRemoved.addListener(windowRemoved); - - case 6: - case "end": - return _context.stop(); - } - } - }, _callee, this); - })); - - return function setupWindowListeners() { - return _ref.apply(this, arguments); - }; -}(); - -var createWindowWithTabs = function () { - var _ref2 = _asyncToGenerator(regeneratorRuntime.mark(function _callee2(tabs, isIncognito) { - var pinnedIndex, firstTab, t, i, firstPinned, w, _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, oldTabId, oldTab, tabPinned, movedTabs, newTab; - - return regeneratorRuntime.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - pinnedIndex = 0; - firstTab = tabs.shift(); - t = []; - - for (i = 0; i < tabs.length; i++) { - t.push(tabs[i].id); - } - ; - - firstPinned = firstTab.pinned; - _context2.next = 8; - return browser.windows.create({ tabId: firstTab.id, incognito: !!isIncognito }); - - case 8: - w = _context2.sent; - - if (!firstPinned) { - _context2.next = 13; - break; - } - - _context2.next = 12; - return browser.tabs.update(w.tabs[0].id, { pinned: firstPinned }); - - case 12: - pinnedIndex++; - - case 13: - if (!(t.length > 0)) { - _context2.next = 60; - break; - } - - i = 0; - _iteratorNormalCompletion2 = true; - _didIteratorError2 = false; - _iteratorError2 = undefined; - _context2.prev = 18; - _iterator2 = t[Symbol.iterator](); - - case 20: - if (_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done) { - _context2.next = 45; - break; - } - - oldTabId = _step2.value; - - i++; - _context2.next = 25; - return browser.tabs.get(oldTabId); - - case 25: - oldTab = _context2.sent; - tabPinned = oldTab.pinned; - movedTabs = []; - - if (tabPinned) { - _context2.next = 34; - break; - } - - _context2.next = 31; - return browser.tabs.move(oldTabId, { windowId: w.id, index: -1 }); - - case 31: - movedTabs = _context2.sent; - _context2.next = 37; - break; - - case 34: - _context2.next = 36; - return browser.tabs.move(oldTabId, { windowId: w.id, index: pinnedIndex++ }); - - case 36: - movedTabs = _context2.sent; - - case 37: - if (!(movedTabs.length > 0)) { - _context2.next = 42; - break; - } - - newTab = movedTabs[0]; - - if (!tabPinned) { - _context2.next = 42; - break; - } - - _context2.next = 42; - return browser.tabs.update(newTab.id, { pinned: tabPinned }); - - case 42: - _iteratorNormalCompletion2 = true; - _context2.next = 20; - break; - - case 45: - _context2.next = 51; - break; - - case 47: - _context2.prev = 47; - _context2.t0 = _context2["catch"](18); - _didIteratorError2 = true; - _iteratorError2 = _context2.t0; - - case 51: - _context2.prev = 51; - _context2.prev = 52; - - if (!_iteratorNormalCompletion2 && _iterator2.return) { - _iterator2.return(); - } - - case 54: - _context2.prev = 54; - - if (!_didIteratorError2) { - _context2.next = 57; - break; - } - - throw _iteratorError2; - - case 57: - return _context2.finish(54); - - case 58: - return _context2.finish(51); - - case 59: - ; - - case 60: - _context2.next = 62; - return browser.windows.update(w.id, { focused: true }); - - case 62: - case "end": - return _context2.stop(); - } - } - }, _callee2, this, [[18, 47, 51, 59], [52,, 54, 58]]); - })); - - return function createWindowWithTabs(_x, _x2) { - return _ref2.apply(this, arguments); - }; -}(); - -var createWindowWithSessionTabs = function () { - var _ref3 = _asyncToGenerator(regeneratorRuntime.mark(function _callee3(window, tabId) { - var customName, color, whitelistWindow, whitelistTab, filteredWindow, newWindow, emptyTab, i, newTab, tabCreated; - return regeneratorRuntime.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - customName = false; - - if (window && window.name && window.customName) { - customName = window.name; - } - color = "default"; - - if (window && window.color) { - color = window.color; - } - - whitelistWindow = ["left", "top", "width", "height", "incognito", "type"]; - - - if (navigator.userAgent.search("Firefox") > -1) { - whitelistWindow = ["left", "top", "width", "height", "incognito", "type"]; - } - - whitelistTab = ["url", "active", "selected", "pinned", "index"]; - - - if (navigator.userAgent.search("Firefox") > -1) { - whitelistTab = ["url", "active", "pinned", "index"]; - } - - filteredWindow = Object.keys(window.windowsInfo).filter(function (key) { - return whitelistWindow.includes(key); - }).reduce(function (obj, key) { - obj[key] = window.windowsInfo[key]; - return obj; - }, {}); - - - if (filteredWindow.left < 0 || filteredWindow.left > 800) filteredWindow.left = 0; - if (filteredWindow.top < 0 || filteredWindow.top > 600) filteredWindow.top = 0; - if (filteredWindow.width > 800) filteredWindow.width = 800; - if (filteredWindow.height > 600) filteredWindow.height = 600; - - filteredWindow.type = "normal"; - - _context3.next = 16; - return browser.windows.create(filteredWindow).catch(function (error) { - console.error(error); - console.log(error); - console.log(error.message); - }); - - case 16: - newWindow = _context3.sent; - emptyTab = newWindow.tabs[0].id; - i = 0; - - case 19: - if (!(i < window.tabs.length)) { - _context3.next = 38; - break; - } - - newTab = Object.keys(window.tabs[i]).filter(function (key) { - return whitelistTab.includes(key); - }).reduce(function (obj, key) { - obj[key] = window.tabs[i][key]; - return obj; - }, {}); - - if (!(tabId != null && tabId != newTab.index)) { - _context3.next = 23; - break; - } - - return _context3.abrupt("continue", 35); - - case 23: - newTab.windowId = newWindow.id; - - if (navigator.userAgent.search("Firefox") > -1) { - if (!!newTab.url && newTab.url.search("about:") > -1) { - console.log("filtered by about: url", newTab.url); - newTab.url = ""; - } - } - _context3.prev = 25; - _context3.next = 28; - return browser.tabs.create(newTab).catch(function (error) { - console.error(error); - console.log(error); - console.log(error.message); - }); - - case 28: - tabCreated = _context3.sent; - _context3.next = 35; - break; - - case 31: - _context3.prev = 31; - _context3.t0 = _context3["catch"](25); - - console.log("couldn't restore tab"); - console.error(_context3.t0); - - case 35: - i++; - _context3.next = 19; - break; - - case 38: - _context3.next = 40; - return browser.tabs.remove(emptyTab).catch(function (error) { - console.error(error); - console.log(error); - console.log(error.message); - }); - - case 40: - - if (customName) { - console.log("setting name"); - setWindowName(newWindow.id, customName); - } - - if (color != "default") { - console.log("setting color"); - setWindowColor(newWindow.id, color); - } - - _context3.next = 44; - return browser.windows.update(newWindow.id, { focused: true }); - - case 44: - case "end": - return _context3.stop(); - } - } - }, _callee3, this, [[25, 31]]); - })); - - return function createWindowWithSessionTabs(_x3, _x4) { - return _ref3.apply(this, arguments); - }; -}(); - -var focusOnWindow = function () { - var _ref4 = _asyncToGenerator(regeneratorRuntime.mark(function _callee4(windowId) { - return regeneratorRuntime.wrap(function _callee4$(_context4) { - while (1) { - switch (_context4.prev = _context4.next) { - case 0: - _context4.next = 2; - return browser.windows.update(windowId, { focused: true }); - - case 2: - case "end": - return _context4.stop(); - } - } - }, _callee4, this); - })); - - return function focusOnWindow(_x5) { - return _ref4.apply(this, arguments); - }; -}(); - -var hideWindows = function () { - var _ref5 = _asyncToGenerator(regeneratorRuntime.mark(function _callee6(windowId) { - var hideWindows, result; - return regeneratorRuntime.wrap(function _callee6$(_context6) { - while (1) { - switch (_context6.prev = _context6.next) { - case 0: - if (!(navigator.userAgent.search("Firefox") > -1)) { - _context6.next = 2; - break; - } - - return _context6.abrupt("return"); - - case 2: - if (!(!windowId || windowId < 0)) { - _context6.next = 6; - break; - } - - return _context6.abrupt("return"); - - case 6: - _context6.next = 8; - return getLocalStorage("hideWindows", false); - - case 8: - hideWindows = _context6.sent; - - if (hideWindows) { - _context6.next = 11; - break; - } - - return _context6.abrupt("return"); - - case 11: - _context6.next = 13; - return browser.permissions.contains({ permissions: ['system.display'] }); - - case 13: - result = _context6.sent; - - if (result) { - chrome.system.display.getInfo(function () { - var _ref6 = _asyncToGenerator(regeneratorRuntime.mark(function _callee5(windowId, displaylayouts) { - var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, displaylayout, windows, monitor, i, a, result; - - return regeneratorRuntime.wrap(function _callee5$(_context5) { - while (1) { - switch (_context5.prev = _context5.next) { - case 0: - globalDisplayInfo = []; - _iteratorNormalCompletion = true; - _didIteratorError = false; - _iteratorError = undefined; - _context5.prev = 4; - - for (_iterator = displaylayouts[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - displaylayout = _step.value; - - globalDisplayInfo.push(displaylayout.bounds); - } - _context5.next = 12; - break; - - case 8: - _context5.prev = 8; - _context5.t0 = _context5["catch"](4); - - _didIteratorError = true; - _iteratorError = _context5.t0; - - case 12: - _context5.prev = 12; - _context5.prev = 13; - - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - - case 15: - _context5.prev = 15; - - if (!_didIteratorError) { - _context5.next = 18; - break; - } - - throw _iteratorError; - - case 18: - return _context5.finish(15); - - case 19: - return _context5.finish(12); - - case 20: - _context5.next = 22; - return browser.windows.getAll({ populate: true }); - - case 22: - windows = _context5.sent; - monitor = -1; - - for (i = windows.length - 1; i >= 0; i--) { - if (windows[i].id == windowId) { - for (a in globalDisplayInfo) { - result = is_in_bounds(windows[i], globalDisplayInfo[a]); - - if (result) { - monitor = a; - } - } - } - } - ; - - i = windows.length - 1; - - case 27: - if (!(i >= 0)) { - _context5.next = 35; - break; - } - - if (!(windows[i].id != windowId)) { - _context5.next = 32; - break; - } - - if (!is_in_bounds(windows[i], globalDisplayInfo[monitor])) { - _context5.next = 32; - break; - } - - _context5.next = 32; - return browser.windows.update(windows[i].id, { "state": "minimized" }); - - case 32: - i--; - _context5.next = 27; - break; - - case 35: - ; - - case 36: - case "end": - return _context5.stop(); - } - } - }, _callee5, this, [[4, 8, 12, 20], [13,, 15, 19]]); - })); - - return function (_x7, _x8) { - return _ref6.apply(this, arguments); - }; - }().bind(null, windowId)); - } - - case 15: - case "end": - return _context6.stop(); - } - } - }, _callee6, this); - })); - - return function hideWindows(_x6) { - return _ref5.apply(this, arguments); - }; -}(); - -var windowActive = function () { - var _ref7 = _asyncToGenerator(regeneratorRuntime.mark(function _callee7(windowId) { - var windows, windowAge; - return regeneratorRuntime.wrap(function _callee7$(_context7) { - while (1) { - switch (_context7.prev = _context7.next) { - case 0: - if (!(windowId < 0)) { - _context7.next = 2; - break; - } - - return _context7.abrupt("return"); - - case 2: - windows = []; - _context7.next = 5; - return getLocalStorage("windowAge", []); - - case 5: - windowAge = _context7.sent; - - if (windowAge instanceof Array) windows = windowAge; - - if (windows.indexOf(windowId) > -1) windows.splice(windows.indexOf(windowId), 1); - windows.unshift(windowId); - _context7.next = 11; - return setLocalStorage("windowAge", windows); - - case 11: - case "end": - return _context7.stop(); - } - } - }, _callee7, this); - })); - - return function windowActive(_x9) { - return _ref7.apply(this, arguments); - }; -}(); - -var windowFocus = function () { - var _ref8 = _asyncToGenerator(regeneratorRuntime.mark(function _callee8(windowId) { - return regeneratorRuntime.wrap(function _callee8$(_context8) { - while (1) { - switch (_context8.prev = _context8.next) { - case 0: - _context8.prev = 0; - - if (!windowId) { - _context8.next = 6; - break; - } - - _context8.next = 4; - return windowActive(windowId); - - case 4: - _context8.next = 6; - return hideWindows(windowId); - - case 6: - _context8.next = 10; - break; - - case 8: - _context8.prev = 8; - _context8.t0 = _context8["catch"](0); - - case 10: - case "end": - return _context8.stop(); - } - } - }, _callee8, this, [[0, 8]]); - })); - - return function windowFocus(_x10) { - return _ref8.apply(this, arguments); - }; -}(); - -var windowCreated = function () { - var _ref9 = _asyncToGenerator(regeneratorRuntime.mark(function _callee9(window) { - return regeneratorRuntime.wrap(function _callee9$(_context9) { - while (1) { - switch (_context9.prev = _context9.next) { - case 0: - _context9.prev = 0; - - if (!(!!window && !!window.id)) { - _context9.next = 4; - break; - } - - _context9.next = 4; - return windowActive(window.id); - - case 4: - _context9.next = 8; - break; - - case 6: - _context9.prev = 6; - _context9.t0 = _context9["catch"](0); - - case 8: - setTimeout(cleanupDebounce, 250); - - case 9: - case "end": - return _context9.stop(); - } - } - }, _callee9, this, [[0, 6]]); - })); - - return function windowCreated(_x11) { - return _ref9.apply(this, arguments); - }; -}(); - -var windowRemoved = function () { - var _ref10 = _asyncToGenerator(regeneratorRuntime.mark(function _callee10(windowId) { - return regeneratorRuntime.wrap(function _callee10$(_context10) { - while (1) { - switch (_context10.prev = _context10.next) { - case 0: - _context10.prev = 0; - - if (!windowId) { - _context10.next = 4; - break; - } - - _context10.next = 4; - return windowActive(windowId); - - case 4: - _context10.next = 8; - break; - - case 6: - _context10.prev = 6; - _context10.t0 = _context10["catch"](0); - - case 8: - case "end": - return _context10.stop(); - } - } - }, _callee10, this, [[0, 6]]); - })); - - return function windowRemoved(_x12) { - return _ref10.apply(this, arguments); - }; -}(); - -var checkWindow = function () { - var _ref11 = _asyncToGenerator(regeneratorRuntime.mark(function _callee11(windowId) { - var storage, names, colors, hashes, window, newHash; - return regeneratorRuntime.wrap(function _callee11$(_context11) { - while (1) { - switch (_context11.prev = _context11.next) { - case 0: - if (windowId) { - _context11.next = 2; - break; - } - - return _context11.abrupt("return"); - - case 2: - _context11.next = 4; - return browser.storage.local.get(['windowNames', 'windowColors', 'windowHashes']); - - case 4: - storage = _context11.sent; - names = storage.windowNames || {}; - colors = storage.windowColors || {}; - hashes = storage.windowHashes || {}; - - if (!(!names[windowId] && !colors[windowId])) { - _context11.next = 10; - break; - } - - return _context11.abrupt("return"); - - case 10: - _context11.prev = 10; - _context11.next = 13; - return browser.windows.get(windowId, { populate: true }); - - case 13: - window = _context11.sent; - newHash = hashcode(window); - - hashes[windowId] = newHash; - _context11.next = 18; - return setLocalStorage('windowHashes', hashes); - - case 18: - _context11.next = 23; - break; - - case 20: - _context11.prev = 20; - _context11.t0 = _context11["catch"](10); - - console.log(_context11.t0); - - case 23: - case "end": - return _context11.stop(); - } - } - }, _callee11, this, [[10, 20]]); - })); - - return function checkWindow(_x13) { - return _ref11.apply(this, arguments); - }; -}(); - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } - -var browser = browser || chrome; - -function focusOnWindowDelayed(windowId) { - setTimeout(focusOnWindow.bind(this, windowId), 125); -} - -function hashcode(window) { - var urls = []; - for (var i = 0; i < window.tabs.length; i++) { - if (!window.tabs[i].url) continue; - urls.push(window.tabs[i].url); - } - urls.sort(); - - var hash = 0; - for (var i = 0; i < urls.length; i++) { - var code = stringHashcode(urls[i]); - hash = (hash << 5) - hash + code; - hash = hash & hash; - } - return hash; -} -//# sourceMappingURL=windows.js.map \ No newline at end of file diff --git a/outlib/service_worker/background/windows.js.map b/outlib/service_worker/background/windows.js.map deleted file mode 100644 index 9e86a23e..00000000 --- a/outlib/service_worker/background/windows.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../lib/service_worker/background/windows.js"],"names":["browser","windows","onFocusChanged","removeListener","windowFocus","onCreated","windowCreated","onRemoved","windowRemoved","addListener","setupWindowListeners","tabs","isIncognito","pinnedIndex","firstTab","shift","t","i","length","push","id","firstPinned","pinned","create","tabId","incognito","w","update","oldTabId","get","oldTab","tabPinned","movedTabs","move","windowId","index","newTab","focused","createWindowWithTabs","window","customName","name","color","whitelistWindow","navigator","userAgent","search","whitelistTab","filteredWindow","Object","keys","windowsInfo","filter","key","includes","reduce","obj","left","top","width","height","type","catch","error","console","log","message","newWindow","emptyTab","url","tabCreated","remove","setWindowName","setWindowColor","createWindowWithSessionTabs","focusOnWindow","getLocalStorage","hideWindows","permissions","contains","result","chrome","system","display","getInfo","displaylayouts","globalDisplayInfo","_iteratorNormalCompletion","_didIteratorError","_iteratorError","undefined","_iterator","Symbol","iterator","_step","next","done","displaylayout","value","bounds","return","getAll","populate","monitor","a","is_in_bounds","bind","windowAge","Array","indexOf","splice","unshift","setLocalStorage","windowActive","setTimeout","cleanupDebounce","storage","local","names","windowNames","colors","windowColors","hashes","windowHashes","newHash","hashcode","checkWindow","focusOnWindowDelayed","urls","sort","hash","code","stringHashcode"],"mappings":";;;sDAEA;AAAA;AAAA;AAAA;AAAA;AACCA,cAAQC,OAAR,CAAgBC,cAAhB,CAA+BC,cAA/B,CAA8CC,WAA9C;AACAJ,cAAQC,OAAR,CAAgBI,SAAhB,CAA0BF,cAA1B,CAAyCG,aAAzC;AACAN,cAAQC,OAAR,CAAgBM,SAAhB,CAA0BJ,cAA1B,CAAyCK,aAAzC;;AAEAR,cAAQC,OAAR,CAAgBC,cAAhB,CAA+BO,WAA/B,CAA2CL,WAA3C;AACAJ,cAAQC,OAAR,CAAgBI,SAAhB,CAA0BI,WAA1B,CAAsCH,aAAtC;AACAN,cAAQC,OAAR,CAAgBM,SAAhB,CAA0BE,WAA1B,CAAsCD,aAAtC;;AAPD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,E;;iBAAeE,oB;;;;;;uDAUf,kBAAoCC,IAApC,EAA0CC,WAA1C;AAAA;;AAAA;AAAA;AAAA;AAAA;AACKC,iBADL,GACmB,CADnB;AAEKC,cAFL,GAEgBH,KAAKI,KAAL,EAFhB;AAGKC,OAHL,GAGS,EAHT;;AAIC,WAASC,CAAT,GAAa,CAAb,EAAgBA,IAAIN,KAAKO,MAAzB,EAAiCD,GAAjC,EAAsC;AACrCD,SAAEG,IAAF,CAAOR,KAAKM,CAAL,EAAQG,EAAf;AACA;AACD;;AAEIC,iBATL,GASmBP,SAASQ,MAT5B;AAAA;AAAA,aAUetB,QAAQC,OAAR,CAAgBsB,MAAhB,CAAuB,EAACC,OAAOV,SAASM,EAAjB,EAAqBK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CAAYO,MAAhC,EAAwCD,GAAxC,EAA6C;AAC5C,MAAI,CAACsB,OAAO5B,IAAP,CAAYM,CAAZ,EAAeoD,GAApB,EAAyB;AACzB2D,OAAK7G,IAAL,CAAUoB,OAAO5B,IAAP,CAAYM,CAAZ,EAAeoD,GAAzB;AACA;AACD2D,MAAKC,IAAL;;AAEA,KAAIC,OAAO,CAAX;AACA,MAAK,IAAIjH,IAAI,CAAb,EAAgBA,IAAI+G,KAAK9G,MAAzB,EAAiCD,GAAjC,EAAsC;AACrC,MAAIkH,OAAOC,eAAeJ,KAAK/G,CAAL,CAAf,CAAX;AACAiH,SAAQ,CAACA,QAAQ,CAAT,IAAcA,IAAf,GAAuBC,IAA9B;AACAD,SAAOA,OAAOA,IAAd;AACA;AACD,QAAOA,IAAP;AACA","file":"windows.js","sourcesContent":["var browser = browser || chrome;\r\n\r\nasync function setupWindowListeners() {\r\n\tbrowser.windows.onFocusChanged.removeListener(windowFocus);\r\n\tbrowser.windows.onCreated.removeListener(windowCreated);\r\n\tbrowser.windows.onRemoved.removeListener(windowRemoved);\r\n\r\n\tbrowser.windows.onFocusChanged.addListener(windowFocus);\r\n\tbrowser.windows.onCreated.addListener(windowCreated);\r\n\tbrowser.windows.onRemoved.addListener(windowRemoved);\r\n}\r\n\r\nasync function createWindowWithTabs(tabs, isIncognito) {\r\n\tvar pinnedIndex = 0;\r\n\tvar firstTab = tabs.shift();\r\n\tvar t = [];\r\n\tfor (var i = 0; i < tabs.length; i++) {\r\n\t\tt.push(tabs[i].id);\r\n\t}\r\n\t;\r\n\r\n\tvar firstPinned = firstTab.pinned;\r\n\tvar w = await browser.windows.create({tabId: firstTab.id, incognito: !!isIncognito});\r\n\tif (firstPinned) {\r\n\t\tawait browser.tabs.update(w.tabs[0].id, {pinned: firstPinned});\r\n\t\tpinnedIndex++;\r\n\t}\r\n\r\n\tif (t.length > 0) {\r\n\t\tvar i = 0;\r\n\t\tfor (var oldTabId of t) {\r\n\t\t\ti++;\r\n\t\t\tvar oldTab = await browser.tabs.get(oldTabId);\r\n\t\t\tvar tabPinned = oldTab.pinned;\r\n\t\t\tvar movedTabs = [];\r\n\t\t\tif (!tabPinned) {\r\n\t\t\t\tmovedTabs = await browser.tabs.move(oldTabId, {windowId: w.id, index: -1});\r\n\t\t\t} else {\r\n\t\t\t\tmovedTabs = await browser.tabs.move(oldTabId, {windowId: w.id, index: pinnedIndex++});\r\n\t\t\t}\r\n\t\t\tif (movedTabs.length > 0) {\r\n\t\t\t\tvar newTab = movedTabs[0];\r\n\t\t\t\tif (tabPinned) {\r\n\t\t\t\t\tawait browser.tabs.update(newTab.id, {pinned: tabPinned});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t;\r\n\t}\r\n\tawait browser.windows.update(w.id, {focused: true});\r\n}\r\n\r\nasync function createWindowWithSessionTabs(window, tabId) {\r\n\r\n\tvar customName = false;\r\n\tif (window && window.name && window.customName) {\r\n\t\tcustomName = window.name;\r\n\t}\r\n\tvar color = \"default\";\r\n\tif (window && window.color) {\r\n\t\tcolor = window.color;\r\n\t}\r\n\r\n\tvar whitelistWindow = [\"left\", \"top\", \"width\", \"height\", \"incognito\", \"type\"];\r\n\r\n\tif (navigator.userAgent.search(\"Firefox\") > -1) {\r\n\t\twhitelistWindow = [\"left\", \"top\", \"width\", \"height\", \"incognito\", \"type\"];\r\n\t}\r\n\r\n\tvar whitelistTab = [\"url\", \"active\", \"selected\", \"pinned\", \"index\"];\r\n\r\n\tif (navigator.userAgent.search(\"Firefox\") > -1) {\r\n\t\twhitelistTab = [\"url\", \"active\", \"pinned\", \"index\"];\r\n\t}\r\n\r\n\tvar filteredWindow = Object.keys(window.windowsInfo)\r\n\t\t.filter(function (key) {\r\n\t\t\treturn whitelistWindow.includes(key);\r\n\t\t})\r\n\t\t.reduce(function (obj, key) {\r\n\t\t\tobj[key] = window.windowsInfo[key];\r\n\t\t\treturn obj;\r\n\t\t}, {});\r\n\r\n\tif (filteredWindow.left < 0 || filteredWindow.left > 800) filteredWindow.left = 0;\r\n\tif (filteredWindow.top < 0 || filteredWindow.top > 600) filteredWindow.top = 0;\r\n\tif (filteredWindow.width > 800) filteredWindow.width = 800;\r\n\tif (filteredWindow.height > 600) filteredWindow.height = 600;\r\n\r\n\tfilteredWindow.type = \"normal\";\r\n\r\n\t// console.log(\"filtered window\", filteredWindow);\r\n\r\n\tvar newWindow = await browser.windows.create(filteredWindow).catch(function (error) {\r\n\t\tconsole.error(error);\r\n\t\tconsole.log(error);\r\n\t\tconsole.log(error.message);\r\n\t});\r\n\r\n\tvar emptyTab = newWindow.tabs[0].id;\r\n\r\n\tfor (var i = 0; i < window.tabs.length; i++) {\r\n\t\tvar newTab = Object.keys(window.tabs[i])\r\n\t\t\t.filter(function (key) {\r\n\t\t\t\treturn whitelistTab.includes(key);\r\n\t\t\t})\r\n\t\t\t.reduce(function (obj, key) {\r\n\t\t\t\tobj[key] = window.tabs[i][key];\r\n\t\t\t\treturn obj;\r\n\t\t\t}, {});\r\n\r\n\t\tif (tabId != null && tabId != newTab.index) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tnewTab.windowId = newWindow.id;\r\n\r\n\t\tif (navigator.userAgent.search(\"Firefox\") > -1) {\r\n\t\t\tif (!!newTab.url && newTab.url.search(\"about:\") > -1) {\r\n\t\t\t\tconsole.log(\"filtered by about: url\", newTab.url);\r\n\t\t\t\tnewTab.url = \"\";\r\n\t\t\t}\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tvar tabCreated = await browser.tabs.create(newTab).catch(function (error) {\r\n\t\t\t\tconsole.error(error);\r\n\t\t\t\tconsole.log(error);\r\n\t\t\t\tconsole.log(error.message);\r\n\t\t\t});\r\n\t\t} catch (e) {\r\n\t\t\tconsole.log(\"couldn't restore tab\");\r\n\t\t\tconsole.error(e);\r\n\t\t}\r\n\t}\r\n\r\n\tawait browser.tabs.remove(emptyTab).catch(function (error) {\r\n\t\tconsole.error(error);\r\n\t\tconsole.log(error);\r\n\t\tconsole.log(error.message);\r\n\t});\r\n\r\n\tif (customName) {\r\n\t\tconsole.log(\"setting name\");\r\n\t\tsetWindowName(newWindow.id, customName);\r\n\t}\r\n\r\n\tif (color != \"default\") {\r\n\t\tconsole.log(\"setting color\");\r\n\t\tsetWindowColor(newWindow.id, color);\r\n\t}\r\n\r\n\tawait browser.windows.update(newWindow.id, {focused: true});\r\n}\r\n\r\nfunction focusOnWindowDelayed(windowId) {\r\n\tsetTimeout(focusOnWindow.bind(this, windowId), 125);\r\n}\r\n\r\nasync function focusOnWindow(windowId) {\r\n\tawait browser.windows.update(windowId, {focused: true});\r\n}\r\n\r\nasync function hideWindows(windowId) {\r\n\tif (navigator.userAgent.search(\"Firefox\") > -1) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tif (!windowId || windowId < 0) {\r\n\t\treturn;\r\n\t} else {\r\n\t\tvar hideWindows = await getLocalStorage(\"hideWindows\", false);\r\n\t\tif (!hideWindows) return;\r\n\r\n\t\tvar result = await browser.permissions.contains({permissions: ['system.display']});\r\n\t\tif (result) {\r\n\t\t\t// The extension has the permissions.\r\n\t\t\tchrome.system.display.getInfo(async function (windowId, displaylayouts) {\r\n\t\t\t\tglobalDisplayInfo = [];\r\n\t\t\t\tvar _iteratorNormalCompletion = true;\r\n\t\t\t\tvar _didIteratorError = false;\r\n\t\t\t\tvar _iteratorError = undefined;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfor (var _iterator = displaylayouts[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\r\n\t\t\t\t\t\tvar displaylayout = _step.value;\r\n\t\t\t\t\t\tglobalDisplayInfo.push(displaylayout.bounds);\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (err) {\r\n\t\t\t\t\t_didIteratorError = true;\r\n\t\t\t\t\t_iteratorError = err;\r\n\t\t\t\t} finally {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return) {\r\n\t\t\t\t\t\t\t_iterator.return();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} finally {\r\n\t\t\t\t\t\tif (_didIteratorError) {\r\n\t\t\t\t\t\t\tthrow _iteratorError;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tvar windows = await browser.windows.getAll({populate: true});\r\n\t\t\t\tvar monitor = -1;\r\n\t\t\t\tfor (var i = windows.length - 1; i >= 0; i--) {\r\n\t\t\t\t\tif (windows[i].id == windowId) {\r\n\t\t\t\t\t\tfor (var a in globalDisplayInfo) {\r\n\t\t\t\t\t\t\tvar result = is_in_bounds(windows[i], globalDisplayInfo[a]);\r\n\t\t\t\t\t\t\tif (result) {\r\n\t\t\t\t\t\t\t\tmonitor = a;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t;\r\n\r\n\t\t\t\tfor (var i = windows.length - 1; i >= 0; i--) {\r\n\t\t\t\t\tif (windows[i].id != windowId) {\r\n\t\t\t\t\t\tif (is_in_bounds(windows[i], globalDisplayInfo[monitor])) {\r\n\t\t\t\t\t\t\tawait browser.windows.update(windows[i].id, {\"state\": \"minimized\"});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t;\r\n\t\t\t}.bind(null, windowId));\r\n\t\t}\r\n\t}\r\n}\r\n\r\nasync function windowActive(windowId) {\r\n\tif (windowId < 0) return;\r\n\r\n\tvar windows = [];\r\n\tvar windowAge = await getLocalStorage(\"windowAge\", []);\r\n\tif (windowAge instanceof Array) windows = windowAge;\r\n\r\n\tif (windows.indexOf(windowId) > -1) windows.splice(windows.indexOf(windowId), 1);\r\n\twindows.unshift(windowId);\r\n\tawait setLocalStorage(\"windowAge\", windows);\r\n\r\n\t// browser.windows.getLastFocused({ populate: true }, function (w) {\r\n\t// \tfor (var i = 0; i < w.tabs.length; i++) {\r\n\t// \t\tvar tab = w.tabs[i];\r\n\t// \t\tif (tab.active == true) {\r\n\t// \t\t\t// console.log(\"get last focused\", tab.id);\r\n\t// \t\t\t// tabActiveChanged({\r\n\t// \t\t\t// \ttabId: tab.id,\r\n\t// \t\t\t// \twindowId: tab.windowId\r\n\t// \t\t\t// });\r\n\t// \t\t}\r\n\t// \t};\r\n\t// });\r\n\t// console.log(windows);\r\n}\r\n\r\nasync function windowFocus(windowId) {\r\n\ttry {\r\n\t\tif (!!windowId) {\r\n\t\t\tawait windowActive(windowId);\r\n\t\t\t// console.log(\"onFocused\", windowId);\r\n\t\t\tawait hideWindows(windowId);\r\n\t\t}\r\n\t} catch (e) {\r\n\r\n\t}\r\n}\r\n\r\nasync function windowCreated(window) {\r\n\ttry {\r\n\t\tif (!!window && !!window.id) {\r\n\t\t\tawait windowActive(window.id);\r\n\t\t}\r\n\t} catch (e) {\r\n\r\n\t}\r\n\t// console.log(\"onCreated \" + window.id, window);\r\n\tsetTimeout(cleanupDebounce, 250);\r\n}\r\n\r\nasync function windowRemoved(windowId) {\r\n\ttry {\r\n\t\tif (!!windowId) {\r\n\t\t\tawait windowActive(windowId);\r\n\t\t}\r\n\t} catch (e) {\r\n\r\n\t}\r\n\t// console.log(\"onRemoved\", windowId);\r\n}\r\n\r\nasync function checkWindow(windowId) {\r\n\tif (!windowId) return;\r\n\r\n\tvar storage = await browser.storage.local.get(['windowNames', 'windowColors', 'windowHashes']);\r\n\r\n\tvar names = storage.windowNames || {};\r\n\tvar colors = storage.windowColors || {};\r\n\tvar hashes = storage.windowHashes || {};\r\n\r\n\tif (!names[windowId] && !colors[windowId]) return;\r\n\r\n\ttry {\r\n\t\tvar window = await browser.windows.get(windowId, {populate: true});\r\n\r\n\t\tvar newHash = hashcode(window);\r\n\t\thashes[windowId] = newHash;\r\n\t\tawait setLocalStorage('windowHashes', hashes);\r\n\t} catch (e) {\r\n\t\tconsole.log(e);\r\n\t}\r\n}\r\n\r\nfunction hashcode(window) {\r\n\tvar urls = [];\r\n\tfor (var i = 0; i < window.tabs.length; i++) {\r\n\t\tif (!window.tabs[i].url) continue;\r\n\t\turls.push(window.tabs[i].url);\r\n\t}\r\n\turls.sort();\r\n\r\n\tvar hash = 0;\r\n\tfor (var i = 0; i < urls.length; i++) {\r\n\t\tvar code = stringHashcode(urls[i]);\r\n\t\thash = ((hash << 5) - hash) + code;\r\n\t\thash = hash & hash; // Convert to 32bit integer\r\n\t}\r\n\treturn hash;\r\n}"]} \ No newline at end of file diff --git a/outlib/service_worker/service_worker.js b/outlib/service_worker/service_worker.js deleted file mode 100644 index a3d1ddc5..00000000 --- a/outlib/service_worker/service_worker.js +++ /dev/null @@ -1,181 +0,0 @@ -"use strict"; - -var openSidebar = function () { - var _ref3 = _asyncToGenerator(regeneratorRuntime.mark(function _callee3() { - return regeneratorRuntime.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - _context3.next = 2; - return browser.sidebarAction.open(); - - case 2: - case 'end': - return _context3.stop(); - } - } - }, _callee3, this); - })); - - return function openSidebar() { - return _ref3.apply(this, arguments); - }; -}(); - -var setup = function () { - var _ref4 = _asyncToGenerator(regeneratorRuntime.mark(function _callee4() { - return regeneratorRuntime.wrap(function _callee4$(_context4) { - while (1) { - switch (_context4.prev = _context4.next) { - case 0: - _context4.next = 2; - return setupContextMenus(); - - case 2: - _context4.next = 4; - return setupPopup(); - - case 4: - _context4.next = 6; - return setupTabListeners(); - - case 6: - _context4.next = 8; - return setupWindowListeners(); - - case 8: - - updateTabCountDebounce(); - - setTimeout(cleanupDebounce, 2500); - - case 10: - case 'end': - return _context4.stop(); - } - } - }, _callee4, this); - })); - - return function setup() { - return _ref4.apply(this, arguments); - }; -}(); - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } - -importScripts('../../vendor/babel-polyfill.js'); -importScripts('../../vendor/browser-polyfill.min.js'); - -importScripts('../helpers/storage.js'); -importScripts('../helpers/utils.js'); - -importScripts('./background/actions.js'); -importScripts('./background/windows.js'); -importScripts('./background/tabs.js'); -importScripts('./background/tracking.js'); - -importScripts('./ui/context_menus.js'); -importScripts('./ui/open.js'); - -var browser = browser || chrome; -var globalTabsActive = []; -var globalDisplayInfo = []; - -browser.runtime.onStartup.addListener(_asyncToGenerator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - console.log(" ON STARTUP"); - - case 1: - case 'end': - return _context.stop(); - } - } - }, _callee, this); -}))); - -browser.runtime.onSuspend.addListener(_asyncToGenerator(regeneratorRuntime.mark(function _callee2() { - return regeneratorRuntime.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - console.log(" ON SUSPEND"); - - case 1: - case 'end': - return _context2.stop(); - } - } - }, _callee2, this); -}))); - -var updateTabCountDebounce = debounce(updateTabCount, 250); -var cleanupDebounce = debounce(cleanUp, 500); - -browser.commands.onCommand.addListener(handleCommands); -browser.runtime.onMessage.addListener(handleMessages); - -_asyncToGenerator(regeneratorRuntime.mark(function _callee5() { - var windows, i; - return regeneratorRuntime.wrap(function _callee5$(_context5) { - while (1) { - switch (_context5.prev = _context5.next) { - case 0: - _context5.next = 2; - return browser.windows.getAll({ populate: true }); - - case 2: - windows = _context5.sent; - _context5.next = 5; - return setLocalStorage("windowAge", []); - - case 5: - if (!(!!windows && windows.length > 0)) { - _context5.next = 16; - break; - } - - windows.sort(function (a, b) { - if (a.id < b.id) return 1; - if (a.id > b.id) return -1; - return 0; - }); - i = 0; - - case 8: - if (!(i < windows.length)) { - _context5.next = 15; - break; - } - - if (!windows[i].id) { - _context5.next = 12; - break; - } - - _context5.next = 12; - return windowActive(windows[i].id); - - case 12: - i++; - _context5.next = 8; - break; - - case 15: - ; - - case 16: - case 'end': - return _context5.stop(); - } - } - }, _callee5, this); -}))(); - -setInterval(setup, 300000); - -setup(); -//# sourceMappingURL=service_worker.js.map \ No newline at end of file diff --git a/outlib/service_worker/service_worker.js.map b/outlib/service_worker/service_worker.js.map deleted file mode 100644 index 31768058..00000000 --- a/outlib/service_worker/service_worker.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../lib/service_worker/service_worker.js"],"names":["browser","sidebarAction","open","openSidebar","setupContextMenus","setupPopup","setupTabListeners","setupWindowListeners","updateTabCountDebounce","setTimeout","cleanupDebounce","setup","importScripts","chrome","globalTabsActive","globalDisplayInfo","runtime","onStartup","addListener","console","log","onSuspend","debounce","updateTabCount","cleanUp","commands","onCommand","handleCommands","onMessage","handleMessages","windows","getAll","populate","setLocalStorage","length","sort","a","b","id","i","windowActive","setInterval"],"mappings":"AAAA;;;uDAmCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aACOA,QAAQC,aAAR,CAAsBC,IAAtB,EADP;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,E;;iBAAeC,W;;;;;;uDAIf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aACOC,mBADP;;AAAA;AAAA;AAAA,aAEOC,YAFP;;AAAA;AAAA;AAAA,aAGOC,mBAHP;;AAAA;AAAA;AAAA,aAIOC,sBAJP;;AAAA;;AAMCC;;AAEAC,iBAAWC,eAAX,EAA4B,IAA5B;;AARD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,E;;iBAAeC,K;;;;;;;AArCfC,cAAc,gCAAd;AACAA,cAAc,sCAAd;;AAEAA,cAAc,uBAAd;AACAA,cAAc,qBAAd;;AAEAA,cAAc,yBAAd;AACAA,cAAc,yBAAd;AACAA,cAAc,sBAAd;AACAA,cAAc,0BAAd;;AAEAA,cAAc,uBAAd;AACAA,cAAc,cAAd;;AAEA,IAAIZ,UA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AIT,QAAQI,MAT7B;AAAA;AAAA;AAAA;;AAAA,SAUO,CAACJ,QAAQS,CAAR,EAAWD,EAVnB;AAAA;AAAA;AAAA;;AAAA;AAAA,YAU6BE,aAAaV,QAAQS,CAAR,EAAWD,EAAxB,CAV7B;;AAAA;AASqCC,QATrC;AAAA;AAAA;;AAAA;AAWE;;AAXF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAD;;AAeAE,YAAY9B,KAAZ,EAAmB,MAAnB;;AAEAA","file":"service_worker.js","sourcesContent":["\"use strict\";\n\nimportScripts('../../vendor/babel-polyfill.js');\nimportScripts('../../vendor/browser-polyfill.min.js');\n\nimportScripts('../helpers/storage.js');\nimportScripts('../helpers/utils.js');\n\nimportScripts('./background/actions.js');\nimportScripts('./background/windows.js');\nimportScripts('./background/tabs.js');\nimportScripts('./background/tracking.js');\n\nimportScripts('./ui/context_menus.js');\nimportScripts('./ui/open.js');\n\nvar browser = browser || chrome;\nvar globalTabsActive = [];\nvar globalDisplayInfo = [];\n\nbrowser.runtime.onStartup.addListener(\n\tasync function () {\n\t\tconsole.log(\" ON STARTUP\");\n\t}\n);\n\nbrowser.runtime.onSuspend.addListener(\n\tasync function () {\n\t\tconsole.log(\" ON SUSPEND\");\n\t}\n);\n\nvar updateTabCountDebounce = debounce(updateTabCount, 250);\nvar cleanupDebounce = debounce(cleanUp, 500);\n\nasync function openSidebar() {\n\tawait browser.sidebarAction.open();\n}\n\nasync function setup() {\n\tawait setupContextMenus();\n\tawait setupPopup();\n\tawait setupTabListeners();\n\tawait setupWindowListeners();\n\n\tupdateTabCountDebounce();\n\n\tsetTimeout(cleanupDebounce, 2500);\n}\n\nbrowser.commands.onCommand.addListener(handleCommands);\nbrowser.runtime.onMessage.addListener(handleMessages);\n\n(async function () {\n\tvar windows = await browser.windows.getAll({ populate: true });\n\tawait setLocalStorage(\"windowAge\", []);\n\tif (!!windows && windows.length > 0) {\n\t\twindows.sort(function (a, b) {\n\t\t\tif (a.id < b.id) return 1;\n\t\t\tif (a.id > b.id) return -1;\n\t\t\treturn 0;\n\t\t});\n\t\tfor (var i = 0; i < windows.length; i++) {\n\t\t\tif (!!windows[i].id) await windowActive(windows[i].id);\n\t\t};\n\t}\n})();\n\nsetInterval(setup, 300000);\n\nsetup();"]} \ No newline at end of file diff --git a/outlib/service_worker/ui/context_menus.js b/outlib/service_worker/ui/context_menus.js deleted file mode 100644 index c95dbc00..00000000 --- a/outlib/service_worker/ui/context_menus.js +++ /dev/null @@ -1,161 +0,0 @@ -"use strict"; - -var setupContextMenus = function () { - var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee() { - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - _context.next = 2; - return browser.contextMenus.removeAll(); - - case 2: - browser.contextMenus.create({ - id: "open_in_own_tab", - title: "📔 Open in own tab", - contexts: ["action"] - }); - - if (!!browser.action.openPopup) { - browser.contextMenus.create({ - id: "open_popup", - title: "📑 Open popup", - contexts: ["action"] - }); - } - - if (!!browser.sidebarAction) { - browser.contextMenus.create({ - id: "open_sidebar", - title: "🗂 Open sidebar", - contexts: ["action"] - }); - } - - browser.contextMenus.create({ - id: "sep1", - type: "separator", - contexts: ["action"] - }); - - browser.contextMenus.create({ - title: "😍 Support this extension", - id: "support_menu", - "contexts": ["action"] - }); - - browser.contextMenus.create({ - id: "review", - title: "⭐ Leave a review", - "contexts": ["action"], - parentId: "support_menu" - }); - - browser.contextMenus.create({ - id: "donate", - title: "☕ Donate to keep Extensions Alive", - "contexts": ["action"], - parentId: "support_menu" - }); - - browser.contextMenus.create({ - id: "patron", - title: "💰 Become a Patron", - "contexts": ["action"], - parentId: "support_menu" - }); - - browser.contextMenus.create({ - id: "twitter", - title: "🐦 Follow on Twitter", - "contexts": ["action"], - parentId: "support_menu" - }); - - browser.contextMenus.create({ - title: "🤔 Issues and Suggestions", - id: "code_menu", - "contexts": ["action"] - }); - - browser.contextMenus.create({ - id: "changelog", - title: "🆕 View recent changes", - "contexts": ["action"], - parentId: "code_menu" - }); - - browser.contextMenus.create({ - id: "options", - title: "⚙ Edit Options", - "contexts": ["action"], - parentId: "code_menu" - }); - - browser.contextMenus.create({ - id: "source", - title: "💻 View source code", - "contexts": ["action"], - parentId: "code_menu" - }); - - browser.contextMenus.create({ - id: "report", - title: "🤔 Report an issue", - "contexts": ["action"], - parentId: "code_menu" - }); - - browser.contextMenus.create({ - id: "send", - title: "💡 Send a suggestion", - "contexts": ["action"], - parentId: "code_menu" - }); - - browser.contextMenus.onClicked.addListener(function (info, tab) { - if (info.menuItemId == "open_in_own_tab") openAsOwnTab(); - if (info.menuItemId == "open_popup") openPopup(); - if (info.menuItemId == "open_sidebar") openSidebar(); - - if (info.menuItemId == "donate") browser.tabs.create({ url: 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=67TZLSEGYQFFW' }); - if (info.menuItemId == "patron") browser.tabs.create({ url: 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=67TZLSEGYQFFW' }); - if (info.menuItemId == "changelog") browser.tabs.create({ url: 'changelog.html' }); - if (info.menuItemId == "options") browser.tabs.create({ url: 'options.html' }); - if (info.menuItemId == "report") browser.tabs.create({ url: 'https://github.com/stefanXO/Tab-Manager-Plus/issues' }); - - if (info.menuItemId == "source") browser.tabs.create({ url: 'https://github.com/stefanXO/Tab-Manager-Plus' }); - - if (info.menuItemId == "twitter") browser.tabs.create({ url: 'https://www.twitter.com/mastef' }); - - if (info.menuItemId == "send") { - browser.tabs.create({ url: 'https://github.com/stefanXO/Tab-Manager-Plus/issues' }); - browser.tabs.create({ url: 'mailto:markus+tmp@stefanxo.com' }); - } - - if (info.menuItemId == "review") { - if (navigator.userAgent.search("Firefox") > -1) { - browser.tabs.create({ url: 'https://addons.mozilla.org/en-US/firefox/addon/tab-manager-plus-for-firefox/' }); - } else { - browser.tabs.create({ url: 'https://chrome.google.com/webstore/detail/tab-manager-plus-for-chro/cnkdjjdmfiffagllbiiilooaoofcoeff' }); - } - } - }); - - case 18: - case "end": - return _context.stop(); - } - } - }, _callee, this); - })); - - return function setupContextMenus() { - return _ref.apply(this, arguments); - }; -}(); - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } - -var browser = browser || chrome; -//# sourceMappingURL=context_menus.js.map \ No newline at end of file diff --git a/outlib/service_worker/ui/context_menus.js.map b/outlib/service_worker/ui/context_menus.js.map deleted file mode 100644 index 2ce855a8..00000000 --- a/outlib/service_worker/ui/context_menus.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../lib/service_worker/ui/context_menus.js"],"names":["browser","contextMenus","removeAll","create","id","title","contexts","action","openPopup","sidebarAction","type","parentId","onClicked","addListener","info","tab","menuItemId","openAsOwnTab","openSidebar","tabs","url","navigator","userAgent","search","setupContextMenus","chrome"],"mappings":";;;sDAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aACOA,QAAQC,YAAR,CAAqBC,SAArB,EADP;;AAAA;AAECF,cAAQC,YAAR,CAAqBE,MAArB,CAA4B;AAC3BC,WAAI,iBADuB;AAE3BC,cAAO,oBAFoB;AAG3BC,iBAAU,CAAC,QAAD;AAHiB,OAA5B;;AAMA,UAAI,CAAC,CAACN,QAAQO,MAAR,CAAeC,SAArB,EAAgC;AAC/BR,eAAQC,YAAR,CAAqBE,MAArB,CAA4B;AAC3BC,YAAI,YADuB;AAE3BC,eAAO,eAFoB;AAG3BC,kBAAU,CAAC,QAAD;AAHiB,QAA5B;AAKA;;AAED,UAAI,CAAC,CAACN,QAAQS,aAAd,EAA6B;AAC5BT,eAAQC,YAAR,CAAqBE,MAArB,CAA4B;AAC3BC,YAAI,cADuB;AAE3BC,eAAO,i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AApB;AAClC,WAAIN,KAAKE,UAAL,IAAmB,QAAvB,EAAiChB,QAAQmB,IAAR,CAAahB,MAAb,CAAoB,EAACiB,KAAK,qDAAN,EAApB;;AAEjC,WAAIN,KAAKE,UAAL,IAAmB,QAAvB,EAAiChB,QAAQmB,IAAR,CAAahB,MAAb,CAAoB,EAACiB,KAAK,8CAAN,EAApB;;AAEjC,WAAIN,KAAKE,UAAL,IAAmB,SAAvB,EAAkChB,QAAQmB,IAAR,CAAahB,MAAb,CAAoB,EAACiB,KAAK,gCAAN,EAApB;;AAElC,WAAIN,KAAKE,UAAL,IAAmB,MAAvB,EAA+B;AAC9BhB,gBAAQmB,IAAR,CAAahB,MAAb,CAAoB,EAACiB,KAAK,qDAAN,EAApB;AACApB,gBAAQmB,IAAR,CAAahB,MAAb,CAAoB,EAACiB,KAAK,gCAAN,EAApB;AACA;;AAED,WAAIN,KAAKE,UAAL,IAAmB,QAAvB,EAAiC;AAChC,YAAIK,UAAUC,SAAV,CAAoBC,MAApB,CAA2B,SAA3B,IAAwC,CAAC,CAA7C,EAAgD;AAC/CvB,iBAAQmB,IAAR,CAAahB,MAAb,CAAoB,EAACiB,KAAK,8EAAN,EAApB;AACA,SAFD,MAEO;AACNpB,iBAAQmB,IAAR,CAAahB,MAAb,CAAoB,EAACiB,KAAK,sGAAN,EAApB;AACA;AACD;AACD,OA5BF;;AAzGD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,E;;iBAAeI,iB;;;;;;;AAFd,IAAIxB,UAAUA,WAAWyB,MAAzB","file":"context_menus.js","sourcesContent":["var browser = browser || chrome;\r\n\r\nasync function setupContextMenus() {\r\n\tawait browser.contextMenus.removeAll();\r\n\tbrowser.contextMenus.create({\r\n\t\tid: \"open_in_own_tab\",\r\n\t\ttitle: \"📔 Open in own tab\",\r\n\t\tcontexts: [\"action\"]\r\n\t});\r\n\r\n\tif (!!browser.action.openPopup) {\r\n\t\tbrowser.contextMenus.create({\r\n\t\t\tid: \"open_popup\",\r\n\t\t\ttitle: \"📑 Open popup\",\r\n\t\t\tcontexts: [\"action\"]\r\n\t\t});\r\n\t}\r\n\r\n\tif (!!browser.sidebarAction) {\r\n\t\tbrowser.contextMenus.create({\r\n\t\t\tid: \"open_sidebar\",\r\n\t\t\ttitle: \"🗂 Open sidebar\",\r\n\t\t\tcontexts: [\"action\"]\r\n\t\t});\r\n\t}\r\n\r\n\tbrowser.contextMenus.create({\r\n\t\tid: \"sep1\",\r\n\t\ttype: \"separator\",\r\n\t\tcontexts: [\"action\"]\r\n\t});\r\n\r\n\tbrowser.contextMenus.create({\r\n\t\ttitle: \"😍 Support this extension\",\r\n\t\tid: \"support_menu\",\r\n\t\t\"contexts\": [\"action\"]\r\n\t});\r\n\r\n\tbrowser.contextMenus.create({\r\n\t\tid: \"review\",\r\n\t\ttitle: \"⭐ Leave a review\",\r\n\t\t\"contexts\": [\"action\"],\r\n\t\tparentId: \"support_menu\"\r\n\t});\r\n\r\n\tbrowser.contextMenus.create({\r\n\t\tid: \"donate\",\r\n\t\ttitle: \"☕ Donate to keep Extensions Alive\",\r\n\t\t\"contexts\": [\"action\"],\r\n\t\tparentId: \"support_menu\"\r\n\t});\r\n\r\n\tbrowser.contextMenus.create({\r\n\t\tid: \"patron\",\r\n\t\ttitle: \"💰 Become a Patron\",\r\n\t\t\"contexts\": [\"action\"],\r\n\t\tparentId: \"support_menu\"\r\n\t});\r\n\r\n\tbrowser.contextMenus.create({\r\n\t\tid: \"twitter\",\r\n\t\ttitle: \"🐦 Follow on Twitter\",\r\n\t\t\"contexts\": [\"action\"],\r\n\t\tparentId: \"support_menu\"\r\n\t});\r\n\r\n\tbrowser.contextMenus.create({\r\n\t\ttitle: \"🤔 Issues and Suggestions\",\r\n\t\tid: \"code_menu\",\r\n\t\t\"contexts\": [\"action\"]\r\n\t});\r\n\r\n\tbrowser.contextMenus.create({\r\n\t\tid: \"changelog\",\r\n\t\ttitle: \"🆕 View recent changes\",\r\n\t\t\"contexts\": [\"action\"],\r\n\t\tparentId: \"code_menu\"\r\n\t});\r\n\r\n\tbrowser.contextMenus.create({\r\n\t\tid: \"options\",\r\n\t\ttitle: \"⚙ Edit Options\",\r\n\t\t\"contexts\": [\"action\"],\r\n\t\tparentId: \"code_menu\"\r\n\t});\r\n\r\n\tbrowser.contextMenus.create({\r\n\t\tid: \"source\",\r\n\t\ttitle: \"💻 View source code\",\r\n\t\t\"contexts\": [\"action\"],\r\n\t\tparentId: \"code_menu\"\r\n\t});\r\n\r\n\tbrowser.contextMenus.create({\r\n\t\tid: \"report\",\r\n\t\ttitle: \"🤔 Report an issue\",\r\n\t\t\"contexts\": [\"action\"],\r\n\t\tparentId: \"code_menu\"\r\n\t});\r\n\r\n\tbrowser.contextMenus.create({\r\n\t\tid: \"send\",\r\n\t\ttitle: \"💡 Send a suggestion\",\r\n\t\t\"contexts\": [\"action\"],\r\n\t\tparentId: \"code_menu\"\r\n\t});\r\n\r\n\tbrowser.contextMenus.onClicked.addListener(\r\n\t\tfunction (info, tab) {\r\n\t\t\tif (info.menuItemId == \"open_in_own_tab\") openAsOwnTab();\r\n\t\t\tif (info.menuItemId == \"open_popup\") openPopup();\r\n\t\t\tif (info.menuItemId == \"open_sidebar\") openSidebar();\r\n\r\n\t\t\tif (info.menuItemId == \"donate\") browser.tabs.create({url: 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=67TZLSEGYQFFW'});\r\n\t\t\tif (info.menuItemId == \"patron\") browser.tabs.create({url: 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=67TZLSEGYQFFW'});\r\n\t\t\tif (info.menuItemId == \"changelog\") browser.tabs.create({url: 'changelog.html'});\r\n\t\t\tif (info.menuItemId == \"options\") browser.tabs.create({url: 'options.html'});\r\n\t\t\tif (info.menuItemId == \"report\") browser.tabs.create({url: 'https://github.com/stefanXO/Tab-Manager-Plus/issues'});\r\n\r\n\t\t\tif (info.menuItemId == \"source\") browser.tabs.create({url: 'https://github.com/stefanXO/Tab-Manager-Plus'});\r\n\r\n\t\t\tif (info.menuItemId == \"twitter\") browser.tabs.create({url: 'https://www.twitter.com/mastef'});\r\n\r\n\t\t\tif (info.menuItemId == \"send\") {\r\n\t\t\t\tbrowser.tabs.create({url: 'https://github.com/stefanXO/Tab-Manager-Plus/issues'});\r\n\t\t\t\tbrowser.tabs.create({url: 'mailto:markus+tmp@stefanxo.com'});\r\n\t\t\t}\r\n\r\n\t\t\tif (info.menuItemId == \"review\") {\r\n\t\t\t\tif (navigator.userAgent.search(\"Firefox\") > -1) {\r\n\t\t\t\t\tbrowser.tabs.create({url: 'https://addons.mozilla.org/en-US/firefox/addon/tab-manager-plus-for-firefox/'});\r\n\t\t\t\t} else {\r\n\t\t\t\t\tbrowser.tabs.create({url: 'https://chrome.google.com/webstore/detail/tab-manager-plus-for-chro/cnkdjjdmfiffagllbiiilooaoofcoeff'});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t);\r\n}"]} \ No newline at end of file diff --git a/outlib/service_worker/ui/open.js b/outlib/service_worker/ui/open.js deleted file mode 100644 index c282efd2..00000000 --- a/outlib/service_worker/ui/open.js +++ /dev/null @@ -1,177 +0,0 @@ -"use strict"; - -var openPopup = function () { - var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee() { - var openInOwnTab; - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - _context.next = 2; - return getLocalStorage("openInOwnTab", false); - - case 2: - openInOwnTab = _context.sent; - - if (!openInOwnTab) { - _context.next = 12; - break; - } - - _context.next = 6; - return browser.action.setPopup({ popup: "popup.html?popup=true" }); - - case 6: - _context.next = 8; - return browser.action.openPopup(); - - case 8: - _context.next = 10; - return browser.action.setPopup({ popup: "" }); - - case 10: - _context.next = 14; - break; - - case 12: - _context.next = 14; - return browser.action.openPopup(); - - case 14: - case "end": - return _context.stop(); - } - } - }, _callee, this); - })); - - return function openPopup() { - return _ref.apply(this, arguments); - }; -}(); - -var openAsOwnTab = function () { - var _ref2 = _asyncToGenerator(regeneratorRuntime.mark(function _callee2() { - var popup_page, tabs, currentTab, previousTab, i, tab; - return regeneratorRuntime.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - popup_page = browser.runtime.getURL("popup.html"); - _context2.next = 3; - return browser.tabs.query({}); - - case 3: - tabs = _context2.sent; - - if (!!globalTabsActive && globalTabsActive.length > 1) { - currentTab = globalTabsActive[globalTabsActive.length - 1]; - previousTab = globalTabsActive[globalTabsActive.length - 2]; - } - - i = 0; - - case 6: - if (!(i < tabs.length)) { - _context2.next = 17; - break; - } - - tab = tabs[i]; - - if (!(tab.url.indexOf("popup.html") > -1 && tab.url.indexOf(popup_page) > -1)) { - _context2.next = 14; - break; - } - - if (!(currentTab && currentTab.tabId && tab.id == currentTab.tabId && previousTab && previousTab.tabId)) { - _context2.next = 13; - break; - } - - return _context2.abrupt("return", focusOnTabAndWindow(previousTab)); - - case 13: - return _context2.abrupt("return", browser.windows.update(tab.windowId, { focused: true }).then(function () { - browser.tabs.highlight({ windowId: tab.windowId, tabs: tab.index }); - }.bind(this))); - - case 14: - i++; - _context2.next = 6; - break; - - case 17: - return _context2.abrupt("return", browser.tabs.create({ url: "popup.html" })); - - case 18: - case "end": - return _context2.stop(); - } - } - }, _callee2, this); - })); - - return function openAsOwnTab() { - return _ref2.apply(this, arguments); - }; -}(); - -var setupPopup = function () { - var _ref3 = _asyncToGenerator(regeneratorRuntime.mark(function _callee3() { - var openInOwnTab; - return regeneratorRuntime.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - _context3.next = 2; - return getLocalStorage("openInOwnTab", false); - - case 2: - openInOwnTab = _context3.sent; - _context3.next = 5; - return browser.action.onClicked.removeListener(openAsOwnTab); - - case 5: - if (!openInOwnTab) { - _context3.next = 12; - break; - } - - _context3.next = 8; - return browser.action.setPopup({ popup: "" }); - - case 8: - _context3.next = 10; - return browser.action.onClicked.addListener(openAsOwnTab); - - case 10: - _context3.next = 14; - break; - - case 12: - _context3.next = 14; - return browser.action.setPopup({ popup: "popup.html?popup=true" }); - - case 14: - if (browser.sidebarAction) { - browser.sidebarAction.setPanel({ panel: "popup.html?panel=true" }); - } - - case 15: - case "end": - return _context3.stop(); - } - } - }, _callee3, this); - })); - - return function setupPopup() { - return _ref3.apply(this, arguments); - }; -}(); - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } - -var browser = browser || chrome; -//# sourceMappingURL=open.js.map \ No newline at end of file diff --git a/outlib/service_worker/ui/open.js.map b/outlib/service_worker/ui/open.js.map deleted file mode 100644 index d82dad14..00000000 --- a/outlib/service_worker/ui/open.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../lib/service_worker/ui/open.js"],"names":["getLocalStorage","openInOwnTab","browser","action","setPopup","popup","openPopup","popup_page","runtime","getURL","tabs","query","globalTabsActive","length","currentTab","previousTab","i","tab","url","indexOf","tabId","id","focusOnTabAndWindow","windows","update","windowId","focused","then","highlight","index","bind","create","openAsOwnTab","onClicked","removeListener","addListener","sidebarAction","setPanel","panel","setupPopup","chrome"],"mappings":";;;sDAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAC0BA,gBAAgB,cAAhB,EAAgC,KAAhC,CAD1B;;AAAA;AACKC,kBADL;;AAAA,WAEKA,YAFL;AAAA;AAAA;AAAA;;AAAA;AAAA,aAGQC,QAAQC,MAAR,CAAeC,QAAf,CAAwB,EAACC,OAAO,uBAAR,EAAxB,CAHR;;AAAA;AAAA;AAAA,aAIQH,QAAQC,MAAR,CAAeG,SAAf,EAJR;;AAAA;AAAA;AAAA,aAKQJ,QAAQC,MAAR,CAAe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CAAuB,EAACH,UAAUR,IAAIQ,QAAf,EAAyBf,MAAMO,IAAIY,KAAnC,EAAvB;AACA,OAFD,CAEEC,IAFF,CAEO,IAFP,CADM,CAjBX;;AAAA;AAWkCd,SAXlC;AAAA;AAAA;;AAAA;AAAA,wCAyBQd,QAAQQ,IAAR,CAAaqB,MAAb,CAAoB,EAACb,KAAK,YAAN,EAApB,CAzBR;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,E;;iBAAec,Y;;;;;;uDA4Bf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAE0BhC,gBAAgB,cAAhB,EAAgC,KAAhC,CAF1B;;AAAA;AAEKC,kBAFL;AAAA;AAAA,aAIOC,QAAQC,MAAR,CAAe8B,SAAf,CAAyBC,cAAzB,CAAwCF,YAAxC,CAJP;;AAAA;AAAA,WAKK/B,YALL;AAAA;AAAA;AAAA;;AAAA;AAAA,aAMQC,QAAQC,MAAR,CAAeC,QAAf,CAAwB,EAACC,OAAO,EAAR,EAAxB,CANR;;AAAA;AAAA;AAAA,aAOQH,QAAQC,MAAR,CAAe8B,SAAf,CAAyBE,WAAzB,CAAqCH,YAArC,CAPR;;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA,aASQ9B,QAAQC,MAAR,CAAeC,QAAf,CAAwB,EAACC,OAAO,uBAAR,EAAxB,CATR;;AAAA;AAWC,UAAIH,QAAQkC,aAAZ,EAA2B;AAC1BlC,eAAQkC,aAAR,CAAsBC,QAAtB,CAA+B,EAACC,OAAO,uBAAR,EAA/B;AACA;;AAbF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,E;;iBAAeC,U;;;;;;;AAzCd,IAAIrC,UAAUA,WAAWsC,MAAzB","file":"open.js","sourcesContent":["var browser = browser || chrome;\r\n\r\nasync function openPopup() {\r\n\tvar openInOwnTab = await getLocalStorage(\"openInOwnTab\", false);\r\n\tif (openInOwnTab) {\r\n\t\tawait browser.action.setPopup({popup: \"popup.html?popup=true\"});\r\n\t\tawait browser.action.openPopup();\r\n\t\tawait browser.action.setPopup({popup: \"\"});\r\n\t} else {\r\n\t\tawait browser.action.openPopup();\r\n\t}\r\n}\r\n\r\nasync function openAsOwnTab() {\r\n\tvar popup_page = browser.runtime.getURL(\"popup.html\");\r\n\tvar tabs = await browser.tabs.query({});\r\n\r\n\tvar currentTab;\r\n\tvar previousTab;\r\n\tif (!!globalTabsActive && globalTabsActive.length > 1) {\r\n\t\tcurrentTab = globalTabsActive[globalTabsActive.length - 1];\r\n\t\tpreviousTab = globalTabsActive[globalTabsActive.length - 2];\r\n\t}\r\n\r\n\tfor (var i = 0; i < tabs.length; i++) {\r\n\t\tvar tab = tabs[i];\r\n\t\tif (tab.url.indexOf(\"popup.html\") > -1 && tab.url.indexOf(popup_page) > -1) {\r\n\t\t\tif (currentTab && currentTab.tabId && tab.id == currentTab.tabId && previousTab && previousTab.tabId) {\r\n\t\t\t\treturn focusOnTabAndWindow(previousTab);\r\n\t\t\t} else {\r\n\t\t\t\treturn browser.windows.update(tab.windowId, {focused: true}).then(\r\n\t\t\t\t\tfunction () {\r\n\t\t\t\t\t\tbrowser.tabs.highlight({windowId: tab.windowId, tabs: tab.index});\r\n\t\t\t\t\t}.bind(this)\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn browser.tabs.create({url: \"popup.html\"});\r\n}\r\n\r\nasync function setupPopup() {\r\n\r\n\tvar openInOwnTab = await getLocalStorage(\"openInOwnTab\", false);\r\n\r\n\tawait browser.action.onClicked.removeListener(openAsOwnTab);\r\n\tif (openInOwnTab) {\r\n\t\tawait browser.action.setPopup({popup: \"\"});\r\n\t\tawait browser.action.onClicked.addListener(openAsOwnTab);\r\n\t} else {\r\n\t\tawait browser.action.setPopup({popup: \"popup.html?popup=true\"});\r\n\t}\r\n\tif (browser.sidebarAction) {\r\n\t\tbrowser.sidebarAction.setPanel({panel: \"popup.html?panel=true\"});\r\n\t}\r\n}"]} \ No newline at end of file diff --git a/package.json b/package.json index a7a1acff..4b2ea156 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { - "name": "tab-manager", - "version": "5.3.0", + "name": "tab-manager-plus", + "version": "6.0.0", "description": "This is an extended version of the old Tab Manager Google Chrome extension. Should work on both Chrome and Firefox. Malware free, with a new view type and many new features.", "main": "index.js", "directories": { - "lib": "lib" + "src": "src" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "watch": "npx babel --watch lib --out-dir outlib --source-maps true", - "build": "babel lib --out-dir outlib --source-maps true" + "watch": "tsc --noEmit && node watch.mjs", + "build": "tsc --noEmit && node build.mjs" }, "repository": { "type": "git", @@ -22,19 +22,22 @@ }, "homepage": "https://github.com/stefanXO/Tab-Manager#readme", "devDependencies": { - "babel-cli": "^6.26.0", - "babel-core": "^6.26.3", - "babel-plugin-inline-replace-variables": "^1.3.1", - "babel-plugin-transform-async-to-generator": "^6.24.1", - "babel-plugin-transform-react-createelement-to-jsx": "^1.1.0", - "babel-preset-browser": "^1.0.1", - "babel-preset-es2015": "^6.24.1", - "babel-preset-es2017": "^6.24.1", - "babel-preset-react": "^6.24.1", - "babel-preset-react-app": "^3.1.2", - "crx3": "^1.1.3" + "@types/chrome": "^0.0.272", + "@types/node": "^22.7.2", + "@types/react": "^18.3.9", + "@types/react-dom": "^18.3.0", + "@types/webextension-polyfill": "^0.12.1", + "crx3": "^1.1.3", + "esbuild": "0.24.0", + "typescript": "^5.6.2", + "webextension-polyfill": "^0.12.0" }, "dependencies": { - "babel-preset-es2016": "^6.24.1" - } -} \ No newline at end of file + "react": "16.11.0", + "react-dom": "16.11.0", + "react-jsx": "^1.0.0" + }, + "browserslist": [ + "Chrome >= 88" + ] +} diff --git a/popup.html b/popup.html index 3741d6d8..30e585f2 100644 --- a/popup.html +++ b/popup.html @@ -10,18 +10,7 @@ - - - - - - - - - - - - + diff --git a/readme.md b/readme.md index 97001366..209b041a 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -# Tab Manager Plus 5.3.0 +# Tab Manager Plus 6.0.0 ##### Search through your tabs instantly, save windows for later, limit open tabs per window - and many more. diff --git a/lib/helpers/migrate.js b/src/helpers/migrate.ts similarity index 65% rename from lib/helpers/migrate.js rename to src/helpers/migrate.ts index 98d00d95..71cc3e60 100644 --- a/lib/helpers/migrate.js +++ b/src/helpers/migrate.ts @@ -1,23 +1,24 @@ "use strict"; import { toBoolean } from "./utils.js"; +import * as S from "@strings"; +import * as browser from 'webextension-polyfill'; +import {ISavedSession} from "@types"; -var browser = browser || chrome; - -var stringkeys = [ +const stringkeys = [ "layout", "version" ]; -var jsonkeys = [ +const jsonkeys = [ "tabLimit", "tabWidth", "tabHeight", "windowAge", - "windowNames", - "windowColors" + S.windowNames, + S.windowColors ]; -var boolkeys = [ +const boolkeys = [ "openInOwnTab", "animations", "windowTitles", @@ -32,7 +33,7 @@ var boolkeys = [ (async function () { - var needsMigration = false; + let needsMigration = false; for (const key of stringkeys) { if (!!localStorage[key]) { needsMigration = true; break; } @@ -47,19 +48,21 @@ var boolkeys = [ } if (needsMigration) { - var values = await browser.storage.local.get(null); - values = values || {}; - // delete all values that don't have a tabs array - for (const key in values) { - if (!!values[key].tabs) { - console.log("session deleting " + key); - await browser.storage.local.remove(key); - } else { - delete values[key]; + let keyValue = {}; + let values : Record = await browser.storage.local.get(null); + if (!!values) { + // delete all values that don't have a tabs array + for (const key in values) { + if (!!(values[key] as ISavedSession).tabs) { + console.log("session deleting " + key); + await browser.storage.local.remove(key); + } else { + delete values[key]; + } } + keyValue["sessions"] = values; } - var keyValue = {}; - keyValue["sessions"] = values; + for (const key of stringkeys) { if (!!localStorage[key]) keyValue[key] = localStorage[key]; } @@ -77,6 +80,5 @@ var boolkeys = [ for (const key of stringkeys) localStorage.removeItem(key); for (const key of boolkeys) localStorage.removeItem(key); for (const key of jsonkeys) localStorage.removeItem(key); - } })(); \ No newline at end of file diff --git a/src/helpers/storage.ts b/src/helpers/storage.ts new file mode 100644 index 00000000..4da7ea41 --- /dev/null +++ b/src/helpers/storage.ts @@ -0,0 +1,49 @@ +import * as browser from 'webextension-polyfill'; + +export async function getLocalStorage(key, default_value = null){ + const result = await browser.storage.local.get([key]); + return result[key] === undefined ? default_value : result[key]; +} + +export async function getLocalStorageMap(key: string): Promise>{ + const result = await browser.storage.local.get([key]); + if (result[key] === undefined) { + return new Map(); + } + let newMap = new Map(); + let obj: Object = result[key]; + for (const [k, v] of Object.entries(obj)) { + let key = parseInt(k); + newMap.set(key as T, v as V); + } + return newMap; +} + +export async function getLocalStorageStringMap(key : string) : Promise> { + const result = await browser.storage.local.get([key]); + if (result[key] === undefined) { + return new Map(); + } + let newMap = new Map(); + let obj : Object = result[key]; + for (const [k, v] of Object.entries(obj)) { + newMap.set(k as T, v as V); + } + return newMap; +} + +export async function setLocalStorage(key : string, value){ + const obj = {}; + obj[key] = value; + return browser.storage.local.set(obj); +} + +export async function setLocalStorageMap(key : string, value : Map) { + const obj = {}; + obj[key] = Object.fromEntries(value); + return browser.storage.local.set(obj); +} + +export async function removeLocalStorage(key){ + return browser.storage.local.remove(key); +} \ No newline at end of file diff --git a/lib/helpers/utils.js b/src/helpers/utils.ts similarity index 94% rename from lib/helpers/utils.js rename to src/helpers/utils.ts index 3ab04b07..f03252e1 100644 --- a/lib/helpers/utils.js +++ b/src/helpers/utils.ts @@ -2,7 +2,7 @@ // be triggered. The function will be called after it stops being called for // N milliseconds. If `immediate` is passed, trigger the function on the // leading edge, instead of the trailing. -export function debounce(func, wait, immediate) { +export function debounce(func, wait, immediate = false) { var timeout; return function () { var context = this, args = arguments; @@ -32,7 +32,7 @@ export function isInViewport(element, ofElement) { return rect.top >= 0 && rect.left >= 0 && rect.bottom <= ofElement.height && rect.right <= ofElement.width; } -export function stringHashcode(string) { +export function stringHashcode(string) : number { var hash = 0; for (var i = 0; i < string.length; i++) { var code = string.charCodeAt(i); diff --git a/lib/popup/options.js b/src/popup/options.js similarity index 100% rename from lib/popup/options.js rename to src/popup/options.js diff --git a/lib/popup/popup.jsx b/src/popup/popup.tsx similarity index 72% rename from lib/popup/popup.jsx rename to src/popup/popup.tsx index efb74183..2cf47a9e 100644 --- a/lib/popup/popup.jsx +++ b/src/popup/popup.tsx @@ -1,8 +1,25 @@ "use strict"; +import '@helpers/migrate'; +import {getLocalStorage} from "@helpers/storage"; +import {TabManager} from '@views'; +import * as React from 'react'; +import * as ReactDOM from "react-dom"; + +declare global { + interface Window { + loaded: boolean; + inPopup: boolean; + inPanel: boolean; + optionPage: boolean; + extensionVersion: string; + } +} + window.loaded = false; window.inPopup = window.location.search.indexOf("?popup") > -1; window.inPanel = window.location.search.indexOf("?panel") > -1; +window.extensionVersion = process.env.VERSION; window.onload = () => window.requestAnimationFrame(loadApp); @@ -19,8 +36,8 @@ setTimeout(loadApp, 15000); async function loadApp() { if (!!window.loaded) return; - var height = await getLocalStorage("tabHeight", 0); - var width = await getLocalStorage("tabWidth", 0); + let height : number = await getLocalStorage("tabHeight", 600); + let width : number = await getLocalStorage("tabWidth", 800); console.log(height, width); if (window.inPopup) { @@ -31,8 +48,7 @@ async function loadApp() { var root = document.getElementById("root"); if (root != null) { - var _height = document.body.style.height.split("px")[0]; - _height = parseInt(_height) || 0; + var _height = parseInt(document.body.style.height.split("px")[0]) || 0; if (_height < 300) { _height = 400; document.body.style.minHeight = _height + "px"; @@ -64,5 +80,7 @@ async function loadApp() { ReactDOM.render(, document.getElementById("TMP")); } -window.addEventListener("contextmenu", function (e) {e.preventDefault();}); +window.addEventListener("contextmenu", function (e) { + e.preventDefault(); +}); diff --git a/lib/popup/views/Session.jsx b/src/popup/views/Session.tsx similarity index 55% rename from lib/popup/views/Session.jsx rename to src/popup/views/Session.tsx index 7b1425c1..f21fb0ec 100644 --- a/lib/popup/views/Session.jsx +++ b/src/popup/views/Session.tsx @@ -1,17 +1,22 @@ -"use strict"; +"use strict" -class Session extends React.Component { - constructor(props) { +import {getLocalStorage, setLocalStorage} from "@helpers/storage"; +import {Tab} from "@views"; +import * as React from "react"; +import * as browser from 'webextension-polyfill'; +import {ICommand, ISession, ISessionState} from '@types'; +import * as S from "@strings"; + +export class Session extends React.Component { + constructor(props : ISession) { super(props); - //console.log(this.props.window); - //console.log(this.props.window.name); - var name = this.props.window.name; - var color = this.props.window.color || "default"; + + let name = this.props.session.name; + let color = this.props.session.color || "default"; + this.state = { - windowTitles: [], name: name, - color: color, - tabs: 0 + color: color }; this.stop = this.stop.bind(this); @@ -23,23 +28,21 @@ class Session extends React.Component { } render() { - var _this = this; - var name = this.state.name; - var color = this.state.color; - var hideWindow = true; - var titleAdded = false; - var tabsperrow = this.props.layout.indexOf("blocks") > -1 ? Math.ceil(Math.sqrt(this.props.tabs.length + 2)) : this.props.layout === "vertical" ? 1 : 15; - var tabs = this.props.tabs.map(function(tab) { - var tabId = tab.id * tab.id * tab.id * 100; - var isHidden = !!_this.props.hiddenTabs[tabId] && _this.props.filterTabs; - var isSelected = !!_this.props.selection[tabId]; + let _this = this; + let hideWindow = true; + let titleAdded = false; + let tabsperrow = this.props.layout.indexOf("blocks") > -1 ? Math.ceil(Math.sqrt(this.props.tabs.length + 2)) : this.props.layout === "vertical" ? 1 : 15; + let tabs = this.props.tabs.map(function(tab) { + let tabId = tab.id * tab.id * tab.id * 100; + let isHidden = _this.props.hiddenTabs.has(tabId) && _this.props.filterTabs; + let isSelected = _this.props.selection.has(tabId); tab.id = tab.index; - hideWindow &= isHidden; + if (!isHidden) hideWindow = false; return ( , -
+
, +
-1 ? "" : "windowaction")} title={"Restore this saved window\nWill restore " + tabs.length + " tabs. Please note : The tabs will be restored without their history."} @@ -76,10 +79,10 @@ class Session extends React.Component { } if (this.props.windowTitles) { - if (name) { + if (this.state.name) { tabs.unshift( -

- {name} +

+ {this.state.name}

); titleAdded = true; @@ -95,20 +98,20 @@ class Session extends React.Component { for (var j = 0; j < tabs.length; j++) { children.push(tabs[j]); if ((j + 1) % tabsperrow === 0 && j && this.props.layout.indexOf("blocks") > -1) { - children.push(
); + children.push(
); } } var focused = false; - if (this.props.window.windowsInfo.focused || this.props.lastOpenWindow === this.props.window.windowsInfo.id) { + if (this.props.session.windowsInfo.focused || this.props.lastOpenWindow === this.props.session.windowsInfo.id) { focused = true; } return (
) { e.stopPropagation(); } - async windowClick(e) { + async windowClick(e : React.MouseEvent) { this.restoreSession(e, null); } - async openTab(e, index) { - console.log(index); + async openTab(e : React.MouseEvent, index : number) { this.restoreSession(e, index); } - async restoreSession(e, tabId) { + async restoreSession(e : React.MouseEvent, tabId : number) { e.stopPropagation(); - console.log("source window", this.props.window); - // chrome.runtime.getBackgroundPage(function callback(tabs, backgroundPage) { - // backgroundPage.createWindowWithTabs(tabs); - // }.bind(null, this.props.window.tabs)); - - browser.runtime.sendMessage({command: "create_window_with_session_tabs", window: this.props.window, tab_id: tabId}); - + await browser.runtime.sendMessage({ + command: S.create_window_with_session_tabs, + session: this.props.session, + tab_id: tabId + }); this.props.parentUpdate(); @@ -168,25 +168,12 @@ class Session extends React.Component { this.props.scrollTo("window", browser.windows.WINDOW_ID_CURRENT); }.bind(this), 500); } - - // , function (tabs, w) { - // browser.tabs.create(first.id, { pinned: first.pinned }); - // if (t.length > 0) { - // browser.tabs.move(t, { windowId: w.id, index: -1 }, function (tab) { - // browser.tabs.update(tab.id, { pinned: tab.pinned }); - // }); - // } - // browser.windows.update(w.id, { focused: true }); - // }.bind(null, this.props.window.tabs)); - // browser.windows.update(this.props.window.windowsInfo.id, { - // "focused": true }, - // function (a) {this.props.parentUpdate();}.bind(this)); } async close(e) { e.stopPropagation(); var sessions = await getLocalStorage('sessions', {}); - delete sessions[this.props.window.id]; + delete sessions[this.props.session.id]; var value = await setLocalStorage('sessions', sessions).catch(function (err) { console.log(err); @@ -195,11 +182,11 @@ class Session extends React.Component { console.log(value); this.props.parentUpdate(); - // browser.windows.remove(this.props.window.windowsInfo.id); + // browser.windows.remove(this.props.session.windowsInfo.id); } maximize(e) { e.stopPropagation(); - // browser.windows.update(this.props.window.windowsInfo.id, { + // browser.windows.update(this.props.session.windowsInfo.id, { // "state": "normal" }, // function (a) {this.props.parentUpdate();}.bind(this)); } diff --git a/lib/popup/views/Tab.jsx b/src/popup/views/Tab.tsx similarity index 61% rename from lib/popup/views/Tab.jsx rename to src/popup/views/Tab.tsx index 7900191d..7029c1d7 100644 --- a/lib/popup/views/Tab.jsx +++ b/src/popup/views/Tab.tsx @@ -1,12 +1,19 @@ "use strict"; -class Tab extends React.Component { - constructor(props) { +import * as S from "@strings"; +import * as React from "react"; +import * as browser from 'webextension-polyfill'; +import {ICommand, ITab, ITabState} from '@types'; + +export class Tab extends React.Component { + constructor(props : ITab) { super(props); this.state = { favIcon: "", dragFavIcon: "", - hovered: false + draggingOver: "", + hovered: false, + tabRef: React.createRef() }; this.onHover = this.onHover.bind(this); @@ -19,8 +26,6 @@ class Tab extends React.Component { this.drop = this.drop.bind(this); this.resolveFavIconUrl = this.resolveFavIconUrl.bind(this); this.checkSettings = this.checkSettings.bind(this); - - this.tabRef = React.createRef(); } async componentDidMount() { @@ -32,8 +37,8 @@ class Tab extends React.Component { } render() { - var children = []; - if (this.props.layout == "vertical") { + const children = []; + if (this.props.layout === "vertical") { children.push(
Pinned @@ -54,7 +59,7 @@ class Tab extends React.Component { key={"tab-icon-" + this.props.tab.id} className="iconoverlay " style={{ - backgroundImage: "url(" + this.state.favIcon + ")" + backgroundImage: !!this.state.favIcon ? "url(" + this.state.favIcon + ")" : "" }} /> ); @@ -75,18 +80,18 @@ class Tab extends React.Component { ((this.props.tab.mutedInfo && this.props.tab.mutedInfo.muted) ? "muted " : "") + (this.props.tab.audible ? "audible " : "") + (this.props.tab.discarded ? "discarded " : "") + - (this.props.layout == "vertical" ? "full " : "") + + (this.props.layout === "vertical" ? "full " : "") + (this.props.tab.incognito ? "incognito " : "") + - (this.state.draggingOver || "") + + (this.state.draggingOver) + (this.props.searchActive ? "search-active " : "") + " tab-" + this.props.tab.id + " " + - (this.props.layout == "vertical" ? "vertical " : "blocks "), + (this.props.layout === "vertical" ? "vertical " : "blocks "), style: - (this.props.layout == "vertical" + (this.props.layout === "vertical" ? { } - : { backgroundImage: "url(" + this.state.favIcon + ")" } + : { backgroundImage: !!this.state.favIcon ? "url(" + this.state.favIcon + ")" : "" } ) , id: this.props.id, @@ -95,7 +100,7 @@ class Tab extends React.Component { onMouseDown: this.onMouseDown, onMouseEnter: this.onHover, onMouseOut: this.onHoverOut, - ref: this.tabRef + ref: this.state.tabRef }; if (!!this.props.draggable) { @@ -114,22 +119,21 @@ class Tab extends React.Component { ); } onHover(e) { - this.setState({hover: true}); + this.setState({hovered: true}); this.props.hoverHandler(this.props.tab); } onHoverOut(e) { - this.setState({hover: false}); + this.setState({hovered: false}); } - onMouseDown(e) { + async onMouseDown(e : React.MouseEvent) { if (e.button === 0) return; if (!this.props.draggable) return; - this.click(e); + await this.click(e); } - async click(e) { + async click(e : React.MouseEvent) { this.stopProp(e); - var tabId = this.props.tab.id; - var windowId = this.props.window.id; + var tabId : number = this.props.tab.id; if (e.button === 1) { this.props.middleClick(tabId); @@ -144,15 +148,17 @@ class Tab extends React.Component { if (!!this.props.click) { this.props.click(e, this.props.tab.id); } else { + let windowId = this.props.window.id; + if (navigator.userAgent.search("Firefox") > -1) { - browser.runtime.sendMessage({ - command: "focus_on_tab_and_window_delayed", - tab: {id: tabId, windowId: windowId} + browser.runtime.sendMessage({ + command: S.focus_on_tab_and_window_delayed, + saved_tab: {tabId: tabId, windowId: windowId} }); } else { - browser.runtime.sendMessage({ - command: "focus_on_tab_and_window", - tab: {id: tabId, windowId: windowId} + browser.runtime.sendMessage({ + command: S.focus_on_tab_and_window, + saved_tab: {tabId: tabId, windowId: windowId} }); } } @@ -161,29 +167,38 @@ class Tab extends React.Component { } return false; } - dragStart(e) { + dragStart(e : React.DragEvent) { if (!this.props.draggable) return false; if (!this.props.drag) return false; - this.state.dragFavIcon = ""; + this.setState({ + dragFavIcon: "" + }); this.props.dragFavicon(this.state.favIcon); - e.dataTransfer.setData("Text", this.props.tab.id); + e.dataTransfer.setData("Text", this.props.tab.id.toString()); e.dataTransfer.setData("text/uri-list", this.props.tab.url || ""); this.props.drag(e, this.props.tab.id); } - dragOver(e) { + dragOver(e : React.DragEvent) { if (!this.props.draggable) return false; if (!this.props.drag) return false; - this.state.dragFavIcon = this.props.dragFavicon(); + let favicon = this.props.dragFavicon(); + let draggingover; var before = this.state.draggingOver; - if (this.props.layout == "vertical") { - this.state.draggingOver = e.nativeEvent.offsetY > ReactDOM.findDOMNode(this).clientHeight / 2 ? "bottom" : "top"; + if (this.props.layout === "vertical") { + draggingover = e.nativeEvent.offsetY > this.state.tabRef.current.clientHeight / 2 ? "bottom" : "top"; } else { - this.state.draggingOver = e.nativeEvent.offsetX > ReactDOM.findDOMNode(this).clientWidth / 2 ? "right" : "left"; + draggingover = e.nativeEvent.offsetX > this.state.tabRef.current.clientWidth / 2 ? "right" : "left"; } - if (before != this.state.draggingOver) { + + this.setState({ + draggingOver: draggingover, + dragFavIcon: favicon + }); + + if (before !== this.state.draggingOver) { this.forceUpdate(); this.props.parentUpdate(); } @@ -191,55 +206,55 @@ class Tab extends React.Component { dragOut() { if (!this.props.draggable) return false; if (!this.props.drag) return; - this.state.dragFavIcon = ""; - delete this.state.draggingOver; + + this.setState({ + dragFavIcon: "", + draggingOver: "" + }); this.forceUpdate(); this.props.parentUpdate(); } - drop(e) { + drop(e : React.DragEvent) { if (!this.props.draggable) return false; if (!this.props.drag) return false; if (!this.props.drop) return; - this.state.dragFavIcon = ""; this.stopProp(e); - var before = this.state.draggingOver == "top" || this.state.draggingOver == "left"; - delete this.state.draggingOver; + + var before = this.state.draggingOver === "top" || this.state.draggingOver === "left"; + + this.setState({ + draggingOver: "", + dragFavIcon: "" + }); this.props.drop(this.props.tab.id, before); this.forceUpdate(); this.props.parentUpdate(); } async resolveFavIconUrl() { - var image; + let image : string; // firefox screenshots; needs // if(!!browser.tabs.captureTab) { // console.log("tabs captureTab"); // image = await browser.tabs.captureTab(this.props.tab.id); // image = "url(" + image + ")"; // }else - if (!!this.props.tab.url && navigator.userAgent.search("Firefox") === -1) { - image = "chrome-extension://" + chrome.runtime.id + "/_favicon/?pageUrl=" + encodeURIComponent(this.props.tab.url) + "&size=64&" + Date.now(); - } else if (!!this.props.tab.url && this.props.tab.url.indexOf("chrome://") !== 0 && this.props.tab.url.indexOf("about:") !== 0) { - // chrome screenshots / only for active tabs; needs - // if(!!browser.tabs.captureVisibleTab && this.props.tab.highlighted) { - // console.log("tabsCapture"); - // try { - // image = await browser.tabs.captureVisibleTab( this.props.window.id, {} ); - // //console.log(image); - // } catch ( e ) { - // console.log(e.message); - // } - // image = "url(" + image + ")"; - // }else{ - image = this.props.tab.favIconUrl ? "" + this.props.tab.favIconUrl + "" : ""; - //} - } else { - var favIcons = ["bookmarks", "chrome", "crashes", "downloads", "extensions", "flags", "history", "settings"]; - var iconUrl = this.props.tab.url || ""; - var iconName = ""; - if (iconUrl.length > 9) iconName = iconUrl.slice(9).match(/^\w+/g); - image = !iconName || favIcons.indexOf(iconName[0]) < 0 ? "" : "../images/chrome/" + iconName[0] + ".png"; + + var _url : string = this.props.tab.url || this.props.tab.pendingUrl || ""; + + if (!!_url && navigator.userAgent.search("Firefox") === -1) { + image = "chrome-extension://" + chrome.runtime.id + "/_favicon/?pageUrl=" + encodeURIComponent(_url) + "&size=64"; // &" + Date.now(); + } else if (!!_url && _url.indexOf("chrome://") !== 0 && _url.indexOf("about:") !== 0) { + image = this.props.tab.favIconUrl ? "" + this.props.tab.favIconUrl + "" : ""; + } else { + const favIcons = ["bookmarks", "chrome", "crashes", "downloads", "extensions", "flags", "history", "settings"]; + let iconUrl = _url; + if (iconUrl.length > 9) { + let iconName = iconUrl.slice(9).match(/^\w+/g); + console.log(iconName); + image = !iconName || favIcons.indexOf(iconName[0]) < 0 ? "" : "../images/chrome/" + iconName[0] + ".png"; + } } this.setState({ favIcon: image diff --git a/lib/popup/views/TabManager.jsx b/src/popup/views/TabManager.tsx similarity index 69% rename from lib/popup/views/TabManager.jsx rename to src/popup/views/TabManager.tsx index 89f7566c..5f07ac37 100644 --- a/lib/popup/views/TabManager.jsx +++ b/src/popup/views/TabManager.tsx @@ -1,44 +1,34 @@ -"use strict"; - -var browser = browser || chrome; - -class TabManager extends React.Component { - constructor(props) { +import {getLocalStorage, setLocalStorage} from "@helpers/storage"; +import {debounce, maybePluralize} from "@helpers/utils"; +import {Window, Session, TabOptions, Tab} from "@views"; +import * as React from "react"; +import * as S from "@strings"; +import * as browser from 'webextension-polyfill'; +import {ICommand, ITabManager, ITabManagerState, ISavedSession} from "@types"; + +const {setTimeout, clearTimeout} = window + +export class TabManager extends React.Component { + constructor(props : ITabManager) { super(props); - //this.update(); - - if (navigator.userAgent.search("Firefox") > -1) { - } else { - var check = browser.permissions.contains({ permissions: ["system.display"] }); - check.then( - function(result) { - if (result) { - // The extension has the permissions. - } else { - setLocalStorage("hideWindows", false); - this.state.hideWindows = false; - } - }.bind(this) - ); - } - - var layout = "blocks"; - var animations = true; - var windowTitles = true; - var compact = false; - var dark = false; - var tabactions = true; - var badge = true; - var sessionsFeature = false; - var hideWindows = false; - var filterTabs = false; - var tabLimit = 0; - var openInOwnTab = false; - var tabWidth = 800; - var tabHeight = 600; - var closeTimeout; - var resetTimeout; + let layout = "blocks"; + let animations = true; + let windowTitles = true; + let compact = false; + let dark = false; + let tabactions = true; + let badge = true; + let sessionsFeature = false; + let hideWindows = false; + let filterTabs = false; + let tabLimit = 0; + let openInOwnTab = false; + let tabWidth = 800; + let tabHeight = 600; + + let resetTimeout = -1; + // var closeTimeout; this.state = { layout: layout, @@ -57,24 +47,27 @@ class TabManager extends React.Component { lastOpenWindow: -1, windows: [], sessions: [], - selection: {}, - lastSelect: false, - hiddenTabs: {}, - tabsbyid: {}, - windowsbyid: {}, - closeTimeout: closeTimeout, + selection: new Set(), + lastSelect: 0, + hiddenTabs: new Set(), + tabsbyid: new Map(), + windowsbyid: new Map(), resetTimeout: resetTimeout, height: 600, hasScrollBar: false, focusUpdates: 0, topText: "", bottomText: "", - lastDirection: false, + lastDirection: "", optionsActive: !!this.props.optionsActive, filterTabs: filterTabs, dupTabs: false, dragFavicon: "", - colorsActive: false + colorsActive: 0, + + tabCount: 0, + hiddenCount: 0, + searchLen: 0 }; this.addWindow = this.addWindow.bind(this); @@ -123,7 +116,11 @@ class TabManager extends React.Component { this.toggleWindowTitles = this.toggleWindowTitles.bind(this); this.update = this.update.bind(this); this.windowTitlesText = this.windowTitlesText.bind(this); - + this.onTabDetached = this.onTabDetached.bind(this); + this.onTabAttached = this.onTabAttached.bind(this); + this.onTabRemoved = this.onTabRemoved.bind(this); + this.onTabCreated = this.onTabCreated.bind(this); + this.dirtyWindow = this.dirtyWindow.bind(this); } UNSAFE_componentWillMount() { this.update(); @@ -164,24 +161,24 @@ class TabManager extends React.Component { if (typeof storage["hideWindows"] === "undefined") storage["hideWindows"] = hideWindows; if (typeof storage["filter-tabs"] === "undefined") storage["filter-tabs"] = filterTabs; - storage["version"] = __VERSION__; + storage["version"] = window.extensionVersion; await browser.storage.local.set(storage); - layout = storage["layout"]; - tabLimit = storage["tabLimit"]; - tabWidth = storage["tabWidth"]; - tabHeight = storage["tabHeight"]; - openInOwnTab = storage["openInOwnTab"]; - animations = storage["animations"]; - windowTitles = storage["windowTitles"]; - compact = storage["compact"]; - dark = storage["dark"]; - tabactions = storage["tabactions"]; - badge = storage["badge"]; - sessionsFeature = storage["sessionsFeature"]; - hideWindows = storage["hideWindows"]; - filterTabs = storage["filter-tabs"]; + layout = storage["layout"] as string; + tabLimit = storage["tabLimit"] as number; + tabWidth = storage["tabWidth"] as number; + tabHeight = storage["tabHeight"] as number; + openInOwnTab = storage["openInOwnTab"] as boolean; + animations = storage["animations"] as boolean; + windowTitles = storage["windowTitles"] as boolean; + compact = storage["compact"] as boolean; + dark = storage["dark"] as boolean; + tabactions = storage["tabactions"] as boolean; + badge = storage["badge"] as boolean; + sessionsFeature = storage["sessionsFeature"] as boolean; + hideWindows = storage["hideWindows"] as boolean; + filterTabs = storage["filter-tabs"] as boolean; if (dark) { document.body.className = "dark"; @@ -207,35 +204,40 @@ class TabManager extends React.Component { }); } - hoverHandler(tab) { + hoverHandler(tab : browser.Tabs.Tab) { this.setState({ topText: tab.title || "" }); - this.setState({ bottomText: tab.url || "" }); + this.setState({ bottomText: tab.url || tab.pendingUrl || "" }); // clearTimeout(this.state.closeTimeout); // this.state.closeTimeout = setTimeout(function () { // window.close(); // }, 100000); - clearTimeout(this.state.resetTimeout); - this.state.resetTimeout = setTimeout( + var _reset_timeout = this.state.resetTimeout; + clearTimeout(_reset_timeout); + _reset_timeout = setTimeout( function() { this.setState({ topText: "", bottomText: "" }); this.update(); }.bind(this), 15000 ); + this.setState({resetTimeout: _reset_timeout}); //this.update(); } - hoverIcon(e) { - if (e && e.nativeEvent) { - e.nativeEvent.preventDefault(); - e.nativeEvent.stopPropagation(); - } - + hoverIcon(e : React.MouseEvent | string) { var text = ""; - if(e && e.target && !!e.target.title) { - text = e.target.title; - } else if (typeof (e) === "string") { + if (typeof (e) === "string") { text = e; + } else { + if (e && e.nativeEvent) { + e.nativeEvent.preventDefault(); + e.nativeEvent.stopPropagation(); + } + + if (e && e.target && !!(e.target as HTMLDivElement).title) { + text = (e.target as HTMLDivElement).title; + } } + var bottom = " "; if (text.indexOf("\n") > -1) { var a = text.split("\n"); @@ -248,13 +250,13 @@ class TabManager extends React.Component { this.forceUpdate(); } render() { - var _this = this; + let _this = this; - // var hiddenCount = this.state.hiddenCount || 0; - var tabCount = this.state.tabCount || 0; + // let hiddenCount = this.state.hiddenCount || 0; + let tabCount = this.state.tabCount; - var haveMin = false; - var haveSess = false; + let haveMin = false; + let haveSess = false; for (let i = this.state.windows.length - 1; i >= 0; i--) { if (this.state.windows[i].state === "minimized") haveMin = true; @@ -265,7 +267,7 @@ class TabManager extends React.Component { // disable session window if we have filtering enabled // and filter active if (haveSess && this.state.filterTabs) { - if (this.state.searchLen > 0 || Object.keys(this.state.hiddenTabs).length > 0) { + if (this.state.searchLen > 0 || this.state.hiddenTabs.size > 0) { haveSess = false; } } @@ -286,7 +288,7 @@ class TabManager extends React.Component { tabIndex={0} > {!this.state.optionsActive &&
- {this.state.windows.map(function(window) { + {this.state.windows.map(function(window : browser.Windows.Window) { if (window.state === "minimized") return; if (!!this.state.colorsActive && this.state.colorsActive !== window.id) return; return ( @@ -367,12 +369,12 @@ class TabManager extends React.Component {
{haveSess - ? this.state.sessions.map(function(window) { + ? this.state.sessions.map(function(window : ISavedSession) { if (!!this.state.colorsActive && this.state.colorsActive !== window.id) return; return ( ); @@ -455,7 +458,7 @@ class TabManager extends React.Component { disabled={true} className="tabtitle" ref="topbox" - placeholder={maybePluralize(tabCount, 'tab') + " in " + this.state.windows.length + " windows"} + placeholder={maybePluralize(tabCount, 'tab') + " in " + maybePluralize(this.state.windows.length, 'window')} value={this.state.topText} /> @@ -465,7 +468,7 @@ class TabManager extends React.Component { - +
0 - ? "Close selected tabs\nWill close " + maybePluralize(Object.keys(this.state.selection).length, 'tab') + this.state.selection.size > 0 + ? "Close selected tabs\nWill close " + maybePluralize(this.state.selection.size, 'tab') : "Close current Tab" } onClick={this.deleteTabs} @@ -487,12 +490,12 @@ class TabManager extends React.Component {
0 - ? "Discard selected tabs\nWill discard " + maybePluralize(Object.keys(this.state.selection).length, 'tab') + " - freeing memory" + this.state.selection.size > 0 + ? "Discard selected tabs\nWill discard " + maybePluralize(this.state.selection.size, 'tab') + " - freeing memory" : "Select tabs to discard them and free memory" } style={ - Object.keys(this.state.selection).length > 0 + this.state.selection.size > 0 ? {} : { opacity: 0.25 } } @@ -502,8 +505,8 @@ class TabManager extends React.Component {
0 - ? "Pin selected tabs\nWill pin " + maybePluralize(Object.keys(this.state.selection).length, 'tab') + this.state.selection.size > 0 + ? "Pin selected tabs\nWill pin " + maybePluralize(this.state.selection.size, 'tab') : "Pin current Tab" } onClick={this.pinTabs} @@ -517,7 +520,7 @@ class TabManager extends React.Component { (this.state.searchLen > 0 ? "\n" + (this.state.filterTabs ? "Will reveal " : "Will hide ") + - maybePluralize((Object.keys(this.state.tabsbyid).length - Object.keys(this.state.selection).length), 'tab') + maybePluralize((this.state.tabsbyid.size - this.state.selection.size), 'tab') : "") } onClick={this.toggleFilterMismatchedTabs} @@ -526,8 +529,8 @@ class TabManager extends React.Component {
0 - ? "Move tabs to new window\nWill move " + maybePluralize(Object.keys(this.state.selection).length, 'selected tab') + " to it" + this.state.selection.size > 0 + ? "Move tabs to new window\nWill move " + maybePluralize(this.state.selection.size, 'selected tab') + " to it" : "Open new empty window" } onClick={this.addWindow} @@ -553,17 +556,30 @@ class TabManager extends React.Component { { await this.loadStorage(); - var _this = this; + if (navigator.userAgent.search("Firefox") > -1) { + } else { + let result = await browser.permissions.contains({permissions: ["system.display"]}); + if (!result) { + setLocalStorage("hideWindows", false); + this.setState({ + hideWindows: false + }); + } + } - var runUpdate = debounce(this.update, 250); + let _this = this; + + let runUpdate = debounce(this.update, 250); runUpdate = runUpdate.bind(this); - var runTabUpdate = (tabid, changeinfo, tab) => { + var runTabUpdate = async (tabid, changeinfo, tab) => { + this.dirtyWindow(tab.windowId); + if (!!_this.refs["window" + tab.windowId]) { - var window = _this.refs["window" + tab.windowId]; + var window = _this.refs["window" + tab.windowId] as Window; if (!!window.refs["tab" + tabid]) { - var _tabref = window.refs["tab" + tabid]; - _tabref.checkSettings(); + var _tabref = window.refs["tab" + tabid] as Tab; + await _tabref.checkSettings(); } } } @@ -576,18 +592,27 @@ class TabManager extends React.Component { browser.tabs.onReplaced.addListener(runUpdate); browser.tabs.onDetached.addListener(runUpdate); browser.tabs.onAttached.addListener(runUpdate); + + browser.tabs.onCreated.addListener(this.onTabCreated); + browser.tabs.onDetached.addListener(this.onTabDetached); + browser.tabs.onAttached.addListener(this.onTabAttached); + browser.tabs.onRemoved.addListener(this.onTabRemoved); + browser.tabs.onActivated.addListener(runUpdate); browser.windows.onFocusChanged.addListener(runUpdate); browser.windows.onCreated.addListener(runUpdate); browser.windows.onRemoved.addListener(runUpdate); - browser.runtime.onMessage.addListener(function (request, sender, sendResponse) { + browser.runtime.onMessage.addListener(async function (message, sender, sendResponse) { + const request = message as ICommand; + console.log(request.command); switch (request.command) { - case "refresh_windows": - for (let window_id of request.window_ids) { + case S.refresh_windows: + let window_ids : number[] = request.window_ids; + for (let window_id of window_ids) { if (!_this.refs["window" + window_id]) continue; - _this.refs["window" + window_id].checkSettings(); + (_this.refs["window" + window_id] as Window).checkSettings(); } break; } @@ -596,9 +621,9 @@ class TabManager extends React.Component { browser.storage.onChanged.addListener(this.sessionSync); - this.sessionSync(); + await this.sessionSync(); - this.refs.root.focus(); + (this.refs.root as HTMLElement).focus(); this.focusRoot(); setTimeout(async function() { @@ -620,20 +645,22 @@ class TabManager extends React.Component { // box.focus(); } async sessionSync() { - var values = await getLocalStorage('sessions', {}); - // console.log(values); - var sessions = []; + let values = await getLocalStorage('sessions', {}); + //console.log(values); + let sessions : ISavedSession[] = []; for (let key in values) { let sess = values[key]; if (sess.id && sess.tabs && sess.windowsInfo) { sessions.push(sess); } } - this.state.sessions = sessions; - this.update(); + this.setState({ + sessions: sessions + }); + await this.update(); } focusRoot() { - this.state.focusUpdates++; + this.setState({ focusUpdates: (this.state.focusUpdates + 1) }); setTimeout( function() { if (document.activeElement === document.body) { @@ -645,11 +672,12 @@ class TabManager extends React.Component { 500 ); } - dragFavicon(val) { - if (!val) { + dragFavicon(icon : string) : string { + if (!icon) { return this.state.dragFavicon; } else { - this.state.dragFavicon = val; + this.setState({ dragFavicon: icon }); + return icon; } } rateExtension() { @@ -665,22 +693,44 @@ class TabManager extends React.Component { this.forceUpdate(); } toggleOptions() { - this.state.optionsActive = !this.state.optionsActive; + this.setState({ optionsActive: !this.state.optionsActive }); this.forceUpdate(); } - toggleColors(active, windowId) { - if(!!active) { - this.state.colorsActive = windowId; - }else{ - this.state.colorsActive = false; - } + toggleColors(active : boolean, windowId : number) { + this.setState({ + colorsActive: !!active ? windowId : 0 + }) console.log("colorsActive", active, windowId, this.state.colorsActive); this.forceUpdate(); } + onTabCreated(tab : browser.Tabs.Tab) { + this.dirtyWindow(tab.windowId); + } + + onTabRemoved(tabId : number, removeInfo : browser.Tabs.OnRemovedRemoveInfoType) { + this.dirtyWindow(removeInfo.windowId); + } + + onTabDetached(tabId : number, detachInfo : browser.Tabs.OnDetachedDetachInfoType) { + const windowId = detachInfo.oldWindowId; + this.dirtyWindow(windowId); + } + + onTabAttached(tabId : number, attachInfo: browser.Tabs.OnAttachedAttachInfoType) { + const windowId = attachInfo.newWindowId; + this.dirtyWindow(windowId); + } + + dirtyWindow(windowId : number) { + const window = this.refs['window' + windowId] as Window; + if (!window) return; + window.setState({dirty: true}); + } + async update() { - var windows = await browser.windows.getAll({ populate: true }); - var sort_windows = await getLocalStorage("windowAge", []); + const windows : browser.Windows.Window[] = await browser.windows.getAll({ populate: true }); + const sort_windows = await getLocalStorage("windowAge", []); windows.sort(function(a, b) { var aSort = sort_windows.indexOf(a.id); @@ -692,26 +742,29 @@ class TabManager extends React.Component { return 0; }); - this.state.lastOpenWindow = windows[0].id; - this.state.windows = windows; - this.state.windowsbyid = {}; - this.state.tabsbyid = {}; + this.state.windowsbyid.clear(); + this.state.tabsbyid.clear(); + + this.setState({ + lastOpenWindow: windows[0].id, + windows: windows + }); + let tabCount = 0; for (const window of windows) { - this.state.windowsbyid[window.id] = window; + this.state.windowsbyid.set(window.id, window); for (const tab of window.tabs) { - this.state.tabsbyid[tab.id] = tab; + this.state.tabsbyid.set(tab.id, tab); tabCount++; } } - for (const id in this.state.selection) { - if (!this.state.tabsbyid[id]) { - delete this.state.selection[id]; - this.state.lastSelect = id; + for (let id of this.state.selection.keys()) { + if (!this.state.tabsbyid.has(id)) { + this.state.selection.delete(id); + this.setState({lastSelect: id}); } } - this.state.tabCount = tabCount; this.setState({ tabCount: tabCount }); @@ -719,30 +772,30 @@ class TabManager extends React.Component { // this.forceUpdate(); } async deleteTabs() { - var _this = this; - var tabs = Object.keys(this.state.selection).map(function(id) { - return _this.state.tabsbyid[id]; + const _this = this; + const tabs: browser.Tabs.Tab[] = [...this.state.selection.keys()].map(function(id) { + return _this.state.tabsbyid.get(id); }); if (tabs.length) { - browser.runtime.sendMessage({command: "close_tabs", tabs: tabs}); + browser.runtime.sendMessage({command: S.close_tabs, tabs: tabs}); } else { - var t = await browser.tabs.query({ currentWindow: true, active: true }); + const t = await browser.tabs.query({ currentWindow: true, active: true }); if (t && t.length > 0) { await browser.tabs.remove(t[0].id); } } this.forceUpdate(); } - deleteTab(tabId) { + deleteTab(tabId : number) { browser.tabs.remove(tabId); } async discardTabs() { - var _this = this; - var tabs = Object.keys(this.state.selection).map(function(id) { - return _this.state.tabsbyid[id]; + const _this = this; + const tabs : browser.Tabs.Tab[] = [...this.state.selection.keys()].map(function(id) { + return _this.state.tabsbyid.get(id); }); if (tabs.length) { - browser.runtime.sendMessage({command: "discard_tabs", tabs: tabs}); + browser.runtime.sendMessage({command: S.discard_tabs, tabs: tabs}); } this.clearSelection(); } @@ -750,30 +803,43 @@ class TabManager extends React.Component { browser.tabs.discard(tabId); } async addWindow() { - var _this = this; - var count = Object.keys(this.state.selection).length; - var tabs = Object.keys(this.state.selection).map(function(id) { - return _this.state.tabsbyid[id]; + const _this = this; + const count = this.state.selection.size; + const tabs : browser.Tabs.Tab[] = [...this.state.selection.keys()].map(function(id) { + return _this.state.tabsbyid.get(id); + }); + + const incognito_tabs = tabs.filter(function(tab) { + return tab.incognito; + }); + + const normal_tabs = tabs.filter(function(tab) { + return !tab.incognito; }); if (count === 0) { await browser.windows.create({}); } else if (count === 1) { if (navigator.userAgent.search("Firefox") > -1) { - browser.runtime.sendMessage({command: "focus_on_tab_and_window_delayed", tab: tabs[0]}); + await browser.runtime.sendMessage({command: S.focus_on_tab_and_window_delayed, tab: tabs[0]}); }else{ - browser.runtime.sendMessage({command: "focus_on_tab_and_window", tab: tabs[0]}); + await browser.runtime.sendMessage({command: S.focus_on_tab_and_window, tab: tabs[0]}); } } else { - browser.runtime.sendMessage({command: "create_window_with_tabs", tabs: tabs}); + if (normal_tabs.length > 0) { + await browser.runtime.sendMessage({command: S.create_window_with_tabs, tabs: normal_tabs, incognito: false}); + } + if (incognito_tabs.length > 0) { + await browser.runtime.sendMessage({command: S.create_window_with_tabs, tabs: incognito_tabs, incognito: true}); + } } if (!!window.inPopup) window.close(); } async pinTabs() { - var _this = this; - var tabs = Object.keys(this.state.selection) + const _this = this; + const tabs : browser.Tabs.Tab[] = [...this.state.selection.keys()] .map(function(id) { - return _this.state.tabsbyid[id]; + return _this.state.tabsbyid.get(id); }) .sort(function(a, b) { return a.index - b.index; @@ -784,31 +850,38 @@ class TabManager extends React.Component { await browser.tabs.update(tabs[i].id, { pinned: !tabs[0].pinned }); } } else { - var t = await browser.tabs.query({ currentWindow: true, active: true }); + const t = await browser.tabs.query({ currentWindow: true, active: true }); if (t && t.length > 0) { await browser.tabs.update(t[0].id, { pinned: !t[0].pinned }); } } } highlightDuplicates(e) { - this.state.selection = {}; - this.state.hiddenTabs = {}; - this.state.searchLen = 0; - this.state.dupTabs = !this.state.dupTabs; - this.refs.searchbox.value = ""; - if (!this.state.dupTabs) { - this.state.hiddenCount = 0; + this.state.selection.clear(); + this.state.hiddenTabs.clear(); + + let searchLen = 0; + const dupTabs = !this.state.dupTabs; + + (this.refs.searchbox as HTMLInputElement).value = ""; + + if (!dupTabs) { + this.setState({ + hiddenCount: 0, + dupTabs: dupTabs, + searchLen: searchLen + }); this.forceUpdate(); return; } - var hiddenCount = this.state.hiddenCount || 0; - var idList = this.state.tabsbyid; - var dup = []; - for (const id in idList) { - var tab = this.state.tabsbyid[id]; - for (const id2 in idList) { + let hiddenCount = this.state.hiddenCount || 0; + const idList : number[] = [...this.state.tabsbyid.keys()]; + const dup = []; + for (const id of idList) { + var tab = this.state.tabsbyid.get(id); + for (const id2 of idList) { if (id === id2) continue; - var tab2 = this.state.tabsbyid[id2]; + var tab2 = this.state.tabsbyid.get(id2); if (tab.url === tab2.url) { dup.push(id); break; @@ -816,19 +889,23 @@ class TabManager extends React.Component { } } for (const dupItem of dup) { - this.state.searchLen++; - hiddenCount -= this.state.hiddenTabs[dupItem] || 0; - this.state.selection[dupItem] = true; - delete this.state.hiddenTabs[dupItem]; - this.state.lastSelect = dupItem; + searchLen++; + hiddenCount -= this.state.hiddenTabs.has(dupItem) ? 1 : 0; + this.state.selection.add(dupItem); + this.state.hiddenTabs.delete(dupItem); + this.setState({ + lastSelect: dupItem + }); } - for (const tab_id in idList) { - // var tab = this.state.tabsbyid[tab_id]; + for (const tab_id of idList) { + // var tab = this.state.tabsbyid.get(tab_id); if (dup.indexOf(tab_id) === -1) { - hiddenCount += 1 - (this.state.hiddenTabs[tab_id] || 0); - this.state.hiddenTabs[tab_id] = true; - delete this.state.selection[tab_id]; - this.state.lastSelect = tab_id; + hiddenCount += 1 - (this.state.hiddenTabs.has(tab_id) ? 1 : 0); + this.state.hiddenTabs.add(tab_id); + this.state.selection.delete(tab_id); + this.setState({ + lastSelect: tab_id + }); } } if (dup.length === 0) { @@ -842,16 +919,23 @@ class TabManager extends React.Component { bottomText: "Press enter to move them to a new window" }); } - this.state.hiddenCount = hiddenCount; + this.setState({ + hiddenCount: hiddenCount + }); + this.setState({ + searchLen: searchLen, + dupTabs: dupTabs + }); + this.forceUpdate(); } search(e) { - var hiddenCount = this.state.hiddenCount || 0; - var searchQuery = e.target.value || ""; - var searchLen = searchQuery.length; + let hiddenCount = this.state.hiddenCount || 0; + const searchQuery = e.target.value || ""; + const searchLen = searchQuery.length; - var searchType = "normal"; - var searchTerms = []; + let searchType = "normal"; + let searchTerms = []; if(searchQuery.indexOf(" ") === -1) { searchType = "normal"; }else if(searchQuery.indexOf(" OR ") > -1) { @@ -866,29 +950,29 @@ class TabManager extends React.Component { } if (!searchLen) { - this.state.selection = {}; - this.state.hiddenTabs = {}; + this.state.selection.clear(); + this.state.hiddenTabs.clear(); hiddenCount = 0; } else { - var idList; - var lastSearchLen = this.state.searchLen; - idList = this.state.tabsbyid; + let idList : number[]; + const lastSearchLen = this.state.searchLen; + idList = [ ...this.state.tabsbyid.keys() ]; if(searchType === "normal") { if (!lastSearchLen) { - idList = this.state.tabsbyid; + idList = [ ...this.state.tabsbyid.keys() ]; } else if (lastSearchLen > searchLen) { - idList = this.state.hiddenTabs; + idList = [ ...this.state.hiddenTabs.keys() ]; } else if (lastSearchLen < searchLen) { - idList = this.state.selection; + idList = [ ...this.state.selection.keys() ]; } } - for (const id in idList) { - var tab = this.state.tabsbyid[id]; - var tabSearchTerm; + for (const id of idList) { + const tab = this.state.tabsbyid.get(id); + let tabSearchTerm; if (!!tab.title) tabSearchTerm = tab.title; if (!!tab.url) tabSearchTerm += " " + tab.url; tabSearchTerm = tabSearchTerm.toLowerCase(); - var match = false; + let match = false; if(searchType === "normal") { match = (tabSearchTerm.indexOf(e.target.value.toLowerCase()) >= 0); }else if(searchType === "OR") { @@ -900,7 +984,7 @@ class TabManager extends React.Component { } } }else if(searchType === "AND") { - var andMatch = true; + let andMatch = true; for (let searchAND of searchTerms) { searchAND = searchAND.trim().toLowerCase(); if(tabSearchTerm.indexOf(searchAND) >= 0) { @@ -913,21 +997,26 @@ class TabManager extends React.Component { match = andMatch; } if (match) { - hiddenCount -= this.state.hiddenTabs[id] || 0; - this.state.selection[id] = true; - delete this.state.hiddenTabs[id]; - this.state.lastSelect = id; + hiddenCount -= this.state.hiddenTabs.has(id) ? 1 : 0; + this.state.selection.add(id); + this.state.hiddenTabs.delete(id); } else { - hiddenCount += 1 - (this.state.hiddenTabs[id] || 0); - this.state.hiddenTabs[id] = true; - delete this.state.selection[id]; - this.state.lastSelect = id; + hiddenCount += 1 - (this.state.hiddenTabs.has(id) ? 1 : 0); + this.state.hiddenTabs.add(id); + this.state.selection.delete(id); } + this.setState({ + lastSelect: id + }); } } - this.state.hiddenCount = hiddenCount; - this.state.searchLen = searchLen; - var matches = Object.keys(this.state.selection).length; + + this.setState({ + hiddenCount: hiddenCount, + searchLen: searchLen + }) + + const matches = this.state.selection.size; // var matchtext = ""; if (matches === 0 && searchLen > 0) { this.setState({ @@ -941,21 +1030,21 @@ class TabManager extends React.Component { }); } else if (matches > 1) { this.setState({ - topText: Object.keys(this.state.selection).length + " matches for '" + searchQuery + "'", + topText: this.state.selection.size + " matches for '" + searchQuery + "'", bottomText: "Press enter to move them to a new window" }); } else if (matches === 1) { this.setState({ - topText: Object.keys(this.state.selection).length + " match for '" + searchQuery + "'", + topText: this.state.selection.size + " match for '" + searchQuery + "'", bottomText: "Press enter to switch to the tab" }); } this.forceUpdate(); } clearSelection() { - this.state.selection = {}; + this.state.selection.clear(); this.setState({ - lastSelect: false + lastSelect: 0 }); } checkKey(e) { @@ -963,14 +1052,18 @@ class TabManager extends React.Component { if (e.keyCode === 13) this.addWindow(); // escape key if (e.keyCode === 27) { - if(this.state.searchLen > 0 || Object.keys(this.state.selection).length > 0) { + if(this.state.searchLen > 0 || this.state.selection.size > 0) { // stop popup from closing if we have search text or selection active e.nativeEvent.preventDefault(); e.nativeEvent.stopPropagation(); } - this.state.hiddenTabs = {}; - this.state.searchLen = 0; - this.refs.searchbox.value = ""; + + this.state.hiddenTabs.clear(); + this.setState({ + searchLen: 0 + }); + + (this.refs.searchbox as HTMLInputElement).value = ""; this.clearSelection(); } // any typed keys @@ -984,8 +1077,11 @@ class TabManager extends React.Component { e.keyCode === 32 ) { if (document.activeElement !== this.refs.searchbox) { - if (document.activeElement.type !== "text" && document.activeElement.type !== "input") { - this.refs.searchbox.focus(); + var activeInputElement = document.activeElement as HTMLInputElement; + console.log(activeInputElement); + console.log(this.refs.searchbox); + if (activeInputElement.type !== "text" && activeInputElement.type !== "input") { + (this.refs.searchbox as HTMLElement)?.focus(); } } } @@ -998,10 +1094,12 @@ class TabManager extends React.Component { */ if (e.keyCode >= 37 && e.keyCode <= 40) { if (document.activeElement !== this.refs.windowcontainer && document.activeElement !== this.refs.searchbox) { - this.refs.windowcontainer.focus(); + console.log(activeInputElement); + console.log(this.refs.windowcontainer); + (this.refs.windowcontainer as HTMLElement)?.focus(); } - if (document.activeElement !== this.refs.searchbox || !this.refs.searchbox.value) { + if (document.activeElement !== this.refs.searchbox || !((this.refs.searchbox as HTMLInputElement).value)) { let goLeft = e.keyCode === 37; let goRight = e.keyCode === 39; let goUp = e.keyCode === 38; @@ -1018,45 +1116,49 @@ class TabManager extends React.Component { } const altKey = e.nativeEvent.metaKey || e.nativeEvent.altKey || e.nativeEvent.shiftKey || e.nativeEvent.ctrlKey; if (goLeft || goRight) { - let selectedTabs = Object.keys(this.state.selection); + let selectedTabs = [...this.state.selection.keys()]; if (!altKey && selectedTabs.length > 1) { } else { let found = false; let selectedNext = false; - let selectedTab = false; - let first = false; - let prev = false; - let last = false; + let selectedTab = 0; + let first = 0; + let prev = 0; + let last = 0; if (selectedTabs.length === 1) { selectedTab = selectedTabs[0]; // console.log("one tab", selectedTab); } else if (selectedTabs.length > 1) { - if (this.state.lastSelect) { + if (!!this.state.lastSelect) { selectedTab = this.state.lastSelect; // console.log("more tabs, last", selectedTab); } else { selectedTab = selectedTabs[0]; // console.log("more tabs, first", selectedTab); } - } else if (selectedTabs.length === 0 && this.state.lastSelect) { + } else if (selectedTabs.length === 0 && !!this.state.lastSelect) { selectedTab = this.state.lastSelect; // console.log("no tabs, last", selectedTab); } - if (this.state.lastDirection) { + if (!!this.state.lastDirection) { if (goRight && this.state.lastDirection === "goRight") { } else if (goLeft && this.state.lastDirection === "goLeft") { } else if (selectedTabs.length > 1) { // console.log("turned back, last", this.state.lastSelect, selectedTab); this.select(this.state.lastSelect); - this.state.lastDirection = false; + this.setState({ + lastDirection: "" + }); found = true; } else { - this.state.lastDirection = false; + this.setState({ + lastDirection: "" + }); } } if (!this.state.lastDirection) { - if (goRight) this.state.lastDirection = "goRight"; - if (goLeft) this.state.lastDirection = "goLeft"; + if (goRight) this.setState({ lastDirection: "goRight" }); + if (goLeft) this.setState({ lastDirection: "goLeft" }); } for (const _w of this.state.windows) { if (found) break; @@ -1065,7 +1167,7 @@ class TabManager extends React.Component { last = _t.id; if (!first) first = _t.id; if (!selectedTab) { - if (!altKey) this.state.selection = {}; + if (!altKey) this.state.selection.clear(); this.select(_t.id); found = true; break; @@ -1073,14 +1175,14 @@ class TabManager extends React.Component { // console.log("select next one", selectedNext); if (goRight) { selectedNext = true; - } else if (prev) { - if (!altKey) this.state.selection = {}; + } else if (!!prev) { + if (!altKey) this.state.selection.clear(); this.select(prev); found = true; break; } } else if (selectedNext) { - if (!altKey) this.state.selection = {}; + if (!altKey) this.state.selection.clear(); this.select(_t.id); found = true; break; @@ -1097,21 +1199,21 @@ class TabManager extends React.Component { last = _t.id; if (!first) first = _t.id; if (!selectedTab) { - if (!altKey) this.state.selection = {}; + if (!altKey) this.state.selection.clear(); this.select(_t.id); found = true; break; } else if (selectedTab === _t.id) { if (goRight) { selectedNext = true; - } else if (prev) { - if (!altKey) this.state.selection = {}; + } else if (!!prev) { + if (!altKey) this.state.selection.clear(); this.select(prev); found = true; break; } } else if (selectedNext) { - if (!altKey) this.state.selection = {}; + if (!altKey) this.state.selection.clear(); this.select(_t.id); found = true; break; @@ -1121,28 +1223,28 @@ class TabManager extends React.Component { } } } - if (!found && goRight && first) { - if (!altKey) this.state.selection = {}; + if (!found && goRight && !!first) { + if (!altKey) this.state.selection.clear(); this.select(first); found = true; } - if (!found && goLeft && last) { - if (!altKey) this.state.selection = {}; + if (!found && goLeft && !!last) { + if (!altKey) this.state.selection.clear(); this.select(last); found = true; } } } if (goUp || goDown) { - let selectedTabs = Object.keys(this.state.selection); + let selectedTabs = [...this.state.selection.keys()]; if (selectedTabs.length > 1) { } else { let found = false; let selectedNext = false; let selectedTab = -1; - let first = false; - let prev = false; - let last = false; + let first = 0; + let prev = 0; + let last = 0; let tabPosition = -1; let i = -1; if (selectedTabs.length === 1) { @@ -1168,7 +1270,7 @@ class TabManager extends React.Component { // console.log("select next window ", selectedNext, tabPosition); selectedNext = true; break; - } else if (prev) { + } else if (!!prev) { // console.log("select prev window ", prev, tabPosition); this.selectWindowTab(prev, tabPosition); found = true; @@ -1205,7 +1307,7 @@ class TabManager extends React.Component { // console.log("select next window ", selectedNext, tabPosition); selectedNext = true; break; - } else if (prev) { + } else if (!!prev) { // console.log("select prev window ", prev, tabPosition); this.selectWindowTab(prev, tabPosition); found = true; @@ -1223,16 +1325,16 @@ class TabManager extends React.Component { } } // console.log(found, goDown, first); - if (!found && goDown && first) { + if (!found && goDown && !!first) { // console.log("go first", first); - this.state.selection = {}; + this.state.selection.clear(); this.selectWindowTab(first, tabPosition); found = true; } // console.log(found, goUp, last); - if (!found && goUp && last) { + if (!found && goUp && !!last) { // console.log("go last", last); - this.state.selection = {}; + this.state.selection.clear(); this.selectWindowTab(last, tabPosition); found = true; } @@ -1242,8 +1344,8 @@ class TabManager extends React.Component { } // page up / page down if (e.keyCode === 33 || e.keyCode === 34) { - if (document.activeElement !== this.refs.windowcontainer) { - this.refs.windowcontainer.focus(); + if (document.activeElement != this.refs.windowcontainer) { + (this.refs.windowcontainer as HTMLElement).focus(); } } } @@ -1255,13 +1357,13 @@ class TabManager extends React.Component { for (let _t of _w.tabs) { i++; if ((_w.tabs.length >= tabPosition && tabPosition === i) || (_w.tabs.length < tabPosition && _w.tabs.length === i)) { - this.state.selection = {}; + this.state.selection.clear(); this.select(_t.id); } } } } - scrollTo(what, id) { + scrollTo(what : string, id : number) { var els = document.getElementById(what + "-" + id); if (!!els) { if (!this.elVisible(els)) { @@ -1274,17 +1376,8 @@ class TabManager extends React.Component { if (layout && typeof (layout) === "string") { newLayout = layout; } else { - if (this.state.layout === "blocks") { - newLayout = this.state.layout = "blocks-big"; - } else if (this.state.layout === "blocks-big") { - newLayout = this.state.layout = "horizontal"; - } else if (this.state.layout === "horizontal") { - newLayout = this.state.layout = "vertical"; - } else { - newLayout = this.state.layout = "blocks"; - } + newLayout = this.nextlayout(); } - this.state.layout = newLayout; await setLocalStorage("layout", newLayout); this.setState({ @@ -1296,46 +1389,49 @@ class TabManager extends React.Component { this.forceUpdate(); } nextlayout() { - if (this.state.layout === "blocks") { - return "blocks-big"; - } else if (this.state.layout === "blocks-big") { - return "horizontal"; - } else if (this.state.layout === "horizontal") { - return "vertical"; - } else { - return "blocks"; + switch (this.state.layout) { + case "blocks": + return "blocks-big"; + case "blocks-big": + return "horizontal"; + case "horizontal": + return "vertical"; + default: + return "blocks"; } } readablelayout(layout) { - if (layout === "blocks") { - return "Block"; - } else if (layout === "blocks-big") { - return "Big Block"; - } else if (layout === "horizontal") { - return "Horizontal"; - } else { - return "Vertical"; + switch (layout) { + case "blocks": + return "Block"; + case "blocks-big": + return "Big Block"; + case "horizontal": + return "Horizontal"; + default: + return "Vertical"; } } - select(id) { - if (this.state.selection[id]) { - delete this.state.selection[id]; + select(id : number) { + if (this.state.selection.has(id)) { + this.state.selection.delete(id); this.setState({ lastSelect: id }); } else { - this.state.selection[id] = true; + this.state.selection.add(id); this.setState({ lastSelect: id }); } this.scrollTo('tab', id); - var tab = this.state.tabsbyid[id]; - if(this.refs['window' + tab.windowId] && this.refs['window' + tab.windowId].refs['tab' + id]) { - this.refs['window' + tab.windowId].refs['tab' + id].resolveFavIconUrl(); + var tab = this.state.tabsbyid.get(id); + if(!!this.refs['window' + tab.windowId] && !!(this.refs['window' + tab.windowId] as Window).refs['tab' + id]) { + ((this.refs['window' + tab.windowId] as Window).refs['tab' + id] as Tab).resolveFavIconUrl(); } - var selected = Object.keys(this.state.selection).length; + console.log(this.state.selection); + var selected = this.state.selection.size; if (selected === 0) { this.setState({ topText: "No tabs selected", @@ -1353,27 +1449,27 @@ class TabManager extends React.Component { }); } } - selectTo(id, tabs) { - var activate = false; - var lastSelect = this.state.lastSelect; + selectTo(id : number, tabs : browser.Tabs.Tab[]) { + let activate = false; + const lastSelect = this.state.lastSelect; if (id === lastSelect) { this.select(id); return; } if (!!lastSelect) { - if (this.state.selection[lastSelect]) { + if (this.state.selection.has(lastSelect)) { activate = true; } } else { - if (this.state.selection[id]) { + if (this.state.selection.has(id)) { activate = false; } else { activate = true; } } - var rangeIndex1; - var rangeIndex2; + let rangeIndex1 : number; + let rangeIndex2 : number; for (let i = 0; i < tabs.length; i++) { if (tabs[i].id === id) { rangeIndex1 = i; @@ -1387,11 +1483,11 @@ class TabManager extends React.Component { return; } if (!rangeIndex2) { - var neighbours = []; + const neighbours = []; for (let i = 0; i < tabs.length; i++) { - var tabId = tabs[i].id; + const tabId = tabs[i].id; if (tabId !== id) { - if (this.state.selection[tabId]) { + if (this.state.selection.has(tabId)) { neighbours.push(tabId); } } @@ -1446,26 +1542,26 @@ class TabManager extends React.Component { lastSelect: tabs[rangeIndex2].id }); if (rangeIndex2 < rangeIndex1) { - var r1 = rangeIndex2; - var r2 = rangeIndex1; + let r1 = rangeIndex2; + let r2 = rangeIndex1; rangeIndex1 = r1; rangeIndex2 = r2; } for (let i = 0; i < tabs.length; i++) { if (i >= rangeIndex1 && i <= rangeIndex2) { - var _tab_id = tabs[i].id; + const _tab_id = tabs[i].id; if (activate) { - this.state.selection[_tab_id] = true; + this.state.selection.add(_tab_id); } else { - delete this.state.selection[_tab_id]; + this.state.selection.delete(_tab_id); } } } this.scrollTo('tab', this.state.lastSelect); - var selected = Object.keys(this.state.selection).length; + const selected = this.state.selection.size; if (selected === 0) { this.setState({ topText: "No tabs selected", @@ -1484,47 +1580,47 @@ class TabManager extends React.Component { } this.forceUpdate(); } - drag(e, id) { - if (!this.state.selection[id]) { - this.state.selection = {}; - this.state.selection[id] = true; - this.state.lastSelect = id; + drag(e : React.DragEvent, id : number) { + if (!this.state.selection.has(id)) { + this.state.selection.add(id); + this.setState({ + lastSelect: id + }); } this.forceUpdate(); } - async drop(id, before) { - var _this5 = this; - var tab = this.state.tabsbyid[id]; - var tabs = Object.keys(this.state.selection).map(function(id) { - return _this5.state.tabsbyid[id]; + async drop(id : number, before : boolean) { + var _this = this; + var tab : browser.Tabs.Tab = this.state.tabsbyid.get(id); + var tabs : browser.Tabs.Tab[] = [...this.state.selection.keys()].map(function(id) { + return _this.state.tabsbyid.get(id); }); var index = tab.index + (before ? 0 : 1); for (let i = 0; i < tabs.length; i++) { - var t = tabs[i]; + const t : browser.Tabs.Tab = tabs[i]; await browser.tabs.move(t.id, { windowId: tab.windowId, index: index }); await browser.tabs.update(t.id, { pinned: t.pinned }); } - this.setState({ - selection: {} - }); + this.state.selection.clear(); this.update(); } - async dropWindow(windowId) { - var _this6 = this; - var tabs = Object.keys(this.state.selection).map(function(id) { - return _this6.state.tabsbyid[id]; + async dropWindow(windowId : number) { + var _this = this; + var tabs : browser.Tabs.Tab[] = [...this.state.selection.keys()].map(function(id) { + return _this.state.tabsbyid.get(id); }); - browser.runtime.sendMessage({command: "move_tabs_to_window", window_id: windowId, tabs: tabs}); + browser.runtime.sendMessage({command: S.move_tabs_to_window, window_id: windowId, tabs: tabs}); + this.state.selection.clear(); + } + async changeTabLimit(e : React.ChangeEvent) { + var _tab_limit = parseInt(e.target.value); this.setState({ - selection: {} + tabLimit: _tab_limit }); - } - async changeTabLimit(e) { - this.state.tabLimit = e.target.value; - await setLocalStorage("tabLimit", this.state.tabLimit); + await setLocalStorage("tabLimit", _tab_limit); this.tabLimitText(); this.forceUpdate(); } @@ -1533,10 +1629,13 @@ class TabManager extends React.Component { bottomText: "Limit the number of tabs per window. Will move new tabs into a new window instead. 0 to turn off" }); } - async changeTabWidth(e) { - this.state.tabWidth = e.target.value; - await setLocalStorage("tabWidth", this.state.tabWidth); - document.body.style.width = this.state.tabWidth + "px"; + async changeTabWidth(e : React.ChangeEvent) { + var _tab_width = parseInt(e.target.value); + this.setState({ + tabWidth: _tab_width + }); + await setLocalStorage("tabWidth", _tab_width); + document.body.style.width = _tab_width + "px"; this.tabWidthText(); this.forceUpdate(); } @@ -1545,10 +1644,13 @@ class TabManager extends React.Component { bottomText: "Change the width of this window. 800 by default." }); } - async changeTabHeight(e) { - this.state.tabHeight = e.target.value; - await setLocalStorage("tabHeight", this.state.tabHeight); - document.body.style.height = this.state.tabHeight + "px"; + async changeTabHeight(e : React.ChangeEvent) { + var _tab_height = parseInt(e.target.value); + this.setState({ + tabHeight: _tab_height + }); + await setLocalStorage("tabHeight", _tab_height); + document.body.style.height = _tab_height + "px"; this.tabHeightText(); this.forceUpdate(); } @@ -1558,8 +1660,9 @@ class TabManager extends React.Component { }); } async toggleAnimations() { - this.state.animations = !this.state.animations; - await setLocalStorage("animations", this.state.animations); + var _animations = !this.state.animations; + this.setState({ animations: _animations }); + await setLocalStorage("animations", _animations); this.animationsText(); this.forceUpdate(); } @@ -1569,8 +1672,9 @@ class TabManager extends React.Component { }); } async toggleWindowTitles() { - this.state.windowTitles = !this.state.windowTitles; - await setLocalStorage("windowTitles", this.state.windowTitles); + var _window_titles = !this.state.windowTitles; + this.setState({windowTitles: _window_titles}); + await setLocalStorage("windowTitles", _window_titles); this.windowTitlesText(); this.forceUpdate(); } @@ -1580,8 +1684,9 @@ class TabManager extends React.Component { }); } async toggleCompact() { - this.state.compact = !this.state.compact; - await setLocalStorage("compact", this.state.compact); + var _compact = !this.state.compact; + this.setState({compact: _compact}); + await setLocalStorage("compact", _compact); this.compactText(); this.forceUpdate(); } @@ -1591,10 +1696,12 @@ class TabManager extends React.Component { }); } async toggleDark() { - this.state.dark = !this.state.dark; - await setLocalStorage("dark", this.state.dark); + var _dark = !this.state.dark; + this.setState({dark: _dark}); + await setLocalStorage("dark", _dark); + this.darkText(); - if (this.state.dark) { + if (_dark) { document.body.className = "dark"; document.documentElement.className = "dark"; } else { @@ -1609,8 +1716,9 @@ class TabManager extends React.Component { }); } async toggleTabActions() { - this.state.tabactions = !this.state.tabactions; - await setLocalStorage("tabactions", this.state.tabactions); + var _tabactions = !this.state.tabactions; + this.setState({tabactions: _tabactions}); + await setLocalStorage("tabactions", _tabactions); this.tabActionsText(); this.forceUpdate(); } @@ -1620,10 +1728,11 @@ class TabManager extends React.Component { }); } async toggleBadge() { - this.state.badge = !this.state.badge; - await setLocalStorage("badge", this.state.badge); + var _badge = !this.state.badge; + this.setState({badge: _badge}); + await setLocalStorage("badge", _badge); this.badgeText(); - browser.runtime.sendMessage({command: "update_tab_count"}); + browser.runtime.sendMessage({command: S.update_tab_count}); this.forceUpdate(); } badgeText() { @@ -1632,10 +1741,11 @@ class TabManager extends React.Component { }); } async toggleOpenInOwnTab() { - this.state.openInOwnTab = !this.state.openInOwnTab; - await setLocalStorage("openInOwnTab", this.state.openInOwnTab); + var _openInOwnTab = !this.state.openInOwnTab; + this.setState({openInOwnTab: _openInOwnTab}); + await setLocalStorage("openInOwnTab", _openInOwnTab); this.openInOwnTabText(); - browser.runtime.sendMessage({ command: "reload_popup_controls" }); + browser.runtime.sendMessage({ command: S.reload_popup_controls }); this.forceUpdate(); } openInOwnTabText() { @@ -1644,8 +1754,9 @@ class TabManager extends React.Component { }); } async toggleSessions() { - this.state.sessionsFeature = !this.state.sessionsFeature; - await setLocalStorage("sessionsFeature", this.state.sessionsFeature); + var _sessionsFeature = !this.state.sessionsFeature; + this.setState({sessionsFeature: _sessionsFeature}); + await setLocalStorage("sessionsFeature", _sessionsFeature); this.sessionsText(); this.forceUpdate(); } @@ -1684,7 +1795,7 @@ class TabManager extends React.Component { bottomText: "Allows you to export your saved windows to an external backup" }); } - importSessions(evt) { + importSessions(evt : React.ChangeEvent) { if (navigator.userAgent.search("Firefox") > -1) { if(window.inPopup) { window.alert("Due to a Firefox bug session import does not work in the popup. Please use the options screen or open Tab Manager Plus in its' own tab"); @@ -1706,7 +1817,7 @@ class TabManager extends React.Component { //console.log('FILE CONTENT', event.target.result); var backupFile; try { - backupFile = JSON.parse(event.target.result); + backupFile = JSON.parse(event.target.result.toString()); } catch (err) { console.error(err); window.alert(err); @@ -1751,18 +1862,22 @@ class TabManager extends React.Component { } async toggleHide() { + var _hide_windows = this.state.hideWindows; if (navigator.userAgent.search("Firefox") > -1) { - this.state.hideWindows = false; + _hide_windows = false; } else { - var granted = await browser.permissions.request({ permissions: ["system.display"] }); + var granted = await chrome.permissions.request({ permissions: ["system.display"] }); if (granted) { - this.state.hideWindows = !this.state.hideWindows; + _hide_windows = !_hide_windows; } else { - this.state.hideWindows = false; + _hide_windows = false; } } - await setLocalStorage("hideWindows", this.state.hideWindows); + await setLocalStorage("hideWindows", _hide_windows); + this.setState({ + hideWindows: _hide_windows + }); this.hideText(); this.forceUpdate(); } @@ -1772,8 +1887,11 @@ class TabManager extends React.Component { }); } async toggleFilterMismatchedTabs() { - this.state.filterTabs = !this.state.filterTabs; - await setLocalStorage("filter-tabs", this.state.filterTabs); + var _filter_tabs = !this.state.filterTabs; + this.setState({ + filterTabs: _filter_tabs + }); + await setLocalStorage("filter-tabs", _filter_tabs); this.forceUpdate(); } getTip() { @@ -1790,16 +1908,13 @@ class TabManager extends React.Component { return "Tip: " + tips[Math.floor(Math.random() * tips.length)]; } - isInViewport(element, ofElement) { - var rect = element.getBoundingClientRect(); - return rect.top >= 0 && rect.left >= 0 && rect.bottom <= ofElement.height && rect.right <= ofElement.width; - } - elVisible(elem) { + elVisible(elem : HTMLElement) { if (!(elem instanceof Element)) throw Error("DomUtil: elem is not an element."); var style = getComputedStyle(elem); if (style.display === "none") return false; if (style.visibility !== "visible") return false; - if (style.opacity < 0.1) return false; + let _opacity : number = parseFloat(style.opacity); + if (_opacity < 0.1) return false; if (elem.offsetWidth + elem.offsetHeight + elem.getBoundingClientRect().height + elem.getBoundingClientRect().width === 0) { return false; } @@ -1812,29 +1927,10 @@ class TabManager extends React.Component { if (elemCenter.x > (document.documentElement.clientWidth || window.innerWidth)) return false; if (elemCenter.y < 0) return false; if (elemCenter.y > (document.documentElement.clientHeight || window.innerHeight)) return false; - var pointContainer = document.elementFromPoint(elemCenter.x, elemCenter.y); + var pointContainer : ParentNode = document.elementFromPoint(elemCenter.x, elemCenter.y); do { if (pointContainer === elem) return true; - } while ((pointContainer = pointContainer.parentNode)); + } while ((pointContainer = pointContainer.parentNode)) return false; } -} - -function debounce(func, wait, immediate) { - var timeout; - return function() { - var context = this, - args = arguments; - var later = function later() { - timeout = null; - if (!immediate) func.apply(context, args); - }; - var callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) func.apply(context, args); - }; -} - -const maybePluralize = (count, noun, suffix = 's') => - `${count} ${noun}${count !== 1 ? suffix : ''}`; \ No newline at end of file +} \ No newline at end of file diff --git a/src/popup/views/TabOptions.tsx b/src/popup/views/TabOptions.tsx new file mode 100644 index 00000000..654e21df --- /dev/null +++ b/src/popup/views/TabOptions.tsx @@ -0,0 +1,422 @@ +"use strict"; + +import * as React from "react"; +import * as browser from 'webextension-polyfill'; +import { ITabOptions, ITabOptionsState } from "@types"; + +export class TabOptions extends React.Component { + constructor(props : ITabOptions) { + super(props); + this.state = {}; + } + logo() { + return ( +
+
+ Tab Manager Plus +

Tab Manager Plus {window.extensionVersion}

+
+
+ ); + } + + optionsSection() { + return ( +
+
+

Tab options

+
+ +
+
+
+

Popup size

+
+ You can resize the popup here up to a maximum size of 800x600. This limitation is a browser limitation, and we cannot display a bigger popup due to + this. If you want to have a better overview, instead you can right click on the Tab Manager Plus icon, and `open in own tab`. This will open the Tab + Manager in a new tab. +
+
+ + +
+
+ + +
+
+
+

Window style

+
+
+ +
+ +
+ Dark mode, for working at night time.
+ By default: disabled +
+
+
+
+ +
+ +
+ Saves a little bit of space around the icons. Makes it less beautiful, but more space efficient.
+ By default: disabled +
+
+
+
+ +
+ +
+ Disables/enables animations and transitions in the popup.
+ By default: enabled +
+
+
+
+ +
+ +
+ Disables/enables window titles.
+ By default: enabled +
+
+
+
+

Session Management

+
+
+ +
+ +
+ Allows you to save windows as sessions ( saved windows ). You can restore these saved windows later on. The restored windows won't have the history + restored. This feature is currently in beta. +
+ By default: disabled ( experimental feature ) +
+
+ {this.props.sessionsFeature &&
+
+ + +
+
Allows you to backup your saved windows to an external file.
+
} + {this.props.sessionsFeature &&
+
+ + +
+
+ Allows you to restore your backup from an external file. The restored windows will be added to your current saved windows. +
+
} +
+
+

Popup icon

+
+
+ +
+ +
+ Shows you the number of open tabs over the Tab Manager icon in the top right of your browser. +
+ By default: enabled +
+
+
+
+ +
+ +
+ Opens the Tab Manager in own tab by default, instead of the popup. +
+ By default: disabled +
+
+
+
+

Window settings

+
+
+ +
+ +
+ With this option enabled, you will only have 1 open window per monitor at all times. When you switch to another window, the other windows will be + minimized to the tray automatically. +
+ By default: disabled +
+
+
+
+ +
+ +
+ Displays buttons in every window for : opening a new tab, minimizing the window, assigning a color to the window and closing the window. +
+ By default: enabled +
+
+
+
+

Advanced settings

+
+ +
+ If you also want to see your incognito tabs in the Tab Manager overview, then enable incognito access for this extension. +
+
+
+ + Change shortcut key + +
If you want to disable or change the shortcut key with which to open Tab Manager Plus, you can do so here.
+
+
+
+
+

Right mouse button

+
With the right mouse button you can select tabs
+

Shift+Right mouse button

+
+ While holding shift, and pressing the right mouse button you can select all tabs between the last selected tab and the current one +
+

Middle mouse button

+
With the middle mouse button you can close a tab
+

[Enter / Return] button

+
+ With the return button you can switch to the currently selected tab, or move multiple selected tabs to a new window +
+
+
+
+ ); + } + async openIncognitoOptions() { + await browser.tabs.create({ + url: "chrome://extensions/?id=cnkdjjdmfiffagllbiiilooaoofcoeff" + }); + } + async openShortcuts() { + await browser.tabs.create({ url: "chrome://extensions/shortcuts" }); + } + licenses() { + return ( +
+
+ Tab Manager Plus is based on{" "} + + dsc/Tab-Manager + + ,{" "} + + joshperry/Tab-Manager + {" "} + and{" "} + + JonasNo/Tab-Manager + + .
+ Licensed by{" "} + + MPLv2 + + . Icons made by{" "} + + Freepik + {" "} + from{" "} + + www.flaticon.com + + . Licensed by{" "} + + CC 3.0 BY + + . +
+
+ ); + } + render() { + var children = []; + + children.push(this.logo()); + children.push(this.optionsSection()); + children.push(
); + //children.push(React.createElement('h4', {}, this.props.getTip())); + children.push(this.licenses()); + + return ( +
+
{children}
+
+ ); + } +} \ No newline at end of file diff --git a/lib/popup/views/TabOptionsFirefox.jsx b/src/popup/views/TabOptionsFirefox.jsx similarity index 99% rename from lib/popup/views/TabOptionsFirefox.jsx rename to src/popup/views/TabOptionsFirefox.jsx index 81dff048..e408a059 100644 --- a/lib/popup/views/TabOptionsFirefox.jsx +++ b/src/popup/views/TabOptionsFirefox.jsx @@ -1,6 +1,8 @@ "use strict"; -class TabOptions extends React.Component { +var browser = browser || chrome; + +export class TabOptions extends React.Component { constructor(props) { super(props); this.state = {}; diff --git a/lib/popup/views/Window.jsx b/src/popup/views/Window.tsx similarity index 67% rename from lib/popup/views/Window.jsx rename to src/popup/views/Window.tsx index 09ebbe78..433d3dd8 100644 --- a/lib/popup/views/Window.jsx +++ b/src/popup/views/Window.tsx @@ -1,7 +1,14 @@ "use strict"; -export class Window extends React.Component { - constructor(props) { +import {getLocalStorage, setLocalStorage, getLocalStorageMap} from "@helpers/storage"; +import {Tab} from "@views"; +import * as S from "@strings"; +import * as React from "react"; +import * as browser from 'webextension-polyfill'; +import {ICommand, IWindow, IWindowState, ISavedSession} from '@types'; + +export class Window extends React.Component { + constructor(props : IWindow) { super(props); this.state = { @@ -9,8 +16,10 @@ export class Window extends React.Component { windowTitles: [], color: "default", name: "", + auto_name: "", tabs: 0, - hover: false + hover: false, + dirty: false }; this.addTab = this.addTab.bind(this); @@ -36,43 +45,157 @@ export class Window extends React.Component { async componentDidMount() { await this.checkSettings(); + await this.update(); } + async componentDidUpdate(prevProps, prevState) { + if (this.state.dirty) { + await this.update(); + this.setState({ dirty: false }); + } + } + + async checkSettings() { - var colors = await getLocalStorage("windowColors", {}); - var color = colors[this.props.window.id] || "default"; + let colors = await getLocalStorageMap(S.windowColors); + let color = colors.get(this.props.window.id) || "default"; + + this.setState({ + color: color + }); + } - var name; - if (!!this.props.window.titlePreface) { - name = this.props.window.titlePreface; + async update() { + let name : string; + if (!!this.props.window.title) { + name = this.props.window.title; } else { - var names = await getLocalStorage("windowNames", {}); - if (typeof names !== 'object') { - await setLocalStorage("windowNames", {}); - names = {}; + let names : Map = await getLocalStorageMap(S.windowNames); + name = names.get(this.props.window.id) || ""; + } + + if (!!name) { + if (name !== this.state.name) { + this.setState({ + name: name + }); } - name = names[this.props.window.id] || ""; + return; } - this.setState({ - color: color, - name: name - }); + let _window_titles = this.state.windowTitles; + let _tabs = this.state.tabs; + let tabs = await browser.tabs.query({ windowId: this.props.window.id }); + if (tabs.length == 0) return; + + if (_window_titles.length === 0 || this.state.tabs !== tabs.length + this.props.window.id * 99) { + _window_titles.length = 0; + _tabs = tabs.length + this.props.window.id * 99; + + for (let i = 0; i < tabs.length; i++) { + const _tab = tabs[i]; + if (!!_tab && (!!_tab.url || !!_tab.pendingUrl)) { + let url : URL; + if (!!_tab.pendingUrl) { + url = new URL(_tab.pendingUrl); + } else if (!!_tab.url) { + url = new URL(_tab.url); + } + + // force refresh once we've loaded tabs + if (_tab.status == "loading") _tabs--; + + let protocol = url.protocol || ""; + let hostname = url.hostname || ""; + if (protocol.indexOf("view-source") > -1 && !!url.pathname) { + url = new URL(url.pathname); + hostname = url.hostname || "source"; + } else if (protocol.indexOf("chrome-extension") > -1) { + hostname = _tab.title || "extension"; + } else if (protocol.indexOf("about") > -1) { + hostname = _tab.title || "about"; + } else if (hostname.indexOf("mail.google") > -1) { + hostname = "gmail"; + } else { + if (!hostname) hostname = ""; + hostname = hostname.replace("www.", ""); + if (!isIpAddress(hostname)) { + let regex_var = new RegExp(/(\.[^\.]{0,2})(\.[^\.]{0,2})(\.*$)|(\.[^\.]*)(\.*$)/); + hostname = hostname + .replace(regex_var, "") + .split(".") + .pop(); + } else { + if (!!_tab.title) { + hostname = _tab.title; + } else { + let ip = hostname.split("."); + hostname = ip[0] + "." + ip[1] + ".*.*"; + } + } + } + + if (!hostname || hostname.length > 7) { + let title = _tab.title || ""; + + const separators = /\s[—|•-]\s/; // Define separators here + + do { + let titles = title.split(separators); + let first = titles[0]; + let last = titles[titles.length - 1]; + if (slugify(first) == slugify(hostname) || slugify_no_space(first) == slugify_no_space(hostname) || slugify_no_space(first).startsWith(slugify_no_space(hostname).substring(0, 3)) || slugify_no_space(hostname).startsWith(slugify_no_space(first).substring(0, 3))) { + title = first; + } else if (slugify(last) == slugify(hostname) || slugify_no_space(last) == slugify_no_space(hostname) || slugify_no_space(last).startsWith(slugify_no_space(hostname).substring(0, 3)) || slugify_no_space(hostname).startsWith(slugify_no_space(last).substring(0, 3))) { + title = last; + } else { + titles.sort((a : string, b : string) => a.length - b.length); + titles.pop(); + title = titles.join("-"); + } + } while (title.length > hostname.length && separators.test(title)) + + if (!hostname || (!!title && title.length < 23)) { + hostname = title; + } + + // while (hostname.length > 21 && hostname.indexOf(" ") > -1) { + // let hostnames = hostname.split(" "); + // hostnames.pop(); + // hostname = hostnames.join(" "); + // } + + } + + _window_titles.push(hostname); + } + } + + this.setState({ + tabs: _tabs + }) + } + + if (_window_titles.length > 0) { + name = this.topEntries(this.state.windowTitles).join(""); + this.setState({ + auto_name: name + }); + } } render() { - var _this = this; - - var color = this.state.color || "default"; - var name = this.state.name; - - var hideWindow = true; - var titleAdded = false; - var tabsperrow = this.props.layout.indexOf("blocks") > -1 ? Math.ceil(Math.sqrt(this.props.tabs.length + 2)) : this.props.layout === "vertical" ? 1 : 15; - var tabs = this.props.tabs.map(function(tab) { - var isHidden = !!_this.props.hiddenTabs[tab.id] && _this.props.filterTabs; - var isSelected = !!_this.props.selection[tab.id]; - hideWindow &= isHidden; + let _this = this; + + let color = this.state.color || "default"; + + let hideWindow = true; + let titleAdded = false; + let tabsperrow = this.props.layout.indexOf("blocks") > -1 ? Math.ceil(Math.sqrt(this.props.tabs.length + 2)) : this.props.layout === "vertical" ? 1 : 15; + let tabs = this.props.tabs.map(function(tab) { + let isHidden : boolean = _this.props.hiddenTabs.has(tab.id) && _this.props.filterTabs; + let isSelected : boolean = _this.props.selection.has(tab.id); + if (!isHidden) hideWindow = false; return ( @@ -331,112 +454,41 @@ export class Window extends React.Component { } if (this.props.windowTitles) { - if (!!name) { - tabs.unshift( -

- {name} -

- ); - titleAdded = true; - } else { - if (this.state.windowTitles.length === 0 || this.state.tabs !== tabs.length + this.props.window.id * 99) { - this.state.windowTitles = []; - this.state.tabs = tabs.length + this.props.window.id * 99; - for (var i = 0; i < tabs.length; i++) { - - if (!!tabs[i].props && !!tabs[i].props.tab && !!tabs[i].props.tab.url) { - var url = new URL(tabs[i].props.tab.url); - var protocol = url.protocol || ""; - var hostname = url.hostname || ""; - if (protocol.indexOf("view-source") > -1 && !!url.pathname) { - url = new URL(url.pathname); - hostname = url.hostname || "source"; - } else if (protocol.indexOf("chrome-extension") > -1) { - hostname = tabs[i].props.tab.title || "extension"; - } else if (protocol.indexOf("about") > -1) { - hostname = tabs[i].props.tab.title || "about"; - } else if (hostname.indexOf("mail.google") > -1) { - hostname = "gmail"; - } else { - if (!hostname) hostname = ""; - hostname = hostname.replace("www.", ""); - var regex_var = new RegExp(/(\.[^\.]{0,2})(\.[^\.]{0,2})(\.*$)|(\.[^\.]*)(\.*$)/); - hostname = hostname - .replace(regex_var, "") - .split(".") - .pop(); - } - - if (!!hostname && hostname.length > 18) { - hostname = tabs[i].props.tab.title || ""; - - while (hostname.length > 18 && hostname.indexOf("—") > -1) { - hostname = hostname.split("—"); - hostname.pop(); - hostname = hostname.join("—"); - } - - while (hostname.length > 18 && hostname.indexOf("-") > -1) { - hostname = hostname.split("-"); - hostname.pop(); - hostname = hostname.join("-"); - } - - while (hostname.length > 18 && hostname.indexOf(" ") > -1) { - hostname = hostname.split(" "); - hostname.pop(); - hostname = hostname.join(" "); - } - - } - this.state.windowTitles.push(hostname); - } - } - } - - if (this.state.windowTitles.length > 0) { - tabs.unshift( -

- {this.topEntries(this.state.windowTitles).join("")} -

- ); - titleAdded = true; - } - } + titleAdded = true; + tabs.unshift( +

+ {this.props.window.incognito ? "🕵" : ""} + {!!this.state.name ? this.state.name : this.state.auto_name} +

+ ); } if (tabsperrow < 5) { tabsperrow = 5; } - var children = []; + let children = []; if (!!titleAdded) { children.push(tabs.shift()); } - var z = -1; - for (var j = 0; j < tabs.length; j++) { - var tab = tabs[j].props.tab; - var isHidden = !!tab && !!tab.id && !!this.props.hiddenTabs[tab.id] && this.props.filterTabs; - if(!isHidden) { - z++; - children.push(tabs[j]); - } + let z = -1; + for (let j = 0; j < tabs.length; j++) { + let tab = tabs[j].props.tab; + let isHidden = !!tab && !!tab.id && this.props.hiddenTabs.has(tab.id) && this.props.filterTabs; + if(isHidden) continue; + z++; + children.push(tabs[j]); + if ((z + 1) % tabsperrow === 0 && z && this.props.layout.indexOf("blocks") > -1) { children.push(
); } } - var focused = false; + let focused = false; if (this.props.window.focused || this.props.lastOpenWindow === this.props.window.id) { focused = true; } @@ -486,27 +538,27 @@ export class Window extends React.Component { browser.tabs.create({ windowId: this.props.window.id }); } dragOver(e) { - this.state.hover = true; + this.setState({hover: true}); this.stopProp(e); } dragLeave(e) { - this.state.hover = false; + this.setState({hover: false}); e.nativeEvent.preventDefault(); } drop(e) { - var distance = 1000000; - var closestTab = null; - var closestRef = null; - - for (var i = 0; i < this.props.tabs.length; i++) { - var tab = this.props.tabs[i]; - var tabRef = this.refs["tab" + tab.id].tabRef.current; - var tabRect = tabRef.getBoundingClientRect(); - var x = e.nativeEvent.clientX; - var y = e.nativeEvent.clientY; - var dx = tabRect.x - x; - var dy = tabRect.y - y; - var d = Math.sqrt(dx * dx + dy * dy); + let distance = 1000000; + let closestTab = null; + let closestRef = null; + + for (let i = 0; i < this.props.tabs.length; i++) { + let tab = this.props.tabs[i]; + let tabRef = (this.refs["tab" + tab.id] as Tab).state.tabRef.current; + let tabRect = tabRef.getBoundingClientRect(); + let x = e.nativeEvent.clientX; + let y = e.nativeEvent.clientY; + let dx = tabRect.x - x; + let dy = tabRect.y - y; + let d = Math.sqrt(dx * dx + dy * dy); if (d < distance) { distance = d; closestTab = tab.id; @@ -517,8 +569,8 @@ export class Window extends React.Component { this.stopProp(e); if (closestTab != null) { - var before; - var boundingRect = closestRef.getBoundingClientRect(); + let before : boolean; + let boundingRect = closestRef.getBoundingClientRect(); if (this.props.layout === "vertical") { before = e.nativeEvent.clientY < boundingRect.top; } else { @@ -530,37 +582,37 @@ export class Window extends React.Component { } } hoverWindow(tabs, _) { - this.state.hover = true; + this.setState({ hover: true }); this.props.hoverIcon("Focus this window\nWill select this window with " + tabs.length + " tabs"); // this.props.hoverIcon(e); } hoverWindowOut(_) { - this.state.hover = false; + this.setState({ hover: false }); } - checkKey(e) { + async checkKey(e) { // close popup when enter or escape have been pressed if (e.keyCode === 13 || e.keyCode === 27) { this.stopProp(e); - this.closePopup(); + await this.closePopup(); } } async windowClick(e) { this.stopProp(e); - var windowId = this.props.window.id; + let windowId = this.props.window.id; if (navigator.userAgent.search("Firefox") > -1) { - browser.runtime.sendMessage({command: "focus_on_window_delayed", window_id: windowId}); + browser.runtime.sendMessage({command: S.focus_on_window_delayed, window_id: windowId}); } else { - browser.runtime.sendMessage({command: "focus_on_window", window_id: windowId}); + browser.runtime.sendMessage({command: S.focus_on_window, window_id: windowId}); } this.props.parentUpdate(); if (!!window.inPopup) window.close(); return false; } - selectToFromTab(tabId) { - if(tabId) this.props.selectTo(tabId, this.props.tabs); + selectToFromTab(tabId : number) { + if (!!tabId) this.props.selectTo(tabId, this.props.tabs); } async close(e) { this.stopProp(e); @@ -568,7 +620,7 @@ export class Window extends React.Component { } uuidv4() { return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) { - var r = (Math.random() * 16) | 0, + let r = (Math.random() * 16) | 0, v = c === "x" ? r : (r & 0x3) | 0x8; return v.toString(16); }); @@ -577,35 +629,35 @@ export class Window extends React.Component { this.stopProp(e); console.log("session name", this.state.name); - var sessionName = this.state.name || this.topEntries(this.state.windowTitles).join(""); - var sessionColor = this.state.color || "default"; + let sessionName = this.state.name || this.topEntries(this.state.windowTitles).join(""); + let sessionColor = this.state.color || "default"; console.log("session name", sessionName); - var session = { + let session : ISavedSession = { tabs: [], - windowsInfo: {}, + windowsInfo: null, name: sessionName, + customName: !!this.state.name, color: sessionColor, date: Date.now(), sessionStartTime: Date.now(), + incognito: this.props.window.incognito, id: this.uuidv4() }; - if (this.state.name) { - session.customName = true; - } - - var queryInfo = {}; + let queryInfo : browser.Tabs.QueryQueryInfoType = { + windowId: this.props.window.id + }; //queryInfo.currentWindow = true; - queryInfo.windowId = this.props.window.id; + console.log(queryInfo); - var tabs = await browser.tabs.query(queryInfo); + let tabs : browser.Tabs.Tab[] = await browser.tabs.query(queryInfo); console.log(tabs); - for (var tabkey in tabs) { + for (let tabkey in tabs) { if (navigator.userAgent.search("Firefox") > -1) { - var newTab = tabs[tabkey]; + let newTab = tabs[tabkey]; if (!!newTab.url && newTab.url.search("about:") > -1) { continue; } @@ -617,10 +669,10 @@ export class Window extends React.Component { console.log(session); - var sessions = await getLocalStorage('sessions', {}); + let sessions = await getLocalStorage('sessions', {}); sessions[session.id] = session; - var value = await setLocalStorage('sessions', sessions).catch(function(err) { + let value = await setLocalStorage('sessions', sessions).catch(function(err) { console.log(err); console.error(err.message); }); @@ -661,39 +713,36 @@ export class Window extends React.Component { this.setState(a); this.props.toggleColors(!this.state.colorActive, this.props.window.id); - var color = a.color || "default"; + let color = a.color || "default"; - browser.runtime.sendMessage({ - command: "set_window_color", + browser.runtime.sendMessage({ + command: S.set_window_color, window_id: this.props.window.id, color: color }); - this.state.color = color; - this.setState({ - color: color - }); - this.closePopup(); + this.setState({ color: color }); + await this.closePopup(); } - closePopup() { + async closePopup() { this.props.toggleColors(!this.state.colorActive, this.props.window.id); this.setState({ colorActive: !this.state.colorActive }); + await this.update(); this.props.parentUpdate(); } async changeName(e) { // this.setState(a); - var name = ""; + let name = ""; if(e && e.target && e.target.value) name = e.target.value; - browser.runtime.sendMessage({ - command: "set_window_name", + browser.runtime.sendMessage({ + command: S.set_window_name, window_id: this.props.window.id, name: name }); - this.state.name = name; this.setState({ name: name }); @@ -709,16 +758,16 @@ export class Window extends React.Component { } } } - topEntries(arr) { - var cnts = arr.reduce(function(obj, val) { + topEntries(arr : string[]) : string[] { + let cnts = arr.reduce(function(obj, val) { obj[val] = (obj[val] || 0) + 1; return obj; }, {}); - var sorted = Object.keys(cnts).sort(function(a, b) { + let sorted = Object.keys(cnts).sort(function(a, b) { return cnts[b] - cnts[a]; }); - var more = 0; + let more = 0; if (sorted.length === 3) { } else { while (sorted.length > 2) { @@ -726,7 +775,7 @@ export class Window extends React.Component { more++; } } - for (var i = 0; i < sorted.length; i++) { + for (let i = 0; i < sorted.length; i++) { if (i > 0) { sorted[i] = ", " + sorted[i]; } @@ -747,3 +796,36 @@ export class Window extends React.Component { } } } + +function slugify(text) { + return text + .toString() + .toLowerCase() + .replace(/\s+/g, "-") // Replace spaces with - + .replace(/[^\w-]+/g, "") // Remove all non-word chars + .replace(/--+/g, "-") // Replace multiple - with single - + .replace(/^-+/, "") // Trim - from start of text + .replace(/-+$/, ""); // Trim - from end of text +} + +function slugify_no_space(text) { + return text + .toString() + .toLowerCase() + .replace(/\s+/g, "") // Replace spaces with - + .replace(/[^\w-]+/g, "") // Remove all non-word chars + .replace(/--+/g, "-") // Replace multiple - with single - + .replace(/^-+/, "") // Trim - from start of text + .replace(/-+$/, ""); // Trim - from end of text +} + +// Function to check if the string is an IP address (IPv4 or IPv6) +function isIpAddress(input) { + // Regex for IPv4: 0-255.0-255.0-255.0-255 + const ipv4Regex = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/; + + // Regex for IPv6: Matches standard IPv6 formatting (8 groups of 4 hex digits) + const ipv6Regex = /^([a-fA-F0-9]{1,4}:){7}[a-fA-F0-9]{1,4}$/; + + return ipv4Regex.test(input) || ipv6Regex.test(input); +} \ No newline at end of file diff --git a/src/popup/views/index.ts b/src/popup/views/index.ts new file mode 100644 index 00000000..9f5ec9e5 --- /dev/null +++ b/src/popup/views/index.ts @@ -0,0 +1,5 @@ +export * from './Session' +export * from './Tab' +export * from './TabManager' +export * from './TabOptions' +export * from './Window' \ No newline at end of file diff --git a/src/service_worker/background/actions.ts b/src/service_worker/background/actions.ts new file mode 100644 index 00000000..9a11f425 --- /dev/null +++ b/src/service_worker/background/actions.ts @@ -0,0 +1,131 @@ +"use strict"; + +import { globalTabsActive } from '@context' +import * as S from "@strings"; +import { focusOnWindow, focusOnWindowDelayed, createWindowWithTabs, createWindowWithSessionTabs, hashcode } from '@background/windows'; +import { getLocalStorageMap, setLocalStorageMap } from "@helpers/storage"; +import { setupPopup } from "@ui/open"; +import { updateTabCount, discardTabs, moveTabsToWindow, closeTabs, focusOnTabAndWindow, focusOnTabAndWindowDelayed } from "@background/tabs"; +import * as browser from 'webextension-polyfill'; +import { ICommand } from '@types'; + +export async function handleMessages(message, sender, sendResponse) { + const request = message as ICommand; + + switch (request.command) { + case S.reload_popup_controls: + setupPopup(); + break; + case S.update_tab_count: + updateTabCount(); + break; + case S.discard_tabs: + discardTabs(request.tabs); + break; + case S.move_tabs_to_window: + moveTabsToWindow(request.window_id, request.tabs); + break; + case S.focus_on_tab_and_window: + if (!!request.tab) { + focusOnTabAndWindow(request.tab.id, request.tab.windowId); + } else { + focusOnTabAndWindow(request.saved_tab.tabId, request.saved_tab.windowId); + } + break; + case S.focus_on_tab_and_window_delayed: + if (!!request.tab) { + focusOnTabAndWindowDelayed(request.tab.id, request.tab.windowId); + } else { + focusOnTabAndWindowDelayed(request.saved_tab.tabId, request.saved_tab.windowId); + } + break; + case S.focus_on_window: + focusOnWindow(request.window_id); + break; + case S.focus_on_window_delayed: + focusOnWindowDelayed(request.window_id); + break; + case S.set_window_color: + setWindowColor(request.window_id, request.color); + break; + case S.set_window_name: + setWindowName(request.window_id, request.name); + break; + case S.create_window_with_tabs: + createWindowWithTabs(request.tabs, request.incognito); + break; + case S.create_window_with_session_tabs: + createWindowWithSessionTabs(request.session, request.tab_id); + break; + case S.close_tabs: + closeTabs(request.tabs); + break; + } +} + +export function handleCommands(command : string) { + if (command === S.switch_to_previous_active_tab) { + if (!!globalTabsActive && globalTabsActive.length > 1) { + var _tab = globalTabsActive[globalTabsActive.length - 2]; + focusOnTabAndWindow(_tab.tabId, _tab.windowId); + } + } +} + +export function trackLastTab(tab : browser.Tabs.OnActivatedActiveInfoType) { + if (!!tab && !!tab.tabId) { + if (!!globalTabsActive && globalTabsActive.length > 0) { + var lastActive = globalTabsActive[globalTabsActive.length - 1]; + if (!!lastActive && lastActive.tabId === tab.tabId && lastActive.windowId === tab.windowId) { + return; + } + } + while (globalTabsActive.length > 20) { + globalTabsActive.shift(); + } + for (let i = globalTabsActive.length - 1; i >= 0; i--) { + if (globalTabsActive[i].tabId === tab.tabId) { + globalTabsActive.splice(i, 1); + } + } + globalTabsActive.push(tab); + } +} + +export async function setWindowColor(windowId : number, color : string) { + var colors : Map = await getLocalStorageMap(S.windowColors); + if (!!color) { + colors.set(windowId, color); + } else { + colors.delete(windowId); + } + await setLocalStorageMap(S.windowColors, colors); + await updateWindowHash(windowId); + browser.runtime.sendMessage({ + command: S.refresh_windows, + window_ids: [windowId] + }); +} + +export async function setWindowName(windowId: number, name : string) { + var names : Map = await getLocalStorageMap(S.windowNames); + if (!!name) { + names.set(windowId, name); + } else { + names.delete(windowId); + } + await setLocalStorageMap(S.windowNames, names); + await updateWindowHash(windowId); + browser.runtime.sendMessage({ + command: S.refresh_windows, + window_ids: [windowId] + }); +} + +async function updateWindowHash(windowId : number) { + const window = await browser.windows.get(windowId, {populate: true}); + const hash = hashcode(window); + const hashes : Map = await getLocalStorageMap(S.windowHashes); + hashes.set(windowId, hash); + await setLocalStorageMap(S.windowHashes, hashes); +} \ No newline at end of file diff --git a/lib/service_worker/background/tabs.js b/src/service_worker/background/tabs.ts similarity index 74% rename from lib/service_worker/background/tabs.js rename to src/service_worker/background/tabs.ts index d2e1165d..81ada837 100644 --- a/lib/service_worker/background/tabs.js +++ b/src/service_worker/background/tabs.ts @@ -1,6 +1,13 @@ -var browser = browser || chrome; +"use strict"; -async function setupTabListeners() { +import {getLocalStorage} from "@helpers/storage"; +import {trackLastTab} from "@background/actions" +import {globalTabsActive} from '@context'; +import {debounce} from "@helpers/utils"; +import {checkWindow, createWindowWithTabs} from '@background/windows'; +import * as browser from 'webextension-polyfill'; + +export async function setupTabListeners() { browser.tabs.onCreated.removeListener(tabAdded); browser.tabs.onUpdated.removeListener(tabCountChanged); browser.tabs.onRemoved.removeListener(tabCountChanged); @@ -47,7 +54,7 @@ export async function discardTabs(tabs) { export async function closeTabs(tabs) { for (const tab of tabs) { - await browser.tabs.remove(item.id); + await browser.tabs.remove(tab.id); } } @@ -58,45 +65,36 @@ export async function moveTabsToWindow(windowId, tabs) { } } -export function focusOnTabAndWindowDelayed(tab) { - var _tab = JSON.parse(JSON.stringify(tab)); - setTimeout(focusOnTabAndWindow.bind(this, _tab), 125); +export function focusOnTabAndWindowDelayed(tabId: number, windowId: number) { + setTimeout(focusOnTabAndWindow.bind(this, tabId, windowId), 125); } -export async function focusOnTabAndWindow(tab) { - var windowId = tab.windowId; - var tabId; - if (!!tab.tabId) { - tabId = tab.tabId; - } else { - tabId = tab.id; - } - +export async function focusOnTabAndWindow(tabId : number, windowId : number) { await browser.windows.update(windowId, {focused: true}); await browser.tabs.update(tabId, {active: true}); await tabActiveChanged({tabId: tabId, windowId: windowId}); } export async function updateTabCount() { - var run = true; + let run = true; - var badge = await getLocalStorage("badge", true); + const badge = await getLocalStorage("badge", true); if (!badge) run = false; if (run) { - var result = await browser.tabs.query({}); - var count = 0; + let result = await browser.tabs.query({}); + let count = 0; if (!!result && !!result.length) { count = result.length; } await browser.action.setBadgeText({text: count + ""}); await browser.action.setBadgeBackgroundColor({color: "purple"}); - var _to_remove = []; + const _to_remove : number[] = []; if (!!globalTabsActive) { for (let i = 0; i < globalTabsActive.length; i++) { - var t = globalTabsActive[i]; - var found = false; + const t = globalTabsActive[i]; + let found = false; if (!!result && !!result.length) { for (let j = 0; j < result.length; j++) { if (result[j].id === t.tabId) found = true; @@ -108,7 +106,6 @@ export async function updateTabCount() { while (_to_remove.length > 0) { let index = _to_remove.pop(); - // console.log("removing", toRemove[i]); if (!!globalTabsActive && globalTabsActive.length > 0) { if (!!globalTabsActive[index]) globalTabsActive.splice(index, 1); } @@ -123,11 +120,13 @@ function tabCountChanged() { updateTabCountDebounce(); } +export const updateTabCountDebounce = debounce(updateTabCount, 250); + async function tabAdded(tab) { - var tabLimit = await getLocalStorage("tabLimit", 0); + const tabLimit = await getLocalStorage("tabLimit", 0); if (tabLimit > 0) { if (tab.id !== browser.tabs.TAB_ID_NONE) { - var tabCount = await browser.tabs.query({currentWindow: true}); + const tabCount = await browser.tabs.query({currentWindow: true}); if (tabCount.length > tabLimit) { await createWindowWithTabs([tab], tab.incognito); } @@ -136,25 +135,8 @@ async function tabAdded(tab) { updateTabCountDebounce(); } -function tabActiveChanged(tab) { - if (!!tab && !!tab.tabId) { - if (!globalTabsActive) globalTabsActive = []; - if (!!globalTabsActive && globalTabsActive.length > 0) { - var lastActive = globalTabsActive[globalTabsActive.length - 1]; - if (!!lastActive && lastActive.tabId == tab.tabId && lastActive.windowId == tab.windowId) { - return; - } - } - while (globalTabsActive.length > 20) { - globalTabsActive.shift(); - } - for (var i = globalTabsActive.length - 1; i >= 0; i--) { - if (globalTabsActive[i].tabId == tab.tabId) { - globalTabsActive.splice(i, 1); - } - } - globalTabsActive.push(tab); - } +function tabActiveChanged(tab : browser.Tabs.OnActivatedActiveInfoType) { + trackLastTab(tab); updateTabCountDebounce(); } diff --git a/src/service_worker/background/tracking.ts b/src/service_worker/background/tracking.ts new file mode 100644 index 00000000..1b485e97 --- /dev/null +++ b/src/service_worker/background/tracking.ts @@ -0,0 +1,112 @@ +"use strict"; + +import {hashcode} from "@background/windows" +import {debounce} from "@helpers/utils"; +import {getLocalStorageMap, setLocalStorageMap, getLocalStorage, setLocalStorage} from "@helpers/storage"; +import * as S from "@strings"; +import * as browser from 'webextension-polyfill'; +import {ICommand} from "@types"; + +export const cleanupDebounce = debounce(cleanUp, 500); + +export async function cleanUp(remove_old = false) { + let activewindows = await browser.windows.getAll({populate: true}); + let windowids: number[] = []; + for (let _w of activewindows) { + windowids.push(_w.id); + } + // console.log("window ids...", windowids); + + let windows = await getLocalStorage("windowAge", []); + if (!(windows instanceof Array)) windows = []; + + // console.log("before", JSON.parse(JSON.stringify(windows))); + for (let i = windows.length - 1; i >= 0; i--) { + if (windowids.indexOf(windows[i]) < 0) { + // console.log("did not find", windows[i], i); + windows.splice(i, 1); + } + } + + // console.log("after", JSON.parse(JSON.stringify(windows))); + await setLocalStorage("windowAge", windows); + + let names : Map = await getLocalStorageMap(S.windowNames); + let colors : Map = await getLocalStorageMap(S.windowColors); + let to_check = new Set(); + let exists = new Set(); + let to_refresh : number[] = []; + + // console.log("before", JSON.parse(JSON.stringify(names))); + for (const [id, _name] of names) { + if (windowids.indexOf(id) < 0) { + // console.log("did not find", id); + to_check.add(id); + } else { + exists.add(id); + } + } + + for (const [id, _color] of colors) { + if (windowids.indexOf(id) < 0) { + // console.log("did not find", id); + to_check.add(id); + } else { + exists.add(id); + } + } + + if (to_check.size > 0) { + let hashes : Map = await getLocalStorageMap(S.windowHashes); + let found = false; + + for (let w of activewindows) { + const windowhash = hashcode(w); + for (const [id, _hash] of hashes) { + if (!to_check.has(id)) continue; + if (exists.has(id)) continue; + if (w.id === id) break; + if (_hash === windowhash) { + console.log("found by hash, old id " + id + " new id " + w.id); + to_refresh.push(w.id); + if (!!names.get(id)) { + names.set(w.id, names.get(id)); + names.delete(id); + } + if (!!colors.get(id)) { + colors.set(w.id, colors.get(id)); + colors.delete(id); + } + hashes.set(w.id, _hash); + hashes.delete(id); + found = true; + to_check.delete(id); + break; + } + } + } + + let save = false; + if (remove_old) { + for (const _id of to_check) { + console.log("should delete from to check " + _id); + colors.delete(_id); + names.delete(_id); + hashes.delete(_id); + save = true; + } + } + + if (found || save) { + await setLocalStorageMap(S.windowNames, names); + await setLocalStorageMap(S.windowColors, colors); + await setLocalStorageMap(S.windowHashes, hashes); + if (found) { + browser.runtime.sendMessage({ + command: S.refresh_windows, + window_ids: to_refresh + }); + } + } + } +} \ No newline at end of file diff --git a/lib/service_worker/background/windows.js b/src/service_worker/background/windows.ts similarity index 54% rename from lib/service_worker/background/windows.js rename to src/service_worker/background/windows.ts index c3e33371..ee4bdd90 100644 --- a/lib/service_worker/background/windows.js +++ b/src/service_worker/background/windows.ts @@ -1,6 +1,14 @@ -var browser = browser || chrome; +"use strict"; -async function setupWindowListeners() { +import {cleanupDebounce} from "@background/tracking"; +import {getLocalStorage, getLocalStorageMap, setLocalStorage, setLocalStorageMap} from "@helpers/storage"; +import {is_in_bounds, stringHashcode} from "@helpers/utils"; +import {setWindowColor, setWindowName} from "@background/actions"; +import * as S from "@strings"; +import * as browser from 'webextension-polyfill'; +import {ISavedSession} from "@types"; + +export async function setupWindowListeners() { browser.windows.onFocusChanged.removeListener(windowFocus); browser.windows.onCreated.removeListener(windowCreated); browser.windows.onRemoved.removeListener(windowRemoved); @@ -10,7 +18,7 @@ async function setupWindowListeners() { browser.windows.onRemoved.addListener(windowRemoved); } -export async function createWindowWithTabs(tabs, isIncognito) { +export async function createWindowWithTabs(tabs : browser.Tabs.Tab[], isIncognito : boolean = false) { var pinnedIndex = 0; var firstTab = tabs.shift(); var t = []; @@ -31,16 +39,23 @@ export async function createWindowWithTabs(tabs, isIncognito) { i++; var oldTab = await browser.tabs.get(oldTabId); var tabPinned = oldTab.pinned; - var movedTabs = []; + var movedTabs : browser.Tabs.Tab | browser.Tabs.Tab[] = []; if (!tabPinned) { movedTabs = await browser.tabs.move(oldTabId, {windowId: w.id, index: -1}); } else { movedTabs = await browser.tabs.move(oldTabId, {windowId: w.id, index: pinnedIndex++}); } - if (movedTabs.length > 0) { - var newTab = movedTabs[0]; + + let firstTab : browser.Tabs.Tab; + if (Array.isArray(movedTabs)) { + firstTab = movedTabs[0]; + } else { + firstTab = movedTabs; + } + + if (!!firstTab) { if (tabPinned) { - await browser.tabs.update(newTab.id, {pinned: tabPinned}); + await browser.tabs.update(firstTab.id, {pinned: tabPinned}); } } } @@ -48,15 +63,15 @@ export async function createWindowWithTabs(tabs, isIncognito) { await browser.windows.update(w.id, {focused: true}); } -export async function createWindowWithSessionTabs(window, tabId) { +export async function createWindowWithSessionTabs(session: ISavedSession, tabId: number) { - var customName = false; - if (window && window.name && window.customName) { - customName = window.name; + var customName : string; + if (session && session.name && session.customName) { + customName = session.name; } var color = "default"; - if (window && window.color) { - color = window.color; + if (session && session.color) { + color = session.color; } var whitelistWindow = ["left", "top", "width", "height", "incognito", "type"]; @@ -71,12 +86,12 @@ export async function createWindowWithSessionTabs(window, tabId) { whitelistTab = ["url", "active", "pinned", "index"]; } - var filteredWindow = Object.keys(window.windowsInfo) + var filteredWindow : browser.Windows.CreateCreateDataType = Object.keys(session.windowsInfo) .filter(function (key) { return whitelistWindow.includes(key); }) .reduce(function (obj, key) { - obj[key] = window.windowsInfo[key]; + obj[key] = session.windowsInfo[key]; return obj; }, {}); @@ -89,37 +104,41 @@ export async function createWindowWithSessionTabs(window, tabId) { // console.log("filtered window", filteredWindow); - var newWindow = await browser.windows.create(filteredWindow).catch(function (error) { + const newWindow = await browser.windows.create(filteredWindow).catch(function (error) { console.error(error); console.log(error); console.log(error.message); }); - var emptyTab = newWindow.tabs[0].id; + if (!newWindow) return; - for (let i = 0; i < window.tabs.length; i++) { - var newTab = Object.keys(window.tabs[i]) + let emptyTab = newWindow.tabs[0].id; + + for (let i = 0; i < session.tabs.length; i++) { + let newTab = Object.keys(session.tabs[i]) .filter(function (key) { return whitelistTab.includes(key); }) .reduce(function (obj, key) { - obj[key] = window.tabs[i][key]; + obj[key] = session.tabs[i][key]; return obj; }, {}); - if (tabId != null && tabId !== newTab.index) { + var fTab : browser.Tabs.Tab = newTab as browser.Tabs.Tab; + + if (tabId != null && tabId !== fTab.index) { continue; } - newTab.windowId = newWindow.id; + fTab.windowId = newWindow.id; if (navigator.userAgent.search("Firefox") > -1) { - if (!!newTab.url && newTab.url.search("about:") > -1) { - console.log("filtered by about: url", newTab.url); - newTab.url = ""; + if (!!fTab.url && fTab.url.search("about:") > -1) { + console.log("filtered by about: url", fTab.url); + fTab.url = ""; } } try { - await browser.tabs.create(newTab).catch(function (error) { + await browser.tabs.create(fTab).catch(function (error) { console.error(error); console.log(error); console.log(error.message); @@ -138,85 +157,75 @@ export async function createWindowWithSessionTabs(window, tabId) { if (customName) { console.log("setting name"); - setWindowName(newWindow.id, customName); + await setWindowName(newWindow.id, customName); } if (color !== "default") { console.log("setting color"); - setWindowColor(newWindow.id, color); + await setWindowColor(newWindow.id, color); } await browser.windows.update(newWindow.id, {focused: true}); } -export function focusOnWindowDelayed(windowId) { +export function focusOnWindowDelayed(windowId: number) { setTimeout(focusOnWindow.bind(this, windowId), 125); } -export async function focusOnWindow(windowId) { +export async function focusOnWindow(windowId : number) { await browser.windows.update(windowId, {focused: true}); } -async function hideWindows(windowId) { +async function hideWindows(windowId : number) { if (navigator.userAgent.search("Firefox") > -1) return; if (!windowId || windowId < 0) return; - var hideWindows = await getLocalStorage("hideWindows", false); - if (!hideWindows) return; - - var result = await browser.permissions.contains({permissions: ['system.display']}); - if (result) { - // The extension has the permissions. - chrome.system.display.getInfo(async function (windowId, displaylayouts) { - var globalDisplayInfo = context.globalDisplayInfo; - globalDisplayInfo.clear(); - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for (let _iterator = displaylayouts[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var displaylayout = _step.value; - globalDisplayInfo.push(displaylayout.bounds); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - var windows = await browser.windows.getAll({populate: true}); - var monitor = -1; - for (let i = windows.length - 1; i >= 0; i--) { - if (windows[i].id === windowId) { - for (let a in globalDisplayInfo) { - var result = is_in_bounds(windows[i], globalDisplayInfo[a]); - if (result) { - monitor = a; - } - } + let hide_windows = await getLocalStorage("hideWindows", false); + if (!hide_windows) return; + + let has_permission = await browser.permissions.contains({permissions: ['system.display']}); + if (!has_permission) return; + + let displaylayouts = await chrome.system.display.getInfo(); + let monitor_bounds = []; + + try { + for (let displaylayout of displaylayouts) { + monitor_bounds.push(displaylayout.bounds); + } + } catch (err) { + console.error(err); + return; + } + + let windows = await browser.windows.getAll({populate: true}); + let monitor = null; + + for (let window of windows) { + if (window.id === windowId) { + for (let bounds_index in monitor_bounds) { + let _monitor = monitor_bounds[bounds_index]; + let _is_in_bounds = is_in_bounds(window, _monitor); + if (_is_in_bounds) { + monitor = _monitor; + break; } } + } + } - for (let i = windows.length - 1; i >= 0; i--) { - if (windows[i].id !== windowId) { - if (is_in_bounds(windows[i], globalDisplayInfo[monitor])) { - await browser.windows.update(windows[i].id, {"state": "minimized"}); - } - } + if (monitor == null) return; + + for (let window of windows) { + if (window.id !== windowId) { + if (is_in_bounds(window, monitor)) { + await browser.windows.update(window.id, {"state": "minimized"}); } - }.bind(null, windowId)); + } } } -export async function windowActive(windowId) { +export async function windowActive(windowId : number) { if (windowId < 0) return; var windows = []; @@ -242,7 +251,7 @@ export async function windowActive(windowId) { // console.log(windows); } -async function windowFocus(windowId) { +async function windowFocus(windowId : number) { try { if (!!windowId) { await windowActive(windowId); @@ -254,7 +263,7 @@ async function windowFocus(windowId) { } } -async function windowCreated(window) { +async function windowCreated(window : browser.Windows.Window) { try { if (!!window && !!window.id) { await windowActive(window.id); @@ -266,7 +275,7 @@ async function windowCreated(window) { setTimeout(cleanupDebounce, 250); } -async function windowRemoved(windowId) { +async function windowRemoved(windowId : number) { try { if (!!windowId) { await windowActive(windowId); @@ -277,39 +286,38 @@ async function windowRemoved(windowId) { // console.log("onRemoved", windowId); } -export async function checkWindow(windowId) { +export async function checkWindow(windowId : number) { if (!windowId) return; - var storage = await browser.storage.local.get(['windowNames', 'windowColors', 'windowHashes']); - - var names = storage.windowNames || {}; - var colors = storage.windowColors || {}; - var hashes = storage.windowHashes || {}; + const colors: Map = await getLocalStorageMap(S.windowColors); + const names: Map = await getLocalStorageMap(S.windowNames); if (!names[windowId] && !colors[windowId]) return; + const hashes: Map = await getLocalStorageMap(S.windowHashes); + try { - var window = await browser.windows.get(windowId, {populate: true}); + const window = await browser.windows.get(windowId, {populate: true}); let newHash = hashcode(window); - hashes[windowId] = newHash; - await setLocalStorage('windowHashes', hashes); + hashes.set(windowId, newHash); + await setLocalStorageMap(S.windowHashes, hashes); } catch (e) { console.log(e); } } -export function hashcode(window) { - var urls = []; +export function hashcode(window : browser.Windows.Window) : number { + let urls = []; for (let i = 0; i < window.tabs.length; i++) { if (!window.tabs[i].url) continue; urls.push(window.tabs[i].url); } urls.sort(); - var hash = 0; + let hash = 0; for (let i = 0; i < urls.length; i++) { - var code = stringHashcode(urls[i]); + const code = stringHashcode(urls[i]); hash = ((hash << 5) - hash) + code; hash = hash & hash; // Convert to 32bit integer } diff --git a/src/service_worker/context.ts b/src/service_worker/context.ts new file mode 100644 index 00000000..4c3a24ff --- /dev/null +++ b/src/service_worker/context.ts @@ -0,0 +1,4 @@ +"use strict"; +import * as browser from 'webextension-polyfill'; + +export let globalTabsActive : browser.Tabs.OnActivatedActiveInfoType[] = []; \ No newline at end of file diff --git a/src/service_worker/service_worker.ts b/src/service_worker/service_worker.ts new file mode 100644 index 00000000..556b0a2e --- /dev/null +++ b/src/service_worker/service_worker.ts @@ -0,0 +1,60 @@ +"use strict"; + +import { setLocalStorage } from "@helpers/storage"; +import * as _a from "@background/actions"; +import * as _w from '@background/windows'; +import * as _t from '@background/tabs'; +import { cleanupDebounce, cleanUp } from '@background/tracking'; + +import * as _c from '@ui/context_menus'; +import * as _o from '@ui/open'; +import {debounce} from "@helpers/utils"; +import * as browser from 'webextension-polyfill'; + +browser.runtime.onStartup.addListener( + async function () { + console.log(" ON STARTUP"); + } +); + +browser.runtime.onSuspend.addListener( + async function () { + console.log(" ON SUSPEND"); + } +); + +browser.commands.onCommand.addListener(_a.handleCommands); +browser.runtime.onMessage.addListener(_a.handleMessages); + +(async function () { + let windows = await browser.windows.getAll({ populate: true }); + await setLocalStorage("windowAge", []); + if (!!windows && windows.length > 0) { + windows.sort(function (a, b) { + if (a.id < b.id) return 1; + if (a.id > b.id) return -1; + return 0; + }); + for (let i = 0; i < windows.length; i++) { + if (!!windows[i].id) await _w.windowActive(windows[i].id); + } + } +})(); + +export const setupDebounced = debounce(setup, 2000); + +async function setup() { + await _c.setupContextMenus(); + await _o.setupPopup(); + await _t.setupTabListeners(); + await _w.setupWindowListeners(); + + _t.updateTabCountDebounce(); + + setTimeout(cleanupDebounce, 2500); +} + +setInterval(setupDebounced, 300000); +setTimeout(cleanUp.bind(this, true), 2000000); + +setup(); \ No newline at end of file diff --git a/src/service_worker/ui/context_menus.ts b/src/service_worker/ui/context_menus.ts new file mode 100644 index 00000000..6f0afef4 --- /dev/null +++ b/src/service_worker/ui/context_menus.ts @@ -0,0 +1,163 @@ +"use strict"; + +import {openPopup, openAsOwnTab, openSidebar} from "@ui/open"; +import * as S from "@strings"; +import * as browser from 'webextension-polyfill'; + +export async function setupContextMenus() { + await browser.contextMenus.removeAll(); + + browser.contextMenus.create({ + id: S.open_in_own_tab, + title: "📔 Open in own tab", + contexts: ["action"] + }); + + if (!!browser.action.openPopup) { + browser.contextMenus.create({ + id: S.open_popup, + title: "📑 Open popup", + contexts: ["action"] + }); + } + + if (!!browser.sidebarAction) { + browser.contextMenus.create({ + id: S.open_sidebar, + title: "🗂 Open sidebar", + contexts: ["action"] + }); + } + + browser.contextMenus.create({ + id: S.sep1, + type: "separator", + contexts: ["action"] + }); + + browser.contextMenus.create({ + title: "😍 Support this extension", + id: S.support_menu, + "contexts": ["action"] + }); + + browser.contextMenus.create({ + id: S.review, + title: "⭐ Leave a review", + "contexts": ["action"], + parentId: "support_menu" + }); + + browser.contextMenus.create({ + id: S.donate, + title: "☕ Donate to keep Extensions Alive", + "contexts": ["action"], + parentId: "support_menu" + }); + + browser.contextMenus.create({ + id: S.patron, + title: "💰 Become a Patron", + "contexts": ["action"], + parentId: "support_menu" + }); + + browser.contextMenus.create({ + id: S.twitter, + title: "🐦 Follow on Twitter", + "contexts": ["action"], + parentId: "support_menu" + }); + + browser.contextMenus.create({ + title: "🤔 Issues and Suggestions", + id: S.code_menu, + "contexts": ["action"] + }); + + browser.contextMenus.create({ + id: S.changelog, + title: "🆕 View recent changes", + "contexts": ["action"], + parentId: "code_menu" + }); + + browser.contextMenus.create({ + id: S.options, + title: "⚙ Edit Options", + "contexts": ["action"], + parentId: "code_menu" + }); + + browser.contextMenus.create({ + id: S.source, + title: "💻 View source code", + "contexts": ["action"], + parentId: "code_menu" + }); + + browser.contextMenus.create({ + id: S.report, + title: "🤔 Report an issue", + "contexts": ["action"], + parentId: "code_menu" + }); + + browser.contextMenus.create({ + id: S.send, + title: "💡 Send a suggestion", + "contexts": ["action"], + parentId: "code_menu" + }); + + browser.contextMenus.onClicked.removeListener(contextListeners); + browser.contextMenus.onClicked.addListener(contextListeners); +} + +async function contextListeners(info: browser.Menus.OnClickData, tab?: browser.Tabs.Tab) +{ + switch (info.menuItemId) { + case S.open_in_own_tab: + await openAsOwnTab(); + break; + case S.open_popup: + await openPopup(); + break; + case S.open_sidebar: + await openSidebar(); + break; + case S.donate: + await browser.tabs.create({url: 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=67TZLSEGYQFFW'}); + break; + case S.patron: + await browser.tabs.create({url: 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=67TZLSEGYQFFW'}); + break; + case S.changelog: + await browser.tabs.create({url: 'changelog.html'}); + break; + case S.options: + await browser.tabs.create({url: 'options.html'}); + break; + case S.report: + await browser.tabs.create({url: 'https://github.com/stefanXO/Tab-Manager-Plus/issues'}); + break; + case S.source: + await browser.tabs.create({url: 'https://github.com/stefanXO/Tab-Manager-Plus'}); + break; + case S.twitter: + await browser.tabs.create({url: 'https://www.twitter.com/mastef'}); + break; + case S.send: + await browser.tabs.create({url: 'https://github.com/stefanXO/Tab-Manager-Plus/issues'}); + await browser.tabs.create({url: 'mailto:markus+tmp@stefanxo.com'}); + break; + case S.review: + if (navigator.userAgent.search("Firefox") > -1) { + await browser.tabs.create({url: 'https://addons.mozilla.org/en-US/firefox/addon/tab-manager-plus-for-firefox/'}); + } else { + await browser.tabs.create({url: 'https://chrome.google.com/webstore/detail/tab-manager-plus-for-chro/cnkdjjdmfiffagllbiiilooaoofcoeff'}); + } + break; + + } +} \ No newline at end of file diff --git a/src/service_worker/ui/open.ts b/src/service_worker/ui/open.ts new file mode 100644 index 00000000..cc11e9d6 --- /dev/null +++ b/src/service_worker/ui/open.ts @@ -0,0 +1,65 @@ +"use strict"; + +import {getLocalStorage} from "@helpers/storage"; +import {globalTabsActive} from '@context'; +import {focusOnTabAndWindow} from "@background/tabs"; +import * as browser from 'webextension-polyfill'; + +export async function openSidebar() { + await browser.sidebarAction.open(); +} + +export async function openPopup() { + const openInOwnTab : boolean = await getLocalStorage("openInOwnTab", false); + if (openInOwnTab) { + await browser.action.setPopup({popup: "popup.html?popup=true"}); + await browser.action.openPopup(); + await browser.action.setPopup({popup: ""}); + } else { + await browser.action.openPopup(); + } +} + +export async function openAsOwnTab() { + const popup_page = await browser.runtime.getURL("popup.html"); + const tabs = await browser.tabs.query({}); + + let currentTab : browser.Tabs.OnActivatedActiveInfoType; + let previousTab : browser.Tabs.OnActivatedActiveInfoType; + + if (!!globalTabsActive && globalTabsActive.length > 1) { + currentTab = globalTabsActive[globalTabsActive.length - 1]; + previousTab = globalTabsActive[globalTabsActive.length - 2]; + } + + for (var i = 0; i < tabs.length; i++) { + const tab = tabs[i]; + if (tab.url.indexOf("popup.html") > -1 && tab.url.indexOf(popup_page) > -1) { + if (currentTab && currentTab.tabId && tab.id === currentTab.tabId && previousTab && previousTab.tabId) { + await focusOnTabAndWindow(previousTab.tabId, previousTab.windowId); + return; + } else { + await browser.windows.update(tab.windowId, {focused: true}); + await browser.tabs.highlight({windowId: tab.windowId, tabs: tab.index}); + return; + } + } + } + await browser.tabs.create({url: "popup.html"}); +} + +export async function setupPopup() { + + const openInOwnTab = await getLocalStorage("openInOwnTab", false); + + browser.action.onClicked.removeListener(openAsOwnTab); + if (openInOwnTab) { + await browser.action.setPopup({popup: ""}); + browser.action.onClicked.addListener(openAsOwnTab); + } else { + await browser.action.setPopup({popup: "popup.html?popup=true"}); + } + if (browser.sidebarAction) { + await browser.sidebarAction.setPanel({panel: "popup.html?panel=true"}); + } +} \ No newline at end of file diff --git a/src/strings/strings.ts b/src/strings/strings.ts new file mode 100644 index 00000000..9779c90c --- /dev/null +++ b/src/strings/strings.ts @@ -0,0 +1,40 @@ +"use strict"; + +// commands +export const reload_popup_controls = "reload_popup_controls"; +export const update_tab_count = "update_tab_count"; +export const discard_tabs = "discard_tabs"; +export const move_tabs_to_window = "move_tabs_to_window"; +export const focus_on_tab_and_window = "focus_on_tab_and_window"; +export const focus_on_tab_and_window_delayed = "focus_on_tab_and_window_delayed"; +export const focus_on_window = "focus_on_window"; +export const focus_on_window_delayed = "focus_on_window_delayed"; +export const set_window_color = "set_window_color"; +export const set_window_name = "set_window_name"; +export const create_window_with_tabs = "create_window_with_tabs"; +export const create_window_with_session_tabs = "create_window_with_session_tabs"; +export const close_tabs = "close_tabs"; +export const switch_to_previous_active_tab = "switch_to_previous_active_tab"; +export const refresh_windows = "refresh_windows"; + +// context menues +export const open_in_own_tab = "open_in_own_tab"; +export const open_popup = "open_popup"; +export const open_sidebar = "open_sidebar"; +export const sep1 = "sep1"; +export const support_menu = "support_menu"; +export const review = "review"; +export const donate = "donate"; +export const patron = "patron"; +export const twitter = "twitter"; +export const code_menu = "code_menu"; +export const changelog = "changelog"; +export const options = "options"; +export const source = "source"; +export const report = "report"; +export const send = "send"; + +// storage keys +export const windowHashes = "windowHashes"; +export const windowColors = "windowColors"; +export const windowNames = "windowNames"; \ No newline at end of file diff --git a/src/types/ICommand.ts b/src/types/ICommand.ts new file mode 100644 index 00000000..6828f51c --- /dev/null +++ b/src/types/ICommand.ts @@ -0,0 +1,17 @@ +import {ISavedSession} from "@types"; +import * as browser from "webextension-polyfill"; + +export interface ICommand +{ + command: string, + window_ids?: number[], + window_id?: number, + tab_id?: number, + color?: string, + name?: string, + session?: ISavedSession, + tab?: browser.Tabs.Tab, + saved_tab?: browser.Tabs.OnActivatedActiveInfoType, + tabs?: browser.Tabs.Tab[], + incognito?: boolean +} \ No newline at end of file diff --git a/src/types/ISavedSession.ts b/src/types/ISavedSession.ts new file mode 100644 index 00000000..2ad562dc --- /dev/null +++ b/src/types/ISavedSession.ts @@ -0,0 +1,13 @@ +import * as browser from "webextension-polyfill"; + +export interface ISavedSession { + tabs: browser.Tabs.Tab[], + windowsInfo: browser.Windows.Window, + name: string, + color: string, + date: number, + sessionStartTime: number, + id: string, + customName: boolean, + incognito: boolean +} \ No newline at end of file diff --git a/src/types/ISession.ts b/src/types/ISession.ts new file mode 100644 index 00000000..def9a646 --- /dev/null +++ b/src/types/ISession.ts @@ -0,0 +1,5 @@ +import {IWindow, ISavedSession} from "@types"; + +export interface ISession extends IWindow { + session: ISavedSession +} \ No newline at end of file diff --git a/src/types/ISessionState.ts b/src/types/ISessionState.ts new file mode 100644 index 00000000..7c16a4fd --- /dev/null +++ b/src/types/ISessionState.ts @@ -0,0 +1,4 @@ +export interface ISessionState { + name: string, + color: string, +} \ No newline at end of file diff --git a/src/types/ITab.ts b/src/types/ITab.ts new file mode 100644 index 00000000..9d3c4c82 --- /dev/null +++ b/src/types/ITab.ts @@ -0,0 +1,28 @@ +import * as browser from "webextension-polyfill"; +import {DragEvent, MouseEvent} from "react"; +import {ISavedSession} from "./ISavedSession"; + +export interface ITab { + tab: browser.Tabs.Tab, + window?: browser.Windows.Window, + session?: ISavedSession, + selected: boolean, + hidden: boolean, + id: string, + + searchActive: boolean, + layout: string, + draggable: boolean, + + middleClick: (tabId: number) => void, + + hoverHandler: (tab: browser.Tabs.Tab) => void, + parentUpdate?: () => void, + select: (id: number) => void, + selectTo?: (id: number) => void, + drag?: (e: DragEvent, id: number) => void, + drop?: (id: number, before: boolean) => void, + dropWindow?: (windowId: number) => void, + dragFavicon?: (icon?: string) => string + click?: (e: MouseEvent, index: number) => void +} \ No newline at end of file diff --git a/src/types/ITabManager.ts b/src/types/ITabManager.ts new file mode 100644 index 00000000..9d736bf4 --- /dev/null +++ b/src/types/ITabManager.ts @@ -0,0 +1,4 @@ +export interface ITabManager +{ + optionsActive: boolean +} \ No newline at end of file diff --git a/src/types/ITabManagerState.ts b/src/types/ITabManagerState.ts new file mode 100644 index 00000000..f578bea7 --- /dev/null +++ b/src/types/ITabManagerState.ts @@ -0,0 +1,45 @@ +import * as browser from "webextension-polyfill"; +import {ISavedSession} from "@types"; + +export interface ITabManagerState { + tabCount: number, + hiddenCount: number, + + animations: boolean, + badge: boolean, + compact: boolean, + dark: boolean, + filterTabs: boolean, + hideWindows: boolean, + lastOpenWindow: number, + layout: string, + openInOwnTab: boolean, + sessionsFeature: boolean, + tabHeight: number, + tabLimit: number, + tabWidth: number, + tabactions: boolean, + windowTitles: boolean, + + windows: browser.Windows.Window[], + sessions: ISavedSession[], + selection: Set, + hiddenTabs: Set, + tabsbyid: Map, + windowsbyid: Map, + + lastSelect: number, + searchLen: number, + height: number, + hasScrollBar: boolean, + focusUpdates: number, + topText: string, + bottomText: string, + lastDirection: string, + optionsActive: boolean, + dupTabs: boolean, + dragFavicon: string, + colorsActive: number, + + resetTimeout: number +} \ No newline at end of file diff --git a/src/types/ITabOptions.ts b/src/types/ITabOptions.ts new file mode 100644 index 00000000..37e79b8f --- /dev/null +++ b/src/types/ITabOptions.ts @@ -0,0 +1,46 @@ +import * as React from "react"; + +export interface ITabOptions { + animations: boolean, + badge: boolean, + compact: boolean, + dark: boolean, + hideWindows: boolean, + openInOwnTab: boolean, + sessionsFeature: boolean, + tabHeight: number, + tabLimit: number, + tabWidth: number, + tabactions: boolean, + windowTitles: boolean, + + tabLimitText: () => void, + changeTabLimit: (e: React.ChangeEvent) => void, + tabWidthText: () => void, + changeTabWidth: (e: React.ChangeEvent) => void, + tabHeightText: () => void, + changeTabHeight: (e: React.ChangeEvent) => void, + darkText: () => void, + toggleDark: () => void, + compactText: () => void, + toggleCompact: () => void, + animationsText: () => void, + toggleAnimations: () => void, + windowTitlesText: () => void, + toggleWindowTitles: () => void, + sessionsText: () => void, + toggleSessions: () => void, + exportSessionsText: () => void, + exportSessions: () => void, + importSessionsText: () => void, + importSessions: (e: React.ChangeEvent) => void, + badgeText: () => void, + toggleBadge: () => void, + openInOwnTabText: () => void, + toggleOpenInOwnTab: () => void, + hideText: () => void, + toggleHide: () => void, + tabActionsText: () => void, + toggleTabActions: () => void + getTip: () => string +} \ No newline at end of file diff --git a/src/types/ITabOptionsState.ts b/src/types/ITabOptionsState.ts new file mode 100644 index 00000000..bbe57112 --- /dev/null +++ b/src/types/ITabOptionsState.ts @@ -0,0 +1,3 @@ +export interface ITabOptionsState { + +} \ No newline at end of file diff --git a/src/types/ITabState.ts b/src/types/ITabState.ts new file mode 100644 index 00000000..29c209b5 --- /dev/null +++ b/src/types/ITabState.ts @@ -0,0 +1,9 @@ +import {RefObject} from "react"; + +export interface ITabState { + draggingOver: string, + dragFavIcon: string, + favIcon: string, + hovered: boolean, + tabRef: RefObject +} \ No newline at end of file diff --git a/src/types/IWindow.ts b/src/types/IWindow.ts new file mode 100644 index 00000000..fa969757 --- /dev/null +++ b/src/types/IWindow.ts @@ -0,0 +1,32 @@ +import * as browser from "webextension-polyfill"; +import {MouseEvent} from "react"; +import * as React from "react"; + +export interface IWindow { + window?: browser.Windows.Window, + windowTitles: boolean, + tabs: browser.Tabs.Tab[], + searchActive: boolean, + layout: string, + tabactions: boolean, + sessionsFeature?: boolean, + hoverIcon: (e: MouseEvent | string) => void, + hiddenTabs: Set, + selection: Set, + filterTabs: boolean, + lastOpenWindow: number, + incognito: boolean, + draggable: boolean, + + hoverHandler: (tab: browser.Tabs.Tab) => void, + scrollTo: (what: string, id: number) => void, + parentUpdate: () => void, + toggleColors: (active: boolean, windowId: number) => void, + tabMiddleClick: (tabId: number) => void, + select: (id: number) => void, + selectTo?: (id: number, tabs: browser.Tabs.Tab[]) => void, + drag?: (e: React.DragEvent, id: number) => void, + drop?: (id: number, before: boolean) => void, + dropWindow?: (windowId: number) => void, + dragFavicon?: (icon: string) => string +} \ No newline at end of file diff --git a/src/types/IWindowState.ts b/src/types/IWindowState.ts new file mode 100644 index 00000000..4716e8bc --- /dev/null +++ b/src/types/IWindowState.ts @@ -0,0 +1,10 @@ +export interface IWindowState { + windowTitles: string[]; + name: string, + auto_name: string, + color: string, + tabs: number, + colorActive: boolean, + hover: boolean, + dirty: boolean +} \ No newline at end of file diff --git a/src/types/index.ts b/src/types/index.ts new file mode 100644 index 00000000..548d63c5 --- /dev/null +++ b/src/types/index.ts @@ -0,0 +1,12 @@ +export * from './ICommand'; +export * from './ITabManager'; +export * from './ITabManagerState'; +export * from './ITab'; +export * from './ITabState'; +export * from './IWindow'; +export * from './IWindowState'; +export * from './ISession'; +export * from './ISessionState'; +export * from './ISavedSession'; +export * from './ITabOptions'; +export * from './ITabOptionsState'; \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..3f8e2939 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,39 @@ +{ + "compilerOptions": { + "jsx": "react", + "outDir": "ts-built", + "rootDir": "src", + "baseUrl": "./src", + "skipLibCheck": true, + "paths": { + "@views": [ + "popup/views/index" + ], + "@background/*": [ + "service_worker/background/*" + ], + "@helpers/*": [ + "helpers/*" + ], + "@types": [ + "types/index" + ], + "@ui/*": [ + "service_worker/ui/*" + ], + "@strings": [ + "strings/strings" + ], + "@context": [ + "service_worker/context" + ] + }, + "target": "es6" + }, + "include": [ + "src/**/*" + ], + "exclude": [ + "**/*.spec.ts" + ] +} \ No newline at end of file diff --git a/vendor/babel-polyfill.js b/vendor/babel-polyfill.js deleted file mode 100644 index cb6d62d2..00000000 --- a/vendor/babel-polyfill.js +++ /dev/null @@ -1,7200 +0,0 @@ -(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i 2 ? arguments[2] : undefined; - var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); - var inc = 1; - if (from < to && to < from + count) { - inc = -1; - from += count - 1; - to += count - 1; - } - while (count-- > 0) { - if (from in O) O[to] = O[from]; - else delete O[to]; - to += inc; - from += inc; - } return O; -}; - -},{"137":137,"141":141,"142":142}],40:[function(_dereq_,module,exports){ -// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) -'use strict'; -var toObject = _dereq_(142); -var toAbsoluteIndex = _dereq_(137); -var toLength = _dereq_(141); -module.exports = function fill(value /* , start = 0, end = @length */) { - var O = toObject(this); - var length = toLength(O.length); - var aLen = arguments.length; - var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length); - var end = aLen > 2 ? arguments[2] : undefined; - var endPos = end === undefined ? length : toAbsoluteIndex(end, length); - while (endPos > index) O[index++] = value; - return O; -}; - -},{"137":137,"141":141,"142":142}],41:[function(_dereq_,module,exports){ -// false -> Array#indexOf -// true -> Array#includes -var toIObject = _dereq_(140); -var toLength = _dereq_(141); -var toAbsoluteIndex = _dereq_(137); -module.exports = function (IS_INCLUDES) { - return function ($this, el, fromIndex) { - var O = toIObject($this); - var length = toLength(O.length); - var index = toAbsoluteIndex(fromIndex, length); - var value; - // Array#includes uses SameValueZero equality algorithm - // eslint-disable-next-line no-self-compare - if (IS_INCLUDES && el != el) while (length > index) { - value = O[index++]; - // eslint-disable-next-line no-self-compare - if (value != value) return true; - // Array#indexOf ignores holes, Array#includes - not - } else for (;length > index; index++) if (IS_INCLUDES || index in O) { - if (O[index] === el) return IS_INCLUDES || index || 0; - } return !IS_INCLUDES && -1; - }; -}; - -},{"137":137,"140":140,"141":141}],42:[function(_dereq_,module,exports){ -// 0 -> Array#forEach -// 1 -> Array#map -// 2 -> Array#filter -// 3 -> Array#some -// 4 -> Array#every -// 5 -> Array#find -// 6 -> Array#findIndex -var ctx = _dereq_(54); -var IObject = _dereq_(77); -var toObject = _dereq_(142); -var toLength = _dereq_(141); -var asc = _dereq_(45); -module.exports = function (TYPE, $create) { - var IS_MAP = TYPE == 1; - var IS_FILTER = TYPE == 2; - var IS_SOME = TYPE == 3; - var IS_EVERY = TYPE == 4; - var IS_FIND_INDEX = TYPE == 6; - var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; - var create = $create || asc; - return function ($this, callbackfn, that) { - var O = toObject($this); - var self = IObject(O); - var f = ctx(callbackfn, that, 3); - var length = toLength(self.length); - var index = 0; - var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; - var val, res; - for (;length > index; index++) if (NO_HOLES || index in self) { - val = self[index]; - res = f(val, index, O); - if (TYPE) { - if (IS_MAP) result[index] = res; // map - else if (res) switch (TYPE) { - case 3: return true; // some - case 5: return val; // find - case 6: return index; // findIndex - case 2: result.push(val); // filter - } else if (IS_EVERY) return false; // every - } - } - return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; - }; -}; - -},{"141":141,"142":142,"45":45,"54":54,"77":77}],43:[function(_dereq_,module,exports){ -var aFunction = _dereq_(33); -var toObject = _dereq_(142); -var IObject = _dereq_(77); -var toLength = _dereq_(141); - -module.exports = function (that, callbackfn, aLen, memo, isRight) { - aFunction(callbackfn); - var O = toObject(that); - var self = IObject(O); - var length = toLength(O.length); - var index = isRight ? length - 1 : 0; - var i = isRight ? -1 : 1; - if (aLen < 2) for (;;) { - if (index in self) { - memo = self[index]; - index += i; - break; - } - index += i; - if (isRight ? index < 0 : length <= index) { - throw TypeError('Reduce of empty array with no initial value'); - } - } - for (;isRight ? index >= 0 : length > index; index += i) if (index in self) { - memo = callbackfn(memo, self[index], index, O); - } - return memo; -}; - -},{"141":141,"142":142,"33":33,"77":77}],44:[function(_dereq_,module,exports){ -var isObject = _dereq_(81); -var isArray = _dereq_(79); -var SPECIES = _dereq_(152)('species'); - -module.exports = function (original) { - var C; - if (isArray(original)) { - C = original.constructor; - // cross-realm fallback - if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; - if (isObject(C)) { - C = C[SPECIES]; - if (C === null) C = undefined; - } - } return C === undefined ? Array : C; -}; - -},{"152":152,"79":79,"81":81}],45:[function(_dereq_,module,exports){ -// 9.4.2.3 ArraySpeciesCreate(originalArray, length) -var speciesConstructor = _dereq_(44); - -module.exports = function (original, length) { - return new (speciesConstructor(original))(length); -}; - -},{"44":44}],46:[function(_dereq_,module,exports){ -'use strict'; -var aFunction = _dereq_(33); -var isObject = _dereq_(81); -var invoke = _dereq_(76); -var arraySlice = [].slice; -var factories = {}; - -var construct = function (F, len, args) { - if (!(len in factories)) { - for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']'; - // eslint-disable-next-line no-new-func - factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); - } return factories[len](F, args); -}; - -module.exports = Function.bind || function bind(that /* , ...args */) { - var fn = aFunction(this); - var partArgs = arraySlice.call(arguments, 1); - var bound = function (/* args... */) { - var args = partArgs.concat(arraySlice.call(arguments)); - return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); - }; - if (isObject(fn.prototype)) bound.prototype = fn.prototype; - return bound; -}; - -},{"33":33,"76":76,"81":81}],47:[function(_dereq_,module,exports){ -// getting tag from 19.1.3.6 Object.prototype.toString() -var cof = _dereq_(48); -var TAG = _dereq_(152)('toStringTag'); -// ES3 wrong here -var ARG = cof(function () { return arguments; }()) == 'Arguments'; - -// fallback for IE11 Script Access Denied error -var tryGet = function (it, key) { - try { - return it[key]; - } catch (e) { /* empty */ } -}; - -module.exports = function (it) { - var O, T, B; - return it === undefined ? 'Undefined' : it === null ? 'Null' - // @@toStringTag case - : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T - // builtinTag case - : ARG ? cof(O) - // ES3 arguments fallback - : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; -}; - -},{"152":152,"48":48}],48:[function(_dereq_,module,exports){ -var toString = {}.toString; - -module.exports = function (it) { - return toString.call(it).slice(8, -1); -}; - -},{}],49:[function(_dereq_,module,exports){ -'use strict'; -var dP = _dereq_(99).f; -var create = _dereq_(98); -var redefineAll = _dereq_(117); -var ctx = _dereq_(54); -var anInstance = _dereq_(37); -var forOf = _dereq_(68); -var $iterDefine = _dereq_(85); -var step = _dereq_(87); -var setSpecies = _dereq_(123); -var DESCRIPTORS = _dereq_(58); -var fastKey = _dereq_(94).fastKey; -var validate = _dereq_(149); -var SIZE = DESCRIPTORS ? '_s' : 'size'; - -var getEntry = function (that, key) { - // fast case - var index = fastKey(key); - var entry; - if (index !== 'F') return that._i[index]; - // frozen object case - for (entry = that._f; entry; entry = entry.n) { - if (entry.k == key) return entry; - } -}; - -module.exports = { - getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { - var C = wrapper(function (that, iterable) { - anInstance(that, C, NAME, '_i'); - that._t = NAME; // collection type - that._i = create(null); // index - that._f = undefined; // first entry - that._l = undefined; // last entry - that[SIZE] = 0; // size - if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); - }); - redefineAll(C.prototype, { - // 23.1.3.1 Map.prototype.clear() - // 23.2.3.2 Set.prototype.clear() - clear: function clear() { - for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) { - entry.r = true; - if (entry.p) entry.p = entry.p.n = undefined; - delete data[entry.i]; - } - that._f = that._l = undefined; - that[SIZE] = 0; - }, - // 23.1.3.3 Map.prototype.delete(key) - // 23.2.3.4 Set.prototype.delete(value) - 'delete': function (key) { - var that = validate(this, NAME); - var entry = getEntry(that, key); - if (entry) { - var next = entry.n; - var prev = entry.p; - delete that._i[entry.i]; - entry.r = true; - if (prev) prev.n = next; - if (next) next.p = prev; - if (that._f == entry) that._f = next; - if (that._l == entry) that._l = prev; - that[SIZE]--; - } return !!entry; - }, - // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) - // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) - forEach: function forEach(callbackfn /* , that = undefined */) { - validate(this, NAME); - var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); - var entry; - while (entry = entry ? entry.n : this._f) { - f(entry.v, entry.k, this); - // revert to the last existing entry - while (entry && entry.r) entry = entry.p; - } - }, - // 23.1.3.7 Map.prototype.has(key) - // 23.2.3.7 Set.prototype.has(value) - has: function has(key) { - return !!getEntry(validate(this, NAME), key); - } - }); - if (DESCRIPTORS) dP(C.prototype, 'size', { - get: function () { - return validate(this, NAME)[SIZE]; - } - }); - return C; - }, - def: function (that, key, value) { - var entry = getEntry(that, key); - var prev, index; - // change existing entry - if (entry) { - entry.v = value; - // create new entry - } else { - that._l = entry = { - i: index = fastKey(key, true), // <- index - k: key, // <- key - v: value, // <- value - p: prev = that._l, // <- previous entry - n: undefined, // <- next entry - r: false // <- removed - }; - if (!that._f) that._f = entry; - if (prev) prev.n = entry; - that[SIZE]++; - // add to index - if (index !== 'F') that._i[index] = entry; - } return that; - }, - getEntry: getEntry, - setStrong: function (C, NAME, IS_MAP) { - // add .keys, .values, .entries, [@@iterator] - // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 - $iterDefine(C, NAME, function (iterated, kind) { - this._t = validate(iterated, NAME); // target - this._k = kind; // kind - this._l = undefined; // previous - }, function () { - var that = this; - var kind = that._k; - var entry = that._l; - // revert to the last existing entry - while (entry && entry.r) entry = entry.p; - // get next entry - if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) { - // or finish the iteration - that._t = undefined; - return step(1); - } - // return step by kind - if (kind == 'keys') return step(0, entry.k); - if (kind == 'values') return step(0, entry.v); - return step(0, [entry.k, entry.v]); - }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); - - // add [@@species], 23.1.2.2, 23.2.2.2 - setSpecies(NAME); - } -}; - -},{"117":117,"123":123,"149":149,"37":37,"54":54,"58":58,"68":68,"85":85,"87":87,"94":94,"98":98,"99":99}],50:[function(_dereq_,module,exports){ -'use strict'; -var redefineAll = _dereq_(117); -var getWeak = _dereq_(94).getWeak; -var anObject = _dereq_(38); -var isObject = _dereq_(81); -var anInstance = _dereq_(37); -var forOf = _dereq_(68); -var createArrayMethod = _dereq_(42); -var $has = _dereq_(71); -var validate = _dereq_(149); -var arrayFind = createArrayMethod(5); -var arrayFindIndex = createArrayMethod(6); -var id = 0; - -// fallback for uncaught frozen keys -var uncaughtFrozenStore = function (that) { - return that._l || (that._l = new UncaughtFrozenStore()); -}; -var UncaughtFrozenStore = function () { - this.a = []; -}; -var findUncaughtFrozen = function (store, key) { - return arrayFind(store.a, function (it) { - return it[0] === key; - }); -}; -UncaughtFrozenStore.prototype = { - get: function (key) { - var entry = findUncaughtFrozen(this, key); - if (entry) return entry[1]; - }, - has: function (key) { - return !!findUncaughtFrozen(this, key); - }, - set: function (key, value) { - var entry = findUncaughtFrozen(this, key); - if (entry) entry[1] = value; - else this.a.push([key, value]); - }, - 'delete': function (key) { - var index = arrayFindIndex(this.a, function (it) { - return it[0] === key; - }); - if (~index) this.a.splice(index, 1); - return !!~index; - } -}; - -module.exports = { - getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { - var C = wrapper(function (that, iterable) { - anInstance(that, C, NAME, '_i'); - that._t = NAME; // collection type - that._i = id++; // collection id - that._l = undefined; // leak store for uncaught frozen objects - if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); - }); - redefineAll(C.prototype, { - // 23.3.3.2 WeakMap.prototype.delete(key) - // 23.4.3.3 WeakSet.prototype.delete(value) - 'delete': function (key) { - if (!isObject(key)) return false; - var data = getWeak(key); - if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key); - return data && $has(data, this._i) && delete data[this._i]; - }, - // 23.3.3.4 WeakMap.prototype.has(key) - // 23.4.3.4 WeakSet.prototype.has(value) - has: function has(key) { - if (!isObject(key)) return false; - var data = getWeak(key); - if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key); - return data && $has(data, this._i); - } - }); - return C; - }, - def: function (that, key, value) { - var data = getWeak(anObject(key), true); - if (data === true) uncaughtFrozenStore(that).set(key, value); - else data[that._i] = value; - return that; - }, - ufstore: uncaughtFrozenStore -}; - -},{"117":117,"149":149,"37":37,"38":38,"42":42,"68":68,"71":71,"81":81,"94":94}],51:[function(_dereq_,module,exports){ -'use strict'; -var global = _dereq_(70); -var $export = _dereq_(62); -var redefine = _dereq_(118); -var redefineAll = _dereq_(117); -var meta = _dereq_(94); -var forOf = _dereq_(68); -var anInstance = _dereq_(37); -var isObject = _dereq_(81); -var fails = _dereq_(64); -var $iterDetect = _dereq_(86); -var setToStringTag = _dereq_(124); -var inheritIfRequired = _dereq_(75); - -module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { - var Base = global[NAME]; - var C = Base; - var ADDER = IS_MAP ? 'set' : 'add'; - var proto = C && C.prototype; - var O = {}; - var fixMethod = function (KEY) { - var fn = proto[KEY]; - redefine(proto, KEY, - KEY == 'delete' ? function (a) { - return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); - } : KEY == 'has' ? function has(a) { - return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); - } : KEY == 'get' ? function get(a) { - return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); - } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; } - : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; } - ); - }; - if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () { - new C().entries().next(); - }))) { - // create collection constructor - C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); - redefineAll(C.prototype, methods); - meta.NEED = true; - } else { - var instance = new C(); - // early implementations not supports chaining - var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; - // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false - var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); }); - // most early implementations doesn't supports iterables, most modern - not close it correctly - var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new - // for early implementations -0 and +0 not the same - var BUGGY_ZERO = !IS_WEAK && fails(function () { - // V8 ~ Chromium 42- fails only with 5+ elements - var $instance = new C(); - var index = 5; - while (index--) $instance[ADDER](index, index); - return !$instance.has(-0); - }); - if (!ACCEPT_ITERABLES) { - C = wrapper(function (target, iterable) { - anInstance(target, C, NAME); - var that = inheritIfRequired(new Base(), target, C); - if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); - return that; - }); - C.prototype = proto; - proto.constructor = C; - } - if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { - fixMethod('delete'); - fixMethod('has'); - IS_MAP && fixMethod('get'); - } - if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); - // weak collections should not contains .clear method - if (IS_WEAK && proto.clear) delete proto.clear; - } - - setToStringTag(C, NAME); - - O[NAME] = C; - $export($export.G + $export.W + $export.F * (C != Base), O); - - if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); - - return C; -}; - -},{"117":117,"118":118,"124":124,"37":37,"62":62,"64":64,"68":68,"70":70,"75":75,"81":81,"86":86,"94":94}],52:[function(_dereq_,module,exports){ -arguments[4][18][0].apply(exports,arguments) -},{"18":18}],53:[function(_dereq_,module,exports){ -'use strict'; -var $defineProperty = _dereq_(99); -var createDesc = _dereq_(116); - -module.exports = function (object, index, value) { - if (index in object) $defineProperty.f(object, index, createDesc(0, value)); - else object[index] = value; -}; - -},{"116":116,"99":99}],54:[function(_dereq_,module,exports){ -arguments[4][19][0].apply(exports,arguments) -},{"19":19,"33":33}],55:[function(_dereq_,module,exports){ -'use strict'; -// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() -var fails = _dereq_(64); -var getTime = Date.prototype.getTime; -var $toISOString = Date.prototype.toISOString; - -var lz = function (num) { - return num > 9 ? num : '0' + num; -}; - -// PhantomJS / old WebKit has a broken implementations -module.exports = (fails(function () { - return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z'; -}) || !fails(function () { - $toISOString.call(new Date(NaN)); -})) ? function toISOString() { - if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value'); - var d = this; - var y = d.getUTCFullYear(); - var m = d.getUTCMilliseconds(); - var s = y < 0 ? '-' : y > 9999 ? '+' : ''; - return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + - '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + - 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + - ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; -} : $toISOString; - -},{"64":64}],56:[function(_dereq_,module,exports){ -'use strict'; -var anObject = _dereq_(38); -var toPrimitive = _dereq_(143); -var NUMBER = 'number'; - -module.exports = function (hint) { - if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint'); - return toPrimitive(anObject(this), hint != NUMBER); -}; - -},{"143":143,"38":38}],57:[function(_dereq_,module,exports){ -// 7.2.1 RequireObjectCoercible(argument) -module.exports = function (it) { - if (it == undefined) throw TypeError("Can't call method on " + it); - return it; -}; - -},{}],58:[function(_dereq_,module,exports){ -arguments[4][20][0].apply(exports,arguments) -},{"20":20,"64":64}],59:[function(_dereq_,module,exports){ -arguments[4][21][0].apply(exports,arguments) -},{"21":21,"70":70,"81":81}],60:[function(_dereq_,module,exports){ -// IE 8- don't enum bug keys -module.exports = ( - 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' -).split(','); - -},{}],61:[function(_dereq_,module,exports){ -// all enumerable object keys, includes symbols -var getKeys = _dereq_(107); -var gOPS = _dereq_(104); -var pIE = _dereq_(108); -module.exports = function (it) { - var result = getKeys(it); - var getSymbols = gOPS.f; - if (getSymbols) { - var symbols = getSymbols(it); - var isEnum = pIE.f; - var i = 0; - var key; - while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key); - } return result; -}; - -},{"104":104,"107":107,"108":108}],62:[function(_dereq_,module,exports){ -var global = _dereq_(70); -var core = _dereq_(52); -var hide = _dereq_(72); -var redefine = _dereq_(118); -var ctx = _dereq_(54); -var PROTOTYPE = 'prototype'; - -var $export = function (type, name, source) { - var IS_FORCED = type & $export.F; - var IS_GLOBAL = type & $export.G; - var IS_STATIC = type & $export.S; - var IS_PROTO = type & $export.P; - var IS_BIND = type & $export.B; - var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]; - var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); - var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); - var key, own, out, exp; - if (IS_GLOBAL) source = name; - for (key in source) { - // contains in native - own = !IS_FORCED && target && target[key] !== undefined; - // export native or passed - out = (own ? target : source)[key]; - // bind timers to global for call from export context - exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; - // extend global - if (target) redefine(target, key, out, type & $export.U); - // export - if (exports[key] != out) hide(exports, key, exp); - if (IS_PROTO && expProto[key] != out) expProto[key] = out; - } -}; -global.core = core; -// type bitmap -$export.F = 1; // forced -$export.G = 2; // global -$export.S = 4; // static -$export.P = 8; // proto -$export.B = 16; // bind -$export.W = 32; // wrap -$export.U = 64; // safe -$export.R = 128; // real proto method for `library` -module.exports = $export; - -},{"118":118,"52":52,"54":54,"70":70,"72":72}],63:[function(_dereq_,module,exports){ -var MATCH = _dereq_(152)('match'); -module.exports = function (KEY) { - var re = /./; - try { - '/./'[KEY](re); - } catch (e) { - try { - re[MATCH] = false; - return !'/./'[KEY](re); - } catch (f) { /* empty */ } - } return true; -}; - -},{"152":152}],64:[function(_dereq_,module,exports){ -arguments[4][23][0].apply(exports,arguments) -},{"23":23}],65:[function(_dereq_,module,exports){ -'use strict'; -_dereq_(248); -var redefine = _dereq_(118); -var hide = _dereq_(72); -var fails = _dereq_(64); -var defined = _dereq_(57); -var wks = _dereq_(152); -var regexpExec = _dereq_(120); - -var SPECIES = wks('species'); - -var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { - // #replace needs built-in support for named groups. - // #match works fine because it just return the exec results, even if it has - // a "grops" property. - var re = /./; - re.exec = function () { - var result = []; - result.groups = { a: '7' }; - return result; - }; - return ''.replace(re, '$') !== '7'; -}); - -var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () { - // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec - var re = /(?:)/; - var originalExec = re.exec; - re.exec = function () { return originalExec.apply(this, arguments); }; - var result = 'ab'.split(re); - return result.length === 2 && result[0] === 'a' && result[1] === 'b'; -})(); - -module.exports = function (KEY, length, exec) { - var SYMBOL = wks(KEY); - - var DELEGATES_TO_SYMBOL = !fails(function () { - // String methods call symbol-named RegEp methods - var O = {}; - O[SYMBOL] = function () { return 7; }; - return ''[KEY](O) != 7; - }); - - var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !fails(function () { - // Symbol-named RegExp methods call .exec - var execCalled = false; - var re = /a/; - re.exec = function () { execCalled = true; return null; }; - if (KEY === 'split') { - // RegExp[@@split] doesn't call the regex's exec method, but first creates - // a new one. We need to return the patched regex when creating the new one. - re.constructor = {}; - re.constructor[SPECIES] = function () { return re; }; - } - re[SYMBOL](''); - return !execCalled; - }) : undefined; - - if ( - !DELEGATES_TO_SYMBOL || - !DELEGATES_TO_EXEC || - (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) || - (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC) - ) { - var nativeRegExpMethod = /./[SYMBOL]; - var fns = exec( - defined, - SYMBOL, - ''[KEY], - function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) { - if (regexp.exec === regexpExec) { - if (DELEGATES_TO_SYMBOL && !forceStringMethod) { - // The native String method already delegates to @@method (this - // polyfilled function), leasing to infinite recursion. - // We avoid it by directly calling the native @@method method. - return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) }; - } - return { done: true, value: nativeMethod.call(str, regexp, arg2) }; - } - return { done: false }; - } - ); - var strfn = fns[0]; - var rxfn = fns[1]; - - redefine(String.prototype, KEY, strfn); - hide(RegExp.prototype, SYMBOL, length == 2 - // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) - // 21.2.5.11 RegExp.prototype[@@split](string, limit) - ? function (string, arg) { return rxfn.call(string, this, arg); } - // 21.2.5.6 RegExp.prototype[@@match](string) - // 21.2.5.9 RegExp.prototype[@@search](string) - : function (string) { return rxfn.call(string, this); } - ); - } -}; - -},{"118":118,"120":120,"152":152,"248":248,"57":57,"64":64,"72":72}],66:[function(_dereq_,module,exports){ -'use strict'; -// 21.2.5.3 get RegExp.prototype.flags -var anObject = _dereq_(38); -module.exports = function () { - var that = anObject(this); - var result = ''; - if (that.global) result += 'g'; - if (that.ignoreCase) result += 'i'; - if (that.multiline) result += 'm'; - if (that.unicode) result += 'u'; - if (that.sticky) result += 'y'; - return result; -}; - -},{"38":38}],67:[function(_dereq_,module,exports){ -'use strict'; -// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray -var isArray = _dereq_(79); -var isObject = _dereq_(81); -var toLength = _dereq_(141); -var ctx = _dereq_(54); -var IS_CONCAT_SPREADABLE = _dereq_(152)('isConcatSpreadable'); - -function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) { - var targetIndex = start; - var sourceIndex = 0; - var mapFn = mapper ? ctx(mapper, thisArg, 3) : false; - var element, spreadable; - - while (sourceIndex < sourceLen) { - if (sourceIndex in source) { - element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex]; - - spreadable = false; - if (isObject(element)) { - spreadable = element[IS_CONCAT_SPREADABLE]; - spreadable = spreadable !== undefined ? !!spreadable : isArray(element); - } - - if (spreadable && depth > 0) { - targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1; - } else { - if (targetIndex >= 0x1fffffffffffff) throw TypeError(); - target[targetIndex] = element; - } - - targetIndex++; - } - sourceIndex++; - } - return targetIndex; -} - -module.exports = flattenIntoArray; - -},{"141":141,"152":152,"54":54,"79":79,"81":81}],68:[function(_dereq_,module,exports){ -var ctx = _dereq_(54); -var call = _dereq_(83); -var isArrayIter = _dereq_(78); -var anObject = _dereq_(38); -var toLength = _dereq_(141); -var getIterFn = _dereq_(153); -var BREAK = {}; -var RETURN = {}; -var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { - var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable); - var f = ctx(fn, that, entries ? 2 : 1); - var index = 0; - var length, step, iterator, result; - if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); - // fast case for arrays with default iterator - if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) { - result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); - if (result === BREAK || result === RETURN) return result; - } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { - result = call(iterator, f, step.value, entries); - if (result === BREAK || result === RETURN) return result; - } -}; -exports.BREAK = BREAK; -exports.RETURN = RETURN; - -},{"141":141,"153":153,"38":38,"54":54,"78":78,"83":83}],69:[function(_dereq_,module,exports){ -module.exports = _dereq_(126)('native-function-to-string', Function.toString); - -},{"126":126}],70:[function(_dereq_,module,exports){ -arguments[4][24][0].apply(exports,arguments) -},{"24":24}],71:[function(_dereq_,module,exports){ -arguments[4][25][0].apply(exports,arguments) -},{"25":25}],72:[function(_dereq_,module,exports){ -arguments[4][26][0].apply(exports,arguments) -},{"116":116,"26":26,"58":58,"99":99}],73:[function(_dereq_,module,exports){ -var document = _dereq_(70).document; -module.exports = document && document.documentElement; - -},{"70":70}],74:[function(_dereq_,module,exports){ -arguments[4][27][0].apply(exports,arguments) -},{"27":27,"58":58,"59":59,"64":64}],75:[function(_dereq_,module,exports){ -var isObject = _dereq_(81); -var setPrototypeOf = _dereq_(122).set; -module.exports = function (that, target, C) { - var S = target.constructor; - var P; - if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) { - setPrototypeOf(that, P); - } return that; -}; - -},{"122":122,"81":81}],76:[function(_dereq_,module,exports){ -// fast apply, http://jsperf.lnkit.com/fast-apply/5 -module.exports = function (fn, args, that) { - var un = that === undefined; - switch (args.length) { - case 0: return un ? fn() - : fn.call(that); - case 1: return un ? fn(args[0]) - : fn.call(that, args[0]); - case 2: return un ? fn(args[0], args[1]) - : fn.call(that, args[0], args[1]); - case 3: return un ? fn(args[0], args[1], args[2]) - : fn.call(that, args[0], args[1], args[2]); - case 4: return un ? fn(args[0], args[1], args[2], args[3]) - : fn.call(that, args[0], args[1], args[2], args[3]); - } return fn.apply(that, args); -}; - -},{}],77:[function(_dereq_,module,exports){ -// fallback for non-array-like ES3 and non-enumerable old V8 strings -var cof = _dereq_(48); -// eslint-disable-next-line no-prototype-builtins -module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { - return cof(it) == 'String' ? it.split('') : Object(it); -}; - -},{"48":48}],78:[function(_dereq_,module,exports){ -// check on default Array iterator -var Iterators = _dereq_(88); -var ITERATOR = _dereq_(152)('iterator'); -var ArrayProto = Array.prototype; - -module.exports = function (it) { - return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); -}; - -},{"152":152,"88":88}],79:[function(_dereq_,module,exports){ -// 7.2.2 IsArray(argument) -var cof = _dereq_(48); -module.exports = Array.isArray || function isArray(arg) { - return cof(arg) == 'Array'; -}; - -},{"48":48}],80:[function(_dereq_,module,exports){ -// 20.1.2.3 Number.isInteger(number) -var isObject = _dereq_(81); -var floor = Math.floor; -module.exports = function isInteger(it) { - return !isObject(it) && isFinite(it) && floor(it) === it; -}; - -},{"81":81}],81:[function(_dereq_,module,exports){ -arguments[4][28][0].apply(exports,arguments) -},{"28":28}],82:[function(_dereq_,module,exports){ -// 7.2.8 IsRegExp(argument) -var isObject = _dereq_(81); -var cof = _dereq_(48); -var MATCH = _dereq_(152)('match'); -module.exports = function (it) { - var isRegExp; - return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); -}; - -},{"152":152,"48":48,"81":81}],83:[function(_dereq_,module,exports){ -// call something on iterator step with safe closing on error -var anObject = _dereq_(38); -module.exports = function (iterator, fn, value, entries) { - try { - return entries ? fn(anObject(value)[0], value[1]) : fn(value); - // 7.4.6 IteratorClose(iterator, completion) - } catch (e) { - var ret = iterator['return']; - if (ret !== undefined) anObject(ret.call(iterator)); - throw e; - } -}; - -},{"38":38}],84:[function(_dereq_,module,exports){ -'use strict'; -var create = _dereq_(98); -var descriptor = _dereq_(116); -var setToStringTag = _dereq_(124); -var IteratorPrototype = {}; - -// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() -_dereq_(72)(IteratorPrototype, _dereq_(152)('iterator'), function () { return this; }); - -module.exports = function (Constructor, NAME, next) { - Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); - setToStringTag(Constructor, NAME + ' Iterator'); -}; - -},{"116":116,"124":124,"152":152,"72":72,"98":98}],85:[function(_dereq_,module,exports){ -'use strict'; -var LIBRARY = _dereq_(89); -var $export = _dereq_(62); -var redefine = _dereq_(118); -var hide = _dereq_(72); -var Iterators = _dereq_(88); -var $iterCreate = _dereq_(84); -var setToStringTag = _dereq_(124); -var getPrototypeOf = _dereq_(105); -var ITERATOR = _dereq_(152)('iterator'); -var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` -var FF_ITERATOR = '@@iterator'; -var KEYS = 'keys'; -var VALUES = 'values'; - -var returnThis = function () { return this; }; - -module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { - $iterCreate(Constructor, NAME, next); - var getMethod = function (kind) { - if (!BUGGY && kind in proto) return proto[kind]; - switch (kind) { - case KEYS: return function keys() { return new Constructor(this, kind); }; - case VALUES: return function values() { return new Constructor(this, kind); }; - } return function entries() { return new Constructor(this, kind); }; - }; - var TAG = NAME + ' Iterator'; - var DEF_VALUES = DEFAULT == VALUES; - var VALUES_BUG = false; - var proto = Base.prototype; - var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; - var $default = $native || getMethod(DEFAULT); - var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; - var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; - var methods, key, IteratorPrototype; - // Fix native - if ($anyNative) { - IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); - if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { - // Set @@toStringTag to native iterators - setToStringTag(IteratorPrototype, TAG, true); - // fix for some old engines - if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis); - } - } - // fix Array#{values, @@iterator}.name in V8 / FF - if (DEF_VALUES && $native && $native.name !== VALUES) { - VALUES_BUG = true; - $default = function values() { return $native.call(this); }; - } - // Define iterator - if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { - hide(proto, ITERATOR, $default); - } - // Plug for library - Iterators[NAME] = $default; - Iterators[TAG] = returnThis; - if (DEFAULT) { - methods = { - values: DEF_VALUES ? $default : getMethod(VALUES), - keys: IS_SET ? $default : getMethod(KEYS), - entries: $entries - }; - if (FORCED) for (key in methods) { - if (!(key in proto)) redefine(proto, key, methods[key]); - } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); - } - return methods; -}; - -},{"105":105,"118":118,"124":124,"152":152,"62":62,"72":72,"84":84,"88":88,"89":89}],86:[function(_dereq_,module,exports){ -var ITERATOR = _dereq_(152)('iterator'); -var SAFE_CLOSING = false; - -try { - var riter = [7][ITERATOR](); - riter['return'] = function () { SAFE_CLOSING = true; }; - // eslint-disable-next-line no-throw-literal - Array.from(riter, function () { throw 2; }); -} catch (e) { /* empty */ } - -module.exports = function (exec, skipClosing) { - if (!skipClosing && !SAFE_CLOSING) return false; - var safe = false; - try { - var arr = [7]; - var iter = arr[ITERATOR](); - iter.next = function () { return { done: safe = true }; }; - arr[ITERATOR] = function () { return iter; }; - exec(arr); - } catch (e) { /* empty */ } - return safe; -}; - -},{"152":152}],87:[function(_dereq_,module,exports){ -module.exports = function (done, value) { - return { value: value, done: !!done }; -}; - -},{}],88:[function(_dereq_,module,exports){ -module.exports = {}; - -},{}],89:[function(_dereq_,module,exports){ -module.exports = false; - -},{}],90:[function(_dereq_,module,exports){ -// 20.2.2.14 Math.expm1(x) -var $expm1 = Math.expm1; -module.exports = (!$expm1 - // Old FF bug - || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 - // Tor Browser bug - || $expm1(-2e-17) != -2e-17 -) ? function expm1(x) { - return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; -} : $expm1; - -},{}],91:[function(_dereq_,module,exports){ -// 20.2.2.16 Math.fround(x) -var sign = _dereq_(93); -var pow = Math.pow; -var EPSILON = pow(2, -52); -var EPSILON32 = pow(2, -23); -var MAX32 = pow(2, 127) * (2 - EPSILON32); -var MIN32 = pow(2, -126); - -var roundTiesToEven = function (n) { - return n + 1 / EPSILON - 1 / EPSILON; -}; - -module.exports = Math.fround || function fround(x) { - var $abs = Math.abs(x); - var $sign = sign(x); - var a, result; - if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; - a = (1 + EPSILON32 / EPSILON) * $abs; - result = a - (a - $abs); - // eslint-disable-next-line no-self-compare - if (result > MAX32 || result != result) return $sign * Infinity; - return $sign * result; -}; - -},{"93":93}],92:[function(_dereq_,module,exports){ -// 20.2.2.20 Math.log1p(x) -module.exports = Math.log1p || function log1p(x) { - return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); -}; - -},{}],93:[function(_dereq_,module,exports){ -// 20.2.2.28 Math.sign(x) -module.exports = Math.sign || function sign(x) { - // eslint-disable-next-line no-self-compare - return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; -}; - -},{}],94:[function(_dereq_,module,exports){ -var META = _dereq_(147)('meta'); -var isObject = _dereq_(81); -var has = _dereq_(71); -var setDesc = _dereq_(99).f; -var id = 0; -var isExtensible = Object.isExtensible || function () { - return true; -}; -var FREEZE = !_dereq_(64)(function () { - return isExtensible(Object.preventExtensions({})); -}); -var setMeta = function (it) { - setDesc(it, META, { value: { - i: 'O' + ++id, // object ID - w: {} // weak collections IDs - } }); -}; -var fastKey = function (it, create) { - // return primitive with prefix - if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; - if (!has(it, META)) { - // can't set metadata to uncaught frozen object - if (!isExtensible(it)) return 'F'; - // not necessary to add metadata - if (!create) return 'E'; - // add missing metadata - setMeta(it); - // return object ID - } return it[META].i; -}; -var getWeak = function (it, create) { - if (!has(it, META)) { - // can't set metadata to uncaught frozen object - if (!isExtensible(it)) return true; - // not necessary to add metadata - if (!create) return false; - // add missing metadata - setMeta(it); - // return hash weak collections IDs - } return it[META].w; -}; -// add metadata on freeze-family methods calling -var onFreeze = function (it) { - if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it); - return it; -}; -var meta = module.exports = { - KEY: META, - NEED: false, - fastKey: fastKey, - getWeak: getWeak, - onFreeze: onFreeze -}; - -},{"147":147,"64":64,"71":71,"81":81,"99":99}],95:[function(_dereq_,module,exports){ -var global = _dereq_(70); -var macrotask = _dereq_(136).set; -var Observer = global.MutationObserver || global.WebKitMutationObserver; -var process = global.process; -var Promise = global.Promise; -var isNode = _dereq_(48)(process) == 'process'; - -module.exports = function () { - var head, last, notify; - - var flush = function () { - var parent, fn; - if (isNode && (parent = process.domain)) parent.exit(); - while (head) { - fn = head.fn; - head = head.next; - try { - fn(); - } catch (e) { - if (head) notify(); - else last = undefined; - throw e; - } - } last = undefined; - if (parent) parent.enter(); - }; - - // Node.js - if (isNode) { - notify = function () { - process.nextTick(flush); - }; - // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 - } else if (Observer && !(global.navigator && global.navigator.standalone)) { - var toggle = true; - var node = document.createTextNode(''); - new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new - notify = function () { - node.data = toggle = !toggle; - }; - // environments with maybe non-completely correct, but existent Promise - } else if (Promise && Promise.resolve) { - // Promise.resolve without an argument throws an error in LG WebOS 2 - var promise = Promise.resolve(undefined); - notify = function () { - promise.then(flush); - }; - // for other environments - macrotask based on: - // - setImmediate - // - MessageChannel - // - window.postMessag - // - onreadystatechange - // - setTimeout - } else { - notify = function () { - // strange IE + webpack dev server bug - use .call(global) - macrotask.call(global, flush); - }; - } - - return function (fn) { - var task = { fn: fn, next: undefined }; - if (last) last.next = task; - if (!head) { - head = task; - notify(); - } last = task; - }; -}; - -},{"136":136,"48":48,"70":70}],96:[function(_dereq_,module,exports){ -'use strict'; -// 25.4.1.5 NewPromiseCapability(C) -var aFunction = _dereq_(33); - -function PromiseCapability(C) { - var resolve, reject; - this.promise = new C(function ($$resolve, $$reject) { - if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); - resolve = $$resolve; - reject = $$reject; - }); - this.resolve = aFunction(resolve); - this.reject = aFunction(reject); -} - -module.exports.f = function (C) { - return new PromiseCapability(C); -}; - -},{"33":33}],97:[function(_dereq_,module,exports){ -'use strict'; -// 19.1.2.1 Object.assign(target, source, ...) -var DESCRIPTORS = _dereq_(58); -var getKeys = _dereq_(107); -var gOPS = _dereq_(104); -var pIE = _dereq_(108); -var toObject = _dereq_(142); -var IObject = _dereq_(77); -var $assign = Object.assign; - -// should work with symbols and should have deterministic property order (V8 bug) -module.exports = !$assign || _dereq_(64)(function () { - var A = {}; - var B = {}; - // eslint-disable-next-line no-undef - var S = Symbol(); - var K = 'abcdefghijklmnopqrst'; - A[S] = 7; - K.split('').forEach(function (k) { B[k] = k; }); - return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; -}) ? function assign(target, source) { // eslint-disable-line no-unused-vars - var T = toObject(target); - var aLen = arguments.length; - var index = 1; - var getSymbols = gOPS.f; - var isEnum = pIE.f; - while (aLen > index) { - var S = IObject(arguments[index++]); - var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S); - var length = keys.length; - var j = 0; - var key; - while (length > j) { - key = keys[j++]; - if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key]; - } - } return T; -} : $assign; - -},{"104":104,"107":107,"108":108,"142":142,"58":58,"64":64,"77":77}],98:[function(_dereq_,module,exports){ -// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) -var anObject = _dereq_(38); -var dPs = _dereq_(100); -var enumBugKeys = _dereq_(60); -var IE_PROTO = _dereq_(125)('IE_PROTO'); -var Empty = function () { /* empty */ }; -var PROTOTYPE = 'prototype'; - -// Create object with fake `null` prototype: use iframe Object with cleared prototype -var createDict = function () { - // Thrash, waste and sodomy: IE GC bug - var iframe = _dereq_(59)('iframe'); - var i = enumBugKeys.length; - var lt = '<'; - var gt = '>'; - var iframeDocument; - iframe.style.display = 'none'; - _dereq_(73).appendChild(iframe); - iframe.src = 'javascript:'; // eslint-disable-line no-script-url - // createDict = iframe.contentWindow.Object; - // html.removeChild(iframe); - iframeDocument = iframe.contentWindow.document; - iframeDocument.open(); - iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); - iframeDocument.close(); - createDict = iframeDocument.F; - while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]]; - return createDict(); -}; - -module.exports = Object.create || function create(O, Properties) { - var result; - if (O !== null) { - Empty[PROTOTYPE] = anObject(O); - result = new Empty(); - Empty[PROTOTYPE] = null; - // add "__proto__" for Object.getPrototypeOf polyfill - result[IE_PROTO] = O; - } else result = createDict(); - return Properties === undefined ? result : dPs(result, Properties); -}; - -},{"100":100,"125":125,"38":38,"59":59,"60":60,"73":73}],99:[function(_dereq_,module,exports){ -arguments[4][29][0].apply(exports,arguments) -},{"143":143,"29":29,"38":38,"58":58,"74":74}],100:[function(_dereq_,module,exports){ -var dP = _dereq_(99); -var anObject = _dereq_(38); -var getKeys = _dereq_(107); - -module.exports = _dereq_(58) ? Object.defineProperties : function defineProperties(O, Properties) { - anObject(O); - var keys = getKeys(Properties); - var length = keys.length; - var i = 0; - var P; - while (length > i) dP.f(O, P = keys[i++], Properties[P]); - return O; -}; - -},{"107":107,"38":38,"58":58,"99":99}],101:[function(_dereq_,module,exports){ -var pIE = _dereq_(108); -var createDesc = _dereq_(116); -var toIObject = _dereq_(140); -var toPrimitive = _dereq_(143); -var has = _dereq_(71); -var IE8_DOM_DEFINE = _dereq_(74); -var gOPD = Object.getOwnPropertyDescriptor; - -exports.f = _dereq_(58) ? gOPD : function getOwnPropertyDescriptor(O, P) { - O = toIObject(O); - P = toPrimitive(P, true); - if (IE8_DOM_DEFINE) try { - return gOPD(O, P); - } catch (e) { /* empty */ } - if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]); -}; - -},{"108":108,"116":116,"140":140,"143":143,"58":58,"71":71,"74":74}],102:[function(_dereq_,module,exports){ -// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window -var toIObject = _dereq_(140); -var gOPN = _dereq_(103).f; -var toString = {}.toString; - -var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames - ? Object.getOwnPropertyNames(window) : []; - -var getWindowNames = function (it) { - try { - return gOPN(it); - } catch (e) { - return windowNames.slice(); - } -}; - -module.exports.f = function getOwnPropertyNames(it) { - return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); -}; - -},{"103":103,"140":140}],103:[function(_dereq_,module,exports){ -// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) -var $keys = _dereq_(106); -var hiddenKeys = _dereq_(60).concat('length', 'prototype'); - -exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { - return $keys(O, hiddenKeys); -}; - -},{"106":106,"60":60}],104:[function(_dereq_,module,exports){ -exports.f = Object.getOwnPropertySymbols; - -},{}],105:[function(_dereq_,module,exports){ -// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) -var has = _dereq_(71); -var toObject = _dereq_(142); -var IE_PROTO = _dereq_(125)('IE_PROTO'); -var ObjectProto = Object.prototype; - -module.exports = Object.getPrototypeOf || function (O) { - O = toObject(O); - if (has(O, IE_PROTO)) return O[IE_PROTO]; - if (typeof O.constructor == 'function' && O instanceof O.constructor) { - return O.constructor.prototype; - } return O instanceof Object ? ObjectProto : null; -}; - -},{"125":125,"142":142,"71":71}],106:[function(_dereq_,module,exports){ -var has = _dereq_(71); -var toIObject = _dereq_(140); -var arrayIndexOf = _dereq_(41)(false); -var IE_PROTO = _dereq_(125)('IE_PROTO'); - -module.exports = function (object, names) { - var O = toIObject(object); - var i = 0; - var result = []; - var key; - for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); - // Don't enum bug & hidden keys - while (names.length > i) if (has(O, key = names[i++])) { - ~arrayIndexOf(result, key) || result.push(key); - } - return result; -}; - -},{"125":125,"140":140,"41":41,"71":71}],107:[function(_dereq_,module,exports){ -// 19.1.2.14 / 15.2.3.14 Object.keys(O) -var $keys = _dereq_(106); -var enumBugKeys = _dereq_(60); - -module.exports = Object.keys || function keys(O) { - return $keys(O, enumBugKeys); -}; - -},{"106":106,"60":60}],108:[function(_dereq_,module,exports){ -exports.f = {}.propertyIsEnumerable; - -},{}],109:[function(_dereq_,module,exports){ -// most Object methods by ES6 should accept primitives -var $export = _dereq_(62); -var core = _dereq_(52); -var fails = _dereq_(64); -module.exports = function (KEY, exec) { - var fn = (core.Object || {})[KEY] || Object[KEY]; - var exp = {}; - exp[KEY] = exec(fn); - $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp); -}; - -},{"52":52,"62":62,"64":64}],110:[function(_dereq_,module,exports){ -var DESCRIPTORS = _dereq_(58); -var getKeys = _dereq_(107); -var toIObject = _dereq_(140); -var isEnum = _dereq_(108).f; -module.exports = function (isEntries) { - return function (it) { - var O = toIObject(it); - var keys = getKeys(O); - var length = keys.length; - var i = 0; - var result = []; - var key; - while (length > i) { - key = keys[i++]; - if (!DESCRIPTORS || isEnum.call(O, key)) { - result.push(isEntries ? [key, O[key]] : O[key]); - } - } - return result; - }; -}; - -},{"107":107,"108":108,"140":140,"58":58}],111:[function(_dereq_,module,exports){ -// all object keys, includes non-enumerable and symbols -var gOPN = _dereq_(103); -var gOPS = _dereq_(104); -var anObject = _dereq_(38); -var Reflect = _dereq_(70).Reflect; -module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) { - var keys = gOPN.f(anObject(it)); - var getSymbols = gOPS.f; - return getSymbols ? keys.concat(getSymbols(it)) : keys; -}; - -},{"103":103,"104":104,"38":38,"70":70}],112:[function(_dereq_,module,exports){ -var $parseFloat = _dereq_(70).parseFloat; -var $trim = _dereq_(134).trim; - -module.exports = 1 / $parseFloat(_dereq_(135) + '-0') !== -Infinity ? function parseFloat(str) { - var string = $trim(String(str), 3); - var result = $parseFloat(string); - return result === 0 && string.charAt(0) == '-' ? -0 : result; -} : $parseFloat; - -},{"134":134,"135":135,"70":70}],113:[function(_dereq_,module,exports){ -var $parseInt = _dereq_(70).parseInt; -var $trim = _dereq_(134).trim; -var ws = _dereq_(135); -var hex = /^[-+]?0[xX]/; - -module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) { - var string = $trim(String(str), 3); - return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); -} : $parseInt; - -},{"134":134,"135":135,"70":70}],114:[function(_dereq_,module,exports){ -module.exports = function (exec) { - try { - return { e: false, v: exec() }; - } catch (e) { - return { e: true, v: e }; - } -}; - -},{}],115:[function(_dereq_,module,exports){ -var anObject = _dereq_(38); -var isObject = _dereq_(81); -var newPromiseCapability = _dereq_(96); - -module.exports = function (C, x) { - anObject(C); - if (isObject(x) && x.constructor === C) return x; - var promiseCapability = newPromiseCapability.f(C); - var resolve = promiseCapability.resolve; - resolve(x); - return promiseCapability.promise; -}; - -},{"38":38,"81":81,"96":96}],116:[function(_dereq_,module,exports){ -arguments[4][30][0].apply(exports,arguments) -},{"30":30}],117:[function(_dereq_,module,exports){ -var redefine = _dereq_(118); -module.exports = function (target, src, safe) { - for (var key in src) redefine(target, key, src[key], safe); - return target; -}; - -},{"118":118}],118:[function(_dereq_,module,exports){ -var global = _dereq_(70); -var hide = _dereq_(72); -var has = _dereq_(71); -var SRC = _dereq_(147)('src'); -var $toString = _dereq_(69); -var TO_STRING = 'toString'; -var TPL = ('' + $toString).split(TO_STRING); - -_dereq_(52).inspectSource = function (it) { - return $toString.call(it); -}; - -(module.exports = function (O, key, val, safe) { - var isFunction = typeof val == 'function'; - if (isFunction) has(val, 'name') || hide(val, 'name', key); - if (O[key] === val) return; - if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); - if (O === global) { - O[key] = val; - } else if (!safe) { - delete O[key]; - hide(O, key, val); - } else if (O[key]) { - O[key] = val; - } else { - hide(O, key, val); - } -// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative -})(Function.prototype, TO_STRING, function toString() { - return typeof this == 'function' && this[SRC] || $toString.call(this); -}); - -},{"147":147,"52":52,"69":69,"70":70,"71":71,"72":72}],119:[function(_dereq_,module,exports){ -'use strict'; - -var classof = _dereq_(47); -var builtinExec = RegExp.prototype.exec; - - // `RegExpExec` abstract operation -// https://tc39.github.io/ecma262/#sec-regexpexec -module.exports = function (R, S) { - var exec = R.exec; - if (typeof exec === 'function') { - var result = exec.call(R, S); - if (typeof result !== 'object') { - throw new TypeError('RegExp exec method returned something other than an Object or null'); - } - return result; - } - if (classof(R) !== 'RegExp') { - throw new TypeError('RegExp#exec called on incompatible receiver'); - } - return builtinExec.call(R, S); -}; - -},{"47":47}],120:[function(_dereq_,module,exports){ -'use strict'; - -var regexpFlags = _dereq_(66); - -var nativeExec = RegExp.prototype.exec; -// This always refers to the native implementation, because the -// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js, -// which loads this file before patching the method. -var nativeReplace = String.prototype.replace; - -var patchedExec = nativeExec; - -var LAST_INDEX = 'lastIndex'; - -var UPDATES_LAST_INDEX_WRONG = (function () { - var re1 = /a/, - re2 = /b*/g; - nativeExec.call(re1, 'a'); - nativeExec.call(re2, 'a'); - return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0; -})(); - -// nonparticipating capturing group, copied from es5-shim's String#split patch. -var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; - -var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED; - -if (PATCH) { - patchedExec = function exec(str) { - var re = this; - var lastIndex, reCopy, match, i; - - if (NPCG_INCLUDED) { - reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re)); - } - if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX]; - - match = nativeExec.call(re, str); - - if (UPDATES_LAST_INDEX_WRONG && match) { - re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex; - } - if (NPCG_INCLUDED && match && match.length > 1) { - // Fix browsers whose `exec` methods don't consistently return `undefined` - // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/ - // eslint-disable-next-line no-loop-func - nativeReplace.call(match[0], reCopy, function () { - for (i = 1; i < arguments.length - 2; i++) { - if (arguments[i] === undefined) match[i] = undefined; - } - }); - } - - return match; - }; -} - -module.exports = patchedExec; - -},{"66":66}],121:[function(_dereq_,module,exports){ -// 7.2.9 SameValue(x, y) -module.exports = Object.is || function is(x, y) { - // eslint-disable-next-line no-self-compare - return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; -}; - -},{}],122:[function(_dereq_,module,exports){ -// Works with __proto__ only. Old v8 can't work with null proto objects. -/* eslint-disable no-proto */ -var isObject = _dereq_(81); -var anObject = _dereq_(38); -var check = function (O, proto) { - anObject(O); - if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); -}; -module.exports = { - set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line - function (test, buggy, set) { - try { - set = _dereq_(54)(Function.call, _dereq_(101).f(Object.prototype, '__proto__').set, 2); - set(test, []); - buggy = !(test instanceof Array); - } catch (e) { buggy = true; } - return function setPrototypeOf(O, proto) { - check(O, proto); - if (buggy) O.__proto__ = proto; - else set(O, proto); - return O; - }; - }({}, false) : undefined), - check: check -}; - -},{"101":101,"38":38,"54":54,"81":81}],123:[function(_dereq_,module,exports){ -'use strict'; -var global = _dereq_(70); -var dP = _dereq_(99); -var DESCRIPTORS = _dereq_(58); -var SPECIES = _dereq_(152)('species'); - -module.exports = function (KEY) { - var C = global[KEY]; - if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { - configurable: true, - get: function () { return this; } - }); -}; - -},{"152":152,"58":58,"70":70,"99":99}],124:[function(_dereq_,module,exports){ -var def = _dereq_(99).f; -var has = _dereq_(71); -var TAG = _dereq_(152)('toStringTag'); - -module.exports = function (it, tag, stat) { - if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); -}; - -},{"152":152,"71":71,"99":99}],125:[function(_dereq_,module,exports){ -var shared = _dereq_(126)('keys'); -var uid = _dereq_(147); -module.exports = function (key) { - return shared[key] || (shared[key] = uid(key)); -}; - -},{"126":126,"147":147}],126:[function(_dereq_,module,exports){ -var core = _dereq_(52); -var global = _dereq_(70); -var SHARED = '__core-js_shared__'; -var store = global[SHARED] || (global[SHARED] = {}); - -(module.exports = function (key, value) { - return store[key] || (store[key] = value !== undefined ? value : {}); -})('versions', []).push({ - version: core.version, - mode: _dereq_(89) ? 'pure' : 'global', - copyright: '© 2019 Denis Pushkarev (zloirock.ru)' -}); - -},{"52":52,"70":70,"89":89}],127:[function(_dereq_,module,exports){ -// 7.3.20 SpeciesConstructor(O, defaultConstructor) -var anObject = _dereq_(38); -var aFunction = _dereq_(33); -var SPECIES = _dereq_(152)('species'); -module.exports = function (O, D) { - var C = anObject(O).constructor; - var S; - return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); -}; - -},{"152":152,"33":33,"38":38}],128:[function(_dereq_,module,exports){ -'use strict'; -var fails = _dereq_(64); - -module.exports = function (method, arg) { - return !!method && fails(function () { - // eslint-disable-next-line no-useless-call - arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null); - }); -}; - -},{"64":64}],129:[function(_dereq_,module,exports){ -var toInteger = _dereq_(139); -var defined = _dereq_(57); -// true -> String#at -// false -> String#codePointAt -module.exports = function (TO_STRING) { - return function (that, pos) { - var s = String(defined(that)); - var i = toInteger(pos); - var l = s.length; - var a, b; - if (i < 0 || i >= l) return TO_STRING ? '' : undefined; - a = s.charCodeAt(i); - return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff - ? TO_STRING ? s.charAt(i) : a - : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; - }; -}; - -},{"139":139,"57":57}],130:[function(_dereq_,module,exports){ -// helper for String#{startsWith, endsWith, includes} -var isRegExp = _dereq_(82); -var defined = _dereq_(57); - -module.exports = function (that, searchString, NAME) { - if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!"); - return String(defined(that)); -}; - -},{"57":57,"82":82}],131:[function(_dereq_,module,exports){ -var $export = _dereq_(62); -var fails = _dereq_(64); -var defined = _dereq_(57); -var quot = /"/g; -// B.2.3.2.1 CreateHTML(string, tag, attribute, value) -var createHTML = function (string, tag, attribute, value) { - var S = String(defined(string)); - var p1 = '<' + tag; - if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; - return p1 + '>' + S + ''; -}; -module.exports = function (NAME, exec) { - var O = {}; - O[NAME] = exec(createHTML); - $export($export.P + $export.F * fails(function () { - var test = ''[NAME]('"'); - return test !== test.toLowerCase() || test.split('"').length > 3; - }), 'String', O); -}; - -},{"57":57,"62":62,"64":64}],132:[function(_dereq_,module,exports){ -// https://github.com/tc39/proposal-string-pad-start-end -var toLength = _dereq_(141); -var repeat = _dereq_(133); -var defined = _dereq_(57); - -module.exports = function (that, maxLength, fillString, left) { - var S = String(defined(that)); - var stringLength = S.length; - var fillStr = fillString === undefined ? ' ' : String(fillString); - var intMaxLength = toLength(maxLength); - if (intMaxLength <= stringLength || fillStr == '') return S; - var fillLen = intMaxLength - stringLength; - var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); - if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen); - return left ? stringFiller + S : S + stringFiller; -}; - -},{"133":133,"141":141,"57":57}],133:[function(_dereq_,module,exports){ -'use strict'; -var toInteger = _dereq_(139); -var defined = _dereq_(57); - -module.exports = function repeat(count) { - var str = String(defined(this)); - var res = ''; - var n = toInteger(count); - if (n < 0 || n == Infinity) throw RangeError("Count can't be negative"); - for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str; - return res; -}; - -},{"139":139,"57":57}],134:[function(_dereq_,module,exports){ -var $export = _dereq_(62); -var defined = _dereq_(57); -var fails = _dereq_(64); -var spaces = _dereq_(135); -var space = '[' + spaces + ']'; -var non = '\u200b\u0085'; -var ltrim = RegExp('^' + space + space + '*'); -var rtrim = RegExp(space + space + '*$'); - -var exporter = function (KEY, exec, ALIAS) { - var exp = {}; - var FORCE = fails(function () { - return !!spaces[KEY]() || non[KEY]() != non; - }); - var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; - if (ALIAS) exp[ALIAS] = fn; - $export($export.P + $export.F * FORCE, 'String', exp); -}; - -// 1 -> String#trimLeft -// 2 -> String#trimRight -// 3 -> String#trim -var trim = exporter.trim = function (string, TYPE) { - string = String(defined(string)); - if (TYPE & 1) string = string.replace(ltrim, ''); - if (TYPE & 2) string = string.replace(rtrim, ''); - return string; -}; - -module.exports = exporter; - -},{"135":135,"57":57,"62":62,"64":64}],135:[function(_dereq_,module,exports){ -module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + - '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; - -},{}],136:[function(_dereq_,module,exports){ -var ctx = _dereq_(54); -var invoke = _dereq_(76); -var html = _dereq_(73); -var cel = _dereq_(59); -var global = _dereq_(70); -var process = global.process; -var setTask = global.setImmediate; -var clearTask = global.clearImmediate; -var MessageChannel = global.MessageChannel; -var Dispatch = global.Dispatch; -var counter = 0; -var queue = {}; -var ONREADYSTATECHANGE = 'onreadystatechange'; -var defer, channel, port; -var run = function () { - var id = +this; - // eslint-disable-next-line no-prototype-builtins - if (queue.hasOwnProperty(id)) { - var fn = queue[id]; - delete queue[id]; - fn(); - } -}; -var listener = function (event) { - run.call(event.data); -}; -// Node.js 0.9+ & IE10+ has setImmediate, otherwise: -if (!setTask || !clearTask) { - setTask = function setImmediate(fn) { - var args = []; - var i = 1; - while (arguments.length > i) args.push(arguments[i++]); - queue[++counter] = function () { - // eslint-disable-next-line no-new-func - invoke(typeof fn == 'function' ? fn : Function(fn), args); - }; - defer(counter); - return counter; - }; - clearTask = function clearImmediate(id) { - delete queue[id]; - }; - // Node.js 0.8- - if (_dereq_(48)(process) == 'process') { - defer = function (id) { - process.nextTick(ctx(run, id, 1)); - }; - // Sphere (JS game engine) Dispatch API - } else if (Dispatch && Dispatch.now) { - defer = function (id) { - Dispatch.now(ctx(run, id, 1)); - }; - // Browsers with MessageChannel, includes WebWorkers - } else if (MessageChannel) { - channel = new MessageChannel(); - port = channel.port2; - channel.port1.onmessage = listener; - defer = ctx(port.postMessage, port, 1); - // Browsers with postMessage, skip WebWorkers - // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' - } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { - defer = function (id) { - global.postMessage(id + '', '*'); - }; - global.addEventListener('message', listener, false); - // IE8- - } else if (ONREADYSTATECHANGE in cel('script')) { - defer = function (id) { - html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { - html.removeChild(this); - run.call(id); - }; - }; - // Rest old browsers - } else { - defer = function (id) { - setTimeout(ctx(run, id, 1), 0); - }; - } -} -module.exports = { - set: setTask, - clear: clearTask -}; - -},{"48":48,"54":54,"59":59,"70":70,"73":73,"76":76}],137:[function(_dereq_,module,exports){ -var toInteger = _dereq_(139); -var max = Math.max; -var min = Math.min; -module.exports = function (index, length) { - index = toInteger(index); - return index < 0 ? max(index + length, 0) : min(index, length); -}; - -},{"139":139}],138:[function(_dereq_,module,exports){ -// https://tc39.github.io/ecma262/#sec-toindex -var toInteger = _dereq_(139); -var toLength = _dereq_(141); -module.exports = function (it) { - if (it === undefined) return 0; - var number = toInteger(it); - var length = toLength(number); - if (number !== length) throw RangeError('Wrong length!'); - return length; -}; - -},{"139":139,"141":141}],139:[function(_dereq_,module,exports){ -// 7.1.4 ToInteger -var ceil = Math.ceil; -var floor = Math.floor; -module.exports = function (it) { - return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); -}; - -},{}],140:[function(_dereq_,module,exports){ -// to indexed object, toObject with fallback for non-array-like ES3 strings -var IObject = _dereq_(77); -var defined = _dereq_(57); -module.exports = function (it) { - return IObject(defined(it)); -}; - -},{"57":57,"77":77}],141:[function(_dereq_,module,exports){ -// 7.1.15 ToLength -var toInteger = _dereq_(139); -var min = Math.min; -module.exports = function (it) { - return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 -}; - -},{"139":139}],142:[function(_dereq_,module,exports){ -// 7.1.13 ToObject(argument) -var defined = _dereq_(57); -module.exports = function (it) { - return Object(defined(it)); -}; - -},{"57":57}],143:[function(_dereq_,module,exports){ -arguments[4][31][0].apply(exports,arguments) -},{"31":31,"81":81}],144:[function(_dereq_,module,exports){ -'use strict'; -if (_dereq_(58)) { - var LIBRARY = _dereq_(89); - var global = _dereq_(70); - var fails = _dereq_(64); - var $export = _dereq_(62); - var $typed = _dereq_(146); - var $buffer = _dereq_(145); - var ctx = _dereq_(54); - var anInstance = _dereq_(37); - var propertyDesc = _dereq_(116); - var hide = _dereq_(72); - var redefineAll = _dereq_(117); - var toInteger = _dereq_(139); - var toLength = _dereq_(141); - var toIndex = _dereq_(138); - var toAbsoluteIndex = _dereq_(137); - var toPrimitive = _dereq_(143); - var has = _dereq_(71); - var classof = _dereq_(47); - var isObject = _dereq_(81); - var toObject = _dereq_(142); - var isArrayIter = _dereq_(78); - var create = _dereq_(98); - var getPrototypeOf = _dereq_(105); - var gOPN = _dereq_(103).f; - var getIterFn = _dereq_(153); - var uid = _dereq_(147); - var wks = _dereq_(152); - var createArrayMethod = _dereq_(42); - var createArrayIncludes = _dereq_(41); - var speciesConstructor = _dereq_(127); - var ArrayIterators = _dereq_(164); - var Iterators = _dereq_(88); - var $iterDetect = _dereq_(86); - var setSpecies = _dereq_(123); - var arrayFill = _dereq_(40); - var arrayCopyWithin = _dereq_(39); - var $DP = _dereq_(99); - var $GOPD = _dereq_(101); - var dP = $DP.f; - var gOPD = $GOPD.f; - var RangeError = global.RangeError; - var TypeError = global.TypeError; - var Uint8Array = global.Uint8Array; - var ARRAY_BUFFER = 'ArrayBuffer'; - var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER; - var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; - var PROTOTYPE = 'prototype'; - var ArrayProto = Array[PROTOTYPE]; - var $ArrayBuffer = $buffer.ArrayBuffer; - var $DataView = $buffer.DataView; - var arrayForEach = createArrayMethod(0); - var arrayFilter = createArrayMethod(2); - var arraySome = createArrayMethod(3); - var arrayEvery = createArrayMethod(4); - var arrayFind = createArrayMethod(5); - var arrayFindIndex = createArrayMethod(6); - var arrayIncludes = createArrayIncludes(true); - var arrayIndexOf = createArrayIncludes(false); - var arrayValues = ArrayIterators.values; - var arrayKeys = ArrayIterators.keys; - var arrayEntries = ArrayIterators.entries; - var arrayLastIndexOf = ArrayProto.lastIndexOf; - var arrayReduce = ArrayProto.reduce; - var arrayReduceRight = ArrayProto.reduceRight; - var arrayJoin = ArrayProto.join; - var arraySort = ArrayProto.sort; - var arraySlice = ArrayProto.slice; - var arrayToString = ArrayProto.toString; - var arrayToLocaleString = ArrayProto.toLocaleString; - var ITERATOR = wks('iterator'); - var TAG = wks('toStringTag'); - var TYPED_CONSTRUCTOR = uid('typed_constructor'); - var DEF_CONSTRUCTOR = uid('def_constructor'); - var ALL_CONSTRUCTORS = $typed.CONSTR; - var TYPED_ARRAY = $typed.TYPED; - var VIEW = $typed.VIEW; - var WRONG_LENGTH = 'Wrong length!'; - - var $map = createArrayMethod(1, function (O, length) { - return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); - }); - - var LITTLE_ENDIAN = fails(function () { - // eslint-disable-next-line no-undef - return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1; - }); - - var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () { - new Uint8Array(1).set({}); - }); - - var toOffset = function (it, BYTES) { - var offset = toInteger(it); - if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!'); - return offset; - }; - - var validate = function (it) { - if (isObject(it) && TYPED_ARRAY in it) return it; - throw TypeError(it + ' is not a typed array!'); - }; - - var allocate = function (C, length) { - if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) { - throw TypeError('It is not a typed array constructor!'); - } return new C(length); - }; - - var speciesFromList = function (O, list) { - return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); - }; - - var fromList = function (C, list) { - var index = 0; - var length = list.length; - var result = allocate(C, length); - while (length > index) result[index] = list[index++]; - return result; - }; - - var addGetter = function (it, key, internal) { - dP(it, key, { get: function () { return this._d[internal]; } }); - }; - - var $from = function from(source /* , mapfn, thisArg */) { - var O = toObject(source); - var aLen = arguments.length; - var mapfn = aLen > 1 ? arguments[1] : undefined; - var mapping = mapfn !== undefined; - var iterFn = getIterFn(O); - var i, length, values, result, step, iterator; - if (iterFn != undefined && !isArrayIter(iterFn)) { - for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) { - values.push(step.value); - } O = values; - } - if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2); - for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) { - result[i] = mapping ? mapfn(O[i], i) : O[i]; - } - return result; - }; - - var $of = function of(/* ...items */) { - var index = 0; - var length = arguments.length; - var result = allocate(this, length); - while (length > index) result[index] = arguments[index++]; - return result; - }; - - // iOS Safari 6.x fails here - var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); }); - - var $toLocaleString = function toLocaleString() { - return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); - }; - - var proto = { - copyWithin: function copyWithin(target, start /* , end */) { - return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined); - }, - every: function every(callbackfn /* , thisArg */) { - return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - }, - fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars - return arrayFill.apply(validate(this), arguments); - }, - filter: function filter(callbackfn /* , thisArg */) { - return speciesFromList(this, arrayFilter(validate(this), callbackfn, - arguments.length > 1 ? arguments[1] : undefined)); - }, - find: function find(predicate /* , thisArg */) { - return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); - }, - findIndex: function findIndex(predicate /* , thisArg */) { - return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); - }, - forEach: function forEach(callbackfn /* , thisArg */) { - arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - }, - indexOf: function indexOf(searchElement /* , fromIndex */) { - return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); - }, - includes: function includes(searchElement /* , fromIndex */) { - return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); - }, - join: function join(separator) { // eslint-disable-line no-unused-vars - return arrayJoin.apply(validate(this), arguments); - }, - lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars - return arrayLastIndexOf.apply(validate(this), arguments); - }, - map: function map(mapfn /* , thisArg */) { - return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined); - }, - reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars - return arrayReduce.apply(validate(this), arguments); - }, - reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars - return arrayReduceRight.apply(validate(this), arguments); - }, - reverse: function reverse() { - var that = this; - var length = validate(that).length; - var middle = Math.floor(length / 2); - var index = 0; - var value; - while (index < middle) { - value = that[index]; - that[index++] = that[--length]; - that[length] = value; - } return that; - }, - some: function some(callbackfn /* , thisArg */) { - return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - }, - sort: function sort(comparefn) { - return arraySort.call(validate(this), comparefn); - }, - subarray: function subarray(begin, end) { - var O = validate(this); - var length = O.length; - var $begin = toAbsoluteIndex(begin, length); - return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))( - O.buffer, - O.byteOffset + $begin * O.BYTES_PER_ELEMENT, - toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin) - ); - } - }; - - var $slice = function slice(start, end) { - return speciesFromList(this, arraySlice.call(validate(this), start, end)); - }; - - var $set = function set(arrayLike /* , offset */) { - validate(this); - var offset = toOffset(arguments[1], 1); - var length = this.length; - var src = toObject(arrayLike); - var len = toLength(src.length); - var index = 0; - if (len + offset > length) throw RangeError(WRONG_LENGTH); - while (index < len) this[offset + index] = src[index++]; - }; - - var $iterators = { - entries: function entries() { - return arrayEntries.call(validate(this)); - }, - keys: function keys() { - return arrayKeys.call(validate(this)); - }, - values: function values() { - return arrayValues.call(validate(this)); - } - }; - - var isTAIndex = function (target, key) { - return isObject(target) - && target[TYPED_ARRAY] - && typeof key != 'symbol' - && key in target - && String(+key) == String(key); - }; - var $getDesc = function getOwnPropertyDescriptor(target, key) { - return isTAIndex(target, key = toPrimitive(key, true)) - ? propertyDesc(2, target[key]) - : gOPD(target, key); - }; - var $setDesc = function defineProperty(target, key, desc) { - if (isTAIndex(target, key = toPrimitive(key, true)) - && isObject(desc) - && has(desc, 'value') - && !has(desc, 'get') - && !has(desc, 'set') - // TODO: add validation descriptor w/o calling accessors - && !desc.configurable - && (!has(desc, 'writable') || desc.writable) - && (!has(desc, 'enumerable') || desc.enumerable) - ) { - target[key] = desc.value; - return target; - } return dP(target, key, desc); - }; - - if (!ALL_CONSTRUCTORS) { - $GOPD.f = $getDesc; - $DP.f = $setDesc; - } - - $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { - getOwnPropertyDescriptor: $getDesc, - defineProperty: $setDesc - }); - - if (fails(function () { arrayToString.call({}); })) { - arrayToString = arrayToLocaleString = function toString() { - return arrayJoin.call(this); - }; - } - - var $TypedArrayPrototype$ = redefineAll({}, proto); - redefineAll($TypedArrayPrototype$, $iterators); - hide($TypedArrayPrototype$, ITERATOR, $iterators.values); - redefineAll($TypedArrayPrototype$, { - slice: $slice, - set: $set, - constructor: function () { /* noop */ }, - toString: arrayToString, - toLocaleString: $toLocaleString - }); - addGetter($TypedArrayPrototype$, 'buffer', 'b'); - addGetter($TypedArrayPrototype$, 'byteOffset', 'o'); - addGetter($TypedArrayPrototype$, 'byteLength', 'l'); - addGetter($TypedArrayPrototype$, 'length', 'e'); - dP($TypedArrayPrototype$, TAG, { - get: function () { return this[TYPED_ARRAY]; } - }); - - // eslint-disable-next-line max-statements - module.exports = function (KEY, BYTES, wrapper, CLAMPED) { - CLAMPED = !!CLAMPED; - var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array'; - var GETTER = 'get' + KEY; - var SETTER = 'set' + KEY; - var TypedArray = global[NAME]; - var Base = TypedArray || {}; - var TAC = TypedArray && getPrototypeOf(TypedArray); - var FORCED = !TypedArray || !$typed.ABV; - var O = {}; - var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE]; - var getter = function (that, index) { - var data = that._d; - return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); - }; - var setter = function (that, index, value) { - var data = that._d; - if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff; - data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); - }; - var addElement = function (that, index) { - dP(that, index, { - get: function () { - return getter(this, index); - }, - set: function (value) { - return setter(this, index, value); - }, - enumerable: true - }); - }; - if (FORCED) { - TypedArray = wrapper(function (that, data, $offset, $length) { - anInstance(that, TypedArray, NAME, '_d'); - var index = 0; - var offset = 0; - var buffer, byteLength, length, klass; - if (!isObject(data)) { - length = toIndex(data); - byteLength = length * BYTES; - buffer = new $ArrayBuffer(byteLength); - } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { - buffer = data; - offset = toOffset($offset, BYTES); - var $len = data.byteLength; - if ($length === undefined) { - if ($len % BYTES) throw RangeError(WRONG_LENGTH); - byteLength = $len - offset; - if (byteLength < 0) throw RangeError(WRONG_LENGTH); - } else { - byteLength = toLength($length) * BYTES; - if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH); - } - length = byteLength / BYTES; - } else if (TYPED_ARRAY in data) { - return fromList(TypedArray, data); - } else { - return $from.call(TypedArray, data); - } - hide(that, '_d', { - b: buffer, - o: offset, - l: byteLength, - e: length, - v: new $DataView(buffer) - }); - while (index < length) addElement(that, index++); - }); - TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$); - hide(TypedArrayPrototype, 'constructor', TypedArray); - } else if (!fails(function () { - TypedArray(1); - }) || !fails(function () { - new TypedArray(-1); // eslint-disable-line no-new - }) || !$iterDetect(function (iter) { - new TypedArray(); // eslint-disable-line no-new - new TypedArray(null); // eslint-disable-line no-new - new TypedArray(1.5); // eslint-disable-line no-new - new TypedArray(iter); // eslint-disable-line no-new - }, true)) { - TypedArray = wrapper(function (that, data, $offset, $length) { - anInstance(that, TypedArray, NAME); - var klass; - // `ws` module bug, temporarily remove validation length for Uint8Array - // https://github.com/websockets/ws/pull/645 - if (!isObject(data)) return new Base(toIndex(data)); - if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { - return $length !== undefined - ? new Base(data, toOffset($offset, BYTES), $length) - : $offset !== undefined - ? new Base(data, toOffset($offset, BYTES)) - : new Base(data); - } - if (TYPED_ARRAY in data) return fromList(TypedArray, data); - return $from.call(TypedArray, data); - }); - arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) { - if (!(key in TypedArray)) hide(TypedArray, key, Base[key]); - }); - TypedArray[PROTOTYPE] = TypedArrayPrototype; - if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray; - } - var $nativeIterator = TypedArrayPrototype[ITERATOR]; - var CORRECT_ITER_NAME = !!$nativeIterator - && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined); - var $iterator = $iterators.values; - hide(TypedArray, TYPED_CONSTRUCTOR, true); - hide(TypedArrayPrototype, TYPED_ARRAY, NAME); - hide(TypedArrayPrototype, VIEW, true); - hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray); - - if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) { - dP(TypedArrayPrototype, TAG, { - get: function () { return NAME; } - }); - } - - O[NAME] = TypedArray; - - $export($export.G + $export.W + $export.F * (TypedArray != Base), O); - - $export($export.S, NAME, { - BYTES_PER_ELEMENT: BYTES - }); - - $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, { - from: $from, - of: $of - }); - - if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES); - - $export($export.P, NAME, proto); - - setSpecies(NAME); - - $export($export.P + $export.F * FORCED_SET, NAME, { set: $set }); - - $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators); - - if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString; - - $export($export.P + $export.F * fails(function () { - new TypedArray(1).slice(); - }), NAME, { slice: $slice }); - - $export($export.P + $export.F * (fails(function () { - return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString(); - }) || !fails(function () { - TypedArrayPrototype.toLocaleString.call([1, 2]); - })), NAME, { toLocaleString: $toLocaleString }); - - Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator; - if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator); - }; -} else module.exports = function () { /* empty */ }; - -},{"101":101,"103":103,"105":105,"116":116,"117":117,"123":123,"127":127,"137":137,"138":138,"139":139,"141":141,"142":142,"143":143,"145":145,"146":146,"147":147,"152":152,"153":153,"164":164,"37":37,"39":39,"40":40,"41":41,"42":42,"47":47,"54":54,"58":58,"62":62,"64":64,"70":70,"71":71,"72":72,"78":78,"81":81,"86":86,"88":88,"89":89,"98":98,"99":99}],145:[function(_dereq_,module,exports){ -'use strict'; -var global = _dereq_(70); -var DESCRIPTORS = _dereq_(58); -var LIBRARY = _dereq_(89); -var $typed = _dereq_(146); -var hide = _dereq_(72); -var redefineAll = _dereq_(117); -var fails = _dereq_(64); -var anInstance = _dereq_(37); -var toInteger = _dereq_(139); -var toLength = _dereq_(141); -var toIndex = _dereq_(138); -var gOPN = _dereq_(103).f; -var dP = _dereq_(99).f; -var arrayFill = _dereq_(40); -var setToStringTag = _dereq_(124); -var ARRAY_BUFFER = 'ArrayBuffer'; -var DATA_VIEW = 'DataView'; -var PROTOTYPE = 'prototype'; -var WRONG_LENGTH = 'Wrong length!'; -var WRONG_INDEX = 'Wrong index!'; -var $ArrayBuffer = global[ARRAY_BUFFER]; -var $DataView = global[DATA_VIEW]; -var Math = global.Math; -var RangeError = global.RangeError; -// eslint-disable-next-line no-shadow-restricted-names -var Infinity = global.Infinity; -var BaseBuffer = $ArrayBuffer; -var abs = Math.abs; -var pow = Math.pow; -var floor = Math.floor; -var log = Math.log; -var LN2 = Math.LN2; -var BUFFER = 'buffer'; -var BYTE_LENGTH = 'byteLength'; -var BYTE_OFFSET = 'byteOffset'; -var $BUFFER = DESCRIPTORS ? '_b' : BUFFER; -var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH; -var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET; - -// IEEE754 conversions based on https://github.com/feross/ieee754 -function packIEEE754(value, mLen, nBytes) { - var buffer = new Array(nBytes); - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0; - var i = 0; - var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; - var e, m, c; - value = abs(value); - // eslint-disable-next-line no-self-compare - if (value != value || value === Infinity) { - // eslint-disable-next-line no-self-compare - m = value != value ? 1 : 0; - e = eMax; - } else { - e = floor(log(value) / LN2); - if (value * (c = pow(2, -e)) < 1) { - e--; - c *= 2; - } - if (e + eBias >= 1) { - value += rt / c; - } else { - value += rt * pow(2, 1 - eBias); - } - if (value * c >= 2) { - e++; - c /= 2; - } - if (e + eBias >= eMax) { - m = 0; - e = eMax; - } else if (e + eBias >= 1) { - m = (value * c - 1) * pow(2, mLen); - e = e + eBias; - } else { - m = value * pow(2, eBias - 1) * pow(2, mLen); - e = 0; - } - } - for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); - e = e << mLen | m; - eLen += mLen; - for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); - buffer[--i] |= s * 128; - return buffer; -} -function unpackIEEE754(buffer, mLen, nBytes) { - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var nBits = eLen - 7; - var i = nBytes - 1; - var s = buffer[i--]; - var e = s & 127; - var m; - s >>= 7; - for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8); - m = e & (1 << -nBits) - 1; - e >>= -nBits; - nBits += mLen; - for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8); - if (e === 0) { - e = 1 - eBias; - } else if (e === eMax) { - return m ? NaN : s ? -Infinity : Infinity; - } else { - m = m + pow(2, mLen); - e = e - eBias; - } return (s ? -1 : 1) * m * pow(2, e - mLen); -} - -function unpackI32(bytes) { - return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; -} -function packI8(it) { - return [it & 0xff]; -} -function packI16(it) { - return [it & 0xff, it >> 8 & 0xff]; -} -function packI32(it) { - return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff]; -} -function packF64(it) { - return packIEEE754(it, 52, 8); -} -function packF32(it) { - return packIEEE754(it, 23, 4); -} - -function addGetter(C, key, internal) { - dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } }); -} - -function get(view, bytes, index, isLittleEndian) { - var numIndex = +index; - var intIndex = toIndex(numIndex); - if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); - var store = view[$BUFFER]._b; - var start = intIndex + view[$OFFSET]; - var pack = store.slice(start, start + bytes); - return isLittleEndian ? pack : pack.reverse(); -} -function set(view, bytes, index, conversion, value, isLittleEndian) { - var numIndex = +index; - var intIndex = toIndex(numIndex); - if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); - var store = view[$BUFFER]._b; - var start = intIndex + view[$OFFSET]; - var pack = conversion(+value); - for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1]; -} - -if (!$typed.ABV) { - $ArrayBuffer = function ArrayBuffer(length) { - anInstance(this, $ArrayBuffer, ARRAY_BUFFER); - var byteLength = toIndex(length); - this._b = arrayFill.call(new Array(byteLength), 0); - this[$LENGTH] = byteLength; - }; - - $DataView = function DataView(buffer, byteOffset, byteLength) { - anInstance(this, $DataView, DATA_VIEW); - anInstance(buffer, $ArrayBuffer, DATA_VIEW); - var bufferLength = buffer[$LENGTH]; - var offset = toInteger(byteOffset); - if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!'); - byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); - if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); - this[$BUFFER] = buffer; - this[$OFFSET] = offset; - this[$LENGTH] = byteLength; - }; - - if (DESCRIPTORS) { - addGetter($ArrayBuffer, BYTE_LENGTH, '_l'); - addGetter($DataView, BUFFER, '_b'); - addGetter($DataView, BYTE_LENGTH, '_l'); - addGetter($DataView, BYTE_OFFSET, '_o'); - } - - redefineAll($DataView[PROTOTYPE], { - getInt8: function getInt8(byteOffset) { - return get(this, 1, byteOffset)[0] << 24 >> 24; - }, - getUint8: function getUint8(byteOffset) { - return get(this, 1, byteOffset)[0]; - }, - getInt16: function getInt16(byteOffset /* , littleEndian */) { - var bytes = get(this, 2, byteOffset, arguments[1]); - return (bytes[1] << 8 | bytes[0]) << 16 >> 16; - }, - getUint16: function getUint16(byteOffset /* , littleEndian */) { - var bytes = get(this, 2, byteOffset, arguments[1]); - return bytes[1] << 8 | bytes[0]; - }, - getInt32: function getInt32(byteOffset /* , littleEndian */) { - return unpackI32(get(this, 4, byteOffset, arguments[1])); - }, - getUint32: function getUint32(byteOffset /* , littleEndian */) { - return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0; - }, - getFloat32: function getFloat32(byteOffset /* , littleEndian */) { - return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4); - }, - getFloat64: function getFloat64(byteOffset /* , littleEndian */) { - return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8); - }, - setInt8: function setInt8(byteOffset, value) { - set(this, 1, byteOffset, packI8, value); - }, - setUint8: function setUint8(byteOffset, value) { - set(this, 1, byteOffset, packI8, value); - }, - setInt16: function setInt16(byteOffset, value /* , littleEndian */) { - set(this, 2, byteOffset, packI16, value, arguments[2]); - }, - setUint16: function setUint16(byteOffset, value /* , littleEndian */) { - set(this, 2, byteOffset, packI16, value, arguments[2]); - }, - setInt32: function setInt32(byteOffset, value /* , littleEndian */) { - set(this, 4, byteOffset, packI32, value, arguments[2]); - }, - setUint32: function setUint32(byteOffset, value /* , littleEndian */) { - set(this, 4, byteOffset, packI32, value, arguments[2]); - }, - setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { - set(this, 4, byteOffset, packF32, value, arguments[2]); - }, - setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { - set(this, 8, byteOffset, packF64, value, arguments[2]); - } - }); -} else { - if (!fails(function () { - $ArrayBuffer(1); - }) || !fails(function () { - new $ArrayBuffer(-1); // eslint-disable-line no-new - }) || fails(function () { - new $ArrayBuffer(); // eslint-disable-line no-new - new $ArrayBuffer(1.5); // eslint-disable-line no-new - new $ArrayBuffer(NaN); // eslint-disable-line no-new - return $ArrayBuffer.name != ARRAY_BUFFER; - })) { - $ArrayBuffer = function ArrayBuffer(length) { - anInstance(this, $ArrayBuffer); - return new BaseBuffer(toIndex(length)); - }; - var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE]; - for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) { - if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]); - } - if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer; - } - // iOS Safari 7.x bug - var view = new $DataView(new $ArrayBuffer(2)); - var $setInt8 = $DataView[PROTOTYPE].setInt8; - view.setInt8(0, 2147483648); - view.setInt8(1, 2147483649); - if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], { - setInt8: function setInt8(byteOffset, value) { - $setInt8.call(this, byteOffset, value << 24 >> 24); - }, - setUint8: function setUint8(byteOffset, value) { - $setInt8.call(this, byteOffset, value << 24 >> 24); - } - }, true); -} -setToStringTag($ArrayBuffer, ARRAY_BUFFER); -setToStringTag($DataView, DATA_VIEW); -hide($DataView[PROTOTYPE], $typed.VIEW, true); -exports[ARRAY_BUFFER] = $ArrayBuffer; -exports[DATA_VIEW] = $DataView; - -},{"103":103,"117":117,"124":124,"138":138,"139":139,"141":141,"146":146,"37":37,"40":40,"58":58,"64":64,"70":70,"72":72,"89":89,"99":99}],146:[function(_dereq_,module,exports){ -var global = _dereq_(70); -var hide = _dereq_(72); -var uid = _dereq_(147); -var TYPED = uid('typed_array'); -var VIEW = uid('view'); -var ABV = !!(global.ArrayBuffer && global.DataView); -var CONSTR = ABV; -var i = 0; -var l = 9; -var Typed; - -var TypedArrayConstructors = ( - 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array' -).split(','); - -while (i < l) { - if (Typed = global[TypedArrayConstructors[i++]]) { - hide(Typed.prototype, TYPED, true); - hide(Typed.prototype, VIEW, true); - } else CONSTR = false; -} - -module.exports = { - ABV: ABV, - CONSTR: CONSTR, - TYPED: TYPED, - VIEW: VIEW -}; - -},{"147":147,"70":70,"72":72}],147:[function(_dereq_,module,exports){ -var id = 0; -var px = Math.random(); -module.exports = function (key) { - return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); -}; - -},{}],148:[function(_dereq_,module,exports){ -var global = _dereq_(70); -var navigator = global.navigator; - -module.exports = navigator && navigator.userAgent || ''; - -},{"70":70}],149:[function(_dereq_,module,exports){ -var isObject = _dereq_(81); -module.exports = function (it, TYPE) { - if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); - return it; -}; - -},{"81":81}],150:[function(_dereq_,module,exports){ -var global = _dereq_(70); -var core = _dereq_(52); -var LIBRARY = _dereq_(89); -var wksExt = _dereq_(151); -var defineProperty = _dereq_(99).f; -module.exports = function (name) { - var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); - if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) }); -}; - -},{"151":151,"52":52,"70":70,"89":89,"99":99}],151:[function(_dereq_,module,exports){ -exports.f = _dereq_(152); - -},{"152":152}],152:[function(_dereq_,module,exports){ -var store = _dereq_(126)('wks'); -var uid = _dereq_(147); -var Symbol = _dereq_(70).Symbol; -var USE_SYMBOL = typeof Symbol == 'function'; - -var $exports = module.exports = function (name) { - return store[name] || (store[name] = - USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); -}; - -$exports.store = store; - -},{"126":126,"147":147,"70":70}],153:[function(_dereq_,module,exports){ -var classof = _dereq_(47); -var ITERATOR = _dereq_(152)('iterator'); -var Iterators = _dereq_(88); -module.exports = _dereq_(52).getIteratorMethod = function (it) { - if (it != undefined) return it[ITERATOR] - || it['@@iterator'] - || Iterators[classof(it)]; -}; - -},{"152":152,"47":47,"52":52,"88":88}],154:[function(_dereq_,module,exports){ -// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) -var $export = _dereq_(62); - -$export($export.P, 'Array', { copyWithin: _dereq_(39) }); - -_dereq_(35)('copyWithin'); - -},{"35":35,"39":39,"62":62}],155:[function(_dereq_,module,exports){ -'use strict'; -var $export = _dereq_(62); -var $every = _dereq_(42)(4); - -$export($export.P + $export.F * !_dereq_(128)([].every, true), 'Array', { - // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) - every: function every(callbackfn /* , thisArg */) { - return $every(this, callbackfn, arguments[1]); - } -}); - -},{"128":128,"42":42,"62":62}],156:[function(_dereq_,module,exports){ -// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) -var $export = _dereq_(62); - -$export($export.P, 'Array', { fill: _dereq_(40) }); - -_dereq_(35)('fill'); - -},{"35":35,"40":40,"62":62}],157:[function(_dereq_,module,exports){ -'use strict'; -var $export = _dereq_(62); -var $filter = _dereq_(42)(2); - -$export($export.P + $export.F * !_dereq_(128)([].filter, true), 'Array', { - // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) - filter: function filter(callbackfn /* , thisArg */) { - return $filter(this, callbackfn, arguments[1]); - } -}); - -},{"128":128,"42":42,"62":62}],158:[function(_dereq_,module,exports){ -'use strict'; -// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) -var $export = _dereq_(62); -var $find = _dereq_(42)(6); -var KEY = 'findIndex'; -var forced = true; -// Shouldn't skip holes -if (KEY in []) Array(1)[KEY](function () { forced = false; }); -$export($export.P + $export.F * forced, 'Array', { - findIndex: function findIndex(callbackfn /* , that = undefined */) { - return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } -}); -_dereq_(35)(KEY); - -},{"35":35,"42":42,"62":62}],159:[function(_dereq_,module,exports){ -'use strict'; -// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) -var $export = _dereq_(62); -var $find = _dereq_(42)(5); -var KEY = 'find'; -var forced = true; -// Shouldn't skip holes -if (KEY in []) Array(1)[KEY](function () { forced = false; }); -$export($export.P + $export.F * forced, 'Array', { - find: function find(callbackfn /* , that = undefined */) { - return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } -}); -_dereq_(35)(KEY); - -},{"35":35,"42":42,"62":62}],160:[function(_dereq_,module,exports){ -'use strict'; -var $export = _dereq_(62); -var $forEach = _dereq_(42)(0); -var STRICT = _dereq_(128)([].forEach, true); - -$export($export.P + $export.F * !STRICT, 'Array', { - // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) - forEach: function forEach(callbackfn /* , thisArg */) { - return $forEach(this, callbackfn, arguments[1]); - } -}); - -},{"128":128,"42":42,"62":62}],161:[function(_dereq_,module,exports){ -'use strict'; -var ctx = _dereq_(54); -var $export = _dereq_(62); -var toObject = _dereq_(142); -var call = _dereq_(83); -var isArrayIter = _dereq_(78); -var toLength = _dereq_(141); -var createProperty = _dereq_(53); -var getIterFn = _dereq_(153); - -$export($export.S + $export.F * !_dereq_(86)(function (iter) { Array.from(iter); }), 'Array', { - // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) - from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { - var O = toObject(arrayLike); - var C = typeof this == 'function' ? this : Array; - var aLen = arguments.length; - var mapfn = aLen > 1 ? arguments[1] : undefined; - var mapping = mapfn !== undefined; - var index = 0; - var iterFn = getIterFn(O); - var length, result, step, iterator; - if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); - // if object isn't iterable or it's array with default iterator - use simple case - if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) { - for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { - createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); - } - } else { - length = toLength(O.length); - for (result = new C(length); length > index; index++) { - createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); - } - } - result.length = index; - return result; - } -}); - -},{"141":141,"142":142,"153":153,"53":53,"54":54,"62":62,"78":78,"83":83,"86":86}],162:[function(_dereq_,module,exports){ -'use strict'; -var $export = _dereq_(62); -var $indexOf = _dereq_(41)(false); -var $native = [].indexOf; -var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0; - -$export($export.P + $export.F * (NEGATIVE_ZERO || !_dereq_(128)($native)), 'Array', { - // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) - indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { - return NEGATIVE_ZERO - // convert -0 to +0 - ? $native.apply(this, arguments) || 0 - : $indexOf(this, searchElement, arguments[1]); - } -}); - -},{"128":128,"41":41,"62":62}],163:[function(_dereq_,module,exports){ -// 22.1.2.2 / 15.4.3.2 Array.isArray(arg) -var $export = _dereq_(62); - -$export($export.S, 'Array', { isArray: _dereq_(79) }); - -},{"62":62,"79":79}],164:[function(_dereq_,module,exports){ -'use strict'; -var addToUnscopables = _dereq_(35); -var step = _dereq_(87); -var Iterators = _dereq_(88); -var toIObject = _dereq_(140); - -// 22.1.3.4 Array.prototype.entries() -// 22.1.3.13 Array.prototype.keys() -// 22.1.3.29 Array.prototype.values() -// 22.1.3.30 Array.prototype[@@iterator]() -module.exports = _dereq_(85)(Array, 'Array', function (iterated, kind) { - this._t = toIObject(iterated); // target - this._i = 0; // next index - this._k = kind; // kind -// 22.1.5.2.1 %ArrayIteratorPrototype%.next() -}, function () { - var O = this._t; - var kind = this._k; - var index = this._i++; - if (!O || index >= O.length) { - this._t = undefined; - return step(1); - } - if (kind == 'keys') return step(0, index); - if (kind == 'values') return step(0, O[index]); - return step(0, [index, O[index]]); -}, 'values'); - -// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) -Iterators.Arguments = Iterators.Array; - -addToUnscopables('keys'); -addToUnscopables('values'); -addToUnscopables('entries'); - -},{"140":140,"35":35,"85":85,"87":87,"88":88}],165:[function(_dereq_,module,exports){ -'use strict'; -// 22.1.3.13 Array.prototype.join(separator) -var $export = _dereq_(62); -var toIObject = _dereq_(140); -var arrayJoin = [].join; - -// fallback for not array-like strings -$export($export.P + $export.F * (_dereq_(77) != Object || !_dereq_(128)(arrayJoin)), 'Array', { - join: function join(separator) { - return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); - } -}); - -},{"128":128,"140":140,"62":62,"77":77}],166:[function(_dereq_,module,exports){ -'use strict'; -var $export = _dereq_(62); -var toIObject = _dereq_(140); -var toInteger = _dereq_(139); -var toLength = _dereq_(141); -var $native = [].lastIndexOf; -var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0; - -$export($export.P + $export.F * (NEGATIVE_ZERO || !_dereq_(128)($native)), 'Array', { - // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) - lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { - // convert -0 to +0 - if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0; - var O = toIObject(this); - var length = toLength(O.length); - var index = length - 1; - if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1])); - if (index < 0) index = length + index; - for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0; - return -1; - } -}); - -},{"128":128,"139":139,"140":140,"141":141,"62":62}],167:[function(_dereq_,module,exports){ -'use strict'; -var $export = _dereq_(62); -var $map = _dereq_(42)(1); - -$export($export.P + $export.F * !_dereq_(128)([].map, true), 'Array', { - // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) - map: function map(callbackfn /* , thisArg */) { - return $map(this, callbackfn, arguments[1]); - } -}); - -},{"128":128,"42":42,"62":62}],168:[function(_dereq_,module,exports){ -'use strict'; -var $export = _dereq_(62); -var createProperty = _dereq_(53); - -// WebKit Array.of isn't generic -$export($export.S + $export.F * _dereq_(64)(function () { - function F() { /* empty */ } - return !(Array.of.call(F) instanceof F); -}), 'Array', { - // 22.1.2.3 Array.of( ...items) - of: function of(/* ...args */) { - var index = 0; - var aLen = arguments.length; - var result = new (typeof this == 'function' ? this : Array)(aLen); - while (aLen > index) createProperty(result, index, arguments[index++]); - result.length = aLen; - return result; - } -}); - -},{"53":53,"62":62,"64":64}],169:[function(_dereq_,module,exports){ -'use strict'; -var $export = _dereq_(62); -var $reduce = _dereq_(43); - -$export($export.P + $export.F * !_dereq_(128)([].reduceRight, true), 'Array', { - // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) - reduceRight: function reduceRight(callbackfn /* , initialValue */) { - return $reduce(this, callbackfn, arguments.length, arguments[1], true); - } -}); - -},{"128":128,"43":43,"62":62}],170:[function(_dereq_,module,exports){ -'use strict'; -var $export = _dereq_(62); -var $reduce = _dereq_(43); - -$export($export.P + $export.F * !_dereq_(128)([].reduce, true), 'Array', { - // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) - reduce: function reduce(callbackfn /* , initialValue */) { - return $reduce(this, callbackfn, arguments.length, arguments[1], false); - } -}); - -},{"128":128,"43":43,"62":62}],171:[function(_dereq_,module,exports){ -'use strict'; -var $export = _dereq_(62); -var html = _dereq_(73); -var cof = _dereq_(48); -var toAbsoluteIndex = _dereq_(137); -var toLength = _dereq_(141); -var arraySlice = [].slice; - -// fallback for not array-like ES3 strings and DOM objects -$export($export.P + $export.F * _dereq_(64)(function () { - if (html) arraySlice.call(html); -}), 'Array', { - slice: function slice(begin, end) { - var len = toLength(this.length); - var klass = cof(this); - end = end === undefined ? len : end; - if (klass == 'Array') return arraySlice.call(this, begin, end); - var start = toAbsoluteIndex(begin, len); - var upTo = toAbsoluteIndex(end, len); - var size = toLength(upTo - start); - var cloned = new Array(size); - var i = 0; - for (; i < size; i++) cloned[i] = klass == 'String' - ? this.charAt(start + i) - : this[start + i]; - return cloned; - } -}); - -},{"137":137,"141":141,"48":48,"62":62,"64":64,"73":73}],172:[function(_dereq_,module,exports){ -'use strict'; -var $export = _dereq_(62); -var $some = _dereq_(42)(3); - -$export($export.P + $export.F * !_dereq_(128)([].some, true), 'Array', { - // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) - some: function some(callbackfn /* , thisArg */) { - return $some(this, callbackfn, arguments[1]); - } -}); - -},{"128":128,"42":42,"62":62}],173:[function(_dereq_,module,exports){ -'use strict'; -var $export = _dereq_(62); -var aFunction = _dereq_(33); -var toObject = _dereq_(142); -var fails = _dereq_(64); -var $sort = [].sort; -var test = [1, 2, 3]; - -$export($export.P + $export.F * (fails(function () { - // IE8- - test.sort(undefined); -}) || !fails(function () { - // V8 bug - test.sort(null); - // Old WebKit -}) || !_dereq_(128)($sort)), 'Array', { - // 22.1.3.25 Array.prototype.sort(comparefn) - sort: function sort(comparefn) { - return comparefn === undefined - ? $sort.call(toObject(this)) - : $sort.call(toObject(this), aFunction(comparefn)); - } -}); - -},{"128":128,"142":142,"33":33,"62":62,"64":64}],174:[function(_dereq_,module,exports){ -_dereq_(123)('Array'); - -},{"123":123}],175:[function(_dereq_,module,exports){ -// 20.3.3.1 / 15.9.4.4 Date.now() -var $export = _dereq_(62); - -$export($export.S, 'Date', { now: function () { return new Date().getTime(); } }); - -},{"62":62}],176:[function(_dereq_,module,exports){ -// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() -var $export = _dereq_(62); -var toISOString = _dereq_(55); - -// PhantomJS / old WebKit has a broken implementations -$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', { - toISOString: toISOString -}); - -},{"55":55,"62":62}],177:[function(_dereq_,module,exports){ -'use strict'; -var $export = _dereq_(62); -var toObject = _dereq_(142); -var toPrimitive = _dereq_(143); - -$export($export.P + $export.F * _dereq_(64)(function () { - return new Date(NaN).toJSON() !== null - || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1; -}), 'Date', { - // eslint-disable-next-line no-unused-vars - toJSON: function toJSON(key) { - var O = toObject(this); - var pv = toPrimitive(O); - return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); - } -}); - -},{"142":142,"143":143,"62":62,"64":64}],178:[function(_dereq_,module,exports){ -var TO_PRIMITIVE = _dereq_(152)('toPrimitive'); -var proto = Date.prototype; - -if (!(TO_PRIMITIVE in proto)) _dereq_(72)(proto, TO_PRIMITIVE, _dereq_(56)); - -},{"152":152,"56":56,"72":72}],179:[function(_dereq_,module,exports){ -var DateProto = Date.prototype; -var INVALID_DATE = 'Invalid Date'; -var TO_STRING = 'toString'; -var $toString = DateProto[TO_STRING]; -var getTime = DateProto.getTime; -if (new Date(NaN) + '' != INVALID_DATE) { - _dereq_(118)(DateProto, TO_STRING, function toString() { - var value = getTime.call(this); - // eslint-disable-next-line no-self-compare - return value === value ? $toString.call(this) : INVALID_DATE; - }); -} - -},{"118":118}],180:[function(_dereq_,module,exports){ -// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) -var $export = _dereq_(62); - -$export($export.P, 'Function', { bind: _dereq_(46) }); - -},{"46":46,"62":62}],181:[function(_dereq_,module,exports){ -'use strict'; -var isObject = _dereq_(81); -var getPrototypeOf = _dereq_(105); -var HAS_INSTANCE = _dereq_(152)('hasInstance'); -var FunctionProto = Function.prototype; -// 19.2.3.6 Function.prototype[@@hasInstance](V) -if (!(HAS_INSTANCE in FunctionProto)) _dereq_(99).f(FunctionProto, HAS_INSTANCE, { value: function (O) { - if (typeof this != 'function' || !isObject(O)) return false; - if (!isObject(this.prototype)) return O instanceof this; - // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: - while (O = getPrototypeOf(O)) if (this.prototype === O) return true; - return false; -} }); - -},{"105":105,"152":152,"81":81,"99":99}],182:[function(_dereq_,module,exports){ -var dP = _dereq_(99).f; -var FProto = Function.prototype; -var nameRE = /^\s*function ([^ (]*)/; -var NAME = 'name'; - -// 19.2.4.2 name -NAME in FProto || _dereq_(58) && dP(FProto, NAME, { - configurable: true, - get: function () { - try { - return ('' + this).match(nameRE)[1]; - } catch (e) { - return ''; - } - } -}); - -},{"58":58,"99":99}],183:[function(_dereq_,module,exports){ -'use strict'; -var strong = _dereq_(49); -var validate = _dereq_(149); -var MAP = 'Map'; - -// 23.1 Map Objects -module.exports = _dereq_(51)(MAP, function (get) { - return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; -}, { - // 23.1.3.6 Map.prototype.get(key) - get: function get(key) { - var entry = strong.getEntry(validate(this, MAP), key); - return entry && entry.v; - }, - // 23.1.3.9 Map.prototype.set(key, value) - set: function set(key, value) { - return strong.def(validate(this, MAP), key === 0 ? 0 : key, value); - } -}, strong, true); - -},{"149":149,"49":49,"51":51}],184:[function(_dereq_,module,exports){ -// 20.2.2.3 Math.acosh(x) -var $export = _dereq_(62); -var log1p = _dereq_(92); -var sqrt = Math.sqrt; -var $acosh = Math.acosh; - -$export($export.S + $export.F * !($acosh - // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 - && Math.floor($acosh(Number.MAX_VALUE)) == 710 - // Tor Browser bug: Math.acosh(Infinity) -> NaN - && $acosh(Infinity) == Infinity -), 'Math', { - acosh: function acosh(x) { - return (x = +x) < 1 ? NaN : x > 94906265.62425156 - ? Math.log(x) + Math.LN2 - : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); - } -}); - -},{"62":62,"92":92}],185:[function(_dereq_,module,exports){ -// 20.2.2.5 Math.asinh(x) -var $export = _dereq_(62); -var $asinh = Math.asinh; - -function asinh(x) { - return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1)); -} - -// Tor Browser bug: Math.asinh(0) -> -0 -$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh }); - -},{"62":62}],186:[function(_dereq_,module,exports){ -// 20.2.2.7 Math.atanh(x) -var $export = _dereq_(62); -var $atanh = Math.atanh; - -// Tor Browser bug: Math.atanh(-0) -> 0 -$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { - atanh: function atanh(x) { - return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; - } -}); - -},{"62":62}],187:[function(_dereq_,module,exports){ -// 20.2.2.9 Math.cbrt(x) -var $export = _dereq_(62); -var sign = _dereq_(93); - -$export($export.S, 'Math', { - cbrt: function cbrt(x) { - return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); - } -}); - -},{"62":62,"93":93}],188:[function(_dereq_,module,exports){ -// 20.2.2.11 Math.clz32(x) -var $export = _dereq_(62); - -$export($export.S, 'Math', { - clz32: function clz32(x) { - return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; - } -}); - -},{"62":62}],189:[function(_dereq_,module,exports){ -// 20.2.2.12 Math.cosh(x) -var $export = _dereq_(62); -var exp = Math.exp; - -$export($export.S, 'Math', { - cosh: function cosh(x) { - return (exp(x = +x) + exp(-x)) / 2; - } -}); - -},{"62":62}],190:[function(_dereq_,module,exports){ -// 20.2.2.14 Math.expm1(x) -var $export = _dereq_(62); -var $expm1 = _dereq_(90); - -$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 }); - -},{"62":62,"90":90}],191:[function(_dereq_,module,exports){ -// 20.2.2.16 Math.fround(x) -var $export = _dereq_(62); - -$export($export.S, 'Math', { fround: _dereq_(91) }); - -},{"62":62,"91":91}],192:[function(_dereq_,module,exports){ -// 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) -var $export = _dereq_(62); -var abs = Math.abs; - -$export($export.S, 'Math', { - hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars - var sum = 0; - var i = 0; - var aLen = arguments.length; - var larg = 0; - var arg, div; - while (i < aLen) { - arg = abs(arguments[i++]); - if (larg < arg) { - div = larg / arg; - sum = sum * div * div + 1; - larg = arg; - } else if (arg > 0) { - div = arg / larg; - sum += div * div; - } else sum += arg; - } - return larg === Infinity ? Infinity : larg * Math.sqrt(sum); - } -}); - -},{"62":62}],193:[function(_dereq_,module,exports){ -// 20.2.2.18 Math.imul(x, y) -var $export = _dereq_(62); -var $imul = Math.imul; - -// some WebKit versions fails with big numbers, some has wrong arity -$export($export.S + $export.F * _dereq_(64)(function () { - return $imul(0xffffffff, 5) != -5 || $imul.length != 2; -}), 'Math', { - imul: function imul(x, y) { - var UINT16 = 0xffff; - var xn = +x; - var yn = +y; - var xl = UINT16 & xn; - var yl = UINT16 & yn; - return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); - } -}); - -},{"62":62,"64":64}],194:[function(_dereq_,module,exports){ -// 20.2.2.21 Math.log10(x) -var $export = _dereq_(62); - -$export($export.S, 'Math', { - log10: function log10(x) { - return Math.log(x) * Math.LOG10E; - } -}); - -},{"62":62}],195:[function(_dereq_,module,exports){ -// 20.2.2.20 Math.log1p(x) -var $export = _dereq_(62); - -$export($export.S, 'Math', { log1p: _dereq_(92) }); - -},{"62":62,"92":92}],196:[function(_dereq_,module,exports){ -// 20.2.2.22 Math.log2(x) -var $export = _dereq_(62); - -$export($export.S, 'Math', { - log2: function log2(x) { - return Math.log(x) / Math.LN2; - } -}); - -},{"62":62}],197:[function(_dereq_,module,exports){ -// 20.2.2.28 Math.sign(x) -var $export = _dereq_(62); - -$export($export.S, 'Math', { sign: _dereq_(93) }); - -},{"62":62,"93":93}],198:[function(_dereq_,module,exports){ -// 20.2.2.30 Math.sinh(x) -var $export = _dereq_(62); -var expm1 = _dereq_(90); -var exp = Math.exp; - -// V8 near Chromium 38 has a problem with very small numbers -$export($export.S + $export.F * _dereq_(64)(function () { - return !Math.sinh(-2e-17) != -2e-17; -}), 'Math', { - sinh: function sinh(x) { - return Math.abs(x = +x) < 1 - ? (expm1(x) - expm1(-x)) / 2 - : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); - } -}); - -},{"62":62,"64":64,"90":90}],199:[function(_dereq_,module,exports){ -// 20.2.2.33 Math.tanh(x) -var $export = _dereq_(62); -var expm1 = _dereq_(90); -var exp = Math.exp; - -$export($export.S, 'Math', { - tanh: function tanh(x) { - var a = expm1(x = +x); - var b = expm1(-x); - return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); - } -}); - -},{"62":62,"90":90}],200:[function(_dereq_,module,exports){ -// 20.2.2.34 Math.trunc(x) -var $export = _dereq_(62); - -$export($export.S, 'Math', { - trunc: function trunc(it) { - return (it > 0 ? Math.floor : Math.ceil)(it); - } -}); - -},{"62":62}],201:[function(_dereq_,module,exports){ -'use strict'; -var global = _dereq_(70); -var has = _dereq_(71); -var cof = _dereq_(48); -var inheritIfRequired = _dereq_(75); -var toPrimitive = _dereq_(143); -var fails = _dereq_(64); -var gOPN = _dereq_(103).f; -var gOPD = _dereq_(101).f; -var dP = _dereq_(99).f; -var $trim = _dereq_(134).trim; -var NUMBER = 'Number'; -var $Number = global[NUMBER]; -var Base = $Number; -var proto = $Number.prototype; -// Opera ~12 has broken Object#toString -var BROKEN_COF = cof(_dereq_(98)(proto)) == NUMBER; -var TRIM = 'trim' in String.prototype; - -// 7.1.3 ToNumber(argument) -var toNumber = function (argument) { - var it = toPrimitive(argument, false); - if (typeof it == 'string' && it.length > 2) { - it = TRIM ? it.trim() : $trim(it, 3); - var first = it.charCodeAt(0); - var third, radix, maxCode; - if (first === 43 || first === 45) { - third = it.charCodeAt(2); - if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix - } else if (first === 48) { - switch (it.charCodeAt(1)) { - case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i - case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i - default: return +it; - } - for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) { - code = digits.charCodeAt(i); - // parseInt parses a string to a first unavailable symbol - // but ToNumber should return NaN if a string contains unavailable symbols - if (code < 48 || code > maxCode) return NaN; - } return parseInt(digits, radix); - } - } return +it; -}; - -if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) { - $Number = function Number(value) { - var it = arguments.length < 1 ? 0 : value; - var that = this; - return that instanceof $Number - // check on 1..constructor(foo) case - && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER) - ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it); - }; - for (var keys = _dereq_(58) ? gOPN(Base) : ( - // ES3: - 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + - // ES6 (in case, if modules with ES6 Number statics required before): - 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + - 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' - ).split(','), j = 0, key; keys.length > j; j++) { - if (has(Base, key = keys[j]) && !has($Number, key)) { - dP($Number, key, gOPD(Base, key)); - } - } - $Number.prototype = proto; - proto.constructor = $Number; - _dereq_(118)(global, NUMBER, $Number); -} - -},{"101":101,"103":103,"118":118,"134":134,"143":143,"48":48,"58":58,"64":64,"70":70,"71":71,"75":75,"98":98,"99":99}],202:[function(_dereq_,module,exports){ -// 20.1.2.1 Number.EPSILON -var $export = _dereq_(62); - -$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) }); - -},{"62":62}],203:[function(_dereq_,module,exports){ -// 20.1.2.2 Number.isFinite(number) -var $export = _dereq_(62); -var _isFinite = _dereq_(70).isFinite; - -$export($export.S, 'Number', { - isFinite: function isFinite(it) { - return typeof it == 'number' && _isFinite(it); - } -}); - -},{"62":62,"70":70}],204:[function(_dereq_,module,exports){ -// 20.1.2.3 Number.isInteger(number) -var $export = _dereq_(62); - -$export($export.S, 'Number', { isInteger: _dereq_(80) }); - -},{"62":62,"80":80}],205:[function(_dereq_,module,exports){ -// 20.1.2.4 Number.isNaN(number) -var $export = _dereq_(62); - -$export($export.S, 'Number', { - isNaN: function isNaN(number) { - // eslint-disable-next-line no-self-compare - return number != number; - } -}); - -},{"62":62}],206:[function(_dereq_,module,exports){ -// 20.1.2.5 Number.isSafeInteger(number) -var $export = _dereq_(62); -var isInteger = _dereq_(80); -var abs = Math.abs; - -$export($export.S, 'Number', { - isSafeInteger: function isSafeInteger(number) { - return isInteger(number) && abs(number) <= 0x1fffffffffffff; - } -}); - -},{"62":62,"80":80}],207:[function(_dereq_,module,exports){ -// 20.1.2.6 Number.MAX_SAFE_INTEGER -var $export = _dereq_(62); - -$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff }); - -},{"62":62}],208:[function(_dereq_,module,exports){ -// 20.1.2.10 Number.MIN_SAFE_INTEGER -var $export = _dereq_(62); - -$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff }); - -},{"62":62}],209:[function(_dereq_,module,exports){ -var $export = _dereq_(62); -var $parseFloat = _dereq_(112); -// 20.1.2.12 Number.parseFloat(string) -$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat }); - -},{"112":112,"62":62}],210:[function(_dereq_,module,exports){ -var $export = _dereq_(62); -var $parseInt = _dereq_(113); -// 20.1.2.13 Number.parseInt(string, radix) -$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt }); - -},{"113":113,"62":62}],211:[function(_dereq_,module,exports){ -'use strict'; -var $export = _dereq_(62); -var toInteger = _dereq_(139); -var aNumberValue = _dereq_(34); -var repeat = _dereq_(133); -var $toFixed = 1.0.toFixed; -var floor = Math.floor; -var data = [0, 0, 0, 0, 0, 0]; -var ERROR = 'Number.toFixed: incorrect invocation!'; -var ZERO = '0'; - -var multiply = function (n, c) { - var i = -1; - var c2 = c; - while (++i < 6) { - c2 += n * data[i]; - data[i] = c2 % 1e7; - c2 = floor(c2 / 1e7); - } -}; -var divide = function (n) { - var i = 6; - var c = 0; - while (--i >= 0) { - c += data[i]; - data[i] = floor(c / n); - c = (c % n) * 1e7; - } -}; -var numToString = function () { - var i = 6; - var s = ''; - while (--i >= 0) { - if (s !== '' || i === 0 || data[i] !== 0) { - var t = String(data[i]); - s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t; - } - } return s; -}; -var pow = function (x, n, acc) { - return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); -}; -var log = function (x) { - var n = 0; - var x2 = x; - while (x2 >= 4096) { - n += 12; - x2 /= 4096; - } - while (x2 >= 2) { - n += 1; - x2 /= 2; - } return n; -}; - -$export($export.P + $export.F * (!!$toFixed && ( - 0.00008.toFixed(3) !== '0.000' || - 0.9.toFixed(0) !== '1' || - 1.255.toFixed(2) !== '1.25' || - 1000000000000000128.0.toFixed(0) !== '1000000000000000128' -) || !_dereq_(64)(function () { - // V8 ~ Android 4.3- - $toFixed.call({}); -})), 'Number', { - toFixed: function toFixed(fractionDigits) { - var x = aNumberValue(this, ERROR); - var f = toInteger(fractionDigits); - var s = ''; - var m = ZERO; - var e, z, j, k; - if (f < 0 || f > 20) throw RangeError(ERROR); - // eslint-disable-next-line no-self-compare - if (x != x) return 'NaN'; - if (x <= -1e21 || x >= 1e21) return String(x); - if (x < 0) { - s = '-'; - x = -x; - } - if (x > 1e-21) { - e = log(x * pow(2, 69, 1)) - 69; - z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1); - z *= 0x10000000000000; - e = 52 - e; - if (e > 0) { - multiply(0, z); - j = f; - while (j >= 7) { - multiply(1e7, 0); - j -= 7; - } - multiply(pow(10, j, 1), 0); - j = e - 1; - while (j >= 23) { - divide(1 << 23); - j -= 23; - } - divide(1 << j); - multiply(1, 1); - divide(2); - m = numToString(); - } else { - multiply(0, z); - multiply(1 << -e, 0); - m = numToString() + repeat.call(ZERO, f); - } - } - if (f > 0) { - k = m.length; - m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f)); - } else { - m = s + m; - } return m; - } -}); - -},{"133":133,"139":139,"34":34,"62":62,"64":64}],212:[function(_dereq_,module,exports){ -'use strict'; -var $export = _dereq_(62); -var $fails = _dereq_(64); -var aNumberValue = _dereq_(34); -var $toPrecision = 1.0.toPrecision; - -$export($export.P + $export.F * ($fails(function () { - // IE7- - return $toPrecision.call(1, undefined) !== '1'; -}) || !$fails(function () { - // V8 ~ Android 4.3- - $toPrecision.call({}); -})), 'Number', { - toPrecision: function toPrecision(precision) { - var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!'); - return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); - } -}); - -},{"34":34,"62":62,"64":64}],213:[function(_dereq_,module,exports){ -// 19.1.3.1 Object.assign(target, source) -var $export = _dereq_(62); - -$export($export.S + $export.F, 'Object', { assign: _dereq_(97) }); - -},{"62":62,"97":97}],214:[function(_dereq_,module,exports){ -var $export = _dereq_(62); -// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) -$export($export.S, 'Object', { create: _dereq_(98) }); - -},{"62":62,"98":98}],215:[function(_dereq_,module,exports){ -var $export = _dereq_(62); -// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) -$export($export.S + $export.F * !_dereq_(58), 'Object', { defineProperties: _dereq_(100) }); - -},{"100":100,"58":58,"62":62}],216:[function(_dereq_,module,exports){ -var $export = _dereq_(62); -// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) -$export($export.S + $export.F * !_dereq_(58), 'Object', { defineProperty: _dereq_(99).f }); - -},{"58":58,"62":62,"99":99}],217:[function(_dereq_,module,exports){ -// 19.1.2.5 Object.freeze(O) -var isObject = _dereq_(81); -var meta = _dereq_(94).onFreeze; - -_dereq_(109)('freeze', function ($freeze) { - return function freeze(it) { - return $freeze && isObject(it) ? $freeze(meta(it)) : it; - }; -}); - -},{"109":109,"81":81,"94":94}],218:[function(_dereq_,module,exports){ -// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) -var toIObject = _dereq_(140); -var $getOwnPropertyDescriptor = _dereq_(101).f; - -_dereq_(109)('getOwnPropertyDescriptor', function () { - return function getOwnPropertyDescriptor(it, key) { - return $getOwnPropertyDescriptor(toIObject(it), key); - }; -}); - -},{"101":101,"109":109,"140":140}],219:[function(_dereq_,module,exports){ -// 19.1.2.7 Object.getOwnPropertyNames(O) -_dereq_(109)('getOwnPropertyNames', function () { - return _dereq_(102).f; -}); - -},{"102":102,"109":109}],220:[function(_dereq_,module,exports){ -// 19.1.2.9 Object.getPrototypeOf(O) -var toObject = _dereq_(142); -var $getPrototypeOf = _dereq_(105); - -_dereq_(109)('getPrototypeOf', function () { - return function getPrototypeOf(it) { - return $getPrototypeOf(toObject(it)); - }; -}); - -},{"105":105,"109":109,"142":142}],221:[function(_dereq_,module,exports){ -// 19.1.2.11 Object.isExtensible(O) -var isObject = _dereq_(81); - -_dereq_(109)('isExtensible', function ($isExtensible) { - return function isExtensible(it) { - return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; - }; -}); - -},{"109":109,"81":81}],222:[function(_dereq_,module,exports){ -// 19.1.2.12 Object.isFrozen(O) -var isObject = _dereq_(81); - -_dereq_(109)('isFrozen', function ($isFrozen) { - return function isFrozen(it) { - return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; - }; -}); - -},{"109":109,"81":81}],223:[function(_dereq_,module,exports){ -// 19.1.2.13 Object.isSealed(O) -var isObject = _dereq_(81); - -_dereq_(109)('isSealed', function ($isSealed) { - return function isSealed(it) { - return isObject(it) ? $isSealed ? $isSealed(it) : false : true; - }; -}); - -},{"109":109,"81":81}],224:[function(_dereq_,module,exports){ -// 19.1.3.10 Object.is(value1, value2) -var $export = _dereq_(62); -$export($export.S, 'Object', { is: _dereq_(121) }); - -},{"121":121,"62":62}],225:[function(_dereq_,module,exports){ -// 19.1.2.14 Object.keys(O) -var toObject = _dereq_(142); -var $keys = _dereq_(107); - -_dereq_(109)('keys', function () { - return function keys(it) { - return $keys(toObject(it)); - }; -}); - -},{"107":107,"109":109,"142":142}],226:[function(_dereq_,module,exports){ -// 19.1.2.15 Object.preventExtensions(O) -var isObject = _dereq_(81); -var meta = _dereq_(94).onFreeze; - -_dereq_(109)('preventExtensions', function ($preventExtensions) { - return function preventExtensions(it) { - return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; - }; -}); - -},{"109":109,"81":81,"94":94}],227:[function(_dereq_,module,exports){ -// 19.1.2.17 Object.seal(O) -var isObject = _dereq_(81); -var meta = _dereq_(94).onFreeze; - -_dereq_(109)('seal', function ($seal) { - return function seal(it) { - return $seal && isObject(it) ? $seal(meta(it)) : it; - }; -}); - -},{"109":109,"81":81,"94":94}],228:[function(_dereq_,module,exports){ -// 19.1.3.19 Object.setPrototypeOf(O, proto) -var $export = _dereq_(62); -$export($export.S, 'Object', { setPrototypeOf: _dereq_(122).set }); - -},{"122":122,"62":62}],229:[function(_dereq_,module,exports){ -'use strict'; -// 19.1.3.6 Object.prototype.toString() -var classof = _dereq_(47); -var test = {}; -test[_dereq_(152)('toStringTag')] = 'z'; -if (test + '' != '[object z]') { - _dereq_(118)(Object.prototype, 'toString', function toString() { - return '[object ' + classof(this) + ']'; - }, true); -} - -},{"118":118,"152":152,"47":47}],230:[function(_dereq_,module,exports){ -var $export = _dereq_(62); -var $parseFloat = _dereq_(112); -// 18.2.4 parseFloat(string) -$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat }); - -},{"112":112,"62":62}],231:[function(_dereq_,module,exports){ -var $export = _dereq_(62); -var $parseInt = _dereq_(113); -// 18.2.5 parseInt(string, radix) -$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt }); - -},{"113":113,"62":62}],232:[function(_dereq_,module,exports){ -'use strict'; -var LIBRARY = _dereq_(89); -var global = _dereq_(70); -var ctx = _dereq_(54); -var classof = _dereq_(47); -var $export = _dereq_(62); -var isObject = _dereq_(81); -var aFunction = _dereq_(33); -var anInstance = _dereq_(37); -var forOf = _dereq_(68); -var speciesConstructor = _dereq_(127); -var task = _dereq_(136).set; -var microtask = _dereq_(95)(); -var newPromiseCapabilityModule = _dereq_(96); -var perform = _dereq_(114); -var userAgent = _dereq_(148); -var promiseResolve = _dereq_(115); -var PROMISE = 'Promise'; -var TypeError = global.TypeError; -var process = global.process; -var versions = process && process.versions; -var v8 = versions && versions.v8 || ''; -var $Promise = global[PROMISE]; -var isNode = classof(process) == 'process'; -var empty = function () { /* empty */ }; -var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; -var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; - -var USE_NATIVE = !!function () { - try { - // correct subclassing with @@species support - var promise = $Promise.resolve(1); - var FakePromise = (promise.constructor = {})[_dereq_(152)('species')] = function (exec) { - exec(empty, empty); - }; - // unhandled rejections tracking support, NodeJS Promise without it fails @@species test - return (isNode || typeof PromiseRejectionEvent == 'function') - && promise.then(empty) instanceof FakePromise - // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables - // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 - // we can't detect it synchronously, so just check versions - && v8.indexOf('6.6') !== 0 - && userAgent.indexOf('Chrome/66') === -1; - } catch (e) { /* empty */ } -}(); - -// helpers -var isThenable = function (it) { - var then; - return isObject(it) && typeof (then = it.then) == 'function' ? then : false; -}; -var notify = function (promise, isReject) { - if (promise._n) return; - promise._n = true; - var chain = promise._c; - microtask(function () { - var value = promise._v; - var ok = promise._s == 1; - var i = 0; - var run = function (reaction) { - var handler = ok ? reaction.ok : reaction.fail; - var resolve = reaction.resolve; - var reject = reaction.reject; - var domain = reaction.domain; - var result, then, exited; - try { - if (handler) { - if (!ok) { - if (promise._h == 2) onHandleUnhandled(promise); - promise._h = 1; - } - if (handler === true) result = value; - else { - if (domain) domain.enter(); - result = handler(value); // may throw - if (domain) { - domain.exit(); - exited = true; - } - } - if (result === reaction.promise) { - reject(TypeError('Promise-chain cycle')); - } else if (then = isThenable(result)) { - then.call(result, resolve, reject); - } else resolve(result); - } else reject(value); - } catch (e) { - if (domain && !exited) domain.exit(); - reject(e); - } - }; - while (chain.length > i) run(chain[i++]); // variable length - can't use forEach - promise._c = []; - promise._n = false; - if (isReject && !promise._h) onUnhandled(promise); - }); -}; -var onUnhandled = function (promise) { - task.call(global, function () { - var value = promise._v; - var unhandled = isUnhandled(promise); - var result, handler, console; - if (unhandled) { - result = perform(function () { - if (isNode) { - process.emit('unhandledRejection', value, promise); - } else if (handler = global.onunhandledrejection) { - handler({ promise: promise, reason: value }); - } else if ((console = global.console) && console.error) { - console.error('Unhandled promise rejection', value); - } - }); - // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should - promise._h = isNode || isUnhandled(promise) ? 2 : 1; - } promise._a = undefined; - if (unhandled && result.e) throw result.v; - }); -}; -var isUnhandled = function (promise) { - return promise._h !== 1 && (promise._a || promise._c).length === 0; -}; -var onHandleUnhandled = function (promise) { - task.call(global, function () { - var handler; - if (isNode) { - process.emit('rejectionHandled', promise); - } else if (handler = global.onrejectionhandled) { - handler({ promise: promise, reason: promise._v }); - } - }); -}; -var $reject = function (value) { - var promise = this; - if (promise._d) return; - promise._d = true; - promise = promise._w || promise; // unwrap - promise._v = value; - promise._s = 2; - if (!promise._a) promise._a = promise._c.slice(); - notify(promise, true); -}; -var $resolve = function (value) { - var promise = this; - var then; - if (promise._d) return; - promise._d = true; - promise = promise._w || promise; // unwrap - try { - if (promise === value) throw TypeError("Promise can't be resolved itself"); - if (then = isThenable(value)) { - microtask(function () { - var wrapper = { _w: promise, _d: false }; // wrap - try { - then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); - } catch (e) { - $reject.call(wrapper, e); - } - }); - } else { - promise._v = value; - promise._s = 1; - notify(promise, false); - } - } catch (e) { - $reject.call({ _w: promise, _d: false }, e); // wrap - } -}; - -// constructor polyfill -if (!USE_NATIVE) { - // 25.4.3.1 Promise(executor) - $Promise = function Promise(executor) { - anInstance(this, $Promise, PROMISE, '_h'); - aFunction(executor); - Internal.call(this); - try { - executor(ctx($resolve, this, 1), ctx($reject, this, 1)); - } catch (err) { - $reject.call(this, err); - } - }; - // eslint-disable-next-line no-unused-vars - Internal = function Promise(executor) { - this._c = []; // <- awaiting reactions - this._a = undefined; // <- checked in isUnhandled reactions - this._s = 0; // <- state - this._d = false; // <- done - this._v = undefined; // <- value - this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled - this._n = false; // <- notify - }; - Internal.prototype = _dereq_(117)($Promise.prototype, { - // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) - then: function then(onFulfilled, onRejected) { - var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); - reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; - reaction.fail = typeof onRejected == 'function' && onRejected; - reaction.domain = isNode ? process.domain : undefined; - this._c.push(reaction); - if (this._a) this._a.push(reaction); - if (this._s) notify(this, false); - return reaction.promise; - }, - // 25.4.5.1 Promise.prototype.catch(onRejected) - 'catch': function (onRejected) { - return this.then(undefined, onRejected); - } - }); - OwnPromiseCapability = function () { - var promise = new Internal(); - this.promise = promise; - this.resolve = ctx($resolve, promise, 1); - this.reject = ctx($reject, promise, 1); - }; - newPromiseCapabilityModule.f = newPromiseCapability = function (C) { - return C === $Promise || C === Wrapper - ? new OwnPromiseCapability(C) - : newGenericPromiseCapability(C); - }; -} - -$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); -_dereq_(124)($Promise, PROMISE); -_dereq_(123)(PROMISE); -Wrapper = _dereq_(52)[PROMISE]; - -// statics -$export($export.S + $export.F * !USE_NATIVE, PROMISE, { - // 25.4.4.5 Promise.reject(r) - reject: function reject(r) { - var capability = newPromiseCapability(this); - var $$reject = capability.reject; - $$reject(r); - return capability.promise; - } -}); -$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { - // 25.4.4.6 Promise.resolve(x) - resolve: function resolve(x) { - return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); - } -}); -$export($export.S + $export.F * !(USE_NATIVE && _dereq_(86)(function (iter) { - $Promise.all(iter)['catch'](empty); -})), PROMISE, { - // 25.4.4.1 Promise.all(iterable) - all: function all(iterable) { - var C = this; - var capability = newPromiseCapability(C); - var resolve = capability.resolve; - var reject = capability.reject; - var result = perform(function () { - var values = []; - var index = 0; - var remaining = 1; - forOf(iterable, false, function (promise) { - var $index = index++; - var alreadyCalled = false; - values.push(undefined); - remaining++; - C.resolve(promise).then(function (value) { - if (alreadyCalled) return; - alreadyCalled = true; - values[$index] = value; - --remaining || resolve(values); - }, reject); - }); - --remaining || resolve(values); - }); - if (result.e) reject(result.v); - return capability.promise; - }, - // 25.4.4.4 Promise.race(iterable) - race: function race(iterable) { - var C = this; - var capability = newPromiseCapability(C); - var reject = capability.reject; - var result = perform(function () { - forOf(iterable, false, function (promise) { - C.resolve(promise).then(capability.resolve, reject); - }); - }); - if (result.e) reject(result.v); - return capability.promise; - } -}); - -},{"114":114,"115":115,"117":117,"123":123,"124":124,"127":127,"136":136,"148":148,"152":152,"33":33,"37":37,"47":47,"52":52,"54":54,"62":62,"68":68,"70":70,"81":81,"86":86,"89":89,"95":95,"96":96}],233:[function(_dereq_,module,exports){ -// 26.1.1 Reflect.apply(target, thisArgument, argumentsList) -var $export = _dereq_(62); -var aFunction = _dereq_(33); -var anObject = _dereq_(38); -var rApply = (_dereq_(70).Reflect || {}).apply; -var fApply = Function.apply; -// MS Edge argumentsList argument is optional -$export($export.S + $export.F * !_dereq_(64)(function () { - rApply(function () { /* empty */ }); -}), 'Reflect', { - apply: function apply(target, thisArgument, argumentsList) { - var T = aFunction(target); - var L = anObject(argumentsList); - return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L); - } -}); - -},{"33":33,"38":38,"62":62,"64":64,"70":70}],234:[function(_dereq_,module,exports){ -// 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) -var $export = _dereq_(62); -var create = _dereq_(98); -var aFunction = _dereq_(33); -var anObject = _dereq_(38); -var isObject = _dereq_(81); -var fails = _dereq_(64); -var bind = _dereq_(46); -var rConstruct = (_dereq_(70).Reflect || {}).construct; - -// MS Edge supports only 2 arguments and argumentsList argument is optional -// FF Nightly sets third argument as `new.target`, but does not create `this` from it -var NEW_TARGET_BUG = fails(function () { - function F() { /* empty */ } - return !(rConstruct(function () { /* empty */ }, [], F) instanceof F); -}); -var ARGS_BUG = !fails(function () { - rConstruct(function () { /* empty */ }); -}); - -$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', { - construct: function construct(Target, args /* , newTarget */) { - aFunction(Target); - anObject(args); - var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); - if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget); - if (Target == newTarget) { - // w/o altered newTarget, optimization for 0-4 arguments - switch (args.length) { - case 0: return new Target(); - case 1: return new Target(args[0]); - case 2: return new Target(args[0], args[1]); - case 3: return new Target(args[0], args[1], args[2]); - case 4: return new Target(args[0], args[1], args[2], args[3]); - } - // w/o altered newTarget, lot of arguments case - var $args = [null]; - $args.push.apply($args, args); - return new (bind.apply(Target, $args))(); - } - // with altered newTarget, not support built-in constructors - var proto = newTarget.prototype; - var instance = create(isObject(proto) ? proto : Object.prototype); - var result = Function.apply.call(Target, instance, args); - return isObject(result) ? result : instance; - } -}); - -},{"33":33,"38":38,"46":46,"62":62,"64":64,"70":70,"81":81,"98":98}],235:[function(_dereq_,module,exports){ -// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) -var dP = _dereq_(99); -var $export = _dereq_(62); -var anObject = _dereq_(38); -var toPrimitive = _dereq_(143); - -// MS Edge has broken Reflect.defineProperty - throwing instead of returning false -$export($export.S + $export.F * _dereq_(64)(function () { - // eslint-disable-next-line no-undef - Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 }); -}), 'Reflect', { - defineProperty: function defineProperty(target, propertyKey, attributes) { - anObject(target); - propertyKey = toPrimitive(propertyKey, true); - anObject(attributes); - try { - dP.f(target, propertyKey, attributes); - return true; - } catch (e) { - return false; - } - } -}); - -},{"143":143,"38":38,"62":62,"64":64,"99":99}],236:[function(_dereq_,module,exports){ -// 26.1.4 Reflect.deleteProperty(target, propertyKey) -var $export = _dereq_(62); -var gOPD = _dereq_(101).f; -var anObject = _dereq_(38); - -$export($export.S, 'Reflect', { - deleteProperty: function deleteProperty(target, propertyKey) { - var desc = gOPD(anObject(target), propertyKey); - return desc && !desc.configurable ? false : delete target[propertyKey]; - } -}); - -},{"101":101,"38":38,"62":62}],237:[function(_dereq_,module,exports){ -'use strict'; -// 26.1.5 Reflect.enumerate(target) -var $export = _dereq_(62); -var anObject = _dereq_(38); -var Enumerate = function (iterated) { - this._t = anObject(iterated); // target - this._i = 0; // next index - var keys = this._k = []; // keys - var key; - for (key in iterated) keys.push(key); -}; -_dereq_(84)(Enumerate, 'Object', function () { - var that = this; - var keys = that._k; - var key; - do { - if (that._i >= keys.length) return { value: undefined, done: true }; - } while (!((key = keys[that._i++]) in that._t)); - return { value: key, done: false }; -}); - -$export($export.S, 'Reflect', { - enumerate: function enumerate(target) { - return new Enumerate(target); - } -}); - -},{"38":38,"62":62,"84":84}],238:[function(_dereq_,module,exports){ -// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) -var gOPD = _dereq_(101); -var $export = _dereq_(62); -var anObject = _dereq_(38); - -$export($export.S, 'Reflect', { - getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { - return gOPD.f(anObject(target), propertyKey); - } -}); - -},{"101":101,"38":38,"62":62}],239:[function(_dereq_,module,exports){ -// 26.1.8 Reflect.getPrototypeOf(target) -var $export = _dereq_(62); -var getProto = _dereq_(105); -var anObject = _dereq_(38); - -$export($export.S, 'Reflect', { - getPrototypeOf: function getPrototypeOf(target) { - return getProto(anObject(target)); - } -}); - -},{"105":105,"38":38,"62":62}],240:[function(_dereq_,module,exports){ -// 26.1.6 Reflect.get(target, propertyKey [, receiver]) -var gOPD = _dereq_(101); -var getPrototypeOf = _dereq_(105); -var has = _dereq_(71); -var $export = _dereq_(62); -var isObject = _dereq_(81); -var anObject = _dereq_(38); - -function get(target, propertyKey /* , receiver */) { - var receiver = arguments.length < 3 ? target : arguments[2]; - var desc, proto; - if (anObject(target) === receiver) return target[propertyKey]; - if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value') - ? desc.value - : desc.get !== undefined - ? desc.get.call(receiver) - : undefined; - if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver); -} - -$export($export.S, 'Reflect', { get: get }); - -},{"101":101,"105":105,"38":38,"62":62,"71":71,"81":81}],241:[function(_dereq_,module,exports){ -// 26.1.9 Reflect.has(target, propertyKey) -var $export = _dereq_(62); - -$export($export.S, 'Reflect', { - has: function has(target, propertyKey) { - return propertyKey in target; - } -}); - -},{"62":62}],242:[function(_dereq_,module,exports){ -// 26.1.10 Reflect.isExtensible(target) -var $export = _dereq_(62); -var anObject = _dereq_(38); -var $isExtensible = Object.isExtensible; - -$export($export.S, 'Reflect', { - isExtensible: function isExtensible(target) { - anObject(target); - return $isExtensible ? $isExtensible(target) : true; - } -}); - -},{"38":38,"62":62}],243:[function(_dereq_,module,exports){ -// 26.1.11 Reflect.ownKeys(target) -var $export = _dereq_(62); - -$export($export.S, 'Reflect', { ownKeys: _dereq_(111) }); - -},{"111":111,"62":62}],244:[function(_dereq_,module,exports){ -// 26.1.12 Reflect.preventExtensions(target) -var $export = _dereq_(62); -var anObject = _dereq_(38); -var $preventExtensions = Object.preventExtensions; - -$export($export.S, 'Reflect', { - preventExtensions: function preventExtensions(target) { - anObject(target); - try { - if ($preventExtensions) $preventExtensions(target); - return true; - } catch (e) { - return false; - } - } -}); - -},{"38":38,"62":62}],245:[function(_dereq_,module,exports){ -// 26.1.14 Reflect.setPrototypeOf(target, proto) -var $export = _dereq_(62); -var setProto = _dereq_(122); - -if (setProto) $export($export.S, 'Reflect', { - setPrototypeOf: function setPrototypeOf(target, proto) { - setProto.check(target, proto); - try { - setProto.set(target, proto); - return true; - } catch (e) { - return false; - } - } -}); - -},{"122":122,"62":62}],246:[function(_dereq_,module,exports){ -// 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) -var dP = _dereq_(99); -var gOPD = _dereq_(101); -var getPrototypeOf = _dereq_(105); -var has = _dereq_(71); -var $export = _dereq_(62); -var createDesc = _dereq_(116); -var anObject = _dereq_(38); -var isObject = _dereq_(81); - -function set(target, propertyKey, V /* , receiver */) { - var receiver = arguments.length < 4 ? target : arguments[3]; - var ownDesc = gOPD.f(anObject(target), propertyKey); - var existingDescriptor, proto; - if (!ownDesc) { - if (isObject(proto = getPrototypeOf(target))) { - return set(proto, propertyKey, V, receiver); - } - ownDesc = createDesc(0); - } - if (has(ownDesc, 'value')) { - if (ownDesc.writable === false || !isObject(receiver)) return false; - if (existingDescriptor = gOPD.f(receiver, propertyKey)) { - if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false; - existingDescriptor.value = V; - dP.f(receiver, propertyKey, existingDescriptor); - } else dP.f(receiver, propertyKey, createDesc(0, V)); - return true; - } - return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); -} - -$export($export.S, 'Reflect', { set: set }); - -},{"101":101,"105":105,"116":116,"38":38,"62":62,"71":71,"81":81,"99":99}],247:[function(_dereq_,module,exports){ -var global = _dereq_(70); -var inheritIfRequired = _dereq_(75); -var dP = _dereq_(99).f; -var gOPN = _dereq_(103).f; -var isRegExp = _dereq_(82); -var $flags = _dereq_(66); -var $RegExp = global.RegExp; -var Base = $RegExp; -var proto = $RegExp.prototype; -var re1 = /a/g; -var re2 = /a/g; -// "new" creates a new object, old webkit buggy here -var CORRECT_NEW = new $RegExp(re1) !== re1; - -if (_dereq_(58) && (!CORRECT_NEW || _dereq_(64)(function () { - re2[_dereq_(152)('match')] = false; - // RegExp constructor can alter flags and IsRegExp works correct with @@match - return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i'; -}))) { - $RegExp = function RegExp(p, f) { - var tiRE = this instanceof $RegExp; - var piRE = isRegExp(p); - var fiU = f === undefined; - return !tiRE && piRE && p.constructor === $RegExp && fiU ? p - : inheritIfRequired(CORRECT_NEW - ? new Base(piRE && !fiU ? p.source : p, f) - : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f) - , tiRE ? this : proto, $RegExp); - }; - var proxy = function (key) { - key in $RegExp || dP($RegExp, key, { - configurable: true, - get: function () { return Base[key]; }, - set: function (it) { Base[key] = it; } - }); - }; - for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]); - proto.constructor = $RegExp; - $RegExp.prototype = proto; - _dereq_(118)(global, 'RegExp', $RegExp); -} - -_dereq_(123)('RegExp'); - -},{"103":103,"118":118,"123":123,"152":152,"58":58,"64":64,"66":66,"70":70,"75":75,"82":82,"99":99}],248:[function(_dereq_,module,exports){ -'use strict'; -var regexpExec = _dereq_(120); -_dereq_(62)({ - target: 'RegExp', - proto: true, - forced: regexpExec !== /./.exec -}, { - exec: regexpExec -}); - -},{"120":120,"62":62}],249:[function(_dereq_,module,exports){ -// 21.2.5.3 get RegExp.prototype.flags() -if (_dereq_(58) && /./g.flags != 'g') _dereq_(99).f(RegExp.prototype, 'flags', { - configurable: true, - get: _dereq_(66) -}); - -},{"58":58,"66":66,"99":99}],250:[function(_dereq_,module,exports){ -'use strict'; - -var anObject = _dereq_(38); -var toLength = _dereq_(141); -var advanceStringIndex = _dereq_(36); -var regExpExec = _dereq_(119); - -// @@match logic -_dereq_(65)('match', 1, function (defined, MATCH, $match, maybeCallNative) { - return [ - // `String.prototype.match` method - // https://tc39.github.io/ecma262/#sec-string.prototype.match - function match(regexp) { - var O = defined(this); - var fn = regexp == undefined ? undefined : regexp[MATCH]; - return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); - }, - // `RegExp.prototype[@@match]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match - function (regexp) { - var res = maybeCallNative($match, regexp, this); - if (res.done) return res.value; - var rx = anObject(regexp); - var S = String(this); - if (!rx.global) return regExpExec(rx, S); - var fullUnicode = rx.unicode; - rx.lastIndex = 0; - var A = []; - var n = 0; - var result; - while ((result = regExpExec(rx, S)) !== null) { - var matchStr = String(result[0]); - A[n] = matchStr; - if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); - n++; - } - return n === 0 ? null : A; - } - ]; -}); - -},{"119":119,"141":141,"36":36,"38":38,"65":65}],251:[function(_dereq_,module,exports){ -'use strict'; - -var anObject = _dereq_(38); -var toObject = _dereq_(142); -var toLength = _dereq_(141); -var toInteger = _dereq_(139); -var advanceStringIndex = _dereq_(36); -var regExpExec = _dereq_(119); -var max = Math.max; -var min = Math.min; -var floor = Math.floor; -var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g; -var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g; - -var maybeToString = function (it) { - return it === undefined ? it : String(it); -}; - -// @@replace logic -_dereq_(65)('replace', 2, function (defined, REPLACE, $replace, maybeCallNative) { - return [ - // `String.prototype.replace` method - // https://tc39.github.io/ecma262/#sec-string.prototype.replace - function replace(searchValue, replaceValue) { - var O = defined(this); - var fn = searchValue == undefined ? undefined : searchValue[REPLACE]; - return fn !== undefined - ? fn.call(searchValue, O, replaceValue) - : $replace.call(String(O), searchValue, replaceValue); - }, - // `RegExp.prototype[@@replace]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace - function (regexp, replaceValue) { - var res = maybeCallNative($replace, regexp, this, replaceValue); - if (res.done) return res.value; - - var rx = anObject(regexp); - var S = String(this); - var functionalReplace = typeof replaceValue === 'function'; - if (!functionalReplace) replaceValue = String(replaceValue); - var global = rx.global; - if (global) { - var fullUnicode = rx.unicode; - rx.lastIndex = 0; - } - var results = []; - while (true) { - var result = regExpExec(rx, S); - if (result === null) break; - results.push(result); - if (!global) break; - var matchStr = String(result[0]); - if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); - } - var accumulatedResult = ''; - var nextSourcePosition = 0; - for (var i = 0; i < results.length; i++) { - result = results[i]; - var matched = String(result[0]); - var position = max(min(toInteger(result.index), S.length), 0); - var captures = []; - // NOTE: This is equivalent to - // captures = result.slice(1).map(maybeToString) - // but for some reason `nativeSlice.call(result, 1, result.length)` (called in - // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and - // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. - for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j])); - var namedCaptures = result.groups; - if (functionalReplace) { - var replacerArgs = [matched].concat(captures, position, S); - if (namedCaptures !== undefined) replacerArgs.push(namedCaptures); - var replacement = String(replaceValue.apply(undefined, replacerArgs)); - } else { - replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); - } - if (position >= nextSourcePosition) { - accumulatedResult += S.slice(nextSourcePosition, position) + replacement; - nextSourcePosition = position + matched.length; - } - } - return accumulatedResult + S.slice(nextSourcePosition); - } - ]; - - // https://tc39.github.io/ecma262/#sec-getsubstitution - function getSubstitution(matched, str, position, captures, namedCaptures, replacement) { - var tailPos = position + matched.length; - var m = captures.length; - var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; - if (namedCaptures !== undefined) { - namedCaptures = toObject(namedCaptures); - symbols = SUBSTITUTION_SYMBOLS; - } - return $replace.call(replacement, symbols, function (match, ch) { - var capture; - switch (ch.charAt(0)) { - case '$': return '$'; - case '&': return matched; - case '`': return str.slice(0, position); - case "'": return str.slice(tailPos); - case '<': - capture = namedCaptures[ch.slice(1, -1)]; - break; - default: // \d\d? - var n = +ch; - if (n === 0) return match; - if (n > m) { - var f = floor(n / 10); - if (f === 0) return match; - if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1); - return match; - } - capture = captures[n - 1]; - } - return capture === undefined ? '' : capture; - }); - } -}); - -},{"119":119,"139":139,"141":141,"142":142,"36":36,"38":38,"65":65}],252:[function(_dereq_,module,exports){ -'use strict'; - -var anObject = _dereq_(38); -var sameValue = _dereq_(121); -var regExpExec = _dereq_(119); - -// @@search logic -_dereq_(65)('search', 1, function (defined, SEARCH, $search, maybeCallNative) { - return [ - // `String.prototype.search` method - // https://tc39.github.io/ecma262/#sec-string.prototype.search - function search(regexp) { - var O = defined(this); - var fn = regexp == undefined ? undefined : regexp[SEARCH]; - return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); - }, - // `RegExp.prototype[@@search]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search - function (regexp) { - var res = maybeCallNative($search, regexp, this); - if (res.done) return res.value; - var rx = anObject(regexp); - var S = String(this); - var previousLastIndex = rx.lastIndex; - if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0; - var result = regExpExec(rx, S); - if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex; - return result === null ? -1 : result.index; - } - ]; -}); - -},{"119":119,"121":121,"38":38,"65":65}],253:[function(_dereq_,module,exports){ -'use strict'; - -var isRegExp = _dereq_(82); -var anObject = _dereq_(38); -var speciesConstructor = _dereq_(127); -var advanceStringIndex = _dereq_(36); -var toLength = _dereq_(141); -var callRegExpExec = _dereq_(119); -var regexpExec = _dereq_(120); -var fails = _dereq_(64); -var $min = Math.min; -var $push = [].push; -var $SPLIT = 'split'; -var LENGTH = 'length'; -var LAST_INDEX = 'lastIndex'; -var MAX_UINT32 = 0xffffffff; - -// babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError -var SUPPORTS_Y = !fails(function () { RegExp(MAX_UINT32, 'y'); }); - -// @@split logic -_dereq_(65)('split', 2, function (defined, SPLIT, $split, maybeCallNative) { - var internalSplit; - if ( - 'abbc'[$SPLIT](/(b)*/)[1] == 'c' || - 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 || - 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 || - '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 || - '.'[$SPLIT](/()()/)[LENGTH] > 1 || - ''[$SPLIT](/.?/)[LENGTH] - ) { - // based on es5-shim implementation, need to rework it - internalSplit = function (separator, limit) { - var string = String(this); - if (separator === undefined && limit === 0) return []; - // If `separator` is not a regex, use native split - if (!isRegExp(separator)) return $split.call(string, separator, limit); - var output = []; - var flags = (separator.ignoreCase ? 'i' : '') + - (separator.multiline ? 'm' : '') + - (separator.unicode ? 'u' : '') + - (separator.sticky ? 'y' : ''); - var lastLastIndex = 0; - var splitLimit = limit === undefined ? MAX_UINT32 : limit >>> 0; - // Make `global` and avoid `lastIndex` issues by working with a copy - var separatorCopy = new RegExp(separator.source, flags + 'g'); - var match, lastIndex, lastLength; - while (match = regexpExec.call(separatorCopy, string)) { - lastIndex = separatorCopy[LAST_INDEX]; - if (lastIndex > lastLastIndex) { - output.push(string.slice(lastLastIndex, match.index)); - if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1)); - lastLength = match[0][LENGTH]; - lastLastIndex = lastIndex; - if (output[LENGTH] >= splitLimit) break; - } - if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop - } - if (lastLastIndex === string[LENGTH]) { - if (lastLength || !separatorCopy.test('')) output.push(''); - } else output.push(string.slice(lastLastIndex)); - return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output; - }; - // Chakra, V8 - } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) { - internalSplit = function (separator, limit) { - return separator === undefined && limit === 0 ? [] : $split.call(this, separator, limit); - }; - } else { - internalSplit = $split; - } - - return [ - // `String.prototype.split` method - // https://tc39.github.io/ecma262/#sec-string.prototype.split - function split(separator, limit) { - var O = defined(this); - var splitter = separator == undefined ? undefined : separator[SPLIT]; - return splitter !== undefined - ? splitter.call(separator, O, limit) - : internalSplit.call(String(O), separator, limit); - }, - // `RegExp.prototype[@@split]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split - // - // NOTE: This cannot be properly polyfilled in engines that don't support - // the 'y' flag. - function (regexp, limit) { - var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== $split); - if (res.done) return res.value; - - var rx = anObject(regexp); - var S = String(this); - var C = speciesConstructor(rx, RegExp); - - var unicodeMatching = rx.unicode; - var flags = (rx.ignoreCase ? 'i' : '') + - (rx.multiline ? 'm' : '') + - (rx.unicode ? 'u' : '') + - (SUPPORTS_Y ? 'y' : 'g'); - - // ^(? + rx + ) is needed, in combination with some S slicing, to - // simulate the 'y' flag. - var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags); - var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; - if (lim === 0) return []; - if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : []; - var p = 0; - var q = 0; - var A = []; - while (q < S.length) { - splitter.lastIndex = SUPPORTS_Y ? q : 0; - var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q)); - var e; - if ( - z === null || - (e = $min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p - ) { - q = advanceStringIndex(S, q, unicodeMatching); - } else { - A.push(S.slice(p, q)); - if (A.length === lim) return A; - for (var i = 1; i <= z.length - 1; i++) { - A.push(z[i]); - if (A.length === lim) return A; - } - q = p = e; - } - } - A.push(S.slice(p)); - return A; - } - ]; -}); - -},{"119":119,"120":120,"127":127,"141":141,"36":36,"38":38,"64":64,"65":65,"82":82}],254:[function(_dereq_,module,exports){ -'use strict'; -_dereq_(249); -var anObject = _dereq_(38); -var $flags = _dereq_(66); -var DESCRIPTORS = _dereq_(58); -var TO_STRING = 'toString'; -var $toString = /./[TO_STRING]; - -var define = function (fn) { - _dereq_(118)(RegExp.prototype, TO_STRING, fn, true); -}; - -// 21.2.5.14 RegExp.prototype.toString() -if (_dereq_(64)(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) { - define(function toString() { - var R = anObject(this); - return '/'.concat(R.source, '/', - 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined); - }); -// FF44- RegExp#toString has a wrong name -} else if ($toString.name != TO_STRING) { - define(function toString() { - return $toString.call(this); - }); -} - -},{"118":118,"249":249,"38":38,"58":58,"64":64,"66":66}],255:[function(_dereq_,module,exports){ -'use strict'; -var strong = _dereq_(49); -var validate = _dereq_(149); -var SET = 'Set'; - -// 23.2 Set Objects -module.exports = _dereq_(51)(SET, function (get) { - return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; -}, { - // 23.2.3.1 Set.prototype.add(value) - add: function add(value) { - return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value); - } -}, strong); - -},{"149":149,"49":49,"51":51}],256:[function(_dereq_,module,exports){ -'use strict'; -// B.2.3.2 String.prototype.anchor(name) -_dereq_(131)('anchor', function (createHTML) { - return function anchor(name) { - return createHTML(this, 'a', 'name', name); - }; -}); - -},{"131":131}],257:[function(_dereq_,module,exports){ -'use strict'; -// B.2.3.3 String.prototype.big() -_dereq_(131)('big', function (createHTML) { - return function big() { - return createHTML(this, 'big', '', ''); - }; -}); - -},{"131":131}],258:[function(_dereq_,module,exports){ -'use strict'; -// B.2.3.4 String.prototype.blink() -_dereq_(131)('blink', function (createHTML) { - return function blink() { - return createHTML(this, 'blink', '', ''); - }; -}); - -},{"131":131}],259:[function(_dereq_,module,exports){ -'use strict'; -// B.2.3.5 String.prototype.bold() -_dereq_(131)('bold', function (createHTML) { - return function bold() { - return createHTML(this, 'b', '', ''); - }; -}); - -},{"131":131}],260:[function(_dereq_,module,exports){ -'use strict'; -var $export = _dereq_(62); -var $at = _dereq_(129)(false); -$export($export.P, 'String', { - // 21.1.3.3 String.prototype.codePointAt(pos) - codePointAt: function codePointAt(pos) { - return $at(this, pos); - } -}); - -},{"129":129,"62":62}],261:[function(_dereq_,module,exports){ -// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) -'use strict'; -var $export = _dereq_(62); -var toLength = _dereq_(141); -var context = _dereq_(130); -var ENDS_WITH = 'endsWith'; -var $endsWith = ''[ENDS_WITH]; - -$export($export.P + $export.F * _dereq_(63)(ENDS_WITH), 'String', { - endsWith: function endsWith(searchString /* , endPosition = @length */) { - var that = context(this, searchString, ENDS_WITH); - var endPosition = arguments.length > 1 ? arguments[1] : undefined; - var len = toLength(that.length); - var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len); - var search = String(searchString); - return $endsWith - ? $endsWith.call(that, search, end) - : that.slice(end - search.length, end) === search; - } -}); - -},{"130":130,"141":141,"62":62,"63":63}],262:[function(_dereq_,module,exports){ -'use strict'; -// B.2.3.6 String.prototype.fixed() -_dereq_(131)('fixed', function (createHTML) { - return function fixed() { - return createHTML(this, 'tt', '', ''); - }; -}); - -},{"131":131}],263:[function(_dereq_,module,exports){ -'use strict'; -// B.2.3.7 String.prototype.fontcolor(color) -_dereq_(131)('fontcolor', function (createHTML) { - return function fontcolor(color) { - return createHTML(this, 'font', 'color', color); - }; -}); - -},{"131":131}],264:[function(_dereq_,module,exports){ -'use strict'; -// B.2.3.8 String.prototype.fontsize(size) -_dereq_(131)('fontsize', function (createHTML) { - return function fontsize(size) { - return createHTML(this, 'font', 'size', size); - }; -}); - -},{"131":131}],265:[function(_dereq_,module,exports){ -var $export = _dereq_(62); -var toAbsoluteIndex = _dereq_(137); -var fromCharCode = String.fromCharCode; -var $fromCodePoint = String.fromCodePoint; - -// length should be 1, old FF problem -$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { - // 21.1.2.2 String.fromCodePoint(...codePoints) - fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars - var res = []; - var aLen = arguments.length; - var i = 0; - var code; - while (aLen > i) { - code = +arguments[i++]; - if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point'); - res.push(code < 0x10000 - ? fromCharCode(code) - : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) - ); - } return res.join(''); - } -}); - -},{"137":137,"62":62}],266:[function(_dereq_,module,exports){ -// 21.1.3.7 String.prototype.includes(searchString, position = 0) -'use strict'; -var $export = _dereq_(62); -var context = _dereq_(130); -var INCLUDES = 'includes'; - -$export($export.P + $export.F * _dereq_(63)(INCLUDES), 'String', { - includes: function includes(searchString /* , position = 0 */) { - return !!~context(this, searchString, INCLUDES) - .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); - } -}); - -},{"130":130,"62":62,"63":63}],267:[function(_dereq_,module,exports){ -'use strict'; -// B.2.3.9 String.prototype.italics() -_dereq_(131)('italics', function (createHTML) { - return function italics() { - return createHTML(this, 'i', '', ''); - }; -}); - -},{"131":131}],268:[function(_dereq_,module,exports){ -'use strict'; -var $at = _dereq_(129)(true); - -// 21.1.3.27 String.prototype[@@iterator]() -_dereq_(85)(String, 'String', function (iterated) { - this._t = String(iterated); // target - this._i = 0; // next index -// 21.1.5.2.1 %StringIteratorPrototype%.next() -}, function () { - var O = this._t; - var index = this._i; - var point; - if (index >= O.length) return { value: undefined, done: true }; - point = $at(O, index); - this._i += point.length; - return { value: point, done: false }; -}); - -},{"129":129,"85":85}],269:[function(_dereq_,module,exports){ -'use strict'; -// B.2.3.10 String.prototype.link(url) -_dereq_(131)('link', function (createHTML) { - return function link(url) { - return createHTML(this, 'a', 'href', url); - }; -}); - -},{"131":131}],270:[function(_dereq_,module,exports){ -var $export = _dereq_(62); -var toIObject = _dereq_(140); -var toLength = _dereq_(141); - -$export($export.S, 'String', { - // 21.1.2.4 String.raw(callSite, ...substitutions) - raw: function raw(callSite) { - var tpl = toIObject(callSite.raw); - var len = toLength(tpl.length); - var aLen = arguments.length; - var res = []; - var i = 0; - while (len > i) { - res.push(String(tpl[i++])); - if (i < aLen) res.push(String(arguments[i])); - } return res.join(''); - } -}); - -},{"140":140,"141":141,"62":62}],271:[function(_dereq_,module,exports){ -var $export = _dereq_(62); - -$export($export.P, 'String', { - // 21.1.3.13 String.prototype.repeat(count) - repeat: _dereq_(133) -}); - -},{"133":133,"62":62}],272:[function(_dereq_,module,exports){ -'use strict'; -// B.2.3.11 String.prototype.small() -_dereq_(131)('small', function (createHTML) { - return function small() { - return createHTML(this, 'small', '', ''); - }; -}); - -},{"131":131}],273:[function(_dereq_,module,exports){ -// 21.1.3.18 String.prototype.startsWith(searchString [, position ]) -'use strict'; -var $export = _dereq_(62); -var toLength = _dereq_(141); -var context = _dereq_(130); -var STARTS_WITH = 'startsWith'; -var $startsWith = ''[STARTS_WITH]; - -$export($export.P + $export.F * _dereq_(63)(STARTS_WITH), 'String', { - startsWith: function startsWith(searchString /* , position = 0 */) { - var that = context(this, searchString, STARTS_WITH); - var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)); - var search = String(searchString); - return $startsWith - ? $startsWith.call(that, search, index) - : that.slice(index, index + search.length) === search; - } -}); - -},{"130":130,"141":141,"62":62,"63":63}],274:[function(_dereq_,module,exports){ -'use strict'; -// B.2.3.12 String.prototype.strike() -_dereq_(131)('strike', function (createHTML) { - return function strike() { - return createHTML(this, 'strike', '', ''); - }; -}); - -},{"131":131}],275:[function(_dereq_,module,exports){ -'use strict'; -// B.2.3.13 String.prototype.sub() -_dereq_(131)('sub', function (createHTML) { - return function sub() { - return createHTML(this, 'sub', '', ''); - }; -}); - -},{"131":131}],276:[function(_dereq_,module,exports){ -'use strict'; -// B.2.3.14 String.prototype.sup() -_dereq_(131)('sup', function (createHTML) { - return function sup() { - return createHTML(this, 'sup', '', ''); - }; -}); - -},{"131":131}],277:[function(_dereq_,module,exports){ -'use strict'; -// 21.1.3.25 String.prototype.trim() -_dereq_(134)('trim', function ($trim) { - return function trim() { - return $trim(this, 3); - }; -}); - -},{"134":134}],278:[function(_dereq_,module,exports){ -'use strict'; -// ECMAScript 6 symbols shim -var global = _dereq_(70); -var has = _dereq_(71); -var DESCRIPTORS = _dereq_(58); -var $export = _dereq_(62); -var redefine = _dereq_(118); -var META = _dereq_(94).KEY; -var $fails = _dereq_(64); -var shared = _dereq_(126); -var setToStringTag = _dereq_(124); -var uid = _dereq_(147); -var wks = _dereq_(152); -var wksExt = _dereq_(151); -var wksDefine = _dereq_(150); -var enumKeys = _dereq_(61); -var isArray = _dereq_(79); -var anObject = _dereq_(38); -var isObject = _dereq_(81); -var toObject = _dereq_(142); -var toIObject = _dereq_(140); -var toPrimitive = _dereq_(143); -var createDesc = _dereq_(116); -var _create = _dereq_(98); -var gOPNExt = _dereq_(102); -var $GOPD = _dereq_(101); -var $GOPS = _dereq_(104); -var $DP = _dereq_(99); -var $keys = _dereq_(107); -var gOPD = $GOPD.f; -var dP = $DP.f; -var gOPN = gOPNExt.f; -var $Symbol = global.Symbol; -var $JSON = global.JSON; -var _stringify = $JSON && $JSON.stringify; -var PROTOTYPE = 'prototype'; -var HIDDEN = wks('_hidden'); -var TO_PRIMITIVE = wks('toPrimitive'); -var isEnum = {}.propertyIsEnumerable; -var SymbolRegistry = shared('symbol-registry'); -var AllSymbols = shared('symbols'); -var OPSymbols = shared('op-symbols'); -var ObjectProto = Object[PROTOTYPE]; -var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f; -var QObject = global.QObject; -// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 -var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; - -// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 -var setSymbolDesc = DESCRIPTORS && $fails(function () { - return _create(dP({}, 'a', { - get: function () { return dP(this, 'a', { value: 7 }).a; } - })).a != 7; -}) ? function (it, key, D) { - var protoDesc = gOPD(ObjectProto, key); - if (protoDesc) delete ObjectProto[key]; - dP(it, key, D); - if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc); -} : dP; - -var wrap = function (tag) { - var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); - sym._k = tag; - return sym; -}; - -var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) { - return typeof it == 'symbol'; -} : function (it) { - return it instanceof $Symbol; -}; - -var $defineProperty = function defineProperty(it, key, D) { - if (it === ObjectProto) $defineProperty(OPSymbols, key, D); - anObject(it); - key = toPrimitive(key, true); - anObject(D); - if (has(AllSymbols, key)) { - if (!D.enumerable) { - if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {})); - it[HIDDEN][key] = true; - } else { - if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false; - D = _create(D, { enumerable: createDesc(0, false) }); - } return setSymbolDesc(it, key, D); - } return dP(it, key, D); -}; -var $defineProperties = function defineProperties(it, P) { - anObject(it); - var keys = enumKeys(P = toIObject(P)); - var i = 0; - var l = keys.length; - var key; - while (l > i) $defineProperty(it, key = keys[i++], P[key]); - return it; -}; -var $create = function create(it, P) { - return P === undefined ? _create(it) : $defineProperties(_create(it), P); -}; -var $propertyIsEnumerable = function propertyIsEnumerable(key) { - var E = isEnum.call(this, key = toPrimitive(key, true)); - if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false; - return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; -}; -var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) { - it = toIObject(it); - key = toPrimitive(key, true); - if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return; - var D = gOPD(it, key); - if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true; - return D; -}; -var $getOwnPropertyNames = function getOwnPropertyNames(it) { - var names = gOPN(toIObject(it)); - var result = []; - var i = 0; - var key; - while (names.length > i) { - if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key); - } return result; -}; -var $getOwnPropertySymbols = function getOwnPropertySymbols(it) { - var IS_OP = it === ObjectProto; - var names = gOPN(IS_OP ? OPSymbols : toIObject(it)); - var result = []; - var i = 0; - var key; - while (names.length > i) { - if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]); - } return result; -}; - -// 19.4.1.1 Symbol([description]) -if (!USE_NATIVE) { - $Symbol = function Symbol() { - if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!'); - var tag = uid(arguments.length > 0 ? arguments[0] : undefined); - var $set = function (value) { - if (this === ObjectProto) $set.call(OPSymbols, value); - if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; - setSymbolDesc(this, tag, createDesc(1, value)); - }; - if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set }); - return wrap(tag); - }; - redefine($Symbol[PROTOTYPE], 'toString', function toString() { - return this._k; - }); - - $GOPD.f = $getOwnPropertyDescriptor; - $DP.f = $defineProperty; - _dereq_(103).f = gOPNExt.f = $getOwnPropertyNames; - _dereq_(108).f = $propertyIsEnumerable; - $GOPS.f = $getOwnPropertySymbols; - - if (DESCRIPTORS && !_dereq_(89)) { - redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); - } - - wksExt.f = function (name) { - return wrap(wks(name)); - }; -} - -$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol }); - -for (var es6Symbols = ( - // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 - 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' -).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]); - -for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]); - -$export($export.S + $export.F * !USE_NATIVE, 'Symbol', { - // 19.4.2.1 Symbol.for(key) - 'for': function (key) { - return has(SymbolRegistry, key += '') - ? SymbolRegistry[key] - : SymbolRegistry[key] = $Symbol(key); - }, - // 19.4.2.5 Symbol.keyFor(sym) - keyFor: function keyFor(sym) { - if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!'); - for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key; - }, - useSetter: function () { setter = true; }, - useSimple: function () { setter = false; } -}); - -$export($export.S + $export.F * !USE_NATIVE, 'Object', { - // 19.1.2.2 Object.create(O [, Properties]) - create: $create, - // 19.1.2.4 Object.defineProperty(O, P, Attributes) - defineProperty: $defineProperty, - // 19.1.2.3 Object.defineProperties(O, Properties) - defineProperties: $defineProperties, - // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) - getOwnPropertyDescriptor: $getOwnPropertyDescriptor, - // 19.1.2.7 Object.getOwnPropertyNames(O) - getOwnPropertyNames: $getOwnPropertyNames, - // 19.1.2.8 Object.getOwnPropertySymbols(O) - getOwnPropertySymbols: $getOwnPropertySymbols -}); - -// Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives -// https://bugs.chromium.org/p/v8/issues/detail?id=3443 -var FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); }); - -$export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', { - getOwnPropertySymbols: function getOwnPropertySymbols(it) { - return $GOPS.f(toObject(it)); - } -}); - -// 24.3.2 JSON.stringify(value [, replacer [, space]]) -$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () { - var S = $Symbol(); - // MS Edge converts symbol values to JSON as {} - // WebKit converts symbol values to JSON as null - // V8 throws on boxed symbols - return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}'; -})), 'JSON', { - stringify: function stringify(it) { - var args = [it]; - var i = 1; - var replacer, $replacer; - while (arguments.length > i) args.push(arguments[i++]); - $replacer = replacer = args[1]; - if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined - if (!isArray(replacer)) replacer = function (key, value) { - if (typeof $replacer == 'function') value = $replacer.call(this, key, value); - if (!isSymbol(value)) return value; - }; - args[1] = replacer; - return _stringify.apply($JSON, args); - } -}); - -// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) -$Symbol[PROTOTYPE][TO_PRIMITIVE] || _dereq_(72)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); -// 19.4.3.5 Symbol.prototype[@@toStringTag] -setToStringTag($Symbol, 'Symbol'); -// 20.2.1.9 Math[@@toStringTag] -setToStringTag(Math, 'Math', true); -// 24.3.3 JSON[@@toStringTag] -setToStringTag(global.JSON, 'JSON', true); - -},{"101":101,"102":102,"103":103,"104":104,"107":107,"108":108,"116":116,"118":118,"124":124,"126":126,"140":140,"142":142,"143":143,"147":147,"150":150,"151":151,"152":152,"38":38,"58":58,"61":61,"62":62,"64":64,"70":70,"71":71,"72":72,"79":79,"81":81,"89":89,"94":94,"98":98,"99":99}],279:[function(_dereq_,module,exports){ -'use strict'; -var $export = _dereq_(62); -var $typed = _dereq_(146); -var buffer = _dereq_(145); -var anObject = _dereq_(38); -var toAbsoluteIndex = _dereq_(137); -var toLength = _dereq_(141); -var isObject = _dereq_(81); -var ArrayBuffer = _dereq_(70).ArrayBuffer; -var speciesConstructor = _dereq_(127); -var $ArrayBuffer = buffer.ArrayBuffer; -var $DataView = buffer.DataView; -var $isView = $typed.ABV && ArrayBuffer.isView; -var $slice = $ArrayBuffer.prototype.slice; -var VIEW = $typed.VIEW; -var ARRAY_BUFFER = 'ArrayBuffer'; - -$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer }); - -$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, { - // 24.1.3.1 ArrayBuffer.isView(arg) - isView: function isView(it) { - return $isView && $isView(it) || isObject(it) && VIEW in it; - } -}); - -$export($export.P + $export.U + $export.F * _dereq_(64)(function () { - return !new $ArrayBuffer(2).slice(1, undefined).byteLength; -}), ARRAY_BUFFER, { - // 24.1.4.3 ArrayBuffer.prototype.slice(start, end) - slice: function slice(start, end) { - if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix - var len = anObject(this).byteLength; - var first = toAbsoluteIndex(start, len); - var fin = toAbsoluteIndex(end === undefined ? len : end, len); - var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first)); - var viewS = new $DataView(this); - var viewT = new $DataView(result); - var index = 0; - while (first < fin) { - viewT.setUint8(index++, viewS.getUint8(first++)); - } return result; - } -}); - -_dereq_(123)(ARRAY_BUFFER); - -},{"123":123,"127":127,"137":137,"141":141,"145":145,"146":146,"38":38,"62":62,"64":64,"70":70,"81":81}],280:[function(_dereq_,module,exports){ -var $export = _dereq_(62); -$export($export.G + $export.W + $export.F * !_dereq_(146).ABV, { - DataView: _dereq_(145).DataView -}); - -},{"145":145,"146":146,"62":62}],281:[function(_dereq_,module,exports){ -_dereq_(144)('Float32', 4, function (init) { - return function Float32Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - -},{"144":144}],282:[function(_dereq_,module,exports){ -_dereq_(144)('Float64', 8, function (init) { - return function Float64Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - -},{"144":144}],283:[function(_dereq_,module,exports){ -_dereq_(144)('Int16', 2, function (init) { - return function Int16Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - -},{"144":144}],284:[function(_dereq_,module,exports){ -_dereq_(144)('Int32', 4, function (init) { - return function Int32Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - -},{"144":144}],285:[function(_dereq_,module,exports){ -_dereq_(144)('Int8', 1, function (init) { - return function Int8Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - -},{"144":144}],286:[function(_dereq_,module,exports){ -_dereq_(144)('Uint16', 2, function (init) { - return function Uint16Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - -},{"144":144}],287:[function(_dereq_,module,exports){ -_dereq_(144)('Uint32', 4, function (init) { - return function Uint32Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - -},{"144":144}],288:[function(_dereq_,module,exports){ -_dereq_(144)('Uint8', 1, function (init) { - return function Uint8Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - -},{"144":144}],289:[function(_dereq_,module,exports){ -_dereq_(144)('Uint8', 1, function (init) { - return function Uint8ClampedArray(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}, true); - -},{"144":144}],290:[function(_dereq_,module,exports){ -'use strict'; -var global = _dereq_(70); -var each = _dereq_(42)(0); -var redefine = _dereq_(118); -var meta = _dereq_(94); -var assign = _dereq_(97); -var weak = _dereq_(50); -var isObject = _dereq_(81); -var validate = _dereq_(149); -var NATIVE_WEAK_MAP = _dereq_(149); -var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global; -var WEAK_MAP = 'WeakMap'; -var getWeak = meta.getWeak; -var isExtensible = Object.isExtensible; -var uncaughtFrozenStore = weak.ufstore; -var InternalMap; - -var wrapper = function (get) { - return function WeakMap() { - return get(this, arguments.length > 0 ? arguments[0] : undefined); - }; -}; - -var methods = { - // 23.3.3.3 WeakMap.prototype.get(key) - get: function get(key) { - if (isObject(key)) { - var data = getWeak(key); - if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key); - return data ? data[this._i] : undefined; - } - }, - // 23.3.3.5 WeakMap.prototype.set(key, value) - set: function set(key, value) { - return weak.def(validate(this, WEAK_MAP), key, value); - } -}; - -// 23.3 WeakMap Objects -var $WeakMap = module.exports = _dereq_(51)(WEAK_MAP, wrapper, methods, weak, true, true); - -// IE11 WeakMap frozen keys fix -if (NATIVE_WEAK_MAP && IS_IE11) { - InternalMap = weak.getConstructor(wrapper, WEAK_MAP); - assign(InternalMap.prototype, methods); - meta.NEED = true; - each(['delete', 'has', 'get', 'set'], function (key) { - var proto = $WeakMap.prototype; - var method = proto[key]; - redefine(proto, key, function (a, b) { - // store frozen objects on internal weakmap shim - if (isObject(a) && !isExtensible(a)) { - if (!this._f) this._f = new InternalMap(); - var result = this._f[key](a, b); - return key == 'set' ? this : result; - // store all the rest on native weakmap - } return method.call(this, a, b); - }); - }); -} - -},{"118":118,"149":149,"42":42,"50":50,"51":51,"70":70,"81":81,"94":94,"97":97}],291:[function(_dereq_,module,exports){ -'use strict'; -var weak = _dereq_(50); -var validate = _dereq_(149); -var WEAK_SET = 'WeakSet'; - -// 23.4 WeakSet Objects -_dereq_(51)(WEAK_SET, function (get) { - return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; -}, { - // 23.4.3.1 WeakSet.prototype.add(value) - add: function add(value) { - return weak.def(validate(this, WEAK_SET), value, true); - } -}, weak, false, true); - -},{"149":149,"50":50,"51":51}],292:[function(_dereq_,module,exports){ -'use strict'; -// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap -var $export = _dereq_(62); -var flattenIntoArray = _dereq_(67); -var toObject = _dereq_(142); -var toLength = _dereq_(141); -var aFunction = _dereq_(33); -var arraySpeciesCreate = _dereq_(45); - -$export($export.P, 'Array', { - flatMap: function flatMap(callbackfn /* , thisArg */) { - var O = toObject(this); - var sourceLen, A; - aFunction(callbackfn); - sourceLen = toLength(O.length); - A = arraySpeciesCreate(O, 0); - flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]); - return A; - } -}); - -_dereq_(35)('flatMap'); - -},{"141":141,"142":142,"33":33,"35":35,"45":45,"62":62,"67":67}],293:[function(_dereq_,module,exports){ -'use strict'; -// https://github.com/tc39/Array.prototype.includes -var $export = _dereq_(62); -var $includes = _dereq_(41)(true); - -$export($export.P, 'Array', { - includes: function includes(el /* , fromIndex = 0 */) { - return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); - } -}); - -_dereq_(35)('includes'); - -},{"35":35,"41":41,"62":62}],294:[function(_dereq_,module,exports){ -// https://github.com/tc39/proposal-object-values-entries -var $export = _dereq_(62); -var $entries = _dereq_(110)(true); - -$export($export.S, 'Object', { - entries: function entries(it) { - return $entries(it); - } -}); - -},{"110":110,"62":62}],295:[function(_dereq_,module,exports){ -// https://github.com/tc39/proposal-object-getownpropertydescriptors -var $export = _dereq_(62); -var ownKeys = _dereq_(111); -var toIObject = _dereq_(140); -var gOPD = _dereq_(101); -var createProperty = _dereq_(53); - -$export($export.S, 'Object', { - getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { - var O = toIObject(object); - var getDesc = gOPD.f; - var keys = ownKeys(O); - var result = {}; - var i = 0; - var key, desc; - while (keys.length > i) { - desc = getDesc(O, key = keys[i++]); - if (desc !== undefined) createProperty(result, key, desc); - } - return result; - } -}); - -},{"101":101,"111":111,"140":140,"53":53,"62":62}],296:[function(_dereq_,module,exports){ -// https://github.com/tc39/proposal-object-values-entries -var $export = _dereq_(62); -var $values = _dereq_(110)(false); - -$export($export.S, 'Object', { - values: function values(it) { - return $values(it); - } -}); - -},{"110":110,"62":62}],297:[function(_dereq_,module,exports){ -// https://github.com/tc39/proposal-promise-finally -'use strict'; -var $export = _dereq_(62); -var core = _dereq_(52); -var global = _dereq_(70); -var speciesConstructor = _dereq_(127); -var promiseResolve = _dereq_(115); - -$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { - var C = speciesConstructor(this, core.Promise || global.Promise); - var isFunction = typeof onFinally == 'function'; - return this.then( - isFunction ? function (x) { - return promiseResolve(C, onFinally()).then(function () { return x; }); - } : onFinally, - isFunction ? function (e) { - return promiseResolve(C, onFinally()).then(function () { throw e; }); - } : onFinally - ); -} }); - -},{"115":115,"127":127,"52":52,"62":62,"70":70}],298:[function(_dereq_,module,exports){ -'use strict'; -// https://github.com/tc39/proposal-string-pad-start-end -var $export = _dereq_(62); -var $pad = _dereq_(132); -var userAgent = _dereq_(148); - -// https://github.com/zloirock/core-js/issues/280 -var WEBKIT_BUG = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent); - -$export($export.P + $export.F * WEBKIT_BUG, 'String', { - padEnd: function padEnd(maxLength /* , fillString = ' ' */) { - return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); - } -}); - -},{"132":132,"148":148,"62":62}],299:[function(_dereq_,module,exports){ -'use strict'; -// https://github.com/tc39/proposal-string-pad-start-end -var $export = _dereq_(62); -var $pad = _dereq_(132); -var userAgent = _dereq_(148); - -// https://github.com/zloirock/core-js/issues/280 -var WEBKIT_BUG = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent); - -$export($export.P + $export.F * WEBKIT_BUG, 'String', { - padStart: function padStart(maxLength /* , fillString = ' ' */) { - return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); - } -}); - -},{"132":132,"148":148,"62":62}],300:[function(_dereq_,module,exports){ -'use strict'; -// https://github.com/sebmarkbage/ecmascript-string-left-right-trim -_dereq_(134)('trimLeft', function ($trim) { - return function trimLeft() { - return $trim(this, 1); - }; -}, 'trimStart'); - -},{"134":134}],301:[function(_dereq_,module,exports){ -'use strict'; -// https://github.com/sebmarkbage/ecmascript-string-left-right-trim -_dereq_(134)('trimRight', function ($trim) { - return function trimRight() { - return $trim(this, 2); - }; -}, 'trimEnd'); - -},{"134":134}],302:[function(_dereq_,module,exports){ -_dereq_(150)('asyncIterator'); - -},{"150":150}],303:[function(_dereq_,module,exports){ -var $iterators = _dereq_(164); -var getKeys = _dereq_(107); -var redefine = _dereq_(118); -var global = _dereq_(70); -var hide = _dereq_(72); -var Iterators = _dereq_(88); -var wks = _dereq_(152); -var ITERATOR = wks('iterator'); -var TO_STRING_TAG = wks('toStringTag'); -var ArrayValues = Iterators.Array; - -var DOMIterables = { - CSSRuleList: true, // TODO: Not spec compliant, should be false. - CSSStyleDeclaration: false, - CSSValueList: false, - ClientRectList: false, - DOMRectList: false, - DOMStringList: false, - DOMTokenList: true, - DataTransferItemList: false, - FileList: false, - HTMLAllCollection: false, - HTMLCollection: false, - HTMLFormElement: false, - HTMLSelectElement: false, - MediaList: true, // TODO: Not spec compliant, should be false. - MimeTypeArray: false, - NamedNodeMap: false, - NodeList: true, - PaintRequestList: false, - Plugin: false, - PluginArray: false, - SVGLengthList: false, - SVGNumberList: false, - SVGPathSegList: false, - SVGPointList: false, - SVGStringList: false, - SVGTransformList: false, - SourceBufferList: false, - StyleSheetList: true, // TODO: Not spec compliant, should be false. - TextTrackCueList: false, - TextTrackList: false, - TouchList: false -}; - -for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) { - var NAME = collections[i]; - var explicit = DOMIterables[NAME]; - var Collection = global[NAME]; - var proto = Collection && Collection.prototype; - var key; - if (proto) { - if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues); - if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); - Iterators[NAME] = ArrayValues; - if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true); - } -} - -},{"107":107,"118":118,"152":152,"164":164,"70":70,"72":72,"88":88}],304:[function(_dereq_,module,exports){ -var $export = _dereq_(62); -var $task = _dereq_(136); -$export($export.G + $export.B, { - setImmediate: $task.set, - clearImmediate: $task.clear -}); - -},{"136":136,"62":62}],305:[function(_dereq_,module,exports){ -// ie9- setTimeout & setInterval additional parameters fix -var global = _dereq_(70); -var $export = _dereq_(62); -var userAgent = _dereq_(148); -var slice = [].slice; -var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check -var wrap = function (set) { - return function (fn, time /* , ...args */) { - var boundArgs = arguments.length > 2; - var args = boundArgs ? slice.call(arguments, 2) : false; - return set(boundArgs ? function () { - // eslint-disable-next-line no-new-func - (typeof fn == 'function' ? fn : Function(fn)).apply(this, args); - } : fn, time); - }; -}; -$export($export.G + $export.B + $export.F * MSIE, { - setTimeout: wrap(global.setTimeout), - setInterval: wrap(global.setInterval) -}); - -},{"148":148,"62":62,"70":70}],306:[function(_dereq_,module,exports){ -_dereq_(305); -_dereq_(304); -_dereq_(303); -module.exports = _dereq_(52); - -},{"303":303,"304":304,"305":305,"52":52}],307:[function(_dereq_,module,exports){ -/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -var runtime = (function (exports) { - "use strict"; - - var Op = Object.prototype; - var hasOwn = Op.hasOwnProperty; - var undefined; // More compressible than void 0. - var $Symbol = typeof Symbol === "function" ? Symbol : {}; - var iteratorSymbol = $Symbol.iterator || "@@iterator"; - var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; - var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; - - function wrap(innerFn, outerFn, self, tryLocsList) { - // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. - var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; - var generator = Object.create(protoGenerator.prototype); - var context = new Context(tryLocsList || []); - - // The ._invoke method unifies the implementations of the .next, - // .throw, and .return methods. - generator._invoke = makeInvokeMethod(innerFn, self, context); - - return generator; - } - exports.wrap = wrap; - - // Try/catch helper to minimize deoptimizations. Returns a completion - // record like context.tryEntries[i].completion. This interface could - // have been (and was previously) designed to take a closure to be - // invoked without arguments, but in all the cases we care about we - // already have an existing method we want to call, so there's no need - // to create a new function object. We can even get away with assuming - // the method takes exactly one argument, since that happens to be true - // in every case, so we don't have to touch the arguments object. The - // only additional allocation required is the completion record, which - // has a stable shape and so hopefully should be cheap to allocate. - function tryCatch(fn, obj, arg) { - try { - return { type: "normal", arg: fn.call(obj, arg) }; - } catch (err) { - return { type: "throw", arg: err }; - } - } - - var GenStateSuspendedStart = "suspendedStart"; - var GenStateSuspendedYield = "suspendedYield"; - var GenStateExecuting = "executing"; - var GenStateCompleted = "completed"; - - // Returning this object from the innerFn has the same effect as - // breaking out of the dispatch switch statement. - var ContinueSentinel = {}; - - // Dummy constructor functions that we use as the .constructor and - // .constructor.prototype properties for functions that return Generator - // objects. For full spec compliance, you may wish to configure your - // minifier not to mangle the names of these two functions. - function Generator() {} - function GeneratorFunction() {} - function GeneratorFunctionPrototype() {} - - // This is a polyfill for %IteratorPrototype% for environments that - // don't natively support it. - var IteratorPrototype = {}; - IteratorPrototype[iteratorSymbol] = function () { - return this; - }; - - var getProto = Object.getPrototypeOf; - var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); - if (NativeIteratorPrototype && - NativeIteratorPrototype !== Op && - hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { - // This environment has a native %IteratorPrototype%; use it instead - // of the polyfill. - IteratorPrototype = NativeIteratorPrototype; - } - - var Gp = GeneratorFunctionPrototype.prototype = - Generator.prototype = Object.create(IteratorPrototype); - GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; - GeneratorFunctionPrototype.constructor = GeneratorFunction; - GeneratorFunctionPrototype[toStringTagSymbol] = - GeneratorFunction.displayName = "GeneratorFunction"; - - // Helper for defining the .next, .throw, and .return methods of the - // Iterator interface in terms of a single ._invoke method. - function defineIteratorMethods(prototype) { - ["next", "throw", "return"].forEach(function(method) { - prototype[method] = function(arg) { - return this._invoke(method, arg); - }; - }); - } - - exports.isGeneratorFunction = function(genFun) { - var ctor = typeof genFun === "function" && genFun.constructor; - return ctor - ? ctor === GeneratorFunction || - // For the native GeneratorFunction constructor, the best we can - // do is to check its .name property. - (ctor.displayName || ctor.name) === "GeneratorFunction" - : false; - }; - - exports.mark = function(genFun) { - if (Object.setPrototypeOf) { - Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); - } else { - genFun.__proto__ = GeneratorFunctionPrototype; - if (!(toStringTagSymbol in genFun)) { - genFun[toStringTagSymbol] = "GeneratorFunction"; - } - } - genFun.prototype = Object.create(Gp); - return genFun; - }; - - // Within the body of any async function, `await x` is transformed to - // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test - // `hasOwn.call(value, "__await")` to determine if the yielded value is - // meant to be awaited. - exports.awrap = function(arg) { - return { __await: arg }; - }; - - function AsyncIterator(generator) { - function invoke(method, arg, resolve, reject) { - var record = tryCatch(generator[method], generator, arg); - if (record.type === "throw") { - reject(record.arg); - } else { - var result = record.arg; - var value = result.value; - if (value && - typeof value === "object" && - hasOwn.call(value, "__await")) { - return Promise.resolve(value.__await).then(function(value) { - invoke("next", value, resolve, reject); - }, function(err) { - invoke("throw", err, resolve, reject); - }); - } - - return Promise.resolve(value).then(function(unwrapped) { - // When a yielded Promise is resolved, its final value becomes - // the .value of the Promise<{value,done}> result for the - // current iteration. - result.value = unwrapped; - resolve(result); - }, function(error) { - // If a rejected Promise was yielded, throw the rejection back - // into the async generator function so it can be handled there. - return invoke("throw", error, resolve, reject); - }); - } - } - - var previousPromise; - - function enqueue(method, arg) { - function callInvokeWithMethodAndArg() { - return new Promise(function(resolve, reject) { - invoke(method, arg, resolve, reject); - }); - } - - return previousPromise = - // If enqueue has been called before, then we want to wait until - // all previous Promises have been resolved before calling invoke, - // so that results are always delivered in the correct order. If - // enqueue has not been called before, then it is important to - // call invoke immediately, without waiting on a callback to fire, - // so that the async generator function has the opportunity to do - // any necessary setup in a predictable way. This predictability - // is why the Promise constructor synchronously invokes its - // executor callback, and why async functions synchronously - // execute code before the first await. Since we implement simple - // async functions in terms of async generators, it is especially - // important to get this right, even though it requires care. - previousPromise ? previousPromise.then( - callInvokeWithMethodAndArg, - // Avoid propagating failures to Promises returned by later - // invocations of the iterator. - callInvokeWithMethodAndArg - ) : callInvokeWithMethodAndArg(); - } - - // Define the unified helper method that is used to implement .next, - // .throw, and .return (see defineIteratorMethods). - this._invoke = enqueue; - } - - defineIteratorMethods(AsyncIterator.prototype); - AsyncIterator.prototype[asyncIteratorSymbol] = function () { - return this; - }; - exports.AsyncIterator = AsyncIterator; - - // Note that simple async functions are implemented on top of - // AsyncIterator objects; they just return a Promise for the value of - // the final result produced by the iterator. - exports.async = function(innerFn, outerFn, self, tryLocsList) { - var iter = new AsyncIterator( - wrap(innerFn, outerFn, self, tryLocsList) - ); - - return exports.isGeneratorFunction(outerFn) - ? iter // If outerFn is a generator, return the full iterator. - : iter.next().then(function(result) { - return result.done ? result.value : iter.next(); - }); - }; - - function makeInvokeMethod(innerFn, self, context) { - var state = GenStateSuspendedStart; - - return function invoke(method, arg) { - if (state === GenStateExecuting) { - throw new Error("Generator is already running"); - } - - if (state === GenStateCompleted) { - if (method === "throw") { - throw arg; - } - - // Be forgiving, per 25.3.3.3.3 of the spec: - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume - return doneResult(); - } - - context.method = method; - context.arg = arg; - - while (true) { - var delegate = context.delegate; - if (delegate) { - var delegateResult = maybeInvokeDelegate(delegate, context); - if (delegateResult) { - if (delegateResult === ContinueSentinel) continue; - return delegateResult; - } - } - - if (context.method === "next") { - // Setting context._sent for legacy support of Babel's - // function.sent implementation. - context.sent = context._sent = context.arg; - - } else if (context.method === "throw") { - if (state === GenStateSuspendedStart) { - state = GenStateCompleted; - throw context.arg; - } - - context.dispatchException(context.arg); - - } else if (context.method === "return") { - context.abrupt("return", context.arg); - } - - state = GenStateExecuting; - - var record = tryCatch(innerFn, self, context); - if (record.type === "normal") { - // If an exception is thrown from innerFn, we leave state === - // GenStateExecuting and loop back for another invocation. - state = context.done - ? GenStateCompleted - : GenStateSuspendedYield; - - if (record.arg === ContinueSentinel) { - continue; - } - - return { - value: record.arg, - done: context.done - }; - - } else if (record.type === "throw") { - state = GenStateCompleted; - // Dispatch the exception by looping back around to the - // context.dispatchException(context.arg) call above. - context.method = "throw"; - context.arg = record.arg; - } - } - }; - } - - // Call delegate.iterator[context.method](context.arg) and handle the - // result, either by returning a { value, done } result from the - // delegate iterator, or by modifying context.method and context.arg, - // setting context.delegate to null, and returning the ContinueSentinel. - function maybeInvokeDelegate(delegate, context) { - var method = delegate.iterator[context.method]; - if (method === undefined) { - // A .throw or .return when the delegate iterator has no .throw - // method always terminates the yield* loop. - context.delegate = null; - - if (context.method === "throw") { - // Note: ["return"] must be used for ES3 parsing compatibility. - if (delegate.iterator["return"]) { - // If the delegate iterator has a return method, give it a - // chance to clean up. - context.method = "return"; - context.arg = undefined; - maybeInvokeDelegate(delegate, context); - - if (context.method === "throw") { - // If maybeInvokeDelegate(context) changed context.method from - // "return" to "throw", let that override the TypeError below. - return ContinueSentinel; - } - } - - context.method = "throw"; - context.arg = new TypeError( - "The iterator does not provide a 'throw' method"); - } - - return ContinueSentinel; - } - - var record = tryCatch(method, delegate.iterator, context.arg); - - if (record.type === "throw") { - context.method = "throw"; - context.arg = record.arg; - context.delegate = null; - return ContinueSentinel; - } - - var info = record.arg; - - if (! info) { - context.method = "throw"; - context.arg = new TypeError("iterator result is not an object"); - context.delegate = null; - return ContinueSentinel; - } - - if (info.done) { - // Assign the result of the finished delegate to the temporary - // variable specified by delegate.resultName (see delegateYield). - context[delegate.resultName] = info.value; - - // Resume execution at the desired location (see delegateYield). - context.next = delegate.nextLoc; - - // If context.method was "throw" but the delegate handled the - // exception, let the outer generator proceed normally. If - // context.method was "next", forget context.arg since it has been - // "consumed" by the delegate iterator. If context.method was - // "return", allow the original .return call to continue in the - // outer generator. - if (context.method !== "return") { - context.method = "next"; - context.arg = undefined; - } - - } else { - // Re-yield the result returned by the delegate method. - return info; - } - - // The delegate iterator is finished, so forget it and continue with - // the outer generator. - context.delegate = null; - return ContinueSentinel; - } - - // Define Generator.prototype.{next,throw,return} in terms of the - // unified ._invoke helper method. - defineIteratorMethods(Gp); - - Gp[toStringTagSymbol] = "Generator"; - - // A Generator should always return itself as the iterator object when the - // @@iterator function is called on it. Some browsers' implementations of the - // iterator prototype chain incorrectly implement this, causing the Generator - // object to not be returned from this call. This ensures that doesn't happen. - // See https://github.com/facebook/regenerator/issues/274 for more details. - Gp[iteratorSymbol] = function() { - return this; - }; - - Gp.toString = function() { - return "[object Generator]"; - }; - - function pushTryEntry(locs) { - var entry = { tryLoc: locs[0] }; - - if (1 in locs) { - entry.catchLoc = locs[1]; - } - - if (2 in locs) { - entry.finallyLoc = locs[2]; - entry.afterLoc = locs[3]; - } - - this.tryEntries.push(entry); - } - - function resetTryEntry(entry) { - var record = entry.completion || {}; - record.type = "normal"; - delete record.arg; - entry.completion = record; - } - - function Context(tryLocsList) { - // The root entry object (effectively a try statement without a catch - // or a finally block) gives us a place to store values thrown from - // locations where there is no enclosing try statement. - this.tryEntries = [{ tryLoc: "root" }]; - tryLocsList.forEach(pushTryEntry, this); - this.reset(true); - } - - exports.keys = function(object) { - var keys = []; - for (var key in object) { - keys.push(key); - } - keys.reverse(); - - // Rather than returning an object with a next method, we keep - // things simple and return the next function itself. - return function next() { - while (keys.length) { - var key = keys.pop(); - if (key in object) { - next.value = key; - next.done = false; - return next; - } - } - - // To avoid creating an additional object, we just hang the .value - // and .done properties off the next function object itself. This - // also ensures that the minifier will not anonymize the function. - next.done = true; - return next; - }; - }; - - function values(iterable) { - if (iterable) { - var iteratorMethod = iterable[iteratorSymbol]; - if (iteratorMethod) { - return iteratorMethod.call(iterable); - } - - if (typeof iterable.next === "function") { - return iterable; - } - - if (!isNaN(iterable.length)) { - var i = -1, next = function next() { - while (++i < iterable.length) { - if (hasOwn.call(iterable, i)) { - next.value = iterable[i]; - next.done = false; - return next; - } - } - - next.value = undefined; - next.done = true; - - return next; - }; - - return next.next = next; - } - } - - // Return an iterator with no values. - return { next: doneResult }; - } - exports.values = values; - - function doneResult() { - return { value: undefined, done: true }; - } - - Context.prototype = { - constructor: Context, - - reset: function(skipTempReset) { - this.prev = 0; - this.next = 0; - // Resetting context._sent for legacy support of Babel's - // function.sent implementation. - this.sent = this._sent = undefined; - this.done = false; - this.delegate = null; - - this.method = "next"; - this.arg = undefined; - - this.tryEntries.forEach(resetTryEntry); - - if (!skipTempReset) { - for (var name in this) { - // Not sure about the optimal order of these conditions: - if (name.charAt(0) === "t" && - hasOwn.call(this, name) && - !isNaN(+name.slice(1))) { - this[name] = undefined; - } - } - } - }, - - stop: function() { - this.done = true; - - var rootEntry = this.tryEntries[0]; - var rootRecord = rootEntry.completion; - if (rootRecord.type === "throw") { - throw rootRecord.arg; - } - - return this.rval; - }, - - dispatchException: function(exception) { - if (this.done) { - throw exception; - } - - var context = this; - function handle(loc, caught) { - record.type = "throw"; - record.arg = exception; - context.next = loc; - - if (caught) { - // If the dispatched exception was caught by a catch block, - // then let that catch block handle the exception normally. - context.method = "next"; - context.arg = undefined; - } - - return !! caught; - } - - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - var record = entry.completion; - - if (entry.tryLoc === "root") { - // Exception thrown outside of any try block that could handle - // it, so set the completion value of the entire function to - // throw the exception. - return handle("end"); - } - - if (entry.tryLoc <= this.prev) { - var hasCatch = hasOwn.call(entry, "catchLoc"); - var hasFinally = hasOwn.call(entry, "finallyLoc"); - - if (hasCatch && hasFinally) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } else if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - - } else if (hasCatch) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } - - } else if (hasFinally) { - if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - - } else { - throw new Error("try statement without catch or finally"); - } - } - } - }, - - abrupt: function(type, arg) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc <= this.prev && - hasOwn.call(entry, "finallyLoc") && - this.prev < entry.finallyLoc) { - var finallyEntry = entry; - break; - } - } - - if (finallyEntry && - (type === "break" || - type === "continue") && - finallyEntry.tryLoc <= arg && - arg <= finallyEntry.finallyLoc) { - // Ignore the finally entry if control is not jumping to a - // location outside the try/catch block. - finallyEntry = null; - } - - var record = finallyEntry ? finallyEntry.completion : {}; - record.type = type; - record.arg = arg; - - if (finallyEntry) { - this.method = "next"; - this.next = finallyEntry.finallyLoc; - return ContinueSentinel; - } - - return this.complete(record); - }, - - complete: function(record, afterLoc) { - if (record.type === "throw") { - throw record.arg; - } - - if (record.type === "break" || - record.type === "continue") { - this.next = record.arg; - } else if (record.type === "return") { - this.rval = this.arg = record.arg; - this.method = "return"; - this.next = "end"; - } else if (record.type === "normal" && afterLoc) { - this.next = afterLoc; - } - - return ContinueSentinel; - }, - - finish: function(finallyLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.finallyLoc === finallyLoc) { - this.complete(entry.completion, entry.afterLoc); - resetTryEntry(entry); - return ContinueSentinel; - } - } - }, - - "catch": function(tryLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc === tryLoc) { - var record = entry.completion; - if (record.type === "throw") { - var thrown = record.arg; - resetTryEntry(entry); - } - return thrown; - } - } - - // The context.catch method must only be called with a location - // argument that corresponds to a known catch block. - throw new Error("illegal catch attempt"); - }, - - delegateYield: function(iterable, resultName, nextLoc) { - this.delegate = { - iterator: values(iterable), - resultName: resultName, - nextLoc: nextLoc - }; - - if (this.method === "next") { - // Deliberately forget the last sent value so that we don't - // accidentally pass it on to the delegate. - this.arg = undefined; - } - - return ContinueSentinel; - } - }; - - // Regardless of whether this script is executing as a CommonJS module - // or not, return the runtime object so that we can declare the variable - // regeneratorRuntime in the outer scope, which allows this module to be - // injected easily by `bin/regenerator --include-runtime script.js`. - return exports; - -}( - // If this script is executing as a CommonJS module, use module.exports - // as the regeneratorRuntime namespace. Otherwise create a new empty - // object. Either way, the resulting object will be used to initialize - // the regeneratorRuntime variable at the top of this file. - typeof module === "object" ? module.exports : {} -)); - -try { - regeneratorRuntime = runtime; -} catch (accidentalStrictMode) { - // This module should not be running in strict mode, so the above - // assignment should always work unless something is misconfigured. Just - // in case runtime.js accidentally runs in strict mode, we can escape - // strict mode using a global Function call. This could conceivably fail - // if a Content Security Policy forbids using Function, but in that case - // the proper solution is to fix the accidental strict mode problem. If - // you've misconfigured your bundler to force strict mode and applied a - // CSP to forbid Function, and you're not willing to fix either of those - // problems, please detail your unique predicament in a GitHub issue. - Function("r", "regeneratorRuntime = r")(runtime); -} - -},{}]},{},[1]); diff --git a/vendor/browser-polyfill.min.js b/vendor/browser-polyfill.min.js deleted file mode 100644 index 891a5745..00000000 --- a/vendor/browser-polyfill.min.js +++ /dev/null @@ -1,1187 +0,0 @@ -(function (global, factory) { - if (typeof define === "function" && define.amd) { - define("webextension-polyfill", ["module"], factory); - } else if (typeof exports !== "undefined") { - factory(module); - } else { - var mod = { - exports: {} - }; - factory(mod); - global.browser = mod.exports; - } -})(this, function (module) { - /* webextension-polyfill - v0.4.0 - Wed Feb 06 2019 11:58:31 */ - /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ - /* vim: set sts=2 sw=2 et tw=80: */ - /* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - "use strict"; - - if (typeof browser === "undefined" || Object.getPrototypeOf(browser) !== Object.prototype) { - const CHROME_SEND_MESSAGE_CALLBACK_NO_RESPONSE_MESSAGE = "The message port closed before a response was received."; - const SEND_RESPONSE_DEPRECATION_WARNING = "Returning a Promise is the preferred way to send a reply from an onMessage/onMessageExternal listener, as the sendResponse will be removed from the specs (See https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onMessage)"; - - // Wrapping the bulk of this polyfill in a one-time-use function is a minor - // optimization for Firefox. Since Spidermonkey does not fully parse the - // contents of a function until the first time it's called, and since it will - // never actually need to be called, this allows the polyfill to be included - // in Firefox nearly for free. - const wrapAPIs = extensionAPIs => { - // NOTE: apiMetadata is associated to the content of the api-metadata.json file - // at build time by replacing the following "include" with the content of the - // JSON file. - const apiMetadata = { - "alarms": { - "clear": { - "minArgs": 0, - "maxArgs": 1 - }, - "clearAll": { - "minArgs": 0, - "maxArgs": 0 - }, - "get": { - "minArgs": 0, - "maxArgs": 1 - }, - "getAll": { - "minArgs": 0, - "maxArgs": 0 - } - }, - "bookmarks": { - "create": { - "minArgs": 1, - "maxArgs": 1 - }, - "get": { - "minArgs": 1, - "maxArgs": 1 - }, - "getChildren": { - "minArgs": 1, - "maxArgs": 1 - }, - "getRecent": { - "minArgs": 1, - "maxArgs": 1 - }, - "getSubTree": { - "minArgs": 1, - "maxArgs": 1 - }, - "getTree": { - "minArgs": 0, - "maxArgs": 0 - }, - "move": { - "minArgs": 2, - "maxArgs": 2 - }, - "remove": { - "minArgs": 1, - "maxArgs": 1 - }, - "removeTree": { - "minArgs": 1, - "maxArgs": 1 - }, - "search": { - "minArgs": 1, - "maxArgs": 1 - }, - "update": { - "minArgs": 2, - "maxArgs": 2 - } - }, - "browserAction": { - "disable": { - "minArgs": 0, - "maxArgs": 1, - "fallbackToNoCallback": true - }, - "enable": { - "minArgs": 0, - "maxArgs": 1, - "fallbackToNoCallback": true - }, - "getBadgeBackgroundColor": { - "minArgs": 1, - "maxArgs": 1 - }, - "getBadgeText": { - "minArgs": 1, - "maxArgs": 1 - }, - "getPopup": { - "minArgs": 1, - "maxArgs": 1 - }, - "getTitle": { - "minArgs": 1, - "maxArgs": 1 - }, - "openPopup": { - "minArgs": 0, - "maxArgs": 0 - }, - "setBadgeBackgroundColor": { - "minArgs": 1, - "maxArgs": 1, - "fallbackToNoCallback": true - }, - "setBadgeText": { - "minArgs": 1, - "maxArgs": 1, - "fallbackToNoCallback": true - }, - "setIcon": { - "minArgs": 1, - "maxArgs": 1 - }, - "setPopup": { - "minArgs": 1, - "maxArgs": 1, - "fallbackToNoCallback": true - }, - "setTitle": { - "minArgs": 1, - "maxArgs": 1, - "fallbackToNoCallback": true - } - }, - "browsingData": { - "remove": { - "minArgs": 2, - "maxArgs": 2 - }, - "removeCache": { - "minArgs": 1, - "maxArgs": 1 - }, - "removeCookies": { - "minArgs": 1, - "maxArgs": 1 - }, - "removeDownloads": { - "minArgs": 1, - "maxArgs": 1 - }, - "removeFormData": { - "minArgs": 1, - "maxArgs": 1 - }, - "removeHistory": { - "minArgs": 1, - "maxArgs": 1 - }, - "removeLocalStorage": { - "minArgs": 1, - "maxArgs": 1 - }, - "removePasswords": { - "minArgs": 1, - "maxArgs": 1 - }, - "removePluginData": { - "minArgs": 1, - "maxArgs": 1 - }, - "settings": { - "minArgs": 0, - "maxArgs": 0 - } - }, - "commands": { - "getAll": { - "minArgs": 0, - "maxArgs": 0 - } - }, - "contextMenus": { - "remove": { - "minArgs": 1, - "maxArgs": 1 - }, - "removeAll": { - "minArgs": 0, - "maxArgs": 0 - }, - "update": { - "minArgs": 2, - "maxArgs": 2 - } - }, - "cookies": { - "get": { - "minArgs": 1, - "maxArgs": 1 - }, - "getAll": { - "minArgs": 1, - "maxArgs": 1 - }, - "getAllCookieStores": { - "minArgs": 0, - "maxArgs": 0 - }, - "remove": { - "minArgs": 1, - "maxArgs": 1 - }, - "set": { - "minArgs": 1, - "maxArgs": 1 - } - }, - "devtools": { - "inspectedWindow": { - "eval": { - "minArgs": 1, - "maxArgs": 2, - "singleCallbackArg": false - } - }, - "panels": { - "create": { - "minArgs": 3, - "maxArgs": 3, - "singleCallbackArg": true - } - } - }, - "downloads": { - "cancel": { - "minArgs": 1, - "maxArgs": 1 - }, - "download": { - "minArgs": 1, - "maxArgs": 1 - }, - "erase": { - "minArgs": 1, - "maxArgs": 1 - }, - "getFileIcon": { - "minArgs": 1, - "maxArgs": 2 - }, - "open": { - "minArgs": 1, - "maxArgs": 1, - "fallbackToNoCallback": true - }, - "pause": { - "minArgs": 1, - "maxArgs": 1 - }, - "removeFile": { - "minArgs": 1, - "maxArgs": 1 - }, - "resume": { - "minArgs": 1, - "maxArgs": 1 - }, - "search": { - "minArgs": 1, - "maxArgs": 1 - }, - "show": { - "minArgs": 1, - "maxArgs": 1, - "fallbackToNoCallback": true - } - }, - "extension": { - "isAllowedFileSchemeAccess": { - "minArgs": 0, - "maxArgs": 0 - }, - "isAllowedIncognitoAccess": { - "minArgs": 0, - "maxArgs": 0 - } - }, - "history": { - "addUrl": { - "minArgs": 1, - "maxArgs": 1 - }, - "deleteAll": { - "minArgs": 0, - "maxArgs": 0 - }, - "deleteRange": { - "minArgs": 1, - "maxArgs": 1 - }, - "deleteUrl": { - "minArgs": 1, - "maxArgs": 1 - }, - "getVisits": { - "minArgs": 1, - "maxArgs": 1 - }, - "search": { - "minArgs": 1, - "maxArgs": 1 - } - }, - "i18n": { - "detectLanguage": { - "minArgs": 1, - "maxArgs": 1 - }, - "getAcceptLanguages": { - "minArgs": 0, - "maxArgs": 0 - } - }, - "identity": { - "launchWebAuthFlow": { - "minArgs": 1, - "maxArgs": 1 - } - }, - "idle": { - "queryState": { - "minArgs": 1, - "maxArgs": 1 - } - }, - "management": { - "get": { - "minArgs": 1, - "maxArgs": 1 - }, - "getAll": { - "minArgs": 0, - "maxArgs": 0 - }, - "getSelf": { - "minArgs": 0, - "maxArgs": 0 - }, - "setEnabled": { - "minArgs": 2, - "maxArgs": 2 - }, - "uninstallSelf": { - "minArgs": 0, - "maxArgs": 1 - } - }, - "notifications": { - "clear": { - "minArgs": 1, - "maxArgs": 1 - }, - "create": { - "minArgs": 1, - "maxArgs": 2 - }, - "getAll": { - "minArgs": 0, - "maxArgs": 0 - }, - "getPermissionLevel": { - "minArgs": 0, - "maxArgs": 0 - }, - "update": { - "minArgs": 2, - "maxArgs": 2 - } - }, - "pageAction": { - "getPopup": { - "minArgs": 1, - "maxArgs": 1 - }, - "getTitle": { - "minArgs": 1, - "maxArgs": 1 - }, - "hide": { - "minArgs": 1, - "maxArgs": 1, - "fallbackToNoCallback": true - }, - "setIcon": { - "minArgs": 1, - "maxArgs": 1 - }, - "setPopup": { - "minArgs": 1, - "maxArgs": 1, - "fallbackToNoCallback": true - }, - "setTitle": { - "minArgs": 1, - "maxArgs": 1, - "fallbackToNoCallback": true - }, - "show": { - "minArgs": 1, - "maxArgs": 1, - "fallbackToNoCallback": true - } - }, - "permissions": { - "contains": { - "minArgs": 1, - "maxArgs": 1 - }, - "getAll": { - "minArgs": 0, - "maxArgs": 0 - }, - "remove": { - "minArgs": 1, - "maxArgs": 1 - }, - "request": { - "minArgs": 1, - "maxArgs": 1 - } - }, - "runtime": { - "getBackgroundPage": { - "minArgs": 0, - "maxArgs": 0 - }, - "getBrowserInfo": { - "minArgs": 0, - "maxArgs": 0 - }, - "getPlatformInfo": { - "minArgs": 0, - "maxArgs": 0 - }, - "openOptionsPage": { - "minArgs": 0, - "maxArgs": 0 - }, - "requestUpdateCheck": { - "minArgs": 0, - "maxArgs": 0 - }, - "sendMessage": { - "minArgs": 1, - "maxArgs": 3 - }, - "sendNativeMessage": { - "minArgs": 2, - "maxArgs": 2 - }, - "setUninstallURL": { - "minArgs": 1, - "maxArgs": 1 - } - }, - "sessions": { - "getDevices": { - "minArgs": 0, - "maxArgs": 1 - }, - "getRecentlyClosed": { - "minArgs": 0, - "maxArgs": 1 - }, - "restore": { - "minArgs": 0, - "maxArgs": 1 - } - }, - "storage": { - "local": { - "clear": { - "minArgs": 0, - "maxArgs": 0 - }, - "get": { - "minArgs": 0, - "maxArgs": 1 - }, - "getBytesInUse": { - "minArgs": 0, - "maxArgs": 1 - }, - "remove": { - "minArgs": 1, - "maxArgs": 1 - }, - "set": { - "minArgs": 1, - "maxArgs": 1 - } - }, - "managed": { - "get": { - "minArgs": 0, - "maxArgs": 1 - }, - "getBytesInUse": { - "minArgs": 0, - "maxArgs": 1 - } - }, - "sync": { - "clear": { - "minArgs": 0, - "maxArgs": 0 - }, - "get": { - "minArgs": 0, - "maxArgs": 1 - }, - "getBytesInUse": { - "minArgs": 0, - "maxArgs": 1 - }, - "remove": { - "minArgs": 1, - "maxArgs": 1 - }, - "set": { - "minArgs": 1, - "maxArgs": 1 - } - } - }, - "tabs": { - "captureVisibleTab": { - "minArgs": 0, - "maxArgs": 2 - }, - "create": { - "minArgs": 1, - "maxArgs": 1 - }, - "detectLanguage": { - "minArgs": 0, - "maxArgs": 1 - }, - "discard": { - "minArgs": 0, - "maxArgs": 1 - }, - "duplicate": { - "minArgs": 1, - "maxArgs": 1 - }, - "executeScript": { - "minArgs": 1, - "maxArgs": 2 - }, - "get": { - "minArgs": 1, - "maxArgs": 1 - }, - "getCurrent": { - "minArgs": 0, - "maxArgs": 0 - }, - "getZoom": { - "minArgs": 0, - "maxArgs": 1 - }, - "getZoomSettings": { - "minArgs": 0, - "maxArgs": 1 - }, - "highlight": { - "minArgs": 1, - "maxArgs": 1 - }, - "insertCSS": { - "minArgs": 1, - "maxArgs": 2 - }, - "move": { - "minArgs": 2, - "maxArgs": 2 - }, - "query": { - "minArgs": 1, - "maxArgs": 1 - }, - "reload": { - "minArgs": 0, - "maxArgs": 2 - }, - "remove": { - "minArgs": 1, - "maxArgs": 1 - }, - "removeCSS": { - "minArgs": 1, - "maxArgs": 2 - }, - "sendMessage": { - "minArgs": 2, - "maxArgs": 3 - }, - "setZoom": { - "minArgs": 1, - "maxArgs": 2 - }, - "setZoomSettings": { - "minArgs": 1, - "maxArgs": 2 - }, - "update": { - "minArgs": 1, - "maxArgs": 2 - } - }, - "topSites": { - "get": { - "minArgs": 0, - "maxArgs": 0 - } - }, - "webNavigation": { - "getAllFrames": { - "minArgs": 1, - "maxArgs": 1 - }, - "getFrame": { - "minArgs": 1, - "maxArgs": 1 - } - }, - "webRequest": { - "handlerBehaviorChanged": { - "minArgs": 0, - "maxArgs": 0 - } - }, - "windows": { - "create": { - "minArgs": 0, - "maxArgs": 1 - }, - "get": { - "minArgs": 1, - "maxArgs": 2 - }, - "getAll": { - "minArgs": 0, - "maxArgs": 1 - }, - "getCurrent": { - "minArgs": 0, - "maxArgs": 1 - }, - "getLastFocused": { - "minArgs": 0, - "maxArgs": 1 - }, - "remove": { - "minArgs": 1, - "maxArgs": 1 - }, - "update": { - "minArgs": 2, - "maxArgs": 2 - } - } - }; - - if (Object.keys(apiMetadata).length === 0) { - throw new Error("api-metadata.json has not been included in browser-polyfill"); - } - - /** - * A WeakMap subclass which creates and stores a value for any key which does - * not exist when accessed, but behaves exactly as an ordinary WeakMap - * otherwise. - * - * @param {function} createItem - * A function which will be called in order to create the value for any - * key which does not exist, the first time it is accessed. The - * function receives, as its only argument, the key being created. - */ - class DefaultWeakMap extends WeakMap { - constructor(createItem, items = undefined) { - super(items); - this.createItem = createItem; - } - - get(key) { - if (!this.has(key)) { - this.set(key, this.createItem(key)); - } - - return super.get(key); - } - } - - /** - * Returns true if the given object is an object with a `then` method, and can - * therefore be assumed to behave as a Promise. - * - * @param {*} value The value to test. - * @returns {boolean} True if the value is thenable. - */ - const isThenable = value => { - return value && typeof value === "object" && typeof value.then === "function"; - }; - - /** - * Creates and returns a function which, when called, will resolve or reject - * the given promise based on how it is called: - * - * - If, when called, `chrome.runtime.lastError` contains a non-null object, - * the promise is rejected with that value. - * - If the function is called with exactly one argument, the promise is - * resolved to that value. - * - Otherwise, the promise is resolved to an array containing all of the - * function's arguments. - * - * @param {object} promise - * An object containing the resolution and rejection functions of a - * promise. - * @param {function} promise.resolve - * The promise's resolution function. - * @param {function} promise.rejection - * The promise's rejection function. - * @param {object} metadata - * Metadata about the wrapped method which has created the callback. - * @param {integer} metadata.maxResolvedArgs - * The maximum number of arguments which may be passed to the - * callback created by the wrapped async function. - * - * @returns {function} - * The generated callback function. - */ - const makeCallback = (promise, metadata) => { - return (...callbackArgs) => { - if (extensionAPIs.runtime.lastError) { - promise.reject(extensionAPIs.runtime.lastError); - } else if (metadata.singleCallbackArg || callbackArgs.length <= 1 && metadata.singleCallbackArg !== false) { - promise.resolve(callbackArgs[0]); - } else { - promise.resolve(callbackArgs); - } - }; - }; - - const pluralizeArguments = numArgs => numArgs == 1 ? "argument" : "arguments"; - - /** - * Creates a wrapper function for a method with the given name and metadata. - * - * @param {string} name - * The name of the method which is being wrapped. - * @param {object} metadata - * Metadata about the method being wrapped. - * @param {integer} metadata.minArgs - * The minimum number of arguments which must be passed to the - * function. If called with fewer than this number of arguments, the - * wrapper will raise an exception. - * @param {integer} metadata.maxArgs - * The maximum number of arguments which may be passed to the - * function. If called with more than this number of arguments, the - * wrapper will raise an exception. - * @param {integer} metadata.maxResolvedArgs - * The maximum number of arguments which may be passed to the - * callback created by the wrapped async function. - * - * @returns {function(object, ...*)} - * The generated wrapper function. - */ - const wrapAsyncFunction = (name, metadata) => { - return function asyncFunctionWrapper(target, ...args) { - if (args.length < metadata.minArgs) { - throw new Error(`Expected at least ${metadata.minArgs} ${pluralizeArguments(metadata.minArgs)} for ${name}(), got ${args.length}`); - } - - if (args.length > metadata.maxArgs) { - throw new Error(`Expected at most ${metadata.maxArgs} ${pluralizeArguments(metadata.maxArgs)} for ${name}(), got ${args.length}`); - } - - return new Promise((resolve, reject) => { - if (metadata.fallbackToNoCallback) { - // This API method has currently no callback on Chrome, but it return a promise on Firefox, - // and so the polyfill will try to call it with a callback first, and it will fallback - // to not passing the callback if the first call fails. - try { - target[name](...args, makeCallback({ resolve, reject }, metadata)); - } catch (cbError) { - console.warn(`${name} API method doesn't seem to support the callback parameter, ` + "falling back to call it without a callback: ", cbError); - - target[name](...args); - - // Update the API method metadata, so that the next API calls will not try to - // use the unsupported callback anymore. - metadata.fallbackToNoCallback = false; - metadata.noCallback = true; - - resolve(); - } - } else if (metadata.noCallback) { - target[name](...args); - resolve(); - } else { - target[name](...args, makeCallback({ resolve, reject }, metadata)); - } - }); - }; - }; - - /** - * Wraps an existing method of the target object, so that calls to it are - * intercepted by the given wrapper function. The wrapper function receives, - * as its first argument, the original `target` object, followed by each of - * the arguments passed to the original method. - * - * @param {object} target - * The original target object that the wrapped method belongs to. - * @param {function} method - * The method being wrapped. This is used as the target of the Proxy - * object which is created to wrap the method. - * @param {function} wrapper - * The wrapper function which is called in place of a direct invocation - * of the wrapped method. - * - * @returns {Proxy} - * A Proxy object for the given method, which invokes the given wrapper - * method in its place. - */ - const wrapMethod = (target, method, wrapper) => { - return new Proxy(method, { - apply(targetMethod, thisObj, args) { - return wrapper.call(thisObj, target, ...args); - } - }); - }; - - let hasOwnProperty = Function.call.bind(Object.prototype.hasOwnProperty); - - /** - * Wraps an object in a Proxy which intercepts and wraps certain methods - * based on the given `wrappers` and `metadata` objects. - * - * @param {object} target - * The target object to wrap. - * - * @param {object} [wrappers = {}] - * An object tree containing wrapper functions for special cases. Any - * function present in this object tree is called in place of the - * method in the same location in the `target` object tree. These - * wrapper methods are invoked as described in {@see wrapMethod}. - * - * @param {object} [metadata = {}] - * An object tree containing metadata used to automatically generate - * Promise-based wrapper functions for asynchronous. Any function in - * the `target` object tree which has a corresponding metadata object - * in the same location in the `metadata` tree is replaced with an - * automatically-generated wrapper function, as described in - * {@see wrapAsyncFunction} - * - * @returns {Proxy} - */ - const wrapObject = (target, wrappers = {}, metadata = {}) => { - let cache = Object.create(null); - let handlers = { - has(proxyTarget, prop) { - return prop in target || prop in cache; - }, - - get(proxyTarget, prop, receiver) { - if (prop in cache) { - return cache[prop]; - } - - if (!(prop in target)) { - return undefined; - } - - let value = target[prop]; - - if (typeof value === "function") { - // This is a method on the underlying object. Check if we need to do - // any wrapping. - - if (typeof wrappers[prop] === "function") { - // We have a special-case wrapper for this method. - value = wrapMethod(target, target[prop], wrappers[prop]); - } else if (hasOwnProperty(metadata, prop)) { - // This is an async method that we have metadata for. Create a - // Promise wrapper for it. - let wrapper = wrapAsyncFunction(prop, metadata[prop]); - value = wrapMethod(target, target[prop], wrapper); - } else { - // This is a method that we don't know or care about. Return the - // original method, bound to the underlying object. - value = value.bind(target); - } - } else if (typeof value === "object" && value !== null && (hasOwnProperty(wrappers, prop) || hasOwnProperty(metadata, prop))) { - // This is an object that we need to do some wrapping for the children - // of. Create a sub-object wrapper for it with the appropriate child - // metadata. - value = wrapObject(value, wrappers[prop], metadata[prop]); - } else { - // We don't need to do any wrapping for this property, - // so just forward all access to the underlying object. - Object.defineProperty(cache, prop, { - configurable: true, - enumerable: true, - get() { - return target[prop]; - }, - set(value) { - target[prop] = value; - } - }); - - return value; - } - - cache[prop] = value; - return value; - }, - - set(proxyTarget, prop, value, receiver) { - if (prop in cache) { - cache[prop] = value; - } else { - target[prop] = value; - } - return true; - }, - - defineProperty(proxyTarget, prop, desc) { - return Reflect.defineProperty(cache, prop, desc); - }, - - deleteProperty(proxyTarget, prop) { - return Reflect.deleteProperty(cache, prop); - } - }; - - // Per contract of the Proxy API, the "get" proxy handler must return the - // original value of the target if that value is declared read-only and - // non-configurable. For this reason, we create an object with the - // prototype set to `target` instead of using `target` directly. - // Otherwise we cannot return a custom object for APIs that - // are declared read-only and non-configurable, such as `chrome.devtools`. - // - // The proxy handlers themselves will still use the original `target` - // instead of the `proxyTarget`, so that the methods and properties are - // dereferenced via the original targets. - let proxyTarget = Object.create(target); - return new Proxy(proxyTarget, handlers); - }; - - /** - * Creates a set of wrapper functions for an event object, which handles - * wrapping of listener functions that those messages are passed. - * - * A single wrapper is created for each listener function, and stored in a - * map. Subsequent calls to `addListener`, `hasListener`, or `removeListener` - * retrieve the original wrapper, so that attempts to remove a - * previously-added listener work as expected. - * - * @param {DefaultWeakMap} wrapperMap - * A DefaultWeakMap object which will create the appropriate wrapper - * for a given listener function when one does not exist, and retrieve - * an existing one when it does. - * - * @returns {object} - */ - const wrapEvent = wrapperMap => ({ - addListener(target, listener, ...args) { - target.addListener(wrapperMap.get(listener), ...args); - }, - - hasListener(target, listener) { - return target.hasListener(wrapperMap.get(listener)); - }, - - removeListener(target, listener) { - target.removeListener(wrapperMap.get(listener)); - } - }); - - // Keep track if the deprecation warning has been logged at least once. - let loggedSendResponseDeprecationWarning = false; - - const onMessageWrappers = new DefaultWeakMap(listener => { - if (typeof listener !== "function") { - return listener; - } - - /** - * Wraps a message listener function so that it may send responses based on - * its return value, rather than by returning a sentinel value and calling a - * callback. If the listener function returns a Promise, the response is - * sent when the promise either resolves or rejects. - * - * @param {*} message - * The message sent by the other end of the channel. - * @param {object} sender - * Details about the sender of the message. - * @param {function(*)} sendResponse - * A callback which, when called with an arbitrary argument, sends - * that value as a response. - * @returns {boolean} - * True if the wrapped listener returned a Promise, which will later - * yield a response. False otherwise. - */ - return function onMessage(message, sender, sendResponse) { - let didCallSendResponse = false; - - let wrappedSendResponse; - let sendResponsePromise = new Promise(resolve => { - wrappedSendResponse = function (response) { - if (!loggedSendResponseDeprecationWarning) { - console.warn(SEND_RESPONSE_DEPRECATION_WARNING, new Error().stack); - loggedSendResponseDeprecationWarning = true; - } - didCallSendResponse = true; - resolve(response); - }; - }); - - let result; - try { - result = listener(message, sender, wrappedSendResponse); - } catch (err) { - result = Promise.reject(err); - } - - const isResultThenable = result !== true && isThenable(result); - - // If the listener didn't returned true or a Promise, or called - // wrappedSendResponse synchronously, we can exit earlier - // because there will be no response sent from this listener. - if (result !== true && !isResultThenable && !didCallSendResponse) { - return false; - } - - // A small helper to send the message if the promise resolves - // and an error if the promise rejects (a wrapped sendMessage has - // to translate the message into a resolved promise or a rejected - // promise). - const sendPromisedResult = promise => { - promise.then(msg => { - // send the message value. - sendResponse(msg); - }, error => { - // Send a JSON representation of the error if the rejected value - // is an instance of error, or the object itself otherwise. - let message; - if (error && (error instanceof Error || typeof error.message === "string")) { - message = error.message; - } else { - message = "An unexpected error occurred"; - } - - sendResponse({ - __mozWebExtensionPolyfillReject__: true, - message - }); - }).catch(err => { - // Print an error on the console if unable to send the response. - console.error("Failed to send onMessage rejected reply", err); - }); - }; - - // If the listener returned a Promise, send the resolved value as a - // result, otherwise wait the promise related to the wrappedSendResponse - // callback to resolve and send it as a response. - if (isResultThenable) { - sendPromisedResult(result); - } else { - sendPromisedResult(sendResponsePromise); - } - - // Let Chrome know that the listener is replying. - return true; - }; - }); - - const wrappedSendMessageCallback = ({ reject, resolve }, reply) => { - if (extensionAPIs.runtime.lastError) { - // Detect when none of the listeners replied to the sendMessage call and resolve - // the promise to undefined as in Firefox. - // See https://github.com/mozilla/webextension-polyfill/issues/130 - if (extensionAPIs.runtime.lastError.message === CHROME_SEND_MESSAGE_CALLBACK_NO_RESPONSE_MESSAGE) { - resolve(); - } else { - reject(extensionAPIs.runtime.lastError); - } - } else if (reply && reply.__mozWebExtensionPolyfillReject__) { - // Convert back the JSON representation of the error into - // an Error instance. - reject(new Error(reply.message)); - } else { - resolve(reply); - } - }; - - const wrappedSendMessage = (name, metadata, apiNamespaceObj, ...args) => { - if (args.length < metadata.minArgs) { - throw new Error(`Expected at least ${metadata.minArgs} ${pluralizeArguments(metadata.minArgs)} for ${name}(), got ${args.length}`); - } - - if (args.length > metadata.maxArgs) { - throw new Error(`Expected at most ${metadata.maxArgs} ${pluralizeArguments(metadata.maxArgs)} for ${name}(), got ${args.length}`); - } - - return new Promise((resolve, reject) => { - const wrappedCb = wrappedSendMessageCallback.bind(null, { resolve, reject }); - args.push(wrappedCb); - apiNamespaceObj.sendMessage(...args); - }); - }; - - const staticWrappers = { - runtime: { - onMessage: wrapEvent(onMessageWrappers), - onMessageExternal: wrapEvent(onMessageWrappers), - sendMessage: wrappedSendMessage.bind(null, "sendMessage", { minArgs: 1, maxArgs: 3 }) - }, - tabs: { - sendMessage: wrappedSendMessage.bind(null, "sendMessage", { minArgs: 2, maxArgs: 3 }) - } - }; - const settingMetadata = { - clear: { minArgs: 1, maxArgs: 1 }, - get: { minArgs: 1, maxArgs: 1 }, - set: { minArgs: 1, maxArgs: 1 } - }; - apiMetadata.privacy = { - network: { - networkPredictionEnabled: settingMetadata, - webRTCIPHandlingPolicy: settingMetadata - }, - services: { - passwordSavingEnabled: settingMetadata - }, - websites: { - hyperlinkAuditingEnabled: settingMetadata, - referrersEnabled: settingMetadata - } - }; - - return wrapObject(extensionAPIs, staticWrappers, apiMetadata); - }; - - // The build process adds a UMD wrapper around this file, which makes the - // `module` variable available. - module.exports = wrapAPIs(chrome); - } else { - module.exports = browser; - } -}); -//# sourceMappingURL=browser-polyfill.js.map \ No newline at end of file diff --git a/vendor/react-dom-development.js b/vendor/react-dom-development.js deleted file mode 100644 index 014f2e2d..00000000 --- a/vendor/react-dom-development.js +++ /dev/null @@ -1,27873 +0,0 @@ -/** @license React v16.11.0 - * react-dom.development.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -'use strict'; - -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react')) : - typeof define === 'function' && define.amd ? define(['react'], factory) : - (global.ReactDOM = factory(global.React)); -}(this, (function (React) { 'use strict'; - -// Do not require this module directly! Use normal `invariant` calls with -// template literal strings. The messages will be replaced with error codes -// during build. - -/** - * Use invariant() to assert state which your program assumes to be true. - * - * Provide sprintf-style format (only %s is supported) and arguments - * to provide information about what broke and what you were - * expecting. - * - * The invariant message will be stripped in production, but the invariant - * will remain to ensure logic does not differ in production. - */ - -if (!React) { - { - throw Error("ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM."); - } -} - -/** - * Injectable ordering of event plugins. - */ -var eventPluginOrder = null; -/** - * Injectable mapping from names to event plugin modules. - */ - -var namesToPlugins = {}; -/** - * Recomputes the plugin list using the injected plugins and plugin ordering. - * - * @private - */ - -function recomputePluginOrdering() { - if (!eventPluginOrder) { - // Wait until an `eventPluginOrder` is injected. - return; - } - - for (var pluginName in namesToPlugins) { - var pluginModule = namesToPlugins[pluginName]; - var pluginIndex = eventPluginOrder.indexOf(pluginName); - - if (!(pluginIndex > -1)) { - { - throw Error("EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `" + pluginName + "`."); - } - } - - if (plugins[pluginIndex]) { - continue; - } - - if (!pluginModule.extractEvents) { - { - throw Error("EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `" + pluginName + "` does not."); - } - } - - plugins[pluginIndex] = pluginModule; - var publishedEvents = pluginModule.eventTypes; - - for (var eventName in publishedEvents) { - if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) { - { - throw Error("EventPluginRegistry: Failed to publish event `" + eventName + "` for plugin `" + pluginName + "`."); - } - } - } - } -} -/** - * Publishes an event so that it can be dispatched by the supplied plugin. - * - * @param {object} dispatchConfig Dispatch configuration for the event. - * @param {object} PluginModule Plugin publishing the event. - * @return {boolean} True if the event was successfully published. - * @private - */ - - -function publishEventForPlugin(dispatchConfig, pluginModule, eventName) { - if (!!eventNameDispatchConfigs.hasOwnProperty(eventName)) { - { - throw Error("EventPluginHub: More than one plugin attempted to publish the same event name, `" + eventName + "`."); - } - } - - eventNameDispatchConfigs[eventName] = dispatchConfig; - var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; - - if (phasedRegistrationNames) { - for (var phaseName in phasedRegistrationNames) { - if (phasedRegistrationNames.hasOwnProperty(phaseName)) { - var phasedRegistrationName = phasedRegistrationNames[phaseName]; - publishRegistrationName(phasedRegistrationName, pluginModule, eventName); - } - } - - return true; - } else if (dispatchConfig.registrationName) { - publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName); - return true; - } - - return false; -} -/** - * Publishes a registration name that is used to identify dispatched events. - * - * @param {string} registrationName Registration name to add. - * @param {object} PluginModule Plugin publishing the event. - * @private - */ - - -function publishRegistrationName(registrationName, pluginModule, eventName) { - if (!!registrationNameModules[registrationName]) { - { - throw Error("EventPluginHub: More than one plugin attempted to publish the same registration name, `" + registrationName + "`."); - } - } - - registrationNameModules[registrationName] = pluginModule; - registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies; - - { - var lowerCasedName = registrationName.toLowerCase(); - possibleRegistrationNames[lowerCasedName] = registrationName; - - if (registrationName === 'onDoubleClick') { - possibleRegistrationNames.ondblclick = registrationName; - } - } -} -/** - * Registers plugins so that they can extract and dispatch events. - * - * @see {EventPluginHub} - */ - -/** - * Ordered list of injected plugins. - */ - - -var plugins = []; -/** - * Mapping from event name to dispatch config - */ - -var eventNameDispatchConfigs = {}; -/** - * Mapping from registration name to plugin module - */ - -var registrationNameModules = {}; -/** - * Mapping from registration name to event name - */ - -var registrationNameDependencies = {}; -/** - * Mapping from lowercase registration names to the properly cased version, - * used to warn in the case of missing event handlers. Available - * only in true. - * @type {Object} - */ - -var possibleRegistrationNames = {}; // Trust the developer to only use possibleRegistrationNames in true - -/** - * Injects an ordering of plugins (by plugin name). This allows the ordering - * to be decoupled from injection of the actual plugins so that ordering is - * always deterministic regardless of packaging, on-the-fly injection, etc. - * - * @param {array} InjectedEventPluginOrder - * @internal - * @see {EventPluginHub.injection.injectEventPluginOrder} - */ - -function injectEventPluginOrder(injectedEventPluginOrder) { - if (!!eventPluginOrder) { - { - throw Error("EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React."); - } - } // Clone the ordering so it cannot be dynamically mutated. - - - eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder); - recomputePluginOrdering(); -} -/** - * Injects plugins to be used by `EventPluginHub`. The plugin names must be - * in the ordering injected by `injectEventPluginOrder`. - * - * Plugins can be injected as part of page initialization or on-the-fly. - * - * @param {object} injectedNamesToPlugins Map from names to plugin modules. - * @internal - * @see {EventPluginHub.injection.injectEventPluginsByName} - */ - -function injectEventPluginsByName(injectedNamesToPlugins) { - var isOrderingDirty = false; - - for (var pluginName in injectedNamesToPlugins) { - if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) { - continue; - } - - var pluginModule = injectedNamesToPlugins[pluginName]; - - if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) { - if (!!namesToPlugins[pluginName]) { - { - throw Error("EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + pluginName + "`."); - } - } - - namesToPlugins[pluginName] = pluginModule; - isOrderingDirty = true; - } - } - - if (isOrderingDirty) { - recomputePluginOrdering(); - } -} - -var invokeGuardedCallbackImpl = function (name, func, context, a, b, c, d, e, f) { - var funcArgs = Array.prototype.slice.call(arguments, 3); - - try { - func.apply(context, funcArgs); - } catch (error) { - this.onError(error); - } -}; - -{ - // In DEV mode, we swap out invokeGuardedCallback for a special version - // that plays more nicely with the browser's DevTools. The idea is to preserve - // "Pause on exceptions" behavior. Because React wraps all user-provided - // functions in invokeGuardedCallback, and the production version of - // invokeGuardedCallback uses a try-catch, all user exceptions are treated - // like caught exceptions, and the DevTools won't pause unless the developer - // takes the extra step of enabling pause on caught exceptions. This is - // unintuitive, though, because even though React has caught the error, from - // the developer's perspective, the error is uncaught. - // - // To preserve the expected "Pause on exceptions" behavior, we don't use a - // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake - // DOM node, and call the user-provided callback from inside an event handler - // for that fake event. If the callback throws, the error is "captured" using - // a global event handler. But because the error happens in a different - // event loop context, it does not interrupt the normal program flow. - // Effectively, this gives us try-catch behavior without actually using - // try-catch. Neat! - // Check that the browser supports the APIs we need to implement our special - // DEV version of invokeGuardedCallback - if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') { - var fakeNode = document.createElement('react'); - - var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) { - // If document doesn't exist we know for sure we will crash in this method - // when we call document.createEvent(). However this can cause confusing - // errors: https://github.com/facebookincubator/create-react-app/issues/3482 - // So we preemptively throw with a better message instead. - if (!(typeof document !== 'undefined')) { - { - throw Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous."); - } - } - - var evt = document.createEvent('Event'); // Keeps track of whether the user-provided callback threw an error. We - // set this to true at the beginning, then set it to false right after - // calling the function. If the function errors, `didError` will never be - // set to false. This strategy works even if the browser is flaky and - // fails to call our global error handler, because it doesn't rely on - // the error event at all. - - var didError = true; // Keeps track of the value of window.event so that we can reset it - // during the callback to let user code access window.event in the - // browsers that support it. - - var windowEvent = window.event; // Keeps track of the descriptor of window.event to restore it after event - // dispatching: https://github.com/facebook/react/issues/13688 - - var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event'); // Create an event handler for our fake event. We will synchronously - // dispatch our fake event using `dispatchEvent`. Inside the handler, we - // call the user-provided callback. - - var funcArgs = Array.prototype.slice.call(arguments, 3); - - function callCallback() { - // We immediately remove the callback from event listeners so that - // nested `invokeGuardedCallback` calls do not clash. Otherwise, a - // nested call would trigger the fake event handlers of any call higher - // in the stack. - fakeNode.removeEventListener(evtType, callCallback, false); // We check for window.hasOwnProperty('event') to prevent the - // window.event assignment in both IE <= 10 as they throw an error - // "Member not found" in strict mode, and in Firefox which does not - // support window.event. - - if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) { - window.event = windowEvent; - } - - func.apply(context, funcArgs); - didError = false; - } // Create a global error event handler. We use this to capture the value - // that was thrown. It's possible that this error handler will fire more - // than once; for example, if non-React code also calls `dispatchEvent` - // and a handler for that event throws. We should be resilient to most of - // those cases. Even if our error event handler fires more than once, the - // last error event is always used. If the callback actually does error, - // we know that the last error event is the correct one, because it's not - // possible for anything else to have happened in between our callback - // erroring and the code that follows the `dispatchEvent` call below. If - // the callback doesn't error, but the error event was fired, we know to - // ignore it because `didError` will be false, as described above. - - - var error; // Use this to track whether the error event is ever called. - - var didSetError = false; - var isCrossOriginError = false; - - function handleWindowError(event) { - error = event.error; - didSetError = true; - - if (error === null && event.colno === 0 && event.lineno === 0) { - isCrossOriginError = true; - } - - if (event.defaultPrevented) { - // Some other error handler has prevented default. - // Browsers silence the error report if this happens. - // We'll remember this to later decide whether to log it or not. - if (error != null && typeof error === 'object') { - try { - error._suppressLogging = true; - } catch (inner) {// Ignore. - } - } - } - } // Create a fake event type. - - - var evtType = "react-" + (name ? name : 'invokeguardedcallback'); // Attach our event handlers - - window.addEventListener('error', handleWindowError); - fakeNode.addEventListener(evtType, callCallback, false); // Synchronously dispatch our fake event. If the user-provided function - // errors, it will trigger our global error handler. - - evt.initEvent(evtType, false, false); - fakeNode.dispatchEvent(evt); - - if (windowEventDescriptor) { - Object.defineProperty(window, 'event', windowEventDescriptor); - } - - if (didError) { - if (!didSetError) { - // The callback errored, but the error event never fired. - error = new Error('An error was thrown inside one of your components, but React ' + "doesn't know what it was. This is likely due to browser " + 'flakiness. React does its best to preserve the "Pause on ' + 'exceptions" behavior of the DevTools, which requires some ' + "DEV-mode only tricks. It's possible that these don't work in " + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.'); - } else if (isCrossOriginError) { - error = new Error("A cross-origin error was thrown. React doesn't have access to " + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.'); - } - - this.onError(error); - } // Remove our event listeners - - - window.removeEventListener('error', handleWindowError); - }; - - invokeGuardedCallbackImpl = invokeGuardedCallbackDev; - } -} - -var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl; - -var hasError = false; -var caughtError = null; // Used by event system to capture/rethrow the first error. - -var hasRethrowError = false; -var rethrowError = null; -var reporter = { - onError: function (error) { - hasError = true; - caughtError = error; - } -}; -/** - * Call a function while guarding against errors that happens within it. - * Returns an error if it throws, otherwise null. - * - * In production, this is implemented using a try-catch. The reason we don't - * use a try-catch directly is so that we can swap out a different - * implementation in DEV mode. - * - * @param {String} name of the guard to use for logging or debugging - * @param {Function} func The function to invoke - * @param {*} context The context to use when calling the function - * @param {...*} args Arguments for function - */ - -function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) { - hasError = false; - caughtError = null; - invokeGuardedCallbackImpl$1.apply(reporter, arguments); -} -/** - * Same as invokeGuardedCallback, but instead of returning an error, it stores - * it in a global so it can be rethrown by `rethrowCaughtError` later. - * TODO: See if caughtError and rethrowError can be unified. - * - * @param {String} name of the guard to use for logging or debugging - * @param {Function} func The function to invoke - * @param {*} context The context to use when calling the function - * @param {...*} args Arguments for function - */ - -function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) { - invokeGuardedCallback.apply(this, arguments); - - if (hasError) { - var error = clearCaughtError(); - - if (!hasRethrowError) { - hasRethrowError = true; - rethrowError = error; - } - } -} -/** - * During execution of guarded functions we will capture the first error which - * we will rethrow to be handled by the top level error handler. - */ - -function rethrowCaughtError() { - if (hasRethrowError) { - var error = rethrowError; - hasRethrowError = false; - rethrowError = null; - throw error; - } -} -function hasCaughtError() { - return hasError; -} -function clearCaughtError() { - if (hasError) { - var error = caughtError; - hasError = false; - caughtError = null; - return error; - } else { - { - { - throw Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue."); - } - } - } -} - -/** - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. - */ -var warningWithoutStack = function () {}; - -{ - warningWithoutStack = function (condition, format) { - for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - args[_key - 2] = arguments[_key]; - } - - if (format === undefined) { - throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument'); - } - - if (args.length > 8) { - // Check before the condition to catch violations early. - throw new Error('warningWithoutStack() currently supports at most 8 arguments.'); - } - - if (condition) { - return; - } - - if (typeof console !== 'undefined') { - var argsWithFormat = args.map(function (item) { - return '' + item; - }); - argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it - // breaks IE9: https://github.com/facebook/react/issues/13610 - - Function.prototype.apply.call(console.error, console, argsWithFormat); - } - - try { - // --- Welcome to debugging React --- - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - var argIndex = 0; - var message = 'Warning: ' + format.replace(/%s/g, function () { - return args[argIndex++]; - }); - throw new Error(message); - } catch (x) {} - }; -} - -var warningWithoutStack$1 = warningWithoutStack; - -var getFiberCurrentPropsFromNode = null; -var getInstanceFromNode = null; -var getNodeFromInstance = null; -function setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) { - getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl; - getInstanceFromNode = getInstanceFromNodeImpl; - getNodeFromInstance = getNodeFromInstanceImpl; - - { - !(getNodeFromInstance && getInstanceFromNode) ? warningWithoutStack$1(false, 'EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0; - } -} -var validateEventDispatches; - -{ - validateEventDispatches = function (event) { - var dispatchListeners = event._dispatchListeners; - var dispatchInstances = event._dispatchInstances; - var listenersIsArr = Array.isArray(dispatchListeners); - var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0; - var instancesIsArr = Array.isArray(dispatchInstances); - var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0; - !(instancesIsArr === listenersIsArr && instancesLen === listenersLen) ? warningWithoutStack$1(false, 'EventPluginUtils: Invalid `event`.') : void 0; - }; -} -/** - * Dispatch the event to the listener. - * @param {SyntheticEvent} event SyntheticEvent to handle - * @param {function} listener Application-level callback - * @param {*} inst Internal component instance - */ - - -function executeDispatch(event, listener, inst) { - var type = event.type || 'unknown-event'; - event.currentTarget = getNodeFromInstance(inst); - invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event); - event.currentTarget = null; -} -/** - * Standard/simple iteration through an event's collected dispatches. - */ - -function executeDispatchesInOrder(event) { - var dispatchListeners = event._dispatchListeners; - var dispatchInstances = event._dispatchInstances; - - { - validateEventDispatches(event); - } - - if (Array.isArray(dispatchListeners)) { - for (var i = 0; i < dispatchListeners.length; i++) { - if (event.isPropagationStopped()) { - break; - } // Listeners and Instances are two parallel arrays that are always in sync. - - - executeDispatch(event, dispatchListeners[i], dispatchInstances[i]); - } - } else if (dispatchListeners) { - executeDispatch(event, dispatchListeners, dispatchInstances); - } - - event._dispatchListeners = null; - event._dispatchInstances = null; -} -/** - * @see executeDispatchesInOrderStopAtTrueImpl - */ - - - -/** - * Execution of a "direct" dispatch - there must be at most one dispatch - * accumulated on the event or it is considered an error. It doesn't really make - * sense for an event with multiple dispatches (bubbled) to keep track of the - * return values at each dispatch execution, but it does tend to make sense when - * dealing with "direct" dispatches. - * - * @return {*} The return value of executing the single dispatch. - */ - - -/** - * @param {SyntheticEvent} event - * @return {boolean} True iff number of dispatches accumulated is greater than 0. - */ - -/** - * Accumulates items that must not be null or undefined into the first one. This - * is used to conserve memory by avoiding array allocations, and thus sacrifices - * API cleanness. Since `current` can be null before being passed in and not - * null after this function, make sure to assign it back to `current`: - * - * `a = accumulateInto(a, b);` - * - * This API should be sparingly used. Try `accumulate` for something cleaner. - * - * @return {*|array<*>} An accumulation of items. - */ - -function accumulateInto(current, next) { - if (!(next != null)) { - { - throw Error("accumulateInto(...): Accumulated items must not be null or undefined."); - } - } - - if (current == null) { - return next; - } // Both are not empty. Warning: Never call x.concat(y) when you are not - // certain that x is an Array (x could be a string with concat method). - - - if (Array.isArray(current)) { - if (Array.isArray(next)) { - current.push.apply(current, next); - return current; - } - - current.push(next); - return current; - } - - if (Array.isArray(next)) { - // A bit too dangerous to mutate `next`. - return [current].concat(next); - } - - return [current, next]; -} - -/** - * @param {array} arr an "accumulation" of items which is either an Array or - * a single item. Useful when paired with the `accumulate` module. This is a - * simple utility that allows us to reason about a collection of items, but - * handling the case when there is exactly one item (and we do not need to - * allocate an array). - * @param {function} cb Callback invoked with each element or a collection. - * @param {?} [scope] Scope used as `this` in a callback. - */ -function forEachAccumulated(arr, cb, scope) { - if (Array.isArray(arr)) { - arr.forEach(cb, scope); - } else if (arr) { - cb.call(scope, arr); - } -} - -/** - * Internal queue of events that have accumulated their dispatches and are - * waiting to have their dispatches executed. - */ - -var eventQueue = null; -/** - * Dispatches an event and releases it back into the pool, unless persistent. - * - * @param {?object} event Synthetic event to be dispatched. - * @private - */ - -var executeDispatchesAndRelease = function (event) { - if (event) { - executeDispatchesInOrder(event); - - if (!event.isPersistent()) { - event.constructor.release(event); - } - } -}; - -var executeDispatchesAndReleaseTopLevel = function (e) { - return executeDispatchesAndRelease(e); -}; - -function runEventsInBatch(events) { - if (events !== null) { - eventQueue = accumulateInto(eventQueue, events); - } // Set `eventQueue` to null before processing it so that we can tell if more - // events get enqueued while processing. - - - var processingEventQueue = eventQueue; - eventQueue = null; - - if (!processingEventQueue) { - return; - } - - forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel); - - if (!!eventQueue) { - { - throw Error("processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented."); - } - } // This would be a good time to rethrow if any of the event handlers threw. - - - rethrowCaughtError(); -} - -function isInteractive(tag) { - return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea'; -} - -function shouldPreventMouseEvent(name, type, props) { - switch (name) { - case 'onClick': - case 'onClickCapture': - case 'onDoubleClick': - case 'onDoubleClickCapture': - case 'onMouseDown': - case 'onMouseDownCapture': - case 'onMouseMove': - case 'onMouseMoveCapture': - case 'onMouseUp': - case 'onMouseUpCapture': - return !!(props.disabled && isInteractive(type)); - - default: - return false; - } -} -/** - * This is a unified interface for event plugins to be installed and configured. - * - * Event plugins can implement the following properties: - * - * `extractEvents` {function(string, DOMEventTarget, string, object): *} - * Required. When a top-level event is fired, this method is expected to - * extract synthetic events that will in turn be queued and dispatched. - * - * `eventTypes` {object} - * Optional, plugins that fire events must publish a mapping of registration - * names that are used to register listeners. Values of this mapping must - * be objects that contain `registrationName` or `phasedRegistrationNames`. - * - * `executeDispatch` {function(object, function, string)} - * Optional, allows plugins to override how an event gets dispatched. By - * default, the listener is simply invoked. - * - * Each plugin that is injected into `EventsPluginHub` is immediately operable. - * - * @public - */ - -/** - * Methods for injecting dependencies. - */ - - -var injection = { - /** - * @param {array} InjectedEventPluginOrder - * @public - */ - injectEventPluginOrder: injectEventPluginOrder, - - /** - * @param {object} injectedNamesToPlugins Map from names to plugin modules. - */ - injectEventPluginsByName: injectEventPluginsByName -}; -/** - * @param {object} inst The instance, which is the source of events. - * @param {string} registrationName Name of listener (e.g. `onClick`). - * @return {?function} The stored callback. - */ - -function getListener(inst, registrationName) { - var listener; // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not - // live here; needs to be moved to a better place soon - - var stateNode = inst.stateNode; - - if (!stateNode) { - // Work in progress (ex: onload events in incremental mode). - return null; - } - - var props = getFiberCurrentPropsFromNode(stateNode); - - if (!props) { - // Work in progress. - return null; - } - - listener = props[registrationName]; - - if (shouldPreventMouseEvent(registrationName, inst.type, props)) { - return null; - } - - if (!(!listener || typeof listener === 'function')) { - { - throw Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type."); - } - } - - return listener; -} -/** - * Allows registered plugins an opportunity to extract events from top-level - * native browser events. - * - * @return {*} An accumulation of synthetic events. - * @internal - */ - -function extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) { - var events = null; - - for (var i = 0; i < plugins.length; i++) { - // Not every plugin in the ordering may be loaded at runtime. - var possiblePlugin = plugins[i]; - - if (possiblePlugin) { - var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags); - - if (extractedEvents) { - events = accumulateInto(events, extractedEvents); - } - } - } - - return events; -} - -function runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) { - var events = extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags); - runEventsInBatch(events); -} - -var FunctionComponent = 0; -var ClassComponent = 1; -var IndeterminateComponent = 2; // Before we know whether it is function or class - -var HostRoot = 3; // Root of a host tree. Could be nested inside another node. - -var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. - -var HostComponent = 5; -var HostText = 6; -var Fragment = 7; -var Mode = 8; -var ContextConsumer = 9; -var ContextProvider = 10; -var ForwardRef = 11; -var Profiler = 12; -var SuspenseComponent = 13; -var MemoComponent = 14; -var SimpleMemoComponent = 15; -var LazyComponent = 16; -var IncompleteClassComponent = 17; -var DehydratedFragment = 18; -var SuspenseListComponent = 19; -var FundamentalComponent = 20; -var ScopeComponent = 21; - -var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions. -// Current owner and dispatcher used to share the same ref, -// but PR #14548 split them out to better support the react-debug-tools package. - -if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) { - ReactSharedInternals.ReactCurrentDispatcher = { - current: null - }; -} - -if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) { - ReactSharedInternals.ReactCurrentBatchConfig = { - suspense: null - }; -} - -var BEFORE_SLASH_RE = /^(.*)[\\\/]/; -var describeComponentFrame = function (name, source, ownerName) { - var sourceInfo = ''; - - if (source) { - var path = source.fileName; - var fileName = path.replace(BEFORE_SLASH_RE, ''); - - { - // In DEV, include code for a common special case: - // prefer "folder/index.js" instead of just "index.js". - if (/^index\./.test(fileName)) { - var match = path.match(BEFORE_SLASH_RE); - - if (match) { - var pathBeforeSlash = match[1]; - - if (pathBeforeSlash) { - var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, ''); - fileName = folderName + '/' + fileName; - } - } - } - } - - sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')'; - } else if (ownerName) { - sourceInfo = ' (created by ' + ownerName + ')'; - } - - return '\n in ' + (name || 'Unknown') + sourceInfo; -}; - -// The Symbol used to tag the ReactElement-like types. If there is no native Symbol -// nor polyfill, then a plain number is used for performance. -var hasSymbol = typeof Symbol === 'function' && Symbol.for; -var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; -var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; -var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; -var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; -var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; -var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; -var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary -// (unstable) APIs that have been removed. Can we remove the symbols? - - -var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; -var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; -var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; -var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; -var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; -var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; -var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5; -var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6; -var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7; -var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; -var FAUX_ITERATOR_SYMBOL = '@@iterator'; -function getIteratorFn(maybeIterable) { - if (maybeIterable === null || typeof maybeIterable !== 'object') { - return null; - } - - var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; - - if (typeof maybeIterator === 'function') { - return maybeIterator; - } - - return null; -} - -/** - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. - */ - -var warning = warningWithoutStack$1; - -{ - warning = function (condition, format) { - if (condition) { - return; - } - - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - var stack = ReactDebugCurrentFrame.getStackAddendum(); // eslint-disable-next-line react-internal/warning-and-invariant-args - - for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - args[_key - 2] = arguments[_key]; - } - - warningWithoutStack$1.apply(void 0, [false, format + '%s'].concat(args, [stack])); - }; -} - -var warning$1 = warning; - -var Uninitialized = -1; -var Pending = 0; -var Resolved = 1; -var Rejected = 2; -function refineResolvedLazyComponent(lazyComponent) { - return lazyComponent._status === Resolved ? lazyComponent._result : null; -} -function initializeLazyComponentType(lazyComponent) { - if (lazyComponent._status === Uninitialized) { - lazyComponent._status = Pending; - var ctor = lazyComponent._ctor; - var thenable = ctor(); - lazyComponent._result = thenable; - thenable.then(function (moduleObject) { - if (lazyComponent._status === Pending) { - var defaultExport = moduleObject.default; - - { - if (defaultExport === undefined) { - warning$1(false, 'lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + "const MyComponent = lazy(() => import('./MyComponent'))", moduleObject); - } - } - - lazyComponent._status = Resolved; - lazyComponent._result = defaultExport; - } - }, function (error) { - if (lazyComponent._status === Pending) { - lazyComponent._status = Rejected; - lazyComponent._result = error; - } - }); - } -} - -function getWrappedName(outerType, innerType, wrapperName) { - var functionName = innerType.displayName || innerType.name || ''; - return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); -} - -function getComponentName(type) { - if (type == null) { - // Host root, text node or just invalid type. - return null; - } - - { - if (typeof type.tag === 'number') { - warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); - } - } - - if (typeof type === 'function') { - return type.displayName || type.name || null; - } - - if (typeof type === 'string') { - return type; - } - - switch (type) { - case REACT_FRAGMENT_TYPE: - return 'Fragment'; - - case REACT_PORTAL_TYPE: - return 'Portal'; - - case REACT_PROFILER_TYPE: - return "Profiler"; - - case REACT_STRICT_MODE_TYPE: - return 'StrictMode'; - - case REACT_SUSPENSE_TYPE: - return 'Suspense'; - - case REACT_SUSPENSE_LIST_TYPE: - return 'SuspenseList'; - } - - if (typeof type === 'object') { - switch (type.$$typeof) { - case REACT_CONTEXT_TYPE: - return 'Context.Consumer'; - - case REACT_PROVIDER_TYPE: - return 'Context.Provider'; - - case REACT_FORWARD_REF_TYPE: - return getWrappedName(type, type.render, 'ForwardRef'); - - case REACT_MEMO_TYPE: - return getComponentName(type.type); - - case REACT_LAZY_TYPE: - { - var thenable = type; - var resolvedThenable = refineResolvedLazyComponent(thenable); - - if (resolvedThenable) { - return getComponentName(resolvedThenable); - } - - break; - } - } - } - - return null; -} - -var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - -function describeFiber(fiber) { - switch (fiber.tag) { - case HostRoot: - case HostPortal: - case HostText: - case Fragment: - case ContextProvider: - case ContextConsumer: - return ''; - - default: - var owner = fiber._debugOwner; - var source = fiber._debugSource; - var name = getComponentName(fiber.type); - var ownerName = null; - - if (owner) { - ownerName = getComponentName(owner.type); - } - - return describeComponentFrame(name, source, ownerName); - } -} - -function getStackByFiberInDevAndProd(workInProgress) { - var info = ''; - var node = workInProgress; - - do { - info += describeFiber(node); - node = node.return; - } while (node); - - return info; -} -var current = null; -var phase = null; -function getCurrentFiberOwnerNameInDevOrNull() { - { - if (current === null) { - return null; - } - - var owner = current._debugOwner; - - if (owner !== null && typeof owner !== 'undefined') { - return getComponentName(owner.type); - } - } - - return null; -} -function getCurrentFiberStackInDev() { - { - if (current === null) { - return ''; - } // Safe because if current fiber exists, we are reconciling, - // and it is guaranteed to be the work-in-progress version. - - - return getStackByFiberInDevAndProd(current); - } - - return ''; -} -function resetCurrentFiber() { - { - ReactDebugCurrentFrame.getCurrentStack = null; - current = null; - phase = null; - } -} -function setCurrentFiber(fiber) { - { - ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev; - current = fiber; - phase = null; - } -} -function setCurrentPhase(lifeCyclePhase) { - { - phase = lifeCyclePhase; - } -} - -var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined'); - -function endsWith(subject, search) { - var length = subject.length; - return subject.substring(length - search.length, length) === search; -} - -var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; -var _assign = ReactInternals.assign; - -var PLUGIN_EVENT_SYSTEM = 1; -var RESPONDER_EVENT_SYSTEM = 1 << 1; -var IS_PASSIVE = 1 << 2; -var IS_ACTIVE = 1 << 3; -var PASSIVE_NOT_SUPPORTED = 1 << 4; -var IS_REPLAYED = 1 << 5; - -var restoreImpl = null; -var restoreTarget = null; -var restoreQueue = null; - -function restoreStateOfTarget(target) { - // We perform this translation at the end of the event loop so that we - // always receive the correct fiber here - var internalInstance = getInstanceFromNode(target); - - if (!internalInstance) { - // Unmounted - return; - } - - if (!(typeof restoreImpl === 'function')) { - { - throw Error("setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue."); - } - } - - var props = getFiberCurrentPropsFromNode(internalInstance.stateNode); - restoreImpl(internalInstance.stateNode, internalInstance.type, props); -} - -function setRestoreImplementation(impl) { - restoreImpl = impl; -} -function enqueueStateRestore(target) { - if (restoreTarget) { - if (restoreQueue) { - restoreQueue.push(target); - } else { - restoreQueue = [target]; - } - } else { - restoreTarget = target; - } -} -function needsStateRestore() { - return restoreTarget !== null || restoreQueue !== null; -} -function restoreStateIfNeeded() { - if (!restoreTarget) { - return; - } - - var target = restoreTarget; - var queuedTargets = restoreQueue; - restoreTarget = null; - restoreQueue = null; - restoreStateOfTarget(target); - - if (queuedTargets) { - for (var i = 0; i < queuedTargets.length; i++) { - restoreStateOfTarget(queuedTargets[i]); - } - } -} - -var enableUserTimingAPI = true; // Helps identify side effects in begin-phase lifecycle hooks and setState reducers: - -var debugRenderPhaseSideEffects = false; // In some cases, StrictMode should also double-render lifecycles. -// This can be confusing for tests though, -// And it can be bad for performance in production. -// This feature flag can be used to control the behavior: - -var debugRenderPhaseSideEffectsForStrictMode = true; // To preserve the "Pause on caught exceptions" behavior of the debugger, we -// replay the begin phase of a failed component inside invokeGuardedCallback. - -var replayFailedUnitOfWorkWithInvokeGuardedCallback = true; // Warn about deprecated, async-unsafe lifecycles; relates to RFC #6: - -var warnAboutDeprecatedLifecycles = true; // Gather advanced timing metrics for Profiler subtrees. - -var enableProfilerTimer = true; // Trace which interactions trigger each commit. - -var enableSchedulerTracing = true; // SSR experiments - -var enableSuspenseServerRenderer = false; -var enableSelectiveHydration = false; // Only used in www builds. - - // Only used in www builds. - - // Disable javascript: URL strings in href for XSS protection. - -var disableJavaScriptURLs = false; // React Fire: prevent the value and checked attributes from syncing -// with their related DOM properties - -var disableInputAttributeSyncing = false; // These APIs will no longer be "unstable" in the upcoming 16.7 release, -// Control this behavior with a flag to support 16.6 minor releases in the meanwhile. - -var exposeConcurrentModeAPIs = false; -var warnAboutShorthandPropertyCollision = false; // Experimental React Flare event system and event components support. - -var enableFlareAPI = false; // Experimental Host Component support. - -var enableFundamentalAPI = false; // Experimental Scope support. - -var enableScopeAPI = false; // New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107 - - // We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?) -// Till then, we warn about the missing mock, but still fallback to a sync mode compatible version - -var warnAboutUnmockedScheduler = false; // For tests, we flush suspense fallbacks in an act scope; -// *except* in some of our own tests, where we test incremental loading states. - -var flushSuspenseFallbacksInTests = true; // Add a callback property to suspense to notify which promises are currently -// in the update queue. This allows reporting and tracing of what is causing -// the user to see a loading state. -// Also allows hydration callbacks to fire when a dehydrated boundary gets -// hydrated or deleted. - -var enableSuspenseCallback = false; // Part of the simplification of React.createElement so we can eventually move -// from React.createElement to React.jsx -// https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md - -var warnAboutDefaultPropsOnFunctionComponents = false; -var warnAboutStringRefs = false; -var disableLegacyContext = false; -var disableSchedulerTimeoutBasedOnReactExpirationTime = false; -var enableTrustedTypesIntegration = false; - -// the renderer. Such as when we're dispatching events or if third party -// libraries need to call batchedUpdates. Eventually, this API will go away when -// everything is batched by default. We'll then have a similar API to opt-out of -// scheduled work and instead do synchronous work. -// Defaults - -var batchedUpdatesImpl = function (fn, bookkeeping) { - return fn(bookkeeping); -}; - -var discreteUpdatesImpl = function (fn, a, b, c) { - return fn(a, b, c); -}; - -var flushDiscreteUpdatesImpl = function () {}; - -var batchedEventUpdatesImpl = batchedUpdatesImpl; -var isInsideEventHandler = false; -var isBatchingEventUpdates = false; - -function finishEventHandler() { - // Here we wait until all updates have propagated, which is important - // when using controlled components within layers: - // https://github.com/facebook/react/issues/1698 - // Then we restore state of any controlled component. - var controlledComponentsHavePendingUpdates = needsStateRestore(); - - if (controlledComponentsHavePendingUpdates) { - // If a controlled event was fired, we may need to restore the state of - // the DOM node back to the controlled value. This is necessary when React - // bails out of the update without touching the DOM. - flushDiscreteUpdatesImpl(); - restoreStateIfNeeded(); - } -} - -function batchedUpdates(fn, bookkeeping) { - if (isInsideEventHandler) { - // If we are currently inside another batch, we need to wait until it - // fully completes before restoring state. - return fn(bookkeeping); - } - - isInsideEventHandler = true; - - try { - return batchedUpdatesImpl(fn, bookkeeping); - } finally { - isInsideEventHandler = false; - finishEventHandler(); - } -} -function batchedEventUpdates(fn, a, b) { - if (isBatchingEventUpdates) { - // If we are currently inside another batch, we need to wait until it - // fully completes before restoring state. - return fn(a, b); - } - - isBatchingEventUpdates = true; - - try { - return batchedEventUpdatesImpl(fn, a, b); - } finally { - isBatchingEventUpdates = false; - finishEventHandler(); - } -} // This is for the React Flare event system - -function executeUserEventHandler(fn, value) { - var previouslyInEventHandler = isInsideEventHandler; - - try { - isInsideEventHandler = true; - var type = typeof value === 'object' && value !== null ? value.type : ''; - invokeGuardedCallbackAndCatchFirstError(type, fn, undefined, value); - } finally { - isInsideEventHandler = previouslyInEventHandler; - } -} -function discreteUpdates(fn, a, b, c) { - var prevIsInsideEventHandler = isInsideEventHandler; - isInsideEventHandler = true; - - try { - return discreteUpdatesImpl(fn, a, b, c); - } finally { - isInsideEventHandler = prevIsInsideEventHandler; - - if (!isInsideEventHandler) { - finishEventHandler(); - } - } -} -var lastFlushedEventTimeStamp = 0; -function flushDiscreteUpdatesIfNeeded(timeStamp) { - // event.timeStamp isn't overly reliable due to inconsistencies in - // how different browsers have historically provided the time stamp. - // Some browsers provide high-resolution time stamps for all events, - // some provide low-resolution time stamps for all events. FF < 52 - // even mixes both time stamps together. Some browsers even report - // negative time stamps or time stamps that are 0 (iOS9) in some cases. - // Given we are only comparing two time stamps with equality (!==), - // we are safe from the resolution differences. If the time stamp is 0 - // we bail-out of preventing the flush, which can affect semantics, - // such as if an earlier flush removes or adds event listeners that - // are fired in the subsequent flush. However, this is the same - // behaviour as we had before this change, so the risks are low. - if (!isInsideEventHandler && (!enableFlareAPI || timeStamp === 0 || lastFlushedEventTimeStamp !== timeStamp)) { - lastFlushedEventTimeStamp = timeStamp; - flushDiscreteUpdatesImpl(); - } -} -function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl) { - batchedUpdatesImpl = _batchedUpdatesImpl; - discreteUpdatesImpl = _discreteUpdatesImpl; - flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl; - batchedEventUpdatesImpl = _batchedEventUpdatesImpl; -} - -var DiscreteEvent = 0; -var UserBlockingEvent = 1; -var ContinuousEvent = 2; - -var ReactInternals$1 = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; -var _ReactInternals$Sched = ReactInternals$1.Scheduler; -var unstable_cancelCallback = _ReactInternals$Sched.unstable_cancelCallback; -var unstable_now = _ReactInternals$Sched.unstable_now; -var unstable_scheduleCallback = _ReactInternals$Sched.unstable_scheduleCallback; -var unstable_shouldYield = _ReactInternals$Sched.unstable_shouldYield; -var unstable_requestPaint = _ReactInternals$Sched.unstable_requestPaint; -var unstable_getFirstCallbackNode = _ReactInternals$Sched.unstable_getFirstCallbackNode; -var unstable_runWithPriority = _ReactInternals$Sched.unstable_runWithPriority; -var unstable_next = _ReactInternals$Sched.unstable_next; -var unstable_continueExecution = _ReactInternals$Sched.unstable_continueExecution; -var unstable_pauseExecution = _ReactInternals$Sched.unstable_pauseExecution; -var unstable_getCurrentPriorityLevel = _ReactInternals$Sched.unstable_getCurrentPriorityLevel; -var unstable_ImmediatePriority = _ReactInternals$Sched.unstable_ImmediatePriority; -var unstable_UserBlockingPriority = _ReactInternals$Sched.unstable_UserBlockingPriority; -var unstable_NormalPriority = _ReactInternals$Sched.unstable_NormalPriority; -var unstable_LowPriority = _ReactInternals$Sched.unstable_LowPriority; -var unstable_IdlePriority = _ReactInternals$Sched.unstable_IdlePriority; -var unstable_forceFrameRate = _ReactInternals$Sched.unstable_forceFrameRate; -var unstable_flushAllWithoutAsserting = _ReactInternals$Sched.unstable_flushAllWithoutAsserting; - -// CommonJS interop named imports. - -var UserBlockingPriority = unstable_UserBlockingPriority; -var runWithPriority = unstable_runWithPriority; -var listenToResponderEventTypesImpl; -function setListenToResponderEventTypes(_listenToResponderEventTypesImpl) { - listenToResponderEventTypesImpl = _listenToResponderEventTypesImpl; -} -var rootEventTypesToEventResponderInstances = new Map(); -var DoNotPropagateToNextResponder = 0; -var PropagateToNextResponder = 1; -var currentTimeStamp = 0; -var currentInstance = null; -var currentDocument = null; -var currentPropagationBehavior = DoNotPropagateToNextResponder; -var eventResponderContext = { - dispatchEvent: function (eventValue, eventListener, eventPriority) { - validateResponderContext(); - validateEventValue(eventValue); - - switch (eventPriority) { - case DiscreteEvent: - { - flushDiscreteUpdatesIfNeeded(currentTimeStamp); - discreteUpdates(function () { - return executeUserEventHandler(eventListener, eventValue); - }); - break; - } - - case UserBlockingEvent: - { - runWithPriority(UserBlockingPriority, function () { - return executeUserEventHandler(eventListener, eventValue); - }); - break; - } - - case ContinuousEvent: - { - executeUserEventHandler(eventListener, eventValue); - break; - } - } - }, - isTargetWithinResponder: function (target) { - validateResponderContext(); - - if (target != null) { - var fiber = getClosestInstanceFromNode(target); - var responderFiber = currentInstance.fiber; - - while (fiber !== null) { - if (fiber === responderFiber || fiber.alternate === responderFiber) { - return true; - } - - fiber = fiber.return; - } - } - - return false; - }, - isTargetWithinResponderScope: function (target) { - validateResponderContext(); - var componentInstance = currentInstance; - var responder = componentInstance.responder; - - if (target != null) { - var fiber = getClosestInstanceFromNode(target); - var responderFiber = currentInstance.fiber; - - while (fiber !== null) { - if (fiber === responderFiber || fiber.alternate === responderFiber) { - return true; - } - - if (doesFiberHaveResponder(fiber, responder)) { - return false; - } - - fiber = fiber.return; - } - } - - return false; - }, - isTargetWithinNode: function (childTarget, parentTarget) { - validateResponderContext(); - var childFiber = getClosestInstanceFromNode(childTarget); - var parentFiber = getClosestInstanceFromNode(parentTarget); - - if (childFiber != null && parentFiber != null) { - var parentAlternateFiber = parentFiber.alternate; - var node = childFiber; - - while (node !== null) { - if (node === parentFiber || node === parentAlternateFiber) { - return true; - } - - node = node.return; - } - - return false; - } // Fallback to DOM APIs - - - return parentTarget.contains(childTarget); - }, - addRootEventTypes: function (rootEventTypes) { - validateResponderContext(); - listenToResponderEventTypesImpl(rootEventTypes, currentDocument); - - for (var i = 0; i < rootEventTypes.length; i++) { - var rootEventType = rootEventTypes[i]; - var eventResponderInstance = currentInstance; - registerRootEventType(rootEventType, eventResponderInstance); - } - }, - removeRootEventTypes: function (rootEventTypes) { - validateResponderContext(); - - for (var i = 0; i < rootEventTypes.length; i++) { - var rootEventType = rootEventTypes[i]; - var rootEventResponders = rootEventTypesToEventResponderInstances.get(rootEventType); - var rootEventTypesSet = currentInstance.rootEventTypes; - - if (rootEventTypesSet !== null) { - rootEventTypesSet.delete(rootEventType); - } - - if (rootEventResponders !== undefined) { - rootEventResponders.delete(currentInstance); - } - } - }, - getActiveDocument: getActiveDocument, - objectAssign: _assign, - getTimeStamp: function () { - validateResponderContext(); - return currentTimeStamp; - }, - isTargetWithinHostComponent: function (target, elementType) { - validateResponderContext(); - var fiber = getClosestInstanceFromNode(target); - - while (fiber !== null) { - if (fiber.tag === HostComponent && fiber.type === elementType) { - return true; - } - - fiber = fiber.return; - } - - return false; - }, - continuePropagation: function () { - currentPropagationBehavior = PropagateToNextResponder; - }, - enqueueStateRestore: enqueueStateRestore, - getResponderNode: function () { - validateResponderContext(); - var responderFiber = currentInstance.fiber; - - if (responderFiber.tag === ScopeComponent) { - return null; - } - - return responderFiber.stateNode; - } -}; - -function validateEventValue(eventValue) { - if (typeof eventValue === 'object' && eventValue !== null) { - var target = eventValue.target, - type = eventValue.type, - timeStamp = eventValue.timeStamp; - - if (target == null || type == null || timeStamp == null) { - throw new Error('context.dispatchEvent: "target", "timeStamp", and "type" fields on event object are required.'); - } - - var showWarning = function (name) { - { - warning$1(false, '%s is not available on event objects created from event responder modules (React Flare). ' + 'Try wrapping in a conditional, i.e. `if (event.type !== "press") { event.%s }`', name, name); - } - }; - - eventValue.isDefaultPrevented = function () { - { - showWarning('isDefaultPrevented()'); - } - }; - - eventValue.isPropagationStopped = function () { - { - showWarning('isPropagationStopped()'); - } - }; // $FlowFixMe: we don't need value, Flow thinks we do - - - Object.defineProperty(eventValue, 'nativeEvent', { - get: function () { - { - showWarning('nativeEvent'); - } - } - }); - } -} - -function doesFiberHaveResponder(fiber, responder) { - var tag = fiber.tag; - - if (tag === HostComponent || tag === ScopeComponent) { - var dependencies = fiber.dependencies; - - if (dependencies !== null) { - var respondersMap = dependencies.responders; - - if (respondersMap !== null && respondersMap.has(responder)) { - return true; - } - } - } - - return false; -} - -function getActiveDocument() { - return currentDocument; -} - -function createDOMResponderEvent(topLevelType, nativeEvent, nativeEventTarget, passive, passiveSupported) { - var _ref = nativeEvent, - buttons = _ref.buttons, - pointerType = _ref.pointerType; - var eventPointerType = ''; - - if (pointerType !== undefined) { - eventPointerType = pointerType; - } else if (nativeEvent.key !== undefined) { - eventPointerType = 'keyboard'; - } else if (buttons !== undefined) { - eventPointerType = 'mouse'; - } else if (nativeEvent.changedTouches !== undefined) { - eventPointerType = 'touch'; - } - - return { - nativeEvent: nativeEvent, - passive: passive, - passiveSupported: passiveSupported, - pointerType: eventPointerType, - target: nativeEventTarget, - type: topLevelType - }; -} - -function responderEventTypesContainType(eventTypes, type) { - for (var i = 0, len = eventTypes.length; i < len; i++) { - if (eventTypes[i] === type) { - return true; - } - } - - return false; -} - -function validateResponderTargetEventTypes(eventType, responder) { - var targetEventTypes = responder.targetEventTypes; // Validate the target event type exists on the responder - - if (targetEventTypes !== null) { - return responderEventTypesContainType(targetEventTypes, eventType); - } - - return false; -} - -function traverseAndHandleEventResponderInstances(topLevelType, targetFiber, nativeEvent, nativeEventTarget, eventSystemFlags) { - var isPassiveEvent = (eventSystemFlags & IS_PASSIVE) !== 0; - var isPassiveSupported = (eventSystemFlags & PASSIVE_NOT_SUPPORTED) === 0; - var isPassive = isPassiveEvent || !isPassiveSupported; - var eventType = isPassive ? topLevelType : topLevelType + '_active'; // Trigger event responders in this order: - // - Bubble target responder phase - // - Root responder phase - - var visitedResponders = new Set(); - var responderEvent = createDOMResponderEvent(topLevelType, nativeEvent, nativeEventTarget, isPassiveEvent, isPassiveSupported); - var node = targetFiber; - var insidePortal = false; - - while (node !== null) { - var _node = node, - dependencies = _node.dependencies, - tag = _node.tag; - - if (tag === HostPortal) { - insidePortal = true; - } else if ((tag === HostComponent || tag === ScopeComponent) && dependencies !== null) { - var respondersMap = dependencies.responders; - - if (respondersMap !== null) { - var responderInstances = Array.from(respondersMap.values()); - - for (var i = 0, length = responderInstances.length; i < length; i++) { - var responderInstance = responderInstances[i]; - var props = responderInstance.props, - responder = responderInstance.responder, - state = responderInstance.state; - - if (!visitedResponders.has(responder) && validateResponderTargetEventTypes(eventType, responder) && (!insidePortal || responder.targetPortalPropagation)) { - visitedResponders.add(responder); - var onEvent = responder.onEvent; - - if (onEvent !== null) { - currentInstance = responderInstance; - onEvent(responderEvent, eventResponderContext, props, state); - - if (currentPropagationBehavior === PropagateToNextResponder) { - visitedResponders.delete(responder); - currentPropagationBehavior = DoNotPropagateToNextResponder; - } - } - } - } - } - } - - node = node.return; - } // Root phase - - - var rootEventResponderInstances = rootEventTypesToEventResponderInstances.get(eventType); - - if (rootEventResponderInstances !== undefined) { - var _responderInstances = Array.from(rootEventResponderInstances); - - for (var _i = 0; _i < _responderInstances.length; _i++) { - var _responderInstance = _responderInstances[_i]; - var props = _responderInstance.props, - responder = _responderInstance.responder, - state = _responderInstance.state; - var onRootEvent = responder.onRootEvent; - - if (onRootEvent !== null) { - currentInstance = _responderInstance; - onRootEvent(responderEvent, eventResponderContext, props, state); - } - } - } -} - -function mountEventResponder(responder, responderInstance, props, state) { - var onMount = responder.onMount; - - if (onMount !== null) { - var previousInstance = currentInstance; - currentInstance = responderInstance; - - try { - batchedEventUpdates(function () { - onMount(eventResponderContext, props, state); - }); - } finally { - currentInstance = previousInstance; - } - } -} -function unmountEventResponder(responderInstance) { - var responder = responderInstance.responder; - var onUnmount = responder.onUnmount; - - if (onUnmount !== null) { - var props = responderInstance.props, - state = responderInstance.state; - var previousInstance = currentInstance; - currentInstance = responderInstance; - - try { - batchedEventUpdates(function () { - onUnmount(eventResponderContext, props, state); - }); - } finally { - currentInstance = previousInstance; - } - } - - var rootEventTypesSet = responderInstance.rootEventTypes; - - if (rootEventTypesSet !== null) { - var rootEventTypes = Array.from(rootEventTypesSet); - - for (var i = 0; i < rootEventTypes.length; i++) { - var topLevelEventType = rootEventTypes[i]; - var rootEventResponderInstances = rootEventTypesToEventResponderInstances.get(topLevelEventType); - - if (rootEventResponderInstances !== undefined) { - rootEventResponderInstances.delete(responderInstance); - } - } - } -} - -function validateResponderContext() { - if (!(currentInstance !== null)) { - { - throw Error("An event responder context was used outside of an event cycle."); - } - } -} - -function dispatchEventForResponderEventSystem(topLevelType, targetFiber, nativeEvent, nativeEventTarget, eventSystemFlags) { - if (enableFlareAPI) { - var previousInstance = currentInstance; - var previousTimeStamp = currentTimeStamp; - var previousDocument = currentDocument; - var previousPropagationBehavior = currentPropagationBehavior; - currentPropagationBehavior = DoNotPropagateToNextResponder; // nodeType 9 is DOCUMENT_NODE - - currentDocument = nativeEventTarget.nodeType === 9 ? nativeEventTarget : nativeEventTarget.ownerDocument; // We might want to control timeStamp another way here - - currentTimeStamp = nativeEvent.timeStamp; - - try { - batchedEventUpdates(function () { - traverseAndHandleEventResponderInstances(topLevelType, targetFiber, nativeEvent, nativeEventTarget, eventSystemFlags); - }); - } finally { - currentInstance = previousInstance; - currentTimeStamp = previousTimeStamp; - currentDocument = previousDocument; - currentPropagationBehavior = previousPropagationBehavior; - } - } -} -function addRootEventTypesForResponderInstance(responderInstance, rootEventTypes) { - for (var i = 0; i < rootEventTypes.length; i++) { - var rootEventType = rootEventTypes[i]; - registerRootEventType(rootEventType, responderInstance); - } -} - -function registerRootEventType(rootEventType, eventResponderInstance) { - var rootEventResponderInstances = rootEventTypesToEventResponderInstances.get(rootEventType); - - if (rootEventResponderInstances === undefined) { - rootEventResponderInstances = new Set(); - rootEventTypesToEventResponderInstances.set(rootEventType, rootEventResponderInstances); - } - - var rootEventTypesSet = eventResponderInstance.rootEventTypes; - - if (rootEventTypesSet === null) { - rootEventTypesSet = eventResponderInstance.rootEventTypes = new Set(); - } - - if (!!rootEventTypesSet.has(rootEventType)) { - { - throw Error("addRootEventTypes() found a duplicate root event type of \"" + rootEventType + "\". This might be because the event type exists in the event responder \"rootEventTypes\" array or because of a previous addRootEventTypes() using this root event type."); - } - } - - rootEventTypesSet.add(rootEventType); - rootEventResponderInstances.add(eventResponderInstance); -} - -// A reserved attribute. -// It is handled by React separately and shouldn't be written to the DOM. -var RESERVED = 0; // A simple string attribute. -// Attributes that aren't in the whitelist are presumed to have this type. - -var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called -// "enumerated" attributes with "true" and "false" as possible values. -// When true, it should be set to a "true" string. -// When false, it should be set to a "false" string. - -var BOOLEANISH_STRING = 2; // A real boolean attribute. -// When true, it should be present (set either to an empty string or its name). -// When false, it should be omitted. - -var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value. -// When true, it should be present (set either to an empty string or its name). -// When false, it should be omitted. -// For any other value, should be present with that value. - -var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric. -// When falsy, it should be removed. - -var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric. -// When falsy, it should be removed. - -var POSITIVE_NUMERIC = 6; - -/* eslint-disable max-len */ -var ATTRIBUTE_NAME_START_CHAR = ":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"; -/* eslint-enable max-len */ - -var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; - -var ROOT_ATTRIBUTE_NAME = 'data-reactroot'; -var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$'); -var hasOwnProperty = Object.prototype.hasOwnProperty; -var illegalAttributeNameCache = {}; -var validatedAttributeNameCache = {}; -function isAttributeNameSafe(attributeName) { - if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) { - return true; - } - - if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) { - return false; - } - - if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { - validatedAttributeNameCache[attributeName] = true; - return true; - } - - illegalAttributeNameCache[attributeName] = true; - - { - warning$1(false, 'Invalid attribute name: `%s`', attributeName); - } - - return false; -} -function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) { - if (propertyInfo !== null) { - return propertyInfo.type === RESERVED; - } - - if (isCustomComponentTag) { - return false; - } - - if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) { - return true; - } - - return false; -} -function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) { - if (propertyInfo !== null && propertyInfo.type === RESERVED) { - return false; - } - - switch (typeof value) { - case 'function': // $FlowIssue symbol is perfectly valid here - - case 'symbol': - // eslint-disable-line - return true; - - case 'boolean': - { - if (isCustomComponentTag) { - return false; - } - - if (propertyInfo !== null) { - return !propertyInfo.acceptsBooleans; - } else { - var prefix = name.toLowerCase().slice(0, 5); - return prefix !== 'data-' && prefix !== 'aria-'; - } - } - - default: - return false; - } -} -function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) { - if (value === null || typeof value === 'undefined') { - return true; - } - - if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) { - return true; - } - - if (isCustomComponentTag) { - return false; - } - - if (propertyInfo !== null) { - switch (propertyInfo.type) { - case BOOLEAN: - return !value; - - case OVERLOADED_BOOLEAN: - return value === false; - - case NUMERIC: - return isNaN(value); - - case POSITIVE_NUMERIC: - return isNaN(value) || value < 1; - } - } - - return false; -} -function getPropertyInfo(name) { - return properties.hasOwnProperty(name) ? properties[name] : null; -} - -function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL) { - this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN; - this.attributeName = attributeName; - this.attributeNamespace = attributeNamespace; - this.mustUseProperty = mustUseProperty; - this.propertyName = name; - this.type = type; - this.sanitizeURL = sanitizeURL; -} // When adding attributes to this list, be sure to also add them to -// the `possibleStandardNames` module to ensure casing and incorrect -// name warnings. - - -var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM. - -['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular -// elements (not just inputs). Now that ReactDOMInput assigns to the -// defaultValue property -- do we need this? -'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'].forEach(function (name) { - properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty - name, // attributeName - null, // attributeNamespace - false); -}); // A few React string attributes have a different name. -// This is a mapping from React prop names to the attribute names. - -[['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) { - var name = _ref[0], - attributeName = _ref[1]; - properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty - attributeName, // attributeName - null, // attributeNamespace - false); -}); // These are "enumerated" HTML attributes that accept "true" and "false". -// In React, we let users pass `true` and `false` even though technically -// these aren't boolean attributes (they are coerced to strings). - -['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) { - properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty - name.toLowerCase(), // attributeName - null, // attributeNamespace - false); -}); // These are "enumerated" SVG attributes that accept "true" and "false". -// In React, we let users pass `true` and `false` even though technically -// these aren't boolean attributes (they are coerced to strings). -// Since these are SVG attributes, their attribute names are case-sensitive. - -['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) { - properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty - name, // attributeName - null, // attributeNamespace - false); -}); // These are HTML boolean attributes. - -['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM -// on the client side because the browsers are inconsistent. Instead we call focus(). -'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata -'itemScope'].forEach(function (name) { - properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty - name.toLowerCase(), // attributeName - null, // attributeNamespace - false); -}); // These are the few React props that we set as DOM properties -// rather than attributes. These are all booleans. - -['checked', // Note: `option.selected` is not updated if `select.multiple` is -// disabled with `removeAttribute`. We have special logic for handling this. -'multiple', 'muted', 'selected'].forEach(function (name) { - properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty - name, // attributeName - null, // attributeNamespace - false); -}); // These are HTML attributes that are "overloaded booleans": they behave like -// booleans, but can also accept a string value. - -['capture', 'download'].forEach(function (name) { - properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty - name, // attributeName - null, // attributeNamespace - false); -}); // These are HTML attributes that must be positive numbers. - -['cols', 'rows', 'size', 'span'].forEach(function (name) { - properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty - name, // attributeName - null, // attributeNamespace - false); -}); // These are HTML attributes that must be numbers. - -['rowSpan', 'start'].forEach(function (name) { - properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty - name.toLowerCase(), // attributeName - null, // attributeNamespace - false); -}); -var CAMELIZE = /[\-\:]([a-z])/g; - -var capitalize = function (token) { - return token[1].toUpperCase(); -}; // This is a list of all SVG attributes that need special casing, namespacing, -// or boolean value assignment. Regular attributes that just accept strings -// and have the same names are omitted, just like in the HTML whitelist. -// Some of these attributes can be hard to find. This list was created by -// scrapping the MDN documentation. - - -['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'].forEach(function (attributeName) { - var name = attributeName.replace(CAMELIZE, capitalize); - properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty - attributeName, null, // attributeNamespace - false); -}); // String SVG attributes with the xlink namespace. - -['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'].forEach(function (attributeName) { - var name = attributeName.replace(CAMELIZE, capitalize); - properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty - attributeName, 'http://www.w3.org/1999/xlink', false); -}); // String SVG attributes with the xml namespace. - -['xml:base', 'xml:lang', 'xml:space'].forEach(function (attributeName) { - var name = attributeName.replace(CAMELIZE, capitalize); - properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty - attributeName, 'http://www.w3.org/XML/1998/namespace', false); -}); // These attribute exists both in HTML and SVG. -// The attribute name is case-sensitive in SVG so we can't just use -// the React name like we do for attributes that exist only in HTML. - -['tabIndex', 'crossOrigin'].forEach(function (attributeName) { - properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty - attributeName.toLowerCase(), // attributeName - null, // attributeNamespace - false); -}); // These attributes accept URLs. These must not allow javascript: URLS. -// These will also need to accept Trusted Types object in the future. - -var xlinkHref = 'xlinkHref'; -properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty -'xlink:href', 'http://www.w3.org/1999/xlink', true); -['src', 'href', 'action', 'formAction'].forEach(function (attributeName) { - properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty - attributeName.toLowerCase(), // attributeName - null, // attributeNamespace - true); -}); - -var ReactDebugCurrentFrame$1 = null; - -{ - ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; -} // A javascript: URL can contain leading C0 control or \u0020 SPACE, -// and any newline or tab are filtered out as if they're not part of the URL. -// https://url.spec.whatwg.org/#url-parsing -// Tab or newline are defined as \r\n\t: -// https://infra.spec.whatwg.org/#ascii-tab-or-newline -// A C0 control is a code point in the range \u0000 NULL to \u001F -// INFORMATION SEPARATOR ONE, inclusive: -// https://infra.spec.whatwg.org/#c0-control-or-space - -/* eslint-disable max-len */ - - -var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i; -var didWarn = false; - -function sanitizeURL(url) { - if (disableJavaScriptURLs) { - if (!!isJavaScriptProtocol.test(url)) { - { - throw Error("React has blocked a javascript: URL as a security precaution." + (ReactDebugCurrentFrame$1.getStackAddendum())); - } - } - } else if (true && !didWarn && isJavaScriptProtocol.test(url)) { - didWarn = true; - warning$1(false, 'A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url)); - } -} - -// Flow does not allow string concatenation of most non-string types. To work -// around this limitation, we use an opaque type that can only be obtained by -// passing the value through getToStringValue first. -function toString(value) { - return '' + value; -} -function getToStringValue(value) { - switch (typeof value) { - case 'boolean': - case 'number': - case 'object': - case 'string': - case 'undefined': - return value; - - default: - // function, symbol are assigned as empty strings - return ''; - } -} -/** Trusted value is a wrapper for "safe" values which can be assigned to DOM execution sinks. */ - -/** - * We allow passing objects with toString method as element attributes or in dangerouslySetInnerHTML - * and we do validations that the value is safe. Once we do validation we want to use the validated - * value instead of the object (because object.toString may return something else on next call). - * - * If application uses Trusted Types we don't stringify trusted values, but preserve them as objects. - */ -var toStringOrTrustedType = toString; - -if (enableTrustedTypesIntegration && typeof trustedTypes !== 'undefined') { - toStringOrTrustedType = function (value) { - if (typeof value === 'object' && (trustedTypes.isHTML(value) || trustedTypes.isScript(value) || trustedTypes.isScriptURL(value) || - /* TrustedURLs are deprecated and will be removed soon: https://github.com/WICG/trusted-types/pull/204 */ - trustedTypes.isURL && trustedTypes.isURL(value))) { - // Pass Trusted Types through. - return value; - } - - return toString(value); - }; -} - -/** - * Set attribute for a node. The attribute value can be either string or - * Trusted value (if application uses Trusted Types). - */ -function setAttribute(node, attributeName, attributeValue) { - node.setAttribute(attributeName, attributeValue); -} -/** - * Set attribute with namespace for a node. The attribute value can be either string or - * Trusted value (if application uses Trusted Types). - */ - -function setAttributeNS(node, attributeNamespace, attributeName, attributeValue) { - node.setAttributeNS(attributeNamespace, attributeName, attributeValue); -} - -/** - * Get the value for a property on a node. Only used in DEV for SSR validation. - * The "expected" argument is used as a hint of what the expected value is. - * Some properties have multiple equivalent values. - */ -function getValueForProperty(node, name, expected, propertyInfo) { - { - if (propertyInfo.mustUseProperty) { - var propertyName = propertyInfo.propertyName; - return node[propertyName]; - } else { - if (!disableJavaScriptURLs && propertyInfo.sanitizeURL) { - // If we haven't fully disabled javascript: URLs, and if - // the hydration is successful of a javascript: URL, we - // still want to warn on the client. - sanitizeURL('' + expected); - } - - var attributeName = propertyInfo.attributeName; - var stringValue = null; - - if (propertyInfo.type === OVERLOADED_BOOLEAN) { - if (node.hasAttribute(attributeName)) { - var value = node.getAttribute(attributeName); - - if (value === '') { - return true; - } - - if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { - return value; - } - - if (value === '' + expected) { - return expected; - } - - return value; - } - } else if (node.hasAttribute(attributeName)) { - if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { - // We had an attribute but shouldn't have had one, so read it - // for the error message. - return node.getAttribute(attributeName); - } - - if (propertyInfo.type === BOOLEAN) { - // If this was a boolean, it doesn't matter what the value is - // the fact that we have it is the same as the expected. - return expected; - } // Even if this property uses a namespace we use getAttribute - // because we assume its namespaced name is the same as our config. - // To use getAttributeNS we need the local name which we don't have - // in our config atm. - - - stringValue = node.getAttribute(attributeName); - } - - if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { - return stringValue === null ? expected : stringValue; - } else if (stringValue === '' + expected) { - return expected; - } else { - return stringValue; - } - } - } -} -/** - * Get the value for a attribute on a node. Only used in DEV for SSR validation. - * The third argument is used as a hint of what the expected value is. Some - * attributes have multiple equivalent values. - */ - -function getValueForAttribute(node, name, expected) { - { - if (!isAttributeNameSafe(name)) { - return; - } - - if (!node.hasAttribute(name)) { - return expected === undefined ? undefined : null; - } - - var value = node.getAttribute(name); - - if (value === '' + expected) { - return expected; - } - - return value; - } -} -/** - * Sets the value for a property on a node. - * - * @param {DOMElement} node - * @param {string} name - * @param {*} value - */ - -function setValueForProperty(node, name, value, isCustomComponentTag) { - var propertyInfo = getPropertyInfo(name); - - if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) { - return; - } - - if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) { - value = null; - } // If the prop isn't in the special list, treat it as a simple attribute. - - - if (isCustomComponentTag || propertyInfo === null) { - if (isAttributeNameSafe(name)) { - var _attributeName = name; - - if (value === null) { - node.removeAttribute(_attributeName); - } else { - setAttribute(node, _attributeName, toStringOrTrustedType(value)); - } - } - - return; - } - - var mustUseProperty = propertyInfo.mustUseProperty; - - if (mustUseProperty) { - var propertyName = propertyInfo.propertyName; - - if (value === null) { - var type = propertyInfo.type; - node[propertyName] = type === BOOLEAN ? false : ''; - } else { - // Contrary to `setAttribute`, object properties are properly - // `toString`ed by IE8/9. - node[propertyName] = value; - } - - return; - } // The rest are treated as attributes with special cases. - - - var attributeName = propertyInfo.attributeName, - attributeNamespace = propertyInfo.attributeNamespace; - - if (value === null) { - node.removeAttribute(attributeName); - } else { - var _type = propertyInfo.type; - var attributeValue; - - if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) { - // If attribute type is boolean, we know for sure it won't be an execution sink - // and we won't require Trusted Type here. - attributeValue = ''; - } else { - // `setAttribute` with objects becomes only `[object]` in IE8/9, - // ('' + value) makes it output the correct toString()-value. - attributeValue = toStringOrTrustedType(value); - - if (propertyInfo.sanitizeURL) { - sanitizeURL(attributeValue.toString()); - } - } - - if (attributeNamespace) { - setAttributeNS(node, attributeNamespace, attributeName, attributeValue); - } else { - setAttribute(node, attributeName, attributeValue); - } - } -} - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - - -var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; - -var ReactPropTypesSecret_1 = ReactPropTypesSecret$1; - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - - -var printWarning = function() {}; - -{ - var ReactPropTypesSecret = ReactPropTypesSecret_1; - var loggedTypeFailures = {}; - var has = Function.call.bind(Object.prototype.hasOwnProperty); - - printWarning = function(text) { - var message = 'Warning: ' + text; - if (typeof console !== 'undefined') { - console.error(message); - } - try { - // --- Welcome to debugging React --- - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - throw new Error(message); - } catch (x) {} - }; -} - -/** - * Assert that the values match with the type specs. - * Error messages are memorized and will only be shown once. - * - * @param {object} typeSpecs Map of name to a ReactPropType - * @param {object} values Runtime values that need to be type-checked - * @param {string} location e.g. "prop", "context", "child context" - * @param {string} componentName Name of the component for error messages. - * @param {?Function} getStack Returns the component stack. - * @private - */ -function checkPropTypes(typeSpecs, values, location, componentName, getStack) { - { - for (var typeSpecName in typeSpecs) { - if (has(typeSpecs, typeSpecName)) { - var error; - // Prop type validation may throw. In case they do, we don't want to - // fail the render phase where it didn't fail before. So we log it. - // After these have been cleaned up, we'll let them throw. - try { - // This is intentionally an invariant that gets caught. It's the same - // behavior as without this statement except with a better message. - if (typeof typeSpecs[typeSpecName] !== 'function') { - var err = Error( - (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + - 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' - ); - err.name = 'Invariant Violation'; - throw err; - } - error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); - } catch (ex) { - error = ex; - } - if (error && !(error instanceof Error)) { - printWarning( - (componentName || 'React class') + ': type specification of ' + - location + ' `' + typeSpecName + '` is invalid; the type checker ' + - 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + - 'You may have forgotten to pass an argument to the type checker ' + - 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + - 'shape all require an argument).' - ); - } - if (error instanceof Error && !(error.message in loggedTypeFailures)) { - // Only monitor this failure once because there tends to be a lot of the - // same error. - loggedTypeFailures[error.message] = true; - - var stack = getStack ? getStack() : ''; - - printWarning( - 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') - ); - } - } - } - } -} - -/** - * Resets warning cache when testing. - * - * @private - */ -checkPropTypes.resetWarningCache = function() { - { - loggedTypeFailures = {}; - } -}; - -var checkPropTypes_1 = checkPropTypes; - -var ReactDebugCurrentFrame$2 = null; -var ReactControlledValuePropTypes = { - checkPropTypes: null -}; - -{ - ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame; - var hasReadOnlyValue = { - button: true, - checkbox: true, - image: true, - hidden: true, - radio: true, - reset: true, - submit: true - }; - var propTypes = { - value: function (props, propName, componentName) { - if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) { - return null; - } - - return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); - }, - checked: function (props, propName, componentName) { - if (props.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) { - return null; - } - - return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); - } - }; - /** - * Provide a linked `value` attribute for controlled forms. You should not use - * this outside of the ReactDOM controlled form components. - */ - - ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) { - checkPropTypes_1(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum); - }; -} - -function isCheckable(elem) { - var type = elem.type; - var nodeName = elem.nodeName; - return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio'); -} - -function getTracker(node) { - return node._valueTracker; -} - -function detachTracker(node) { - node._valueTracker = null; -} - -function getValueFromNode(node) { - var value = ''; - - if (!node) { - return value; - } - - if (isCheckable(node)) { - value = node.checked ? 'true' : 'false'; - } else { - value = node.value; - } - - return value; -} - -function trackValueOnNode(node) { - var valueField = isCheckable(node) ? 'checked' : 'value'; - var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField); - var currentValue = '' + node[valueField]; // if someone has already defined a value or Safari, then bail - // and don't track value will cause over reporting of changes, - // but it's better then a hard failure - // (needed for certain tests that spyOn input values and Safari) - - if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') { - return; - } - - var get = descriptor.get, - set = descriptor.set; - Object.defineProperty(node, valueField, { - configurable: true, - get: function () { - return get.call(this); - }, - set: function (value) { - currentValue = '' + value; - set.call(this, value); - } - }); // We could've passed this the first time - // but it triggers a bug in IE11 and Edge 14/15. - // Calling defineProperty() again should be equivalent. - // https://github.com/facebook/react/issues/11768 - - Object.defineProperty(node, valueField, { - enumerable: descriptor.enumerable - }); - var tracker = { - getValue: function () { - return currentValue; - }, - setValue: function (value) { - currentValue = '' + value; - }, - stopTracking: function () { - detachTracker(node); - delete node[valueField]; - } - }; - return tracker; -} - -function track(node) { - if (getTracker(node)) { - return; - } // TODO: Once it's just Fiber we can move this to node._wrapperState - - - node._valueTracker = trackValueOnNode(node); -} -function updateValueIfChanged(node) { - if (!node) { - return false; - } - - var tracker = getTracker(node); // if there is no tracker at this point it's unlikely - // that trying again will succeed - - if (!tracker) { - return true; - } - - var lastValue = tracker.getValue(); - var nextValue = getValueFromNode(node); - - if (nextValue !== lastValue) { - tracker.setValue(nextValue); - return true; - } - - return false; -} - -// TODO: direct imports like some-package/src/* are bad. Fix me. -var didWarnValueDefaultValue = false; -var didWarnCheckedDefaultChecked = false; -var didWarnControlledToUncontrolled = false; -var didWarnUncontrolledToControlled = false; - -function isControlled(props) { - var usesChecked = props.type === 'checkbox' || props.type === 'radio'; - return usesChecked ? props.checked != null : props.value != null; -} -/** - * Implements an host component that allows setting these optional - * props: `checked`, `value`, `defaultChecked`, and `defaultValue`. - * - * If `checked` or `value` are not supplied (or null/undefined), user actions - * that affect the checked state or value will trigger updates to the element. - * - * If they are supplied (and not null/undefined), the rendered element will not - * trigger updates to the element. Instead, the props must change in order for - * the rendered element to be updated. - * - * The rendered element will be initialized as unchecked (or `defaultChecked`) - * with an empty value (or `defaultValue`). - * - * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html - */ - - -function getHostProps(element, props) { - var node = element; - var checked = props.checked; - - var hostProps = _assign({}, props, { - defaultChecked: undefined, - defaultValue: undefined, - value: undefined, - checked: checked != null ? checked : node._wrapperState.initialChecked - }); - - return hostProps; -} -function initWrapperState(element, props) { - { - ReactControlledValuePropTypes.checkPropTypes('input', props); - - if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) { - warning$1(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type); - didWarnCheckedDefaultChecked = true; - } - - if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { - warning$1(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type); - didWarnValueDefaultValue = true; - } - } - - var node = element; - var defaultValue = props.defaultValue == null ? '' : props.defaultValue; - node._wrapperState = { - initialChecked: props.checked != null ? props.checked : props.defaultChecked, - initialValue: getToStringValue(props.value != null ? props.value : defaultValue), - controlled: isControlled(props) - }; -} -function updateChecked(element, props) { - var node = element; - var checked = props.checked; - - if (checked != null) { - setValueForProperty(node, 'checked', checked, false); - } -} -function updateWrapper(element, props) { - var node = element; - - { - var controlled = isControlled(props); - - if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) { - warning$1(false, 'A component is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type); - didWarnUncontrolledToControlled = true; - } - - if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) { - warning$1(false, 'A component is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type); - didWarnControlledToUncontrolled = true; - } - } - - updateChecked(element, props); - var value = getToStringValue(props.value); - var type = props.type; - - if (value != null) { - if (type === 'number') { - if (value === 0 && node.value === '' || // We explicitly want to coerce to number here if possible. - // eslint-disable-next-line - node.value != value) { - node.value = toString(value); - } - } else if (node.value !== toString(value)) { - node.value = toString(value); - } - } else if (type === 'submit' || type === 'reset') { - // Submit/reset inputs need the attribute removed completely to avoid - // blank-text buttons. - node.removeAttribute('value'); - return; - } - - if (disableInputAttributeSyncing) { - // When not syncing the value attribute, React only assigns a new value - // whenever the defaultValue React prop has changed. When not present, - // React does nothing - if (props.hasOwnProperty('defaultValue')) { - setDefaultValue(node, props.type, getToStringValue(props.defaultValue)); - } - } else { - // When syncing the value attribute, the value comes from a cascade of - // properties: - // 1. The value React property - // 2. The defaultValue React property - // 3. Otherwise there should be no change - if (props.hasOwnProperty('value')) { - setDefaultValue(node, props.type, value); - } else if (props.hasOwnProperty('defaultValue')) { - setDefaultValue(node, props.type, getToStringValue(props.defaultValue)); - } - } - - if (disableInputAttributeSyncing) { - // When not syncing the checked attribute, the attribute is directly - // controllable from the defaultValue React property. It needs to be - // updated as new props come in. - if (props.defaultChecked == null) { - node.removeAttribute('checked'); - } else { - node.defaultChecked = !!props.defaultChecked; - } - } else { - // When syncing the checked attribute, it only changes when it needs - // to be removed, such as transitioning from a checkbox into a text input - if (props.checked == null && props.defaultChecked != null) { - node.defaultChecked = !!props.defaultChecked; - } - } -} -function postMountWrapper(element, props, isHydrating) { - var node = element; // Do not assign value if it is already set. This prevents user text input - // from being lost during SSR hydration. - - if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) { - var type = props.type; - var isButton = type === 'submit' || type === 'reset'; // Avoid setting value attribute on submit/reset inputs as it overrides the - // default value provided by the browser. See: #12872 - - if (isButton && (props.value === undefined || props.value === null)) { - return; - } - - var initialValue = toString(node._wrapperState.initialValue); // Do not assign value if it is already set. This prevents user text input - // from being lost during SSR hydration. - - if (!isHydrating) { - if (disableInputAttributeSyncing) { - var value = getToStringValue(props.value); // When not syncing the value attribute, the value property points - // directly to the React prop. Only assign it if it exists. - - if (value != null) { - // Always assign on buttons so that it is possible to assign an - // empty string to clear button text. - // - // Otherwise, do not re-assign the value property if is empty. This - // potentially avoids a DOM write and prevents Firefox (~60.0.1) from - // prematurely marking required inputs as invalid. Equality is compared - // to the current value in case the browser provided value is not an - // empty string. - if (isButton || value !== node.value) { - node.value = toString(value); - } - } - } else { - // When syncing the value attribute, the value property should use - // the wrapperState._initialValue property. This uses: - // - // 1. The value React property when present - // 2. The defaultValue React property when present - // 3. An empty string - if (initialValue !== node.value) { - node.value = initialValue; - } - } - } - - if (disableInputAttributeSyncing) { - // When not syncing the value attribute, assign the value attribute - // directly from the defaultValue React property (when present) - var defaultValue = getToStringValue(props.defaultValue); - - if (defaultValue != null) { - node.defaultValue = toString(defaultValue); - } - } else { - // Otherwise, the value attribute is synchronized to the property, - // so we assign defaultValue to the same thing as the value property - // assignment step above. - node.defaultValue = initialValue; - } - } // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug - // this is needed to work around a chrome bug where setting defaultChecked - // will sometimes influence the value of checked (even after detachment). - // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416 - // We need to temporarily unset name to avoid disrupting radio button groups. - - - var name = node.name; - - if (name !== '') { - node.name = ''; - } - - if (disableInputAttributeSyncing) { - // When not syncing the checked attribute, the checked property - // never gets assigned. It must be manually set. We don't want - // to do this when hydrating so that existing user input isn't - // modified - if (!isHydrating) { - updateChecked(element, props); - } // Only assign the checked attribute if it is defined. This saves - // a DOM write when controlling the checked attribute isn't needed - // (text inputs, submit/reset) - - - if (props.hasOwnProperty('defaultChecked')) { - node.defaultChecked = !node.defaultChecked; - node.defaultChecked = !!props.defaultChecked; - } - } else { - // When syncing the checked attribute, both the checked property and - // attribute are assigned at the same time using defaultChecked. This uses: - // - // 1. The checked React property when present - // 2. The defaultChecked React property when present - // 3. Otherwise, false - node.defaultChecked = !node.defaultChecked; - node.defaultChecked = !!node._wrapperState.initialChecked; - } - - if (name !== '') { - node.name = name; - } -} -function restoreControlledState$1(element, props) { - var node = element; - updateWrapper(node, props); - updateNamedCousins(node, props); -} - -function updateNamedCousins(rootNode, props) { - var name = props.name; - - if (props.type === 'radio' && name != null) { - var queryRoot = rootNode; - - while (queryRoot.parentNode) { - queryRoot = queryRoot.parentNode; - } // If `rootNode.form` was non-null, then we could try `form.elements`, - // but that sometimes behaves strangely in IE8. We could also try using - // `form.getElementsByName`, but that will only return direct children - // and won't include inputs that use the HTML5 `form=` attribute. Since - // the input might not even be in a form. It might not even be in the - // document. Let's just use the local `querySelectorAll` to ensure we don't - // miss anything. - - - var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]'); - - for (var i = 0; i < group.length; i++) { - var otherNode = group[i]; - - if (otherNode === rootNode || otherNode.form !== rootNode.form) { - continue; - } // This will throw if radio buttons rendered by different copies of React - // and the same name are rendered into the same form (same as #1939). - // That's probably okay; we don't support it just as we don't support - // mixing React radio buttons with non-React ones. - - - var otherProps = getFiberCurrentPropsFromNode$1(otherNode); - - if (!otherProps) { - { - throw Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported."); - } - } // We need update the tracked value on the named cousin since the value - // was changed but the input saw no event or value set - - - updateValueIfChanged(otherNode); // If this is a controlled radio button group, forcing the input that - // was previously checked to update will cause it to be come re-checked - // as appropriate. - - updateWrapper(otherNode, otherProps); - } - } -} // In Chrome, assigning defaultValue to certain input types triggers input validation. -// For number inputs, the display value loses trailing decimal points. For email inputs, -// Chrome raises "The specified value is not a valid email address". -// -// Here we check to see if the defaultValue has actually changed, avoiding these problems -// when the user is inputting text -// -// https://github.com/facebook/react/issues/7253 - - -function setDefaultValue(node, type, value) { - if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js - type !== 'number' || node.ownerDocument.activeElement !== node) { - if (value == null) { - node.defaultValue = toString(node._wrapperState.initialValue); - } else if (node.defaultValue !== toString(value)) { - node.defaultValue = toString(value); - } - } -} - -var didWarnSelectedSetOnOption = false; -var didWarnInvalidChild = false; - -function flattenChildren(children) { - var content = ''; // Flatten children. We'll warn if they are invalid - // during validateProps() which runs for hydration too. - // Note that this would throw on non-element objects. - // Elements are stringified (which is normally irrelevant - // but matters for ). - - React.Children.forEach(children, function (child) { - if (child == null) { - return; - } - - content += child; // Note: we don't warn about invalid children here. - // Instead, this is done separately below so that - // it happens during the hydration codepath too. - }); - return content; -} -/** - * Implements an